diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..b2b6280b --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + fxserver-es_extended + Copyright (C) 2015 Jérémie N'gadi + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + fxserver-es_extended Copyright (C) 2015 Jérémie N'gadi + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. \ No newline at end of file diff --git a/README.md b/README.md index 25883c09..2270f37f 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,104 @@ -# esx-legacy -Consolidated esx-legacy files into one repo for easy download since we will not support it +

ESX Legacy

Development Discord - Website - Support Discord + + +##### ESX is the most popular framework for creating economy-based roleplay servers on FiveM, with many official and community resources designed to utilise the tools provided here. For a taste of what's available: +> esx_identity: Enables character registration defining a players name, sex, height, and date of birth + +> esx_society: Allows job resources to register a society, gaining employee management, society funds, and more + +> esx_billing: Allows members of some societies to send fines or bills to other players + +> esx_vehicleshop: Allow players to purchase vehicles from a dealership, or setup society support for a player-managed dealership + +> esx_ambulancejop: Adds a death and respawn system while allowing players to work as EMS to heal and revive others + +Many more resources are included in this repository, or you can browse the [ESX Community Github](https://github.com/esx-community/) or [Cfx.re Releases board](https://forum.cfx.re/tag/esx) for more. + +### Information +##### Legacy provides some necessary bug-fixes and improvements to optimise the framework before reaching the end of official support by the development team. +##### Most resources designed for 1.2 will have no issues with Legacy, notable exceptions are those which modify spawning/loading behaviour. There are several minor feature updates which do not impact compatibility with old resources. +##### NOTE: The loadouts system in ESX has always been problematic, and fixing it would require a complete overhaul. Your best option is to use a resource that handles weapons as items. + +#### Optimisation +- Utilise compile-time jenkins hashing over the GetHashKey native +- Update old MySQL queries to use MySQL.store to improve performance, especially during player saving +- Several loops will now sleep when their tasks are not necessary to perform +- Improved support when using ESX Identity to reduce events and queries during player login +- Support for the latest weapons and components + +#### Features +- Integrated support for identity data +- Integrated commands from esx_adminplus +- All players will be saved immediately before a txAdmin scheduled restart +- Detect if a player is new and send the result to the playerLoaded event +- Support for players logging out when using multicharacter resources +- Cache the players ped id and death state in ESX.PlayerData +- Added an imports file (similar to locales.lua) for setting up events and functions in other resources + - Before defining all manifest script files, add `shared_script '@es_extended/imports.lua'` + - Automatically retrieve the ESX object, removing the need to send a callback event on both the client and server + - Ensures current information is always returned when using `ESX.PlayerData` (except loadout and inventory) +- Spawnmanager is being utilised to correctly handle player spawns + - Potential conflicts with some third-party resources that do not expect spawnmanager +- Added an improved function when performing xPlayer loops to prevent large server hitches + - Using `ESX.GetExtendedPlayers()` instead of `ESX.GetPlayers()` + - You can use arguments with the new function as well, such as + - ESX.GetExtendedPlayers('job', 'police') + - ESX.GetExtendedPlayers('group', 'admin') + +#### Fixes +- ESX.Jobs table is populated after all jobs are setup, allowing other resources to retrieve it if needed +- All weapons are properly removed when using the clearloadout command +##### For creating or updating resources refer to the [updated boilerplate](/esx_example). + +### 1.2 Features +- Weight based inventory system +- Weapons support, including support for attachments and tints +- Supports different money accounts (defaulted with cash, bank and black money) +- Many official resources available in our GitHub +- Job system, with grades and clothes support +- Supports multiple languages, most strings are localized +- Easy to use API for developers to easily integrate ESX to their projects +- Register your own commands easily, with argument validation, chat suggestion and using FXServer ACL + +### Requirements +- All resources from the `core` folder +- [spawnmanager](https://github.com/citizenfx/cfx-server-data) +- [mysql-async](https://github.com/brouznouf/fivem-mysql-async/releases/tag/3.3.2) + + +### Installation +- Download files to the resources folder and, if desired, prepare directories for organisation (i.e. resources/[core]/es_extended) +- Import `es_extended.sql` in your database +- Import any other sql files for the resources you are using +- Ensure all resources config files have been adjusted for your preferences +- Use or refer to the included server.cfg for start order and settings + +### Conflicts +* The following resources should not be used with ESX Legacy + - essentialsmode + - basic-gamemode + - fivem-map-skater + - fivem-map-hipster + - default_spawnpoint + +### Information +ESX was initially developed by Gizz back in 2017 for his friend as the were creating an FiveM server and there wasn't any economy roleplaying frameworks available. The original code was written within a week or two and later open sourced, it has ever since been improved and parts been rewritten to further improve on it. +- [ESX Forum](https://forum.esx-framework.org/) +- [ESX Documentation](https://wiki.esx-framework.org/) +- [ESX Development Discord](https://discord.me/esx) +- [FiveM Native Reference](https://runtime.fivem.net/doc/reference.html) + + +### Legal + +### License + +es_extended - ESX framework for FiveM + +Copyright (C) 2015-2021 Jérémie N'gadi + +This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version. + +This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details. + +You should have received a copy Of the GNU General Public License along with this program. If Not, see http://www.gnu.org/licenses/. diff --git a/[esx]/async/.editorconfig b/[esx]/async/.editorconfig new file mode 100644 index 00000000..9b425256 --- /dev/null +++ b/[esx]/async/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_size = 4 +indent_style = tab +end_of_line = crlf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/[esx]/async/LICENSE b/[esx]/async/LICENSE new file mode 100644 index 00000000..0f4f5d61 --- /dev/null +++ b/[esx]/async/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + fxserver-async + Copyright (C) 2015 Jérémie N'gadi + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + fxserver-async Copyright (C) 2015 Jérémie N'gadi + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. \ No newline at end of file diff --git a/[esx]/async/README.md b/[esx]/async/README.md new file mode 100644 index 00000000..12efddbd --- /dev/null +++ b/[esx]/async/README.md @@ -0,0 +1,42 @@ +<<<<<<< HEAD +# esx-legacy +Consolidated esx-legacy files into one repo for easy download since we will not support it +======= +# async +Async utilities for FXServer + +## Installation +Set it as a dependency in you fxmanifest.lua +``` +server_script '@async/async.lua' +``` + +## Usage +``` +local tasks = {} + +for i = 1, 100, 1 do + local task = function(cb) + SetTimeout(1000, function() + local result = math.random(1, 50000) + + cb(result) + end) + end + + table.insert(tasks, task) +end + +Async.parallel(tasks, function(results) + print(json.encode(results)) +end) + +Async.parallelLimit(tasks, 2, function(results) + print(json.encode(results)) +end) + +Async.series(tasks, function(results) + print(json.encode(results)) +end) +``` +>>>>>>> async/master diff --git a/[esx]/async/async.lua b/[esx]/async/async.lua new file mode 100644 index 00000000..ba55f552 --- /dev/null +++ b/[esx]/async/async.lua @@ -0,0 +1,75 @@ +if Citizen and Citizen.CreateThread then + CreateThread = Citizen.CreateThread +end + +Async = {} + +function Async.parallel(tasks, cb) + if #tasks == 0 then + cb({}) + return + end + + local remaining = #tasks + local results = {} + + for i = 1, #tasks, 1 do + CreateThread(function() + tasks[i](function(result) + table.insert(results, result) + + remaining = remaining - 1; + + if remaining == 0 then + cb(results) + end + end) + end) + end +end + +function Async.parallelLimit(tasks, limit, cb) + if #tasks == 0 then + cb({}) + return + end + + local remaining = #tasks + local running = 0 + local queue, results = {}, {} + + for i=1, #tasks, 1 do + table.insert(queue, tasks[i]) + end + + local function processQueue() + if #queue == 0 then + return + end + + while running < limit and #queue > 0 do + local task = table.remove(queue, 1) + + running = running + 1 + + task(function(result) + table.insert(results, result) + + remaining = remaining - 1; + running = running - 1 + + if remaining == 0 then + cb(results) + end + end) + end + + CreateThread(processQueue) + end + + processQueue() +end + +function Async.series(tasks, cb) + Async.parallelLimit(tasks, 1, cb) +end diff --git a/[esx]/async/fxmanifest.lua b/[esx]/async/fxmanifest.lua new file mode 100644 index 00000000..84035837 --- /dev/null +++ b/[esx]/async/fxmanifest.lua @@ -0,0 +1,6 @@ +fx_version 'cerulean' +game 'gta5' + +description 'Async' + +shared_script 'async.lua' diff --git a/[esx]/cron/.editorconfig b/[esx]/cron/.editorconfig new file mode 100644 index 00000000..9b425256 --- /dev/null +++ b/[esx]/cron/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_size = 4 +indent_style = tab +end_of_line = crlf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/[esx]/cron/LICENSE b/[esx]/cron/LICENSE new file mode 100644 index 00000000..d25a9795 --- /dev/null +++ b/[esx]/cron/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + fxserver-cron + Copyright (C) 2015 Jérémie N'gadi + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + fxserver-cron Copyright (C) 2015 Jérémie N'gadi + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. \ No newline at end of file diff --git a/[esx]/cron/README.md b/[esx]/cron/README.md new file mode 100644 index 00000000..a6d49ac0 --- /dev/null +++ b/[esx]/cron/README.md @@ -0,0 +1,52 @@ +# cron + +## Download & Installation + +### Using [fvm](https://github.com/qlaffont/fvm-installer) +``` +fvm install --save --folder=esx esx-org/cron +``` + +### Using Git +``` +cd resources +git clone https://github.com/ESX-Org/cron cron +``` + +### Manually +- Download https://github.com/ESX-Org/cron/archive/master.zip +- Put it in your resource directory + + +## Usage +```lua + +-- Execute task 5:10, every day +function CronTask(d, h, m) + print('Task done') +end + +TriggerEvent('cron:runAt', 5, 10, CronTask) + +-- Execute task every monday at 18:30 +function CronTask(d, h, m) + if d == 1 then + print('Task done') + end +end + +TriggerEvent('cron:runAt', 18, 30, CronTask) + +``` + +# Legal +### License +cron - do stuff in a specified time + +Copyright (C) 2015-2018 Jérémie N'gadi + +This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version. + +This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details. + +You should have received a copy Of the GNU General Public License along with this program. If Not, see http://www.gnu.org/licenses/. diff --git a/[esx]/cron/fxmanifest.lua b/[esx]/cron/fxmanifest.lua new file mode 100644 index 00000000..1797c90e --- /dev/null +++ b/[esx]/cron/fxmanifest.lua @@ -0,0 +1,9 @@ +fx_version 'adamant' + +game 'gta5' + +description 'cron' + +version '1.0.0' + +server_script 'server/main.lua' diff --git a/[esx]/cron/server/main.lua b/[esx]/cron/server/main.lua new file mode 100644 index 00000000..6dc7f8ed --- /dev/null +++ b/[esx]/cron/server/main.lua @@ -0,0 +1,47 @@ +local Jobs = {} +local LastTime = nil + +function RunAt(h, m, cb) + table.insert(Jobs, { + h = h, + m = m, + cb = cb + }) +end + +function GetTime() + local timestamp = os.time() + local d = os.date('*t', timestamp).wday + local h = tonumber(os.date('%H', timestamp)) + local m = tonumber(os.date('%M', timestamp)) + + return {d = d, h = h, m = m} +end + +function OnTime(d, h, m) + + for i=1, #Jobs, 1 do + if Jobs[i].h == h and Jobs[i].m == m then + Jobs[i].cb(d, h, m) + end + end +end + +function Tick() + local time = GetTime() + + if time.h ~= LastTime.h or time.m ~= LastTime.m then + OnTime(time.d, time.h, time.m) + LastTime = time + end + + SetTimeout(60000, Tick) +end + +LastTime = GetTime() + +Tick() + +AddEventHandler('cron:runAt', function(h, m, cb) + RunAt(h, m, cb) +end) diff --git a/[esx]/es_extended/.editorconfig b/[esx]/es_extended/.editorconfig new file mode 100644 index 00000000..9b425256 --- /dev/null +++ b/[esx]/es_extended/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_size = 4 +indent_style = tab +end_of_line = crlf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/[esx]/es_extended/LICENSE b/[esx]/es_extended/LICENSE new file mode 100644 index 00000000..b2b6280b --- /dev/null +++ b/[esx]/es_extended/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + fxserver-es_extended + Copyright (C) 2015 Jérémie N'gadi + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + fxserver-es_extended Copyright (C) 2015 Jérémie N'gadi + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. \ No newline at end of file diff --git a/[esx]/es_extended/README.md b/[esx]/es_extended/README.md new file mode 100644 index 00000000..d7a5ffcc --- /dev/null +++ b/[esx]/es_extended/README.md @@ -0,0 +1,154 @@ +

ESX Legacy

There is no official support for this resource. Create a thread on the ESX Server Development board or find a support Discord.
+ + +ESX is the most popular framework for creating an economy-based roleplay server on FiveM, with many more official and unofficial resources designed to utilise the tools provided by this resource. Here's a taste of what's available: + +###### `esx_identity` enable character registration using a name, sex, and date of birth +###### `esx_society` add employee management, society funds and more +###### `esx_billing` add support for registered societies to fine or bill players +###### `esx_vehicleshop` allow players to purchase vehicles directly or from players +###### `esx_ambulancejob` adds a death and respawn system while allowing players to become EMS to heal or revive others +###### `esx_policejob` allow players to become cops, granting the ability to detain and fine others + + +Many more resources are available on the [ESX Framework Github](https://github.com/esx-framework) and [ESX Community Github](https://github.com/esx-community/) pages. + + +## Information + +- [ESX Forum](https://forum.esx-framework.org/) +- [ESX Documentation](https://wiki.esx-framework.org/) +- [ESX Development Discord](https://discord.me/esx) +- [FiveM Native Reference](https://runtime.fivem.net/doc/reference.html) + +ESX was initially developed by Gizz back in 2017 for his friend as the were creating an FiveM server and there wasn't any economy roleplaying frameworks available. The original code was written within a week or two and later open sourced, it has ever since been improved and parts been rewritten to further improve on it. + + +## Legacy + +ESX Legacy is mostly intended as a bug-fix and optimisation update to provide a more stable experience for the people using ESX 1.2 or Final, however there are also some new features added in to allow better server performance with other resources and official support for esx_multicharacter. +#### Bug fixes +* ESX.Jobs is no longer set until the full table has been creating, allowing other resources to retrieve it more easily +* Now using spawnmanager to spawn players and prevent weird desync issues + - This may cause problems with some third-party resources that modify player spawns +* /clearloadout now properly removes all weapons instead of needing to be performed multiple times + +#### Optimisation +* Support for compile-time hashing instead of calling the native +* Utilise the `MySQL.Store` function to reduce overhead when executing queries +* Allow loops to sleep while not performing any tasks +* The current player ped and death status are now stored in ESX.PlayerData, reducing the need to constantly call the native +* Weapon ammo is no longer synced on every frame, instead triggering a server event once shooting has ceased +* Reduced the number of queries being performed by a single player connecting to the server + +#### Features +* Support for the latest weapons and components +* Additional admin commands from esx_adminplus +* Save all players before the txAdmin scheduled restarts +* When loading a new player, send the isNew argument along with `esx:playerLoaded` +* Added an imports file to load in other resource manifests with `shared_script '@es_extended/imports.lua'` + - Removes the need to define ESX in your resources, as it will perform the task for you + - Ensures ESX.PlayerData will always return current information (exception: loadout and inventory) +* Support for relogging, clearing all player data and cancelling sync loops +* Added the `ESX.GetExtendedPlayers` function to be used with xPlayer loops without causing massive server hitches + +To get an idea for how you can utilise imports and the new functions, you can refer to [this updated boilerplate](https://github.com/thelindat/esx_legacy_boilerplate). +##### Any resources made using the imports will only work for ESX Legacy. + + +## Conflicts +* The following resources should not be used with ESX Legacy and can result in errors + - **essentialsmode** + - basic-gamemode + - fivem-map-skater + - fivem-map-hipster + - default_spawnpoint + + +## 1.2 + Features + +- Weight based inventory system +- Weapons support, including support for attachments and tints +- Supports different money accounts (defaulted with cash, bank and black money) +- Many official resources available in our GitHub +- Job system, with grades and clothes support +- Supports multiple languages, most strings are localized +- Easy to use API for developers to easily integrate ESX to their projects +- Register your own commands easily, with argument validation, chat suggestion and using FXServer ACL + + +## Requirements + +- [mysql-async](https://github.com/brouznouf/fivem-mysql-async) +- [async](https://github.com/esx-framework/async) + + +## Download & Installation + + +### Using Git + +``` +cd resources +git clone https://github.com/esx-framework/es_extended.git --branch legacy +git clone https://github.com/esx-framework/esx_menu_default [esx]/[ui]/esx_menu_default +git clone https://github.com/esx-framework/esx_menu_dialog [esx]/[ui]/esx_menu_dialog +git clone https://github.com/esx-framework/esx_menu_list [esx]/[ui]/esx_menu_list +``` + +### Plume ESX: + +PlumeESX is a full featured (13 jobs) and highly configurable yet lightweight ESX v1.2 base that can be easily extendable. +Forum Thread: https://forum.cfx.re/t/recipe-plumeesx-full-base-2021/1964029 +YouTube Tutorial: https://www.youtube.com/watch?v=iGfwUCO0RZQ + +### Manually + +- Download https://github.com/esx-framework/es_extended/archive/refs/heads/legacy.zip +- Put it in the `resource/[esx]` directory +- Download https://github.com/esx-framework/esx_menu_default/archive/refs/heads/master.zip +- Put it in the `resource/[esx]/[ui]` directory +- Download https://github.com/esx-framework/esx_menu_dialog/archive/refs/heads/master.zip +- Put it in the `resource/[esx]/[ui]` directory +- Download https://github.com/esx-framework/esx_menu_list/archive/refs/heads/master.zip +- Put it in the `resource/[esx]/[ui]` directory + + +### Installation + +- Import `es_extended.sql` in your database +- Configure your `server.cfg` to look like this + +``` +add_principal group.admin group.user +add_ace resource.es_extended command.add_ace allow +add_ace resource.es_extended command.add_principal allow +add_ace resource.es_extended command.remove_principal allow +add_ace resource.es_extended command.stop allow + +start mysql-async +start es_extended + +start esx_menu_default +start esx_menu_list +start esx_menu_dialog +``` + +## Reborn + +ESX Reborn is the name for the framework being actively developed by the team, with many existing features being rewritten and improved upon. It is currently possible to create a server using ESX Reborn, however the project is still missing many features and should not be used unless you are a developer looking to contribute in some way. + + +## Legal + +### License + +es_extended - ESX framework for FiveM + +Copyright (C) 2015-2021 Jérémie N'gadi + +This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version. + +This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details. + +You should have received a copy Of the GNU General Public License along with this program. If Not, see http://www.gnu.org/licenses/. diff --git a/[esx]/es_extended/client/common.lua b/[esx]/es_extended/client/common.lua new file mode 100644 index 00000000..26c0ed40 --- /dev/null +++ b/[esx]/es_extended/client/common.lua @@ -0,0 +1,7 @@ +AddEventHandler('esx:getSharedObject', function(cb) + cb(ESX) +end) + +function getSharedObject() + return ESX +end diff --git a/[esx]/es_extended/client/entityiter.lua b/[esx]/es_extended/client/entityiter.lua new file mode 100644 index 00000000..541ae095 --- /dev/null +++ b/[esx]/es_extended/client/entityiter.lua @@ -0,0 +1,95 @@ +--[[The MIT License (MIT) + +Copyright (c) 2017 IllidanS4 + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. +]] + +local entityEnumerator = { + __gc = function(enum) + if enum.destructor and enum.handle then + enum.destructor(enum.handle) + end + + enum.destructor = nil + enum.handle = nil + end +} + +local function EnumerateEntities(initFunc, moveFunc, disposeFunc) + return coroutine.wrap(function() + local iter, id = initFunc() + if not id or id == 0 then + disposeFunc(iter) + return + end + + local enum = {handle = iter, destructor = disposeFunc} + setmetatable(enum, entityEnumerator) + local next = true + + repeat + coroutine.yield(id) + next, id = moveFunc(iter) + until not next + + enum.destructor, enum.handle = nil, nil + disposeFunc(iter) + end) +end + +function EnumerateEntitiesWithinDistance(entities, isPlayerEntities, coords, maxDistance) + local nearbyEntities = {} + + if coords then + coords = vector3(coords.x, coords.y, coords.z) + else + local playerPed = ESX.PlayerData.ped + coords = GetEntityCoords(playerPed) + end + + for k,entity in pairs(entities) do + local distance = #(coords - GetEntityCoords(entity)) + + if distance <= maxDistance then + table.insert(nearbyEntities, isPlayerEntities and k or entity) + end + end + + return nearbyEntities +end + +function EnumerateObjects() + return EnumerateEntities(FindFirstObject, FindNextObject, EndFindObject) +end + +function EnumeratePeds() + return EnumerateEntities(FindFirstPed, FindNextPed, EndFindPed) +end + +function EnumerateVehicles() + return EnumerateEntities(FindFirstVehicle, FindNextVehicle, EndFindVehicle) +end + +function EnumeratePickups() + return EnumerateEntities(FindFirstPickup, FindNextPickup, EndFindPickup) +end diff --git a/[esx]/es_extended/client/functions.lua b/[esx]/es_extended/client/functions.lua new file mode 100644 index 00000000..09174c08 --- /dev/null +++ b/[esx]/es_extended/client/functions.lua @@ -0,0 +1,1029 @@ +ESX = {} +ESX.PlayerData = {} +ESX.PlayerLoaded = false +ESX.CurrentRequestId = 0 +ESX.ServerCallbacks = {} +ESX.TimeoutCallbacks = {} + +ESX.UI = {} +ESX.UI.HUD = {} +ESX.UI.HUD.RegisteredElements = {} +ESX.UI.Menu = {} +ESX.UI.Menu.RegisteredTypes = {} +ESX.UI.Menu.Opened = {} + +ESX.Game = {} +ESX.Game.Utils = {} + +ESX.Scaleform = {} +ESX.Scaleform.Utils = {} + +ESX.Streaming = {} + +ESX.SetTimeout = function(msec, cb) + table.insert(ESX.TimeoutCallbacks, { + time = GetGameTimer() + msec, + cb = cb + }) + return #ESX.TimeoutCallbacks +end + +ESX.ClearTimeout = function(i) + ESX.TimeoutCallbacks[i] = nil +end + +ESX.IsPlayerLoaded = function() + return ESX.PlayerLoaded +end + +ESX.GetPlayerData = function() + return ESX.PlayerData +end + +ESX.SetPlayerData = function(key, val) + local current = ESX.PlayerData[key] + ESX.PlayerData[key] = val + if key ~= 'inventory' and key ~= 'loadout' then + if type(val) == 'table' or val ~= current then + TriggerEvent('esx:setPlayerData', key, val, current) + end + end +end + +ESX.ShowNotification = function(msg) + SetNotificationTextEntry('STRING') + AddTextComponentString(msg) + DrawNotification(0,1) +end + +ESX.ShowAdvancedNotification = function(sender, subject, msg, textureDict, iconType, flash, saveToBrief, hudColorIndex) + if saveToBrief == nil then saveToBrief = true end + AddTextEntry('esxAdvancedNotification', msg) + BeginTextCommandThefeedPost('esxAdvancedNotification') + if hudColorIndex then ThefeedNextPostBackgroundColor(hudColorIndex) end + EndTextCommandThefeedPostMessagetext(textureDict, textureDict, false, iconType, sender, subject) + EndTextCommandThefeedPostTicker(flash or false, saveToBrief) +end + +ESX.ShowHelpNotification = function(msg, thisFrame, beep, duration) + AddTextEntry('esxHelpNotification', msg) + + if thisFrame then + DisplayHelpTextThisFrame('esxHelpNotification', false) + else + if beep == nil then beep = true end + BeginTextCommandDisplayHelp('esxHelpNotification') + EndTextCommandDisplayHelp(0, false, beep, duration or -1) + end +end + +ESX.ShowFloatingHelpNotification = function(msg, coords) + AddTextEntry('esxFloatingHelpNotification', msg) + SetFloatingHelpTextWorldPosition(1, coords) + SetFloatingHelpTextStyle(1, 1, 2, -1, 3, 0) + BeginTextCommandDisplayHelp('esxFloatingHelpNotification') + EndTextCommandDisplayHelp(2, false, false, -1) +end + +ESX.TriggerServerCallback = function(name, cb, ...) + ESX.ServerCallbacks[ESX.CurrentRequestId] = cb + + TriggerServerEvent('esx:triggerServerCallback', name, ESX.CurrentRequestId, ...) + + if ESX.CurrentRequestId < 65535 then + ESX.CurrentRequestId = ESX.CurrentRequestId + 1 + else + ESX.CurrentRequestId = 0 + end +end + +ESX.UI.HUD.SetDisplay = function(opacity) + SendNUIMessage({ + action = 'setHUDDisplay', + opacity = opacity + }) +end + +ESX.UI.HUD.RegisterElement = function(name, index, priority, html, data) + local found = false + + for i=1, #ESX.UI.HUD.RegisteredElements, 1 do + if ESX.UI.HUD.RegisteredElements[i] == name then + found = true + break + end + end + + if found then + return + end + + table.insert(ESX.UI.HUD.RegisteredElements, name) + + SendNUIMessage({ + action = 'insertHUDElement', + name = name, + index = index, + priority = priority, + html = html, + data = data + }) + + ESX.UI.HUD.UpdateElement(name, data) +end + +ESX.UI.HUD.RemoveElement = function(name) + for i=1, #ESX.UI.HUD.RegisteredElements, 1 do + if ESX.UI.HUD.RegisteredElements[i] == name then + table.remove(ESX.UI.HUD.RegisteredElements, i) + break + end + end + + SendNUIMessage({ + action = 'deleteHUDElement', + name = name + }) +end + +ESX.UI.HUD.Reset = function() + SendNUIMessage({ + action = 'resetHUDElements' + }) + ESX.UI.HUD.RegisteredElements = {} +end + +ESX.UI.HUD.UpdateElement = function(name, data) + SendNUIMessage({ + action = 'updateHUDElement', + name = name, + data = data + }) +end + +ESX.UI.Menu.RegisterType = function(type, open, close) + ESX.UI.Menu.RegisteredTypes[type] = { + open = open, + close = close + } +end + +ESX.UI.Menu.Open = function(type, namespace, name, data, submit, cancel, change, close) + local menu = {} + + menu.type = type + menu.namespace = namespace + menu.name = name + menu.data = data + menu.submit = submit + menu.cancel = cancel + menu.change = change + + menu.close = function() + + ESX.UI.Menu.RegisteredTypes[type].close(namespace, name) + + for i=1, #ESX.UI.Menu.Opened, 1 do + if ESX.UI.Menu.Opened[i] then + if ESX.UI.Menu.Opened[i].type == type and ESX.UI.Menu.Opened[i].namespace == namespace and ESX.UI.Menu.Opened[i].name == name then + ESX.UI.Menu.Opened[i] = nil + end + end + end + + if close then + close() + end + + end + + menu.update = function(query, newData) + + for i=1, #menu.data.elements, 1 do + local match = true + + for k,v in pairs(query) do + if menu.data.elements[i][k] ~= v then + match = false + end + end + + if match then + for k,v in pairs(newData) do + menu.data.elements[i][k] = v + end + end + end + + end + + menu.refresh = function() + ESX.UI.Menu.RegisteredTypes[type].open(namespace, name, menu.data) + end + + menu.setElement = function(i, key, val) + menu.data.elements[i][key] = val + end + + menu.setElements = function(newElements) + menu.data.elements = newElements + end + + menu.setTitle = function(val) + menu.data.title = val + end + + menu.removeElement = function(query) + for i=1, #menu.data.elements, 1 do + for k,v in pairs(query) do + if menu.data.elements[i] then + if menu.data.elements[i][k] == v then + table.remove(menu.data.elements, i) + break + end + end + + end + end + end + + table.insert(ESX.UI.Menu.Opened, menu) + ESX.UI.Menu.RegisteredTypes[type].open(namespace, name, data) + + return menu +end + +ESX.UI.Menu.Close = function(type, namespace, name) + for i=1, #ESX.UI.Menu.Opened, 1 do + if ESX.UI.Menu.Opened[i] then + if ESX.UI.Menu.Opened[i].type == type and ESX.UI.Menu.Opened[i].namespace == namespace and ESX.UI.Menu.Opened[i].name == name then + ESX.UI.Menu.Opened[i].close() + ESX.UI.Menu.Opened[i] = nil + end + end + end +end + +ESX.UI.Menu.CloseAll = function() + for i=1, #ESX.UI.Menu.Opened, 1 do + if ESX.UI.Menu.Opened[i] then + ESX.UI.Menu.Opened[i].close() + ESX.UI.Menu.Opened[i] = nil + end + end +end + +ESX.UI.Menu.GetOpened = function(type, namespace, name) + for i=1, #ESX.UI.Menu.Opened, 1 do + if ESX.UI.Menu.Opened[i] then + if ESX.UI.Menu.Opened[i].type == type and ESX.UI.Menu.Opened[i].namespace == namespace and ESX.UI.Menu.Opened[i].name == name then + return ESX.UI.Menu.Opened[i] + end + end + end +end + +ESX.UI.Menu.GetOpenedMenus = function() + return ESX.UI.Menu.Opened +end + +ESX.UI.Menu.IsOpen = function(type, namespace, name) + return ESX.UI.Menu.GetOpened(type, namespace, name) ~= nil +end + +ESX.UI.ShowInventoryItemNotification = function(add, item, count) + SendNUIMessage({ + action = 'inventoryNotification', + add = add, + item = item, + count = count + }) +end + +ESX.Game.GetPedMugshot = function(ped, transparent) + if DoesEntityExist(ped) then + local mugshot + + if transparent then + mugshot = RegisterPedheadshotTransparent(ped) + else + mugshot = RegisterPedheadshot(ped) + end + + while not IsPedheadshotReady(mugshot) do + Citizen.Wait(0) + end + + return mugshot, GetPedheadshotTxdString(mugshot) + else + return + end +end + +ESX.Game.Teleport = function(entity, coords, cb) + local vector = type(coords) == "vector4" and coords or type(coords) == "vector3" and vector4(coords, 0.0) or vec(coords.x, coords.y, coords.z, coords.heading or 0.0) + + if DoesEntityExist(entity) then + RequestCollisionAtCoord(vector.xyz) + while not HasCollisionLoadedAroundEntity(entity) do + Citizen.Wait(0) + end + + SetEntityCoords(entity, vector.xyz, false, false, false, false) + SetEntityHeading(entity, vector.w) + end + + if cb then + cb() + end +end + +ESX.Game.SpawnObject = function(object, coords, cb, networked) + local model = (type(object) == 'number' and model or GetHashKey(object)) + local vector = type(coords) == "vector3" and coords or vec(coords.x, coords.y, coords.z) + networked = networked == nil and true or networked + + Citizen.CreateThread(function() + ESX.Streaming.RequestModel(model) + + -- The below has to be done just for CreateObject since for some reason CreateObjects model argument is set + -- as an Object instead of a hash so it doesn't automatically hash the item + model = type(model) == 'number' and model or GetHashKey(model) + local obj = CreateObject(model, vector.xyz, networked, false, true) + if cb then + cb(obj) + end + end) +end + +ESX.Game.SpawnLocalObject = function(object, coords, cb) + -- Why have 2 separate functions for this? Just call the other one with an extra param + ESX.Game.SpawnObject(object, coords, cb, false) +end + +ESX.Game.DeleteVehicle = function(vehicle) + SetEntityAsMissionEntity(vehicle, false, true) + DeleteVehicle(vehicle) +end + +ESX.Game.DeleteObject = function(object) + SetEntityAsMissionEntity(object, false, true) + DeleteObject(object) +end + +ESX.Game.SpawnVehicle = function(vehicle, coords, heading, cb, networked) + local model = (type(vehicle) == 'number' and vehicle or GetHashKey(vehicle)) + local vector = type(coords) == "vector3" and coords or vec(coords.x, coords.y, coords.z) + networked = networked == nil and true or networked + Citizen.CreateThread(function() + ESX.Streaming.RequestModel(model) + + local vehicle = CreateVehicle(model, vector.xyz, heading, networked, false) + + if networked then + local id = NetworkGetNetworkIdFromEntity(vehicle) + SetNetworkIdCanMigrate(id, true) + SetEntityAsMissionEntity(vehicle, true, false) + end + SetVehicleHasBeenOwnedByPlayer(vehicle, true) + SetVehicleNeedsToBeHotwired(vehicle, false) + SetModelAsNoLongerNeeded(model) + SetVehRadioStation(vehicle, 'OFF') + + RequestCollisionAtCoord(vector.xyz) + while not HasCollisionLoadedAroundEntity(vehicle) do + Citizen.Wait(0) + end + + if cb then + cb(vehicle) + end + end) +end + +ESX.Game.SpawnLocalVehicle = function(vehicle, coords, heading, cb) + -- Why have 2 separate functions for this? Just call the other one with an extra param + ESX.Game.SpawnVehicle(vehicle, coords, heading, cb, false) +end + +ESX.Game.IsVehicleEmpty = function(vehicle) + local passengers = GetVehicleNumberOfPassengers(vehicle) + local driverSeatFree = IsVehicleSeatFree(vehicle, -1) + + return passengers == 0 and driverSeatFree +end + +ESX.Game.GetObjects = function() + local objects = {} + + for object in EnumerateObjects() do + table.insert(objects, object) + end + + return objects +end + +ESX.Game.GetPeds = function(onlyOtherPeds) + local peds, myPed = {}, ESX.PlayerData.ped + + for ped in EnumeratePeds() do + if ((onlyOtherPeds and ped ~= myPed) or not onlyOtherPeds) then + table.insert(peds, ped) + end + end + + return peds +end + +ESX.Game.GetVehicles = function() + local vehicles = {} + + for vehicle in EnumerateVehicles() do + table.insert(vehicles, vehicle) + end + + return vehicles +end + +ESX.Game.GetPlayers = function(onlyOtherPlayers, returnKeyValue, returnPeds) + local players, myPlayer = {}, PlayerId() + + for k,player in ipairs(GetActivePlayers()) do + local ped = GetPlayerPed(player) + + if DoesEntityExist(ped) and ((onlyOtherPlayers and player ~= myPlayer) or not onlyOtherPlayers) then + if returnKeyValue then + players[player] = ped + else + table.insert(players, returnPeds and ped or player) + end + end + end + + return players +end + +ESX.Game.GetClosestObject = function(coords, modelFilter) return ESX.Game.GetClosestEntity(ESX.Game.GetObjects(), false, coords, modelFilter) end +ESX.Game.GetClosestPed = function(coords, modelFilter) return ESX.Game.GetClosestEntity(ESX.Game.GetPeds(true), false, coords, modelFilter) end +ESX.Game.GetClosestPlayer = function(coords) return ESX.Game.GetClosestEntity(ESX.Game.GetPlayers(true, true), true, coords, nil) end +ESX.Game.GetClosestVehicle = function(coords, modelFilter) return ESX.Game.GetClosestEntity(ESX.Game.GetVehicles(), false, coords, modelFilter) end +ESX.Game.GetPlayersInArea = function(coords, maxDistance) return EnumerateEntitiesWithinDistance(ESX.Game.GetPlayers(true, true), true, coords, maxDistance) end +ESX.Game.GetVehiclesInArea = function(coords, maxDistance) return EnumerateEntitiesWithinDistance(ESX.Game.GetVehicles(), false, coords, maxDistance) end +ESX.Game.IsSpawnPointClear = function(coords, maxDistance) return #ESX.Game.GetVehiclesInArea(coords, maxDistance) == 0 end + +ESX.Game.GetClosestEntity = function(entities, isPlayerEntities, coords, modelFilter) + local closestEntity, closestEntityDistance, filteredEntities = -1, -1, nil + + if coords then + coords = vector3(coords.x, coords.y, coords.z) + else + local playerPed = ESX.PlayerData.ped + coords = GetEntityCoords(playerPed) + end + + if modelFilter then + filteredEntities = {} + + for k,entity in pairs(entities) do + if modelFilter[GetEntityModel(entity)] then + table.insert(filteredEntities, entity) + end + end + end + + for k,entity in pairs(filteredEntities or entities) do + local distance = #(coords - GetEntityCoords(entity)) + + if closestEntityDistance == -1 or distance < closestEntityDistance then + closestEntity, closestEntityDistance = isPlayerEntities and k or entity, distance + end + end + + return closestEntity, closestEntityDistance +end + +ESX.Game.GetVehicleInDirection = function() + local playerPed = ESX.PlayerData.ped + local playerCoords = GetEntityCoords(playerPed) + local inDirection = GetOffsetFromEntityInWorldCoords(playerPed, 0.0, 5.0, 0.0) + local rayHandle = StartShapeTestRay(playerCoords, inDirection, 10, playerPed, 0) + local numRayHandle, hit, endCoords, surfaceNormal, entityHit = GetShapeTestResult(rayHandle) + + if hit == 1 and GetEntityType(entityHit) == 2 then + local entityCoords = GetEntityCoords(entityHit) + return entityHit, entityCoords + end + + return nil +end + +ESX.Game.GetVehicleProperties = function(vehicle) + if DoesEntityExist(vehicle) then + local colorPrimary, colorSecondary = GetVehicleColours(vehicle) + local pearlescentColor, wheelColor = GetVehicleExtraColours(vehicle) + local extras = {} + + for extraId=0, 12 do + if DoesExtraExist(vehicle, extraId) then + local state = IsVehicleExtraTurnedOn(vehicle, extraId) == 1 + extras[tostring(extraId)] = state + end + end + + return { + model = GetEntityModel(vehicle), + + plate = ESX.Math.Trim(GetVehicleNumberPlateText(vehicle)), + plateIndex = GetVehicleNumberPlateTextIndex(vehicle), + + bodyHealth = ESX.Math.Round(GetVehicleBodyHealth(vehicle), 1), + engineHealth = ESX.Math.Round(GetVehicleEngineHealth(vehicle), 1), + tankHealth = ESX.Math.Round(GetVehiclePetrolTankHealth(vehicle), 1), + + fuelLevel = ESX.Math.Round(GetVehicleFuelLevel(vehicle), 1), + dirtLevel = ESX.Math.Round(GetVehicleDirtLevel(vehicle), 1), + color1 = colorPrimary, + color2 = colorSecondary, + + pearlescentColor = pearlescentColor, + wheelColor = wheelColor, + + wheels = GetVehicleWheelType(vehicle), + windowTint = GetVehicleWindowTint(vehicle), + xenonColor = GetVehicleXenonLightsColour(vehicle), + + neonEnabled = { + IsVehicleNeonLightEnabled(vehicle, 0), + IsVehicleNeonLightEnabled(vehicle, 1), + IsVehicleNeonLightEnabled(vehicle, 2), + IsVehicleNeonLightEnabled(vehicle, 3) + }, + + neonColor = table.pack(GetVehicleNeonLightsColour(vehicle)), + extras = extras, + tyreSmokeColor = table.pack(GetVehicleTyreSmokeColor(vehicle)), + + modSpoilers = GetVehicleMod(vehicle, 0), + modFrontBumper = GetVehicleMod(vehicle, 1), + modRearBumper = GetVehicleMod(vehicle, 2), + modSideSkirt = GetVehicleMod(vehicle, 3), + modExhaust = GetVehicleMod(vehicle, 4), + modFrame = GetVehicleMod(vehicle, 5), + modGrille = GetVehicleMod(vehicle, 6), + modHood = GetVehicleMod(vehicle, 7), + modFender = GetVehicleMod(vehicle, 8), + modRightFender = GetVehicleMod(vehicle, 9), + modRoof = GetVehicleMod(vehicle, 10), + + modEngine = GetVehicleMod(vehicle, 11), + modBrakes = GetVehicleMod(vehicle, 12), + modTransmission = GetVehicleMod(vehicle, 13), + modHorns = GetVehicleMod(vehicle, 14), + modSuspension = GetVehicleMod(vehicle, 15), + modArmor = GetVehicleMod(vehicle, 16), + + modTurbo = IsToggleModOn(vehicle, 18), + modSmokeEnabled = IsToggleModOn(vehicle, 20), + modXenon = IsToggleModOn(vehicle, 22), + + modFrontWheels = GetVehicleMod(vehicle, 23), + modBackWheels = GetVehicleMod(vehicle, 24), + + modPlateHolder = GetVehicleMod(vehicle, 25), + modVanityPlate = GetVehicleMod(vehicle, 26), + modTrimA = GetVehicleMod(vehicle, 27), + modOrnaments = GetVehicleMod(vehicle, 28), + modDashboard = GetVehicleMod(vehicle, 29), + modDial = GetVehicleMod(vehicle, 30), + modDoorSpeaker = GetVehicleMod(vehicle, 31), + modSeats = GetVehicleMod(vehicle, 32), + modSteeringWheel = GetVehicleMod(vehicle, 33), + modShifterLeavers = GetVehicleMod(vehicle, 34), + modAPlate = GetVehicleMod(vehicle, 35), + modSpeakers = GetVehicleMod(vehicle, 36), + modTrunk = GetVehicleMod(vehicle, 37), + modHydrolic = GetVehicleMod(vehicle, 38), + modEngineBlock = GetVehicleMod(vehicle, 39), + modAirFilter = GetVehicleMod(vehicle, 40), + modStruts = GetVehicleMod(vehicle, 41), + modArchCover = GetVehicleMod(vehicle, 42), + modAerials = GetVehicleMod(vehicle, 43), + modTrimB = GetVehicleMod(vehicle, 44), + modTank = GetVehicleMod(vehicle, 45), + modWindows = GetVehicleMod(vehicle, 46), + modLivery = GetVehicleLivery(vehicle) + } + else + return + end +end + +ESX.Game.SetVehicleProperties = function(vehicle, props) + if DoesEntityExist(vehicle) then + local colorPrimary, colorSecondary = GetVehicleColours(vehicle) + local pearlescentColor, wheelColor = GetVehicleExtraColours(vehicle) + SetVehicleModKit(vehicle, 0) + + if props.plate then SetVehicleNumberPlateText(vehicle, props.plate) end + if props.plateIndex then SetVehicleNumberPlateTextIndex(vehicle, props.plateIndex) end + if props.bodyHealth then SetVehicleBodyHealth(vehicle, props.bodyHealth + 0.0) end + if props.engineHealth then SetVehicleEngineHealth(vehicle, props.engineHealth + 0.0) end + if props.tankHealth then SetVehiclePetrolTankHealth(vehicle, props.tankHealth + 0.0) end + if props.fuelLevel then SetVehicleFuelLevel(vehicle, props.fuelLevel + 0.0) end + if props.dirtLevel then SetVehicleDirtLevel(vehicle, props.dirtLevel + 0.0) end + if props.color1 then SetVehicleColours(vehicle, props.color1, colorSecondary) end + if props.color2 then SetVehicleColours(vehicle, props.color1 or colorPrimary, props.color2) end + if props.pearlescentColor then SetVehicleExtraColours(vehicle, props.pearlescentColor, wheelColor) end + if props.wheelColor then SetVehicleExtraColours(vehicle, props.pearlescentColor or pearlescentColor, props.wheelColor) end + if props.wheels then SetVehicleWheelType(vehicle, props.wheels) end + if props.windowTint then SetVehicleWindowTint(vehicle, props.windowTint) end + + if props.neonEnabled then + SetVehicleNeonLightEnabled(vehicle, 0, props.neonEnabled[1]) + SetVehicleNeonLightEnabled(vehicle, 1, props.neonEnabled[2]) + SetVehicleNeonLightEnabled(vehicle, 2, props.neonEnabled[3]) + SetVehicleNeonLightEnabled(vehicle, 3, props.neonEnabled[4]) + end + + if props.extras then + for extraId,enabled in pairs(props.extras) do + if enabled then + SetVehicleExtra(vehicle, tonumber(extraId), 0) + else + SetVehicleExtra(vehicle, tonumber(extraId), 1) + end + end + end + + if props.neonColor then SetVehicleNeonLightsColour(vehicle, props.neonColor[1], props.neonColor[2], props.neonColor[3]) end + if props.xenonColor then SetVehicleXenonLightsColour(vehicle, props.xenonColor) end + if props.modSmokeEnabled then ToggleVehicleMod(vehicle, 20, true) end + if props.tyreSmokeColor then SetVehicleTyreSmokeColor(vehicle, props.tyreSmokeColor[1], props.tyreSmokeColor[2], props.tyreSmokeColor[3]) end + if props.modSpoilers then SetVehicleMod(vehicle, 0, props.modSpoilers, false) end + if props.modFrontBumper then SetVehicleMod(vehicle, 1, props.modFrontBumper, false) end + if props.modRearBumper then SetVehicleMod(vehicle, 2, props.modRearBumper, false) end + if props.modSideSkirt then SetVehicleMod(vehicle, 3, props.modSideSkirt, false) end + if props.modExhaust then SetVehicleMod(vehicle, 4, props.modExhaust, false) end + if props.modFrame then SetVehicleMod(vehicle, 5, props.modFrame, false) end + if props.modGrille then SetVehicleMod(vehicle, 6, props.modGrille, false) end + if props.modHood then SetVehicleMod(vehicle, 7, props.modHood, false) end + if props.modFender then SetVehicleMod(vehicle, 8, props.modFender, false) end + if props.modRightFender then SetVehicleMod(vehicle, 9, props.modRightFender, false) end + if props.modRoof then SetVehicleMod(vehicle, 10, props.modRoof, false) end + if props.modEngine then SetVehicleMod(vehicle, 11, props.modEngine, false) end + if props.modBrakes then SetVehicleMod(vehicle, 12, props.modBrakes, false) end + if props.modTransmission then SetVehicleMod(vehicle, 13, props.modTransmission, false) end + if props.modHorns then SetVehicleMod(vehicle, 14, props.modHorns, false) end + if props.modSuspension then SetVehicleMod(vehicle, 15, props.modSuspension, false) end + if props.modArmor then SetVehicleMod(vehicle, 16, props.modArmor, false) end + if props.modTurbo then ToggleVehicleMod(vehicle, 18, props.modTurbo) end + if props.modXenon then ToggleVehicleMod(vehicle, 22, props.modXenon) end + if props.modFrontWheels then SetVehicleMod(vehicle, 23, props.modFrontWheels, false) end + if props.modBackWheels then SetVehicleMod(vehicle, 24, props.modBackWheels, false) end + if props.modPlateHolder then SetVehicleMod(vehicle, 25, props.modPlateHolder, false) end + if props.modVanityPlate then SetVehicleMod(vehicle, 26, props.modVanityPlate, false) end + if props.modTrimA then SetVehicleMod(vehicle, 27, props.modTrimA, false) end + if props.modOrnaments then SetVehicleMod(vehicle, 28, props.modOrnaments, false) end + if props.modDashboard then SetVehicleMod(vehicle, 29, props.modDashboard, false) end + if props.modDial then SetVehicleMod(vehicle, 30, props.modDial, false) end + if props.modDoorSpeaker then SetVehicleMod(vehicle, 31, props.modDoorSpeaker, false) end + if props.modSeats then SetVehicleMod(vehicle, 32, props.modSeats, false) end + if props.modSteeringWheel then SetVehicleMod(vehicle, 33, props.modSteeringWheel, false) end + if props.modShifterLeavers then SetVehicleMod(vehicle, 34, props.modShifterLeavers, false) end + if props.modAPlate then SetVehicleMod(vehicle, 35, props.modAPlate, false) end + if props.modSpeakers then SetVehicleMod(vehicle, 36, props.modSpeakers, false) end + if props.modTrunk then SetVehicleMod(vehicle, 37, props.modTrunk, false) end + if props.modHydrolic then SetVehicleMod(vehicle, 38, props.modHydrolic, false) end + if props.modEngineBlock then SetVehicleMod(vehicle, 39, props.modEngineBlock, false) end + if props.modAirFilter then SetVehicleMod(vehicle, 40, props.modAirFilter, false) end + if props.modStruts then SetVehicleMod(vehicle, 41, props.modStruts, false) end + if props.modArchCover then SetVehicleMod(vehicle, 42, props.modArchCover, false) end + if props.modAerials then SetVehicleMod(vehicle, 43, props.modAerials, false) end + if props.modTrimB then SetVehicleMod(vehicle, 44, props.modTrimB, false) end + if props.modTank then SetVehicleMod(vehicle, 45, props.modTank, false) end + if props.modWindows then SetVehicleMod(vehicle, 46, props.modWindows, false) end + + if props.modLivery then + SetVehicleMod(vehicle, 48, props.modLivery, false) + SetVehicleLivery(vehicle, props.modLivery) + end + end +end + +ESX.Game.Utils.DrawText3D = function(coords, text, size, font) + local vector = type(coords) == "vector3" and coords or vec(coords.x, coords.y, coords.z) + + local camCoords = GetGameplayCamCoords() + local distance = #(vector - camCoords) + + if not size then size = 1 end + if not font then font = 0 end + + local scale = (size / distance) * 2 + local fov = (1 / GetGameplayCamFov()) * 100 + scale = scale * fov + + SetTextScale(0.0 * scale, 0.55 * scale) + SetTextFont(font) + SetTextProportional(1) + SetTextColour(255, 255, 255, 215) + SetTextEntry('STRING') + SetTextCentre(true) + AddTextComponentString(text) + SetDrawOrigin(vector.xyz, 0) + DrawText(0.0, 0.0) + ClearDrawOrigin() +end + +ESX.ShowInventory = function() + local playerPed = ESX.PlayerData.ped + local elements, currentWeight = {}, 0 + + for k,v in pairs(ESX.PlayerData.accounts) do + if v.money > 0 then + local formattedMoney = _U('locale_currency', ESX.Math.GroupDigits(v.money)) + local canDrop = v.name ~= 'bank' + + table.insert(elements, { + label = ('%s: %s'):format(v.label, formattedMoney), + count = v.money, + type = 'item_account', + value = v.name, + usable = false, + rare = false, + canRemove = canDrop + }) + end + end + + for k,v in ipairs(ESX.PlayerData.inventory) do + if v.count > 0 then + currentWeight = currentWeight + (v.weight * v.count) + + table.insert(elements, { + label = ('%s x%s'):format(v.label, v.count), + count = v.count, + type = 'item_standard', + value = v.name, + usable = v.usable, + rare = v.rare, + canRemove = v.canRemove + }) + end + end + + for k,v in ipairs(Config.Weapons) do + local weaponHash = GetHashKey(v.name) + + if HasPedGotWeapon(playerPed, weaponHash, false) then + local ammo, label = GetAmmoInPedWeapon(playerPed, weaponHash) + + if v.ammo then + label = ('%s - %s %s'):format(v.label, ammo, v.ammo.label) + else + label = v.label + end + + table.insert(elements, { + label = label, + count = 1, + type = 'item_weapon', + value = v.name, + usable = false, + rare = false, + ammo = ammo, + canGiveAmmo = (v.ammo ~= nil), + canRemove = true + }) + end + end + + ESX.UI.Menu.CloseAll() + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'inventory', { + title = _U('inventory', currentWeight, ESX.PlayerData.maxWeight), + align = 'bottom-right', + elements = elements + }, function(data, menu) + menu.close() + local player, distance = ESX.Game.GetClosestPlayer() + elements = {} + + if data.current.usable then + table.insert(elements, {label = _U('use'), action = 'use', type = data.current.type, value = data.current.value}) + end + + if data.current.canRemove then + if player ~= -1 and distance <= 3.0 then + table.insert(elements, {label = _U('give'), action = 'give', type = data.current.type, value = data.current.value}) + end + + table.insert(elements, {label = _U('remove'), action = 'remove', type = data.current.type, value = data.current.value}) + end + + if data.current.type == 'item_weapon' and data.current.canGiveAmmo and data.current.ammo > 0 and player ~= -1 and distance <= 3.0 then + table.insert(elements, {label = _U('giveammo'), action = 'give_ammo', type = data.current.type, value = data.current.value}) + end + + table.insert(elements, {label = _U('return'), action = 'return'}) + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'inventory_item', { + title = data.current.label, + align = 'bottom-right', + elements = elements, + }, function(data1, menu1) + local item, type = data1.current.value, data1.current.type + + if data1.current.action == 'give' then + local playersNearby = ESX.Game.GetPlayersInArea(GetEntityCoords(playerPed), 3.0) + + if #playersNearby > 0 then + local players = {} + elements = {} + + for k,playerNearby in ipairs(playersNearby) do + players[GetPlayerServerId(playerNearby)] = true + end + + ESX.TriggerServerCallback('esx:getPlayerNames', function(returnedPlayers) + for playerId,playerName in pairs(returnedPlayers) do + table.insert(elements, { + label = playerName, + playerId = playerId + }) + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'give_item_to', { + title = _U('give_to'), + align = 'bottom-right', + elements = elements + }, function(data2, menu2) + local selectedPlayer, selectedPlayerId = GetPlayerFromServerId(data2.current.playerId), data2.current.playerId + playersNearby = ESX.Game.GetPlayersInArea(GetEntityCoords(playerPed), 3.0) + playersNearby = ESX.Table.Set(playersNearby) + + if playersNearby[selectedPlayer] then + local selectedPlayerPed = GetPlayerPed(selectedPlayer) + + if IsPedOnFoot(selectedPlayerPed) and not IsPedFalling(selectedPlayerPed) then + if type == 'item_weapon' then + TriggerServerEvent('esx:giveInventoryItem', selectedPlayerId, type, item, nil) + menu2.close() + menu1.close() + else + ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'inventory_item_count_give', { + title = _U('amount') + }, function(data3, menu3) + local quantity = tonumber(data3.value) + + if quantity and quantity > 0 and data.current.count >= quantity then + TriggerServerEvent('esx:giveInventoryItem', selectedPlayerId, type, item, quantity) + menu3.close() + menu2.close() + menu1.close() + else + ESX.ShowNotification(_U('amount_invalid')) + end + end, function(data3, menu3) + menu3.close() + end) + end + else + ESX.ShowNotification(_U('in_vehicle')) + end + else + ESX.ShowNotification(_U('players_nearby')) + menu2.close() + end + end, function(data2, menu2) + menu2.close() + end) + end, players) + else + ESX.ShowNotification(_U('players_nearby')) + end + elseif data1.current.action == 'remove' then + if IsPedOnFoot(playerPed) and not IsPedFalling(playerPed) then + local dict, anim = 'weapons@first_person@aim_rng@generic@projectile@sticky_bomb@', 'plant_floor' + ESX.Streaming.RequestAnimDict(dict) + + if type == 'item_weapon' then + menu1.close() + TaskPlayAnim(playerPed, dict, anim, 8.0, 1.0, 1000, 16, 0.0, false, false, false) + Citizen.Wait(1000) + TriggerServerEvent('esx:removeInventoryItem', type, item) + else + ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'inventory_item_count_remove', { + title = _U('amount') + }, function(data2, menu2) + local quantity = tonumber(data2.value) + + if quantity and quantity > 0 and data.current.count >= quantity then + menu2.close() + menu1.close() + TaskPlayAnim(playerPed, dict, anim, 8.0, 1.0, 1000, 16, 0.0, false, false, false) + Citizen.Wait(1000) + TriggerServerEvent('esx:removeInventoryItem', type, item, quantity) + else + ESX.ShowNotification(_U('amount_invalid')) + end + end, function(data2, menu2) + menu2.close() + end) + end + end + elseif data1.current.action == 'use' then + TriggerServerEvent('esx:useItem', item) + elseif data1.current.action == 'return' then + ESX.UI.Menu.CloseAll() + ESX.ShowInventory() + elseif data1.current.action == 'give_ammo' then + local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() + local closestPed = GetPlayerPed(closestPlayer) + local pedAmmo = GetAmmoInPedWeapon(playerPed, GetHashKey(item)) + + if IsPedOnFoot(closestPed) and not IsPedFalling(closestPed) then + if closestPlayer ~= -1 and closestDistance < 3.0 then + if pedAmmo > 0 then + ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'inventory_item_count_give', { + title = _U('amountammo') + }, function(data2, menu2) + local quantity = tonumber(data2.value) + + if quantity and quantity > 0 then + if pedAmmo >= quantity then + TriggerServerEvent('esx:giveInventoryItem', GetPlayerServerId(closestPlayer), 'item_ammo', item, quantity) + menu2.close() + menu1.close() + else + ESX.ShowNotification(_U('noammo')) + end + else + ESX.ShowNotification(_U('amount_invalid')) + end + end, function(data2, menu2) + menu2.close() + end) + else + ESX.ShowNotification(_U('noammo')) + end + else + ESX.ShowNotification(_U('players_nearby')) + end + else + ESX.ShowNotification(_U('in_vehicle')) + end + end + end, function(data1, menu1) + ESX.UI.Menu.CloseAll() + ESX.ShowInventory() + end) + end, function(data, menu) + menu.close() + end) +end + +RegisterNetEvent('esx:serverCallback') +AddEventHandler('esx:serverCallback', function(requestId, ...) + ESX.ServerCallbacks[requestId](...) + ESX.ServerCallbacks[requestId] = nil +end) + +RegisterNetEvent('esx:showNotification') +AddEventHandler('esx:showNotification', function(msg) + ESX.ShowNotification(msg) +end) + +RegisterNetEvent('esx:showAdvancedNotification') +AddEventHandler('esx:showAdvancedNotification', function(sender, subject, msg, textureDict, iconType, flash, saveToBrief, hudColorIndex) + ESX.ShowAdvancedNotification(sender, subject, msg, textureDict, iconType, flash, saveToBrief, hudColorIndex) +end) + +RegisterNetEvent('esx:showHelpNotification') +AddEventHandler('esx:showHelpNotification', function(msg, thisFrame, beep, duration) + ESX.ShowHelpNotification(msg, thisFrame, beep, duration) +end) + +-- SetTimeout +Citizen.CreateThread(function() + while true do + Citizen.Wait(0) + local letSleep = true + local currTime = GetGameTimer() + + if #ESX.TimeoutCallbacks > 0 then + letSleep = false + for i=1, #ESX.TimeoutCallbacks, 1 do + if ESX.TimeoutCallbacks[i] then + if currTime >= ESX.TimeoutCallbacks[i].time then + ESX.TimeoutCallbacks[i].cb() + ESX.TimeoutCallbacks[i] = nil + end + end + end + end + if letSleep then + Citizen.Wait(500) + end + end +end) diff --git a/[esx]/es_extended/client/main.lua b/[esx]/es_extended/client/main.lua new file mode 100644 index 00000000..e5d6aec7 --- /dev/null +++ b/[esx]/es_extended/client/main.lua @@ -0,0 +1,597 @@ +local pickups = {} + +Citizen.CreateThread(function() + while NetworkIsPlayerActive(PlayerId()) and not Config.Multichar do + Citizen.Wait(5) + DoScreenFadeOut(0) + TriggerServerEvent('esx:onPlayerJoined') + break + end +end) + +RegisterNetEvent('esx:playerLoaded') +AddEventHandler('esx:playerLoaded', function(xPlayer, isNew, skin) + ESX.PlayerLoaded = true + ESX.PlayerData = xPlayer + + FreezeEntityPosition(PlayerPedId(), true) + + if Config.Multichar then + Citizen.Wait(3000) + else + exports.spawnmanager:spawnPlayer({ + x = ESX.PlayerData.coords.x, + y = ESX.PlayerData.coords.y, + z = ESX.PlayerData.coords.z + 0.25, + heading = ESX.PlayerData.coords.heading, + model = `mp_m_freemode_01`, + skipFade = false + }, function() + TriggerServerEvent('esx:onPlayerSpawn') + TriggerEvent('esx:onPlayerSpawn') + TriggerEvent('playerSpawned') -- compatibility with old scripts + TriggerEvent('esx:restoreLoadout') + if isNew then + if skin.sex == 0 then + TriggerEvent('skinchanger:loadDefaultModel', true) + else + TriggerEvent('skinchanger:loadDefaultModel', false) + end + elseif skin then TriggerEvent('skinchanger:loadSkin', skin) end + TriggerEvent('esx:loadingScreenOff') + ShutdownLoadingScreen() + ShutdownLoadingScreenNui() + FreezeEntityPosition(ESX.PlayerData.ped, false) + end) + end + + while ESX.PlayerData.ped == nil do Citizen.Wait(20) end + -- enable PVP + if Config.EnablePVP then + SetCanAttackFriendly(ESX.PlayerData.ped, true, false) + NetworkSetFriendlyFireOption(true) + end + + if Config.EnableHud then + for k,v in ipairs(ESX.PlayerData.accounts) do + local accountTpl = '
 {{money}}
' + ESX.UI.HUD.RegisterElement('account_' .. v.name, k, 0, accountTpl, {money = ESX.Math.GroupDigits(v.money)}) + end + + local jobTpl = '
{{job_label}}{{grade_label}}
' + + local gradeLabel = ESX.PlayerData.job.grade_label ~= ESX.PlayerData.job.label and ESX.PlayerData.job.grade_label or '' + if gradeLabel ~= '' then gradeLabel = ' - '..gradeLabel end + + ESX.UI.HUD.RegisterElement('job', #ESX.PlayerData.accounts, 0, jobTpl, { + job_label = ESX.PlayerData.job.label, + grade_label = gradeLabel + }) + end + StartServerSyncLoops() +end) + +RegisterNetEvent('esx:onPlayerLogout') +AddEventHandler('esx:onPlayerLogout', function() + ESX.PlayerLoaded = false + if Config.EnableHud then ESX.UI.HUD.Reset() end +end) + +RegisterNetEvent('esx:setMaxWeight') +AddEventHandler('esx:setMaxWeight', function(newMaxWeight) ESX.PlayerData.maxWeight = newMaxWeight end) + +AddEventHandler('esx:onPlayerSpawn', function() + local playerPed = PlayerPedId() + if ESX.PlayerData.ped ~= playerPed then ESX.SetPlayerData('ped', playerPed) end + if ESX.PlayerData.dead ~= false then ESX.SetPlayerData('dead', false) end +end) + +AddEventHandler('esx:onPlayerDeath', function() + local playerPed = PlayerPedId() + if ESX.PlayerData.ped ~= playerPed then ESX.SetPlayerData('ped', playerPed) end + if ESX.PlayerData.dead ~= false then ESX.SetPlayerData('dead', true) end +end) + +AddEventHandler('skinchanger:modelLoaded', function() + while not ESX.PlayerLoaded do + Citizen.Wait(100) + end + TriggerEvent('esx:restoreLoadout') +end) + +AddEventHandler('esx:restoreLoadout', function() + local playerPed = PlayerPedId() + if ESX.PlayerData.ped ~= playerPed then ESX.SetPlayerData('ped', playerPed) end + local ammoTypes = {} + RemoveAllPedWeapons(ESX.PlayerData.ped, true) + + for k,v in ipairs(ESX.PlayerData.loadout) do + local weaponName = v.name + local weaponHash = GetHashKey(weaponName) + + GiveWeaponToPed(ESX.PlayerData.ped, weaponHash, 0, false, false) + SetPedWeaponTintIndex(ESX.PlayerData.ped, weaponHash, v.tintIndex) + + local ammoType = GetPedAmmoTypeFromWeapon(ESX.PlayerData.ped, weaponHash) + + for k2,v2 in ipairs(v.components) do + local componentHash = ESX.GetWeaponComponent(weaponName, v2).hash + GiveWeaponComponentToPed(ESX.PlayerData.ped, weaponHash, componentHash) + end + + if not ammoTypes[ammoType] then + AddAmmoToPed(ESX.PlayerData.ped, weaponHash, v.ammo) + ammoTypes[ammoType] = true + end + end +end) + +RegisterNetEvent('esx:setAccountMoney') +AddEventHandler('esx:setAccountMoney', function(account) + for k,v in ipairs(ESX.PlayerData.accounts) do + if v.name == account.name then + ESX.PlayerData.accounts[k] = account + break + end + end + ESX.SetPlayerData('accounts', ESX.PlayerData.accounts) + + if Config.EnableHud then + ESX.UI.HUD.UpdateElement('account_' .. account.name, { + money = ESX.Math.GroupDigits(account.money) + }) + end +end) + +RegisterNetEvent('esx:addInventoryItem') +AddEventHandler('esx:addInventoryItem', function(item, count, showNotification) + for k,v in ipairs(ESX.PlayerData.inventory) do + if v.name == item then + ESX.UI.ShowInventoryItemNotification(true, v.label, count - v.count) + ESX.PlayerData.inventory[k].count = count + break + end + end + + if showNotification then + ESX.UI.ShowInventoryItemNotification(true, item, count) + end + + if ESX.UI.Menu.IsOpen('default', 'es_extended', 'inventory') then + ESX.ShowInventory() + end +end) + +RegisterNetEvent('esx:removeInventoryItem') +AddEventHandler('esx:removeInventoryItem', function(item, count, showNotification) + for k,v in ipairs(ESX.PlayerData.inventory) do + if v.name == item then + ESX.UI.ShowInventoryItemNotification(false, v.label, v.count - count) + ESX.PlayerData.inventory[k].count = count + break + end + end + + if showNotification then + ESX.UI.ShowInventoryItemNotification(false, item, count) + end + + if ESX.UI.Menu.IsOpen('default', 'es_extended', 'inventory') then + ESX.ShowInventory() + end +end) + +RegisterNetEvent('esx:addWeapon') +AddEventHandler('esx:addWeapon', function(weapon, ammo) + GiveWeaponToPed(ESX.PlayerData.ped, GetHashKey(weapon), ammo, false, false) +end) + +RegisterNetEvent('esx:addWeaponComponent') +AddEventHandler('esx:addWeaponComponent', function(weapon, weaponComponent) + local componentHash = ESX.GetWeaponComponent(weapon, weaponComponent).hash + GiveWeaponComponentToPed(ESX.PlayerData.ped, GetHashKey(weapon), componentHash) +end) + +RegisterNetEvent('esx:setWeaponAmmo') +AddEventHandler('esx:setWeaponAmmo', function(weapon, weaponAmmo) + SetPedAmmo(ESX.PlayerData.ped, GetHashKey(weapon), weaponAmmo) +end) + +RegisterNetEvent('esx:setWeaponTint') +AddEventHandler('esx:setWeaponTint', function(weapon, weaponTintIndex) + SetPedWeaponTintIndex(ESX.PlayerData.ped, GetHashKey(weapon), weaponTintIndex) +end) + +RegisterNetEvent('esx:removeWeapon') +AddEventHandler('esx:removeWeapon', function(weapon) + local playerPed = ESX.PlayerData.ped + RemoveWeaponFromPed(ESX.PlayerData.ped, GetHashKey(weapon)) + SetPedAmmo(ESX.PlayerData.ped, GetHashKey(weapon), 0) +end) + +RegisterNetEvent('esx:removeWeaponComponent') +AddEventHandler('esx:removeWeaponComponent', function(weapon, weaponComponent) + local componentHash = ESX.GetWeaponComponent(weapon, weaponComponent).hash + RemoveWeaponComponentFromPed(ESX.PlayerData.ped, GetHashKey(weapon), componentHash) +end) + +RegisterNetEvent('esx:teleport') +AddEventHandler('esx:teleport', function(coords) + ESX.Game.Teleport(ESX.PlayerData.ped, coords) +end) + +RegisterNetEvent('esx:setJob') +AddEventHandler('esx:setJob', function(Job) + if Config.EnableHud then + local gradeLabel = Job.grade_label ~= Job.label and Job.grade_label or '' + if gradeLabel ~= '' then gradeLabel = ' - '..gradeLabel end + ESX.UI.HUD.UpdateElement('job', { + job_label = Job.label, + grade_label = gradeLabel + }) + end + ESX.SetPlayerData('job', Job) +end) + +RegisterNetEvent('esx:spawnVehicle') +AddEventHandler('esx:spawnVehicle', function(vehicle) + local model = (type(vehicle) == 'number' and vehicle or GetHashKey(vehicle)) + + if IsModelInCdimage(model) then + local playerCoords, playerHeading = GetEntityCoords(ESX.PlayerData.ped), GetEntityHeading(ESX.PlayerData.ped) + + ESX.Game.SpawnVehicle(model, playerCoords, playerHeading, function(vehicle) + TaskWarpPedIntoVehicle(ESX.PlayerData.ped, vehicle, -1) + end) + else + TriggerEvent('chat:addMessage', { args = { '^1SYSTEM', 'Invalid vehicle model.' } }) + end +end) +RegisterNetEvent('esx:createPickup') +AddEventHandler('esx:createPickup', function(pickupId, label, coords, type, name, components, tintIndex) + local function setObjectProperties(object) + SetEntityAsMissionEntity(object, true, false) + PlaceObjectOnGroundProperly(object) + FreezeEntityPosition(object, true) + SetEntityCollision(object, false, true) + + pickups[pickupId] = { + obj = object, + label = label, + inRange = false, + coords = vector3(coords.x, coords.y, coords.z) + } + end + + if type == 'item_weapon' then + local weaponHash = GetHashKey(name) + ESX.Streaming.RequestWeaponAsset(weaponHash) + local pickupObject = CreateWeaponObject(weaponHash, 50, coords.x, coords.y, coords.z, true, 1.0, 0) + SetWeaponObjectTintIndex(pickupObject, tintIndex) + + for k,v in ipairs(components) do + local component = ESX.GetWeaponComponent(name, v) + GiveWeaponComponentToWeaponObject(pickupObject, component.hash) + end + + setObjectProperties(pickupObject) + else + ESX.Game.SpawnLocalObject('prop_money_bag_01', coords, setObjectProperties) + end +end) + +RegisterNetEvent('esx:createMissingPickups') +AddEventHandler('esx:createMissingPickups', function(missingPickups) + for pickupId,pickup in pairs(missingPickups) do + TriggerEvent('esx:createPickup', pickupId, pickup.label, pickup.coords, pickup.type, pickup.name, pickup.components, pickup.tintIndex) + end +end) + +RegisterNetEvent('esx:registerSuggestions') +AddEventHandler('esx:registerSuggestions', function(registeredCommands) + for name,command in pairs(registeredCommands) do + if command.suggestion then + TriggerEvent('chat:addSuggestion', ('/%s'):format(name), command.suggestion.help, command.suggestion.arguments) + end + end +end) + +RegisterNetEvent('esx:removePickup') +AddEventHandler('esx:removePickup', function(pickupId) + if pickups[pickupId] and pickups[pickupId].obj then + ESX.Game.DeleteObject(pickups[pickupId].obj) + pickups[pickupId] = nil + end +end) + +RegisterNetEvent('esx:deleteVehicle') +AddEventHandler('esx:deleteVehicle', function(radius) + if radius and tonumber(radius) then + radius = tonumber(radius) + 0.01 + local vehicles = ESX.Game.GetVehiclesInArea(GetEntityCoords(ESX.PlayerData.ped), radius) + + for k,entity in ipairs(vehicles) do + local attempt = 0 + + while not NetworkHasControlOfEntity(entity) and attempt < 100 and DoesEntityExist(entity) do + Citizen.Wait(100) + NetworkRequestControlOfEntity(entity) + attempt = attempt + 1 + end + + if DoesEntityExist(entity) and NetworkHasControlOfEntity(entity) then + ESX.Game.DeleteVehicle(entity) + end + end + else + local vehicle, attempt = ESX.Game.GetVehicleInDirection(), 0 + + if IsPedInAnyVehicle(ESX.PlayerData.ped, true) then + vehicle = GetVehiclePedIsIn(ESX.PlayerData.ped, false) + end + + while not NetworkHasControlOfEntity(vehicle) and attempt < 100 and DoesEntityExist(vehicle) do + Citizen.Wait(100) + NetworkRequestControlOfEntity(vehicle) + attempt = attempt + 1 + end + + if DoesEntityExist(vehicle) and NetworkHasControlOfEntity(vehicle) then + ESX.Game.DeleteVehicle(vehicle) + end + end +end) + +-- Pause menu disables HUD display +if Config.EnableHud then + Citizen.CreateThread(function() + local isPaused = false + while true do + Citizen.Wait(300) + + if IsPauseMenuActive() and not isPaused then + isPaused = true + ESX.UI.HUD.SetDisplay(0.0) + elseif not IsPauseMenuActive() and isPaused then + isPaused = false + ESX.UI.HUD.SetDisplay(1.0) + end + end + end) + + AddEventHandler('esx:loadingScreenOff', function() + ESX.UI.HUD.SetDisplay(1.0) + end) +end + +function StartServerSyncLoops() + -- keep track of ammo + Citizen.CreateThread(function() + local currentWeapon = {timer=0} + while ESX.PlayerLoaded do + local sleep = 5 + + if currentWeapon.timer == sleep then + local ammoCount = GetAmmoInPedWeapon(ESX.PlayerData.ped, currentWeapon.hash) + TriggerServerEvent('esx:updateWeaponAmmo', currentWeapon.name, ammoCount) + currentWeapon.timer = 0 + elseif currentWeapon.timer > sleep then + currentWeapon.timer = currentWeapon.timer - sleep + end + + if IsPedArmed(ESX.PlayerData.ped, 4) then + if IsPedShooting(ESX.PlayerData.ped) then + local _,weaponHash = GetCurrentPedWeapon(ESX.PlayerData.ped, true) + local weapon = ESX.GetWeaponFromHash(weaponHash) + + if weapon then + currentWeapon.name = weapon.name + currentWeapon.hash = weaponHash + currentWeapon.timer = 100 * sleep + end + end + else + sleep = 200 + end + Citizen.Wait(sleep) + end + end) + + -- sync current player coords with server + Citizen.CreateThread(function() + local previousCoords = vector3(ESX.PlayerData.coords.x, ESX.PlayerData.coords.y, ESX.PlayerData.coords.z) + + while ESX.PlayerLoaded do + local playerPed = PlayerPedId() + if ESX.PlayerData.ped ~= playerPed then ESX.SetPlayerData('ped', playerPed) end + + if DoesEntityExist(ESX.PlayerData.ped) then + local playerCoords = GetEntityCoords(ESX.PlayerData.ped) + local distance = #(playerCoords - previousCoords) + + if distance > 1 then + previousCoords = playerCoords + local playerHeading = ESX.Math.Round(GetEntityHeading(ESX.PlayerData.ped), 1) + local formattedCoords = {x = ESX.Math.Round(playerCoords.x, 1), y = ESX.Math.Round(playerCoords.y, 1), z = ESX.Math.Round(playerCoords.z, 1), heading = playerHeading} + TriggerServerEvent('esx:updateCoords', formattedCoords) + end + end + Citizen.Wait(1500) + end + end) +end + +if Config.EnableDefaultInventory then + RegisterCommand('showinv', function() + if not ESX.PlayerData.dead and not ESX.UI.Menu.IsOpen('default', 'es_extended', 'inventory') then + ESX.ShowInventory() + end + end) + + RegisterKeyMapping('showinv', _U('keymap_showinventory'), 'keyboard', 'F2') +end + +-- disable wanted level +if not Config.EnableWantedLevel then + ClearPlayerWantedLevel(PlayerId()) + SetMaxWantedLevel(0) +end + +Citizen.CreateThread(function() + while true do + Citizen.Wait(0) + local playerCoords, letSleep = GetEntityCoords(ESX.PlayerData.ped), true + local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer(playerCoords) + + for pickupId,pickup in pairs(pickups) do + local distance = #(playerCoords - pickup.coords) + + if distance < 5 then + local label = pickup.label + letSleep = false + + if distance < 1 then + if IsControlJustReleased(0, 38) then + if IsPedOnFoot(ESX.PlayerData.ped) and (closestDistance == -1 or closestDistance > 3) and not pickup.inRange then + pickup.inRange = true + + local dict, anim = 'weapons@first_person@aim_rng@generic@projectile@sticky_bomb@', 'plant_floor' + ESX.Streaming.RequestAnimDict(dict) + TaskPlayAnim(ESX.PlayerData.ped, dict, anim, 8.0, 1.0, 1000, 16, 0.0, false, false, false) + Citizen.Wait(1000) + + TriggerServerEvent('esx:onPickup', pickupId) + PlaySoundFrontend(-1, 'PICK_UP', 'HUD_FRONTEND_DEFAULT_SOUNDSET', false) + end + end + + label = ('%s~n~%s'):format(label, _U('threw_pickup_prompt')) + end + + ESX.Game.Utils.DrawText3D({ + x = pickup.coords.x, + y = pickup.coords.y, + z = pickup.coords.z + 0.25 + }, label, 1.2, 1) + elseif pickup.inRange then + pickup.inRange = false + end + end + + if letSleep then + Citizen.Wait(500) + end + end +end) + +----- Admin commnads from esx_adminplus + +RegisterNetEvent("esx:tpm") +AddEventHandler("esx:tpm", function() + local WaypointHandle = GetFirstBlipInfoId(8) + if DoesBlipExist(WaypointHandle) then + local waypointCoords = GetBlipInfoIdCoord(WaypointHandle) + + for height = 1, 1000 do + SetPedCoordsKeepVehicle(ESX.PlayerData.ped, waypointCoords["x"], waypointCoords["y"], height + 0.0) + + local foundGround, zPos = GetGroundZFor_3dCoord(waypointCoords["x"], waypointCoords["y"], height + 0.0) + + if foundGround then + SetPedCoordsKeepVehicle(ESX.PlayerData.ped, waypointCoords["x"], waypointCoords["y"], height + 0.0) + + break + end + + Citizen.Wait(5) + end + TriggerEvent('chatMessage', "Successfully Teleported") + else + TriggerEvent('chatMessage', "No Waypoint Set") + end +end) + +local noclip = false +RegisterNetEvent("esx:noclip") +AddEventHandler("esx:noclip", function(input) + local player = PlayerId() + + local msg = "disabled" + if(noclip == false)then + noclip_pos = GetEntityCoords(ESX.PlayerData.ped, false) + end + + noclip = not noclip + + if(noclip)then + msg = "enabled" + end + + TriggerEvent("chatMessage", "Noclip has been ^2^*" .. msg) + end) + + local heading = 0 + Citizen.CreateThread(function() + while true do + Citizen.Wait(0) + + if(noclip)then + SetEntityCoordsNoOffset(ESX.PlayerData.ped, noclip_pos.x, noclip_pos.y, noclip_pos.z, 0, 0, 0) + + if(IsControlPressed(1, 34))then + heading = heading + 1.5 + if(heading > 360)then + heading = 0 + end + + SetEntityHeading(ESX.PlayerData.ped, heading) + end + + if(IsControlPressed(1, 9))then + heading = heading - 1.5 + if(heading < 0)then + heading = 360 + end + + SetEntityHeading(ESX.PlayerData.ped, heading) + end + + if(IsControlPressed(1, 8))then + noclip_pos = GetOffsetFromEntityInWorldCoords(ESX.PlayerData.ped, 0.0, 1.0, 0.0) + end + + if(IsControlPressed(1, 32))then + noclip_pos = GetOffsetFromEntityInWorldCoords(ESX.PlayerData.ped, 0.0, -1.0, 0.0) + end + + if(IsControlPressed(1, 27))then + noclip_pos = GetOffsetFromEntityInWorldCoords(ESX.PlayerData.ped, 0.0, 0.0, 1.0) + end + + if(IsControlPressed(1, 173))then + noclip_pos = GetOffsetFromEntityInWorldCoords(ESX.PlayerData.ped, 0.0, 0.0, -1.0) + end + else + Citizen.Wait(200) + end + end +end) + +RegisterNetEvent("esx:killPlayer") +AddEventHandler("esx:killPlayer", function() + SetEntityHealth(ESX.PlayerData.ped, 0) +end) + +RegisterNetEvent("esx:freezePlayer") +AddEventHandler("esx:freezePlayer", function(input) + local player = PlayerId() + if input == 'freeze' then + SetEntityCollision(ESX.PlayerData.ped, false) + FreezeEntityPosition(ESX.PlayerData.ped, true) + SetPlayerInvincible(player, true) + elseif input == 'unfreeze' then + SetEntityCollision(ESX.PlayerData.ped, true) + FreezeEntityPosition(ESX.PlayerData.ped, false) + SetPlayerInvincible(player, false) + end +end) diff --git a/[esx]/es_extended/client/modules/death.lua b/[esx]/es_extended/client/modules/death.lua new file mode 100644 index 00000000..baa2e727 --- /dev/null +++ b/[esx]/es_extended/client/modules/death.lua @@ -0,0 +1,70 @@ +Citizen.CreateThread(function() + local isDead = false + + while true do + Citizen.Wait(0) + local letSleep = 0 + local player = PlayerId() + + if NetworkIsPlayerActive(player) then + local playerPed = PlayerPedId() + + if IsPedFatallyInjured(playerPed) and not isDead then + letSleep = false + isDead = true + + local killerEntity, deathCause = GetPedSourceOfDeath(playerPed), GetPedCauseOfDeath(playerPed) + local killerClientId = NetworkGetPlayerIndexFromPed(killerEntity) + + if killerEntity ~= playerPed and killerClientId and NetworkIsPlayerActive(killerClientId) then + PlayerKilledByPlayer(GetPlayerServerId(killerClientId), killerClientId, deathCause) + else + PlayerKilled(deathCause) + end + + elseif not IsPedFatallyInjured(playerPed) and isDead then + letSleep = false + isDead = false + end + end + if letSleep then + Citizen.Wait(500) + end + end +end) + +function PlayerKilledByPlayer(killerServerId, killerClientId, deathCause) + local victimCoords = GetEntityCoords(PlayerPedId()) + local killerCoords = GetEntityCoords(GetPlayerPed(killerClientId)) + local distance = #(victimCoords - killerCoords) + + local data = { + victimCoords = {x = ESX.Math.Round(victimCoords.x, 1), y = ESX.Math.Round(victimCoords.y, 1), z = ESX.Math.Round(victimCoords.z, 1)}, + killerCoords = {x = ESX.Math.Round(killerCoords.x, 1), y = ESX.Math.Round(killerCoords.y, 1), z = ESX.Math.Round(killerCoords.z, 1)}, + + killedByPlayer = true, + deathCause = deathCause, + distance = ESX.Math.Round(distance, 1), + + killerServerId = killerServerId, + killerClientId = killerClientId + } + + TriggerEvent('esx:onPlayerDeath', data) + TriggerServerEvent('esx:onPlayerDeath', data) +end + +function PlayerKilled(deathCause) + local playerPed = PlayerPedId() + local victimCoords = GetEntityCoords(playerPed) + + local data = { + victimCoords = {x = ESX.Math.Round(victimCoords.x, 1), y = ESX.Math.Round(victimCoords.y, 1), z = ESX.Math.Round(victimCoords.z, 1)}, + + killedByPlayer = false, + deathCause = deathCause + } + + TriggerEvent('esx:onPlayerDeath', data) + TriggerServerEvent('esx:onPlayerDeath', data) +end diff --git a/[esx]/es_extended/client/modules/scaleform.lua b/[esx]/es_extended/client/modules/scaleform.lua new file mode 100644 index 00000000..681f7db1 --- /dev/null +++ b/[esx]/es_extended/client/modules/scaleform.lua @@ -0,0 +1,98 @@ +ESX.Scaleform.ShowFreemodeMessage = function(title, msg, sec) + local scaleform = ESX.Scaleform.Utils.RequestScaleformMovie('MP_BIG_MESSAGE_FREEMODE') + + BeginScaleformMovieMethod(scaleform, 'SHOW_SHARD_WASTED_MP_MESSAGE') + PushScaleformMovieMethodParameterString(title) + PushScaleformMovieMethodParameterString(msg) + EndScaleformMovieMethod() + + while sec > 0 do + Citizen.Wait(1) + sec = sec - 0.01 + + DrawScaleformMovieFullscreen(scaleform, 255, 255, 255, 255) + end + + SetScaleformMovieAsNoLongerNeeded(scaleform) +end + +ESX.Scaleform.ShowBreakingNews = function(title, msg, bottom, sec) + local scaleform = ESX.Scaleform.Utils.RequestScaleformMovie('BREAKING_NEWS') + + BeginScaleformMovieMethod(scaleform, 'SET_TEXT') + PushScaleformMovieMethodParameterString(msg) + PushScaleformMovieMethodParameterString(bottom) + EndScaleformMovieMethod() + + BeginScaleformMovieMethod(scaleform, 'SET_SCROLL_TEXT') + PushScaleformMovieMethodParameterInt(0) -- top ticker + PushScaleformMovieMethodParameterInt(0) -- Since this is the first string, start at 0 + PushScaleformMovieMethodParameterString(title) + + EndScaleformMovieMethod() + + BeginScaleformMovieMethod(scaleform, 'DISPLAY_SCROLL_TEXT') + PushScaleformMovieMethodParameterInt(0) -- Top ticker + PushScaleformMovieMethodParameterInt(0) -- Index of string + + EndScaleformMovieMethod() + + while sec > 0 do + Citizen.Wait(1) + sec = sec - 0.01 + + DrawScaleformMovieFullscreen(scaleform, 255, 255, 255, 255) + end + + SetScaleformMovieAsNoLongerNeeded(scaleform) +end + +ESX.Scaleform.ShowPopupWarning = function(title, msg, bottom, sec) + local scaleform = ESX.Scaleform.Utils.RequestScaleformMovie('POPUP_WARNING') + + BeginScaleformMovieMethod(scaleform, 'SHOW_POPUP_WARNING') + + PushScaleformMovieMethodParameterFloat(500.0) -- black background + PushScaleformMovieMethodParameterString(title) + PushScaleformMovieMethodParameterString(msg) + PushScaleformMovieMethodParameterString(bottom) + PushScaleformMovieMethodParameterBool(true) + + EndScaleformMovieMethod() + + while sec > 0 do + Citizen.Wait(1) + sec = sec - 0.01 + + DrawScaleformMovieFullscreen(scaleform, 255, 255, 255, 255) + end + + SetScaleformMovieAsNoLongerNeeded(scaleform) +end + +ESX.Scaleform.ShowTrafficMovie = function(sec) + local scaleform = ESX.Scaleform.Utils.RequestScaleformMovie('TRAFFIC_CAM') + + BeginScaleformMovieMethod(scaleform, 'PLAY_CAM_MOVIE') + + EndScaleformMovieMethod() + + while sec > 0 do + Citizen.Wait(1) + sec = sec - 0.01 + + DrawScaleformMovieFullscreen(scaleform, 255, 255, 255, 255) + end + + SetScaleformMovieAsNoLongerNeeded(scaleform) +end + +ESX.Scaleform.Utils.RequestScaleformMovie = function(movie) + local scaleform = RequestScaleformMovie(movie) + + while not HasScaleformMovieLoaded(scaleform) do + Citizen.Wait(0) + end + + return scaleform +end diff --git a/[esx]/es_extended/client/modules/streaming.lua b/[esx]/es_extended/client/modules/streaming.lua new file mode 100644 index 00000000..211f0550 --- /dev/null +++ b/[esx]/es_extended/client/modules/streaming.lua @@ -0,0 +1,85 @@ +function ESX.Streaming.RequestModel(modelHash, cb) + modelHash = (type(modelHash) == 'number' and modelHash or GetHashKey(modelHash)) + + if not HasModelLoaded(modelHash) and IsModelInCdimage(modelHash) then + RequestModel(modelHash) + + while not HasModelLoaded(modelHash) do + Citizen.Wait(4) + end + end + + if cb ~= nil then + cb() + end +end + +function ESX.Streaming.RequestStreamedTextureDict(textureDict, cb) + if not HasStreamedTextureDictLoaded(textureDict) then + RequestStreamedTextureDict(textureDict) + + while not HasStreamedTextureDictLoaded(textureDict) do + Citizen.Wait(4) + end + end + + if cb ~= nil then + cb() + end +end + +function ESX.Streaming.RequestNamedPtfxAsset(assetName, cb) + if not HasNamedPtfxAssetLoaded(assetName) then + RequestNamedPtfxAsset(assetName) + + while not HasNamedPtfxAssetLoaded(assetName) do + Citizen.Wait(4) + end + end + + if cb ~= nil then + cb() + end +end + +function ESX.Streaming.RequestAnimSet(animSet, cb) + if not HasAnimSetLoaded(animSet) then + RequestAnimSet(animSet) + + while not HasAnimSetLoaded(animSet) do + Citizen.Wait(4) + end + end + + if cb ~= nil then + cb() + end +end + +function ESX.Streaming.RequestAnimDict(animDict, cb) + if not HasAnimDictLoaded(animDict) then + RequestAnimDict(animDict) + + while not HasAnimDictLoaded(animDict) do + Citizen.Wait(4) + end + end + + if cb ~= nil then + cb() + end +end + +function ESX.Streaming.RequestWeaponAsset(weaponHash, cb) + if not HasWeaponAssetLoaded(weaponHash) then + RequestWeaponAsset(weaponHash) + + while not HasWeaponAssetLoaded(weaponHash) do + Citizen.Wait(4) + end + end + + if cb ~= nil then + cb() + end +end diff --git a/[esx]/es_extended/client/wrapper.lua b/[esx]/es_extended/client/wrapper.lua new file mode 100644 index 00000000..441312d8 --- /dev/null +++ b/[esx]/es_extended/client/wrapper.lua @@ -0,0 +1,14 @@ +local Chunks = {} + +RegisterNUICallback('__chunk', function(data, cb) + Chunks[data.id] = Chunks[data.id] or '' + Chunks[data.id] = Chunks[data.id] .. data.chunk + + if data['end'] then + local msg = json.decode(Chunks[data.id]) + TriggerEvent(GetCurrentResourceName() .. ':message:' .. data.__type, msg) + Chunks[data.id] = nil + end + + cb('') +end) diff --git a/[esx]/es_extended/common/functions.lua b/[esx]/es_extended/common/functions.lua new file mode 100644 index 00000000..e47b5b7f --- /dev/null +++ b/[esx]/es_extended/common/functions.lua @@ -0,0 +1,100 @@ +local Charset = {} + +for i = 48, 57 do table.insert(Charset, string.char(i)) end +for i = 65, 90 do table.insert(Charset, string.char(i)) end +for i = 97, 122 do table.insert(Charset, string.char(i)) end + +ESX.GetRandomString = function(length) + math.randomseed(GetGameTimer()) + + if length > 0 then + return ESX.GetRandomString(length - 1) .. Charset[math.random(1, #Charset)] + else + return '' + end +end + +ESX.GetConfig = function() + return Config +end + +ESX.GetWeapon = function(weaponName) + weaponName = string.upper(weaponName) + + for k,v in ipairs(Config.Weapons) do + if v.name == weaponName then + return k, v + end + end +end + +ESX.GetWeaponFromHash = function(weaponHash) + for k,v in ipairs(Config.Weapons) do + if GetHashKey(v.name) == weaponHash then + return v + end + end +end + +ESX.GetWeaponList = function() + return Config.Weapons +end + +ESX.GetWeaponLabel = function(weaponName) + weaponName = string.upper(weaponName) + + for k,v in ipairs(Config.Weapons) do + if v.name == weaponName then + return v.label + end + end +end + +ESX.GetWeaponComponent = function(weaponName, weaponComponent) + weaponName = string.upper(weaponName) + local weapons = Config.Weapons + + for k,v in ipairs(Config.Weapons) do + if v.name == weaponName then + for k2,v2 in ipairs(v.components) do + if v2.name == weaponComponent then + return v2 + end + end + end + end +end + +ESX.DumpTable = function(table, nb) + if nb == nil then + nb = 0 + end + + if type(table) == 'table' then + local s = '' + for i = 1, nb + 1, 1 do + s = s .. " " + end + + s = '{\n' + for k,v in pairs(table) do + if type(k) ~= 'number' then k = '"'..k..'"' end + for i = 1, nb, 1 do + s = s .. " " + end + s = s .. '['..k..'] = ' .. ESX.DumpTable(v, nb + 1) .. ',\n' + end + + for i = 1, nb, 1 do + s = s .. " " + end + + return s .. '}' + else + return tostring(table) + end +end + +ESX.Round = function(value, numDecimalPlaces) + return ESX.Math.Round(value, numDecimalPlaces) +end diff --git a/[esx]/es_extended/common/modules/math.lua b/[esx]/es_extended/common/modules/math.lua new file mode 100644 index 00000000..947ccd78 --- /dev/null +++ b/[esx]/es_extended/common/modules/math.lua @@ -0,0 +1,25 @@ +ESX.Math = {} + +ESX.Math.Round = function(value, numDecimalPlaces) + if numDecimalPlaces then + local power = 10^numDecimalPlaces + return math.floor((value * power) + 0.5) / (power) + else + return math.floor(value + 0.5) + end +end + +-- credit http://richard.warburton.it +ESX.Math.GroupDigits = function(value) + local left,num,right = string.match(value,'^([^%d]*%d)(%d*)(.-)$') + + return left..(num:reverse():gsub('(%d%d%d)','%1' .. _U('locale_digit_grouping_symbol')):reverse())..right +end + +ESX.Math.Trim = function(value) + if value then + return (string.gsub(value, "^%s*(.-)%s*$", "%1")) + else + return nil + end +end \ No newline at end of file diff --git a/[esx]/es_extended/common/modules/table.lua b/[esx]/es_extended/common/modules/table.lua new file mode 100644 index 00000000..3741e01e --- /dev/null +++ b/[esx]/es_extended/common/modules/table.lua @@ -0,0 +1,165 @@ +ESX.Table = {} + +-- nil proof alternative to #table +function ESX.Table.SizeOf(t) + local count = 0 + + for _,_ in pairs(t) do + count = count + 1 + end + + return count +end + +function ESX.Table.Set(t) + local set = {} + for k,v in ipairs(t) do set[v] = true end + return set +end + +function ESX.Table.IndexOf(t, value) + for i=1, #t, 1 do + if t[i] == value then + return i + end + end + + return -1 +end + +function ESX.Table.LastIndexOf(t, value) + for i=#t, 1, -1 do + if t[i] == value then + return i + end + end + + return -1 +end + +function ESX.Table.Find(t, cb) + for i=1, #t, 1 do + if cb(t[i]) then + return t[i] + end + end + + return nil +end + +function ESX.Table.FindIndex(t, cb) + for i=1, #t, 1 do + if cb(t[i]) then + return i + end + end + + return -1 +end + +function ESX.Table.Filter(t, cb) + local newTable = {} + + for i=1, #t, 1 do + if cb(t[i]) then + table.insert(newTable, t[i]) + end + end + + return newTable +end + +function ESX.Table.Map(t, cb) + local newTable = {} + + for i=1, #t, 1 do + newTable[i] = cb(t[i], i) + end + + return newTable +end + +function ESX.Table.Reverse(t) + local newTable = {} + + for i=#t, 1, -1 do + table.insert(newTable, t[i]) + end + + return newTable +end + +function ESX.Table.Clone(t) + if type(t) ~= 'table' then return t end + + local meta = getmetatable(t) + local target = {} + + for k,v in pairs(t) do + if type(v) == 'table' then + target[k] = ESX.Table.Clone(v) + else + target[k] = v + end + end + + setmetatable(target, meta) + + return target +end + +function ESX.Table.Concat(t1, t2) + local t3 = ESX.Table.Clone(t1) + + for i=1, #t2, 1 do + table.insert(t3, t2[i]) + end + + return t3 +end + +function ESX.Table.Join(t, sep) + local sep = sep or ',' + local str = '' + + for i=1, #t, 1 do + if i > 1 then + str = str .. sep + end + + str = str .. t[i] + end + + return str +end + +-- Credit: https://stackoverflow.com/a/15706820 +-- Description: sort function for pairs +function ESX.Table.Sort(t, order) + -- collect the keys + local keys = {} + + for k,_ in pairs(t) do + keys[#keys + 1] = k + end + + -- if order function given, sort by it by passing the table and keys a, b, + -- otherwise just sort the keys + if order then + table.sort(keys, function(a,b) + return order(t, a, b) + end) + else + table.sort(keys) + end + + -- return the iterator function + local i = 0 + + return function() + i = i + 1 + if keys[i] then + return keys[i], t[keys[i]] + end + end +end \ No newline at end of file diff --git a/[esx]/es_extended/config.lua b/[esx]/es_extended/config.lua new file mode 100644 index 00000000..6d9f4203 --- /dev/null +++ b/[esx]/es_extended/config.lua @@ -0,0 +1,22 @@ +Config = {} +Config.Locale = 'en' + +Config.Accounts = { + bank = _U('account_bank'), + black_money = _U('account_black_money'), + money = _U('account_money') +} + +Config.StartingAccountMoney = {bank = 50000} + +Config.EnableSocietyPayouts = false -- pay from the society account that the player is employed at? Requirement: esx_society +Config.EnableHud = true -- enable the default hud? Display current job and accounts (black, bank & cash) +Config.MaxWeight = 24 -- the max inventory weight without backpack +Config.PaycheckInterval = 7 * 60000 -- how often to recieve pay checks in milliseconds +Config.EnableDebug = false -- Use Debug options? +Config.EnableDefaultInventory = true -- Display the default Inventory ( F2 ) +Config.EnableWantedLevel = false -- Use Normal GTA wanted Level? +Config.EnablePVP = true -- Allow Player to player combat + +Config.Multichar = false -- Enable support for esx_multicharacter +Config.Identity = true -- Select a characters identity data before they have loaded in (this happens by default with multichar) diff --git a/[esx]/es_extended/config.weapons.lua b/[esx]/es_extended/config.weapons.lua new file mode 100644 index 00000000..7f555e80 --- /dev/null +++ b/[esx]/es_extended/config.weapons.lua @@ -0,0 +1,965 @@ +Config.DefaultWeaponTints = { + [0] = _U('tint_default'), + [1] = _U('tint_green'), + [2] = _U('tint_gold'), + [3] = _U('tint_pink'), + [4] = _U('tint_army'), + [5] = _U('tint_lspd'), + [6] = _U('tint_orange'), + [7] = _U('tint_platinum') +} + +Config.Weapons = { + -- Melee + {name = 'WEAPON_DAGGER', label = _U('weapon_dagger'), components = {}}, + {name = 'WEAPON_BAT', label = _U('weapon_bat'), components = {}}, + {name = 'WEAPON_BATTLEAXE', label = _U('weapon_battleaxe'), components = {}}, + { + name = 'WEAPON_KNUCKLE', + label = _U('weapon_knuckle'), + components = { + {name = 'knuckle_base', label = _U('component_knuckle_base'), hash = `COMPONENT_KNUCKLE_VARMOD_BASE`}, + {name = 'knuckle_pimp', label = _U('component_knuckle_pimp'), hash = `COMPONENT_KNUCKLE_VARMOD_PIMP`}, + {name = 'knuckle_ballas', label = _U('component_knuckle_ballas'), hash = `COMPONENT_KNUCKLE_VARMOD_BALLAS`}, + {name = 'knuckle_dollar', label = _U('component_knuckle_dollar'), hash = `COMPONENT_KNUCKLE_VARMOD_DOLLAR`}, + {name = 'knuckle_diamond', label = _U('component_knuckle_diamond'), hash = `COMPONENT_KNUCKLE_VARMOD_DIAMOND`}, + {name = 'knuckle_hate', label = _U('component_knuckle_hate'), hash = `COMPONENT_KNUCKLE_VARMOD_HATE`}, + {name = 'knuckle_love', label = _U('component_knuckle_love'), hash = `COMPONENT_KNUCKLE_VARMOD_LOVE`}, + {name = 'knuckle_player', label = _U('component_knuckle_player'), hash = `COMPONENT_KNUCKLE_VARMOD_PLAYER`}, + {name = 'knuckle_king', label = _U('component_knuckle_king'), hash = `COMPONENT_KNUCKLE_VARMOD_KING`}, + {name = 'knuckle_vagos', label = _U('component_knuckle_vagos'), hash = `COMPONENT_KNUCKLE_VARMOD_VAGOS`} + } + }, + {name = 'WEAPON_BOTTLE', label = _U('weapon_bottle'), components = {}}, + {name = 'WEAPON_CROWBAR', label = _U('weapon_crowbar'), components = {}}, + {name = 'WEAPON_FLASHLIGHT', label = _U('weapon_flashlight'), components = {}}, + {name = 'WEAPON_GOLFCLUB', label = _U('weapon_golfclub'), components = {}}, + {name = 'WEAPON_HAMMER', label = _U('weapon_hammer'), components = {}}, + {name = 'WEAPON_HATCHET', label = _U('weapon_hatchet'), components = {}}, + {name = 'WEAPON_KNIFE', label = _U('weapon_knife'), components = {}}, + {name = 'WEAPON_MACHETE', label = _U('weapon_machete'), components = {}}, + {name = 'WEAPON_NIGHTSTICK', label = _U('weapon_nightstick'), components = {}}, + {name = 'WEAPON_WRENCH', label = _U('weapon_wrench'), components = {}}, + {name = 'WEAPON_POOLCUE', label = _U('weapon_poolcue'), components = {}}, + {name = 'WEAPON_STONE_HATCHET', label = _U('weapon_stone_hatchet'), components = {}}, + { + name = 'WEAPON_SWITCHBLADE', + label = _U('weapon_switchblade'), + components = { + {name = 'handle_default', label = _U('component_handle_default'), hash = `COMPONENT_SWITCHBLADE_VARMOD_BASE`}, + {name = 'handle_vip', label = _U('component_handle_vip'), hash = `COMPONENT_SWITCHBLADE_VARMOD_VAR1`}, + {name = 'handle_bodyguard', label = _U('component_handle_bodyguard'), hash = `COMPONENT_SWITCHBLADE_VARMOD_VAR2`} + } + }, + -- Handguns + { + name = 'WEAPON_APPISTOL', + label = _U('weapon_appistol'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_PISTOL`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_APPISTOL_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_APPISTOL_CLIP_02`}, + {name = 'flashlight', label = _U('component_flashlight'), hash = `COMPONENT_AT_PI_FLSH`}, + {name = 'suppressor', label = _U('component_suppressor'), hash = `COMPONENT_AT_PI_SUPP`}, + {name = 'luxary_finish', label = _U('component_luxary_finish'), hash = `COMPONENT_APPISTOL_VARMOD_LUXE`} + } + }, + {name = 'WEAPON_CERAMICPISTOL', label = _U('weapon_ceramicpistol'), tints = Config.DefaultWeaponTints, components = {}, ammo = {label = _U('ammo_rounds'), hash = `AMMO_PISTOL`}}, + { + name = 'WEAPON_COMBATPISTOL', + label = _U('weapon_combatpistol'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_PISTOL`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_COMBATPISTOL_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_COMBATPISTOL_CLIP_02`}, + {name = 'flashlight', label = _U('component_flashlight'), hash = `COMPONENT_AT_PI_FLSH`}, + {name = 'suppressor', label = _U('component_suppressor'), hash = `COMPONENT_AT_PI_SUPP`}, + {name = 'luxary_finish', label = _U('component_luxary_finish'), hash = `COMPONENT_COMBATPISTOL_VARMOD_LOWRIDER`} + } + }, + {name = 'WEAPON_DOUBLEACTION', label = _U('weapon_doubleaction'), tints = Config.DefaultWeaponTints, components = {}, ammo = {label = _U('ammo_rounds'), hash = `AMMO_PISTOL`}}, + {name = 'WEAPON_NAVYREVOLVER', label = _U('weapon_navyrevolver'), tints = Config.DefaultWeaponTints, components = {}, ammo = {label = _U('ammo_rounds'), hash = `AMMO_PISTOL`}}, + {name = 'WEAPON_FLAREGUN', label = _U('weapon_flaregun'), tints = Config.DefaultWeaponTints, components = {}, ammo = {label = _U('ammo_flaregun'), hash = `AMMO_FLAREGUN`}}, + {name = 'WEAPON_GADGETPISTOL', label = _U('weapon_gadgetpistol'), tints = Config.DefaultWeaponTints, components = {}, ammo = {label = _U('ammo_rounds'), hash = `AMMO_PISTOL`}}, + { + name = 'WEAPON_HEAVYPISTOL', + label = _U('weapon_heavypistol'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_PISTOL`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_HEAVYPISTOL_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_HEAVYPISTOL_CLIP_02`}, + {name = 'flashlight', label = _U('component_flashlight'), hash = `COMPONENT_AT_PI_FLSH`}, + {name = 'suppressor', label = _U('component_suppressor'), hash = `COMPONENT_AT_PI_SUPP`}, + {name = 'luxary_finish', label = _U('component_luxary_finish'), hash = `COMPONENT_HEAVYPISTOL_VARMOD_LUXE`} + } + }, + { + name = 'WEAPON_REVOLVER', + label = _U('weapon_revolver'), + ammo = {label = _U('ammo_rounds'),hash = `AMMO_PISTOL`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_REVOLVER_CLIP_01`}, + {name = 'vip_finish', label = _U('component_vip_finish'), hash = `COMPONENT_REVOLVER_VARMOD_BOSS`}, + {name = 'bodyguard_finish', label = _U('component_bodyguard_finish'), hash = `COMPONENT_REVOLVER_VARMOD_GOON`} + } + }, + { + name = 'WEAPON_REVOLVER_MK2', + label = _U('weapon_revolver_mk2'), + ammo = {label = _U('ammo_rounds'),hash = `AMMO_PISTOL`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_REVOLVER_MK2_CLIP_01`}, + {name = 'ammo_tracer', label = _U('component_ammo_tracer'), hash = `COMPONENT_REVOLVER_MK2_CLIP_TRACER`}, + {name = 'ammo_incendiary', label = _U('component_ammo_incendiary'), hash = `COMPONENT_REVOLVER_MK2_CLIP_INCENDIARY`}, + {name = 'ammo_hollowpoint', label = _U('component_ammo_hollowpoint'), hash = `COMPONENT_REVOLVER_MK2_CLIP_HOLLOWPOINT`}, + {name = 'ammo_fmj', label = _U('component_ammo_fmj'), hash = `COMPONENT_REVOLVER_MK2_CLIP_FMJ`}, + {name = 'scope_holo', label = _U('component_scope_holo'), hash = `COMPONENT_AT_SIGHTS`}, + {name = 'scope_small', label = _U('component_ammo_fmj'), hash = `COMPONENT_AT_SCOPE_MACRO_MK2`}, + {name = 'flashlight', label = _U('component_flashlight'), hash = `COMPONENT_AT_PI_FLSH`}, + {name = 'compensator', label = _U('component_compensator'), hash = `COMPONENT_AT_PI_COMP_03`}, + {name = 'camo_finish', label = _U('component_camo_finish'), hash = `COMPONENT_REVOLVER_MK2_CAMO`}, + {name = 'camo_finish2', label = _U('component_camo_finish2'), hash = `COMPONENT_REVOLVER_MK2_CAMO_02`}, + {name = 'camo_finish3', label = _U('component_camo_finish3'), hash = `COMPONENT_REVOLVER_MK2_CAMO_03`}, + {name = 'camo_finish4', label = _U('component_camo_finish4'), hash = `COMPONENT_REVOLVER_MK2_CAMO_04`}, + {name = 'camo_finish5', label = _U('component_camo_finish5'), hash = `COMPONENT_REVOLVER_MK2_CAMO_05`}, + {name = 'camo_finish6', label = _U('component_camo_finish6'), hash = `COMPONENT_REVOLVER_MK2_CAMO_06`}, + {name = 'camo_finish7', label = _U('component_camo_finish7'), hash = `COMPONENT_REVOLVER_MK2_CAMO_07`}, + {name = 'camo_finish8', label = _U('component_camo_finish8'), hash = `COMPONENT_REVOLVER_MK2_CAMO_08`}, + {name = 'camo_finish9', label = _U('component_camo_finish9'), hash = `COMPONENT_REVOLVER_MK2_CAMO_09`}, + {name = 'camo_finish10', label = _U('component_camo_finish10'), hash = `COMPONENT_REVOLVER_MK2_CAMO_10`}, + {name = 'camo_finish11', label = _U('component_camo_finish11'), hash = `COMPONENT_REVOLVER_MK2_CAMO_IND_01`} + } + }, + {name = 'WEAPON_MARKSMANPISTOL', label = _U('weapon_marksmanpistol'), tints = Config.DefaultWeaponTints, components = {}, ammo = {label = _U('ammo_rounds'), hash = `AMMO_PISTOL`}}, + { + name = 'WEAPON_PISTOL', + label = _U('weapon_pistol'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_PISTOL`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_PISTOL_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_PISTOL_CLIP_02`}, + {name = 'flashlight', label = _U('component_flashlight'), hash = `COMPONENT_AT_PI_FLSH`}, + {name = 'suppressor', label = _U('component_suppressor'), hash = `COMPONENT_AT_PI_SUPP_02`}, + {name = 'luxary_finish', label = _U('component_luxary_finish'), hash = `COMPONENT_PISTOL_VARMOD_LUXE`} + } + }, + { + name = 'WEAPON_PISTOL_MK2', + label = _U('weapon_pistol_mk2'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_PISTOL`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_PISTOL_MK2_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_PISTOL_MK2_CLIP_02`}, + {name = 'ammo_tracer', label = _U('component_ammo_tracer'), hash = `COMPONENT_PISTOL_MK2_CLIP_TRACER`}, + {name = 'ammo_incendiary', label = _U('component_ammo_incendiary'), hash = `COMPONENT_PISTOL_MK2_CLIP_INCENDIARY`}, + {name = 'ammo_hollowpoint', label = _U('component_ammo_hollowpoint'), hash = `COMPONENT_PISTOL_MK2_CLIP_HOLLOWPOINT`}, + {name = 'ammo_fmj', label = _U('component_ammo_fmj'), hash = `COMPONENT_PISTOL_MK2_CLIP_FMJ`}, + {name = 'scope', label = _U('component_scope'), hash = `COMPONENT_AT_PI_RAIL`}, + {name = 'flashlight', label = _U('component_flashlight'), hash = `COMPONENT_AT_PI_FLSH_02`}, + {name = 'suppressor', label = _U('component_suppressor'), hash = `COMPONENT_AT_PI_SUPP_02`}, + {name = 'compensator', label = _U('component_suppressor'), hash = `COMPONENT_AT_PI_COMP`}, + {name = 'camo_finish', label = _U('component_camo_finish'), hash = `COMPONENT_PISTOL_MK2_CAMO`}, + {name = 'camo_finish2', label = _U('component_camo_finish2'), hash = `COMPONENT_PISTOL_MK2_CAMO_02`}, + {name = 'camo_finish3', label = _U('component_camo_finish3'), hash = `COMPONENT_PISTOL_MK2_CAMO_03`}, + {name = 'camo_finish4', label = _U('component_camo_finish4'), hash = `COMPONENT_PISTOL_MK2_CAMO_04`}, + {name = 'camo_finish5', label = _U('component_camo_finish5'), hash = `COMPONENT_PISTOL_MK2_CAMO_05`}, + {name = 'camo_finish6', label = _U('component_camo_finish6'), hash = `COMPONENT_PISTOL_MK2_CAMO_06`}, + {name = 'camo_finish7', label = _U('component_camo_finish7'), hash = `COMPONENT_PISTOL_MK2_CAMO_07`}, + {name = 'camo_finish8', label = _U('component_camo_finish8'), hash = `COMPONENT_PISTOL_MK2_CAMO_08`}, + {name = 'camo_finish9', label = _U('component_camo_finish9'), hash = `COMPONENT_PISTOL_MK2_CAMO_09`}, + {name = 'camo_finish10', label = _U('component_camo_finish10'), hash = `COMPONENT_PISTOL_MK2_CAMO_10`}, + {name = 'camo_finish11', label = _U('component_camo_finish11'), hash = `COMPONENT_PISTOL_MK2_CAMO_IND_01`}, + {name = 'camo_slide_finish', label = _U('component_camo_slide_finish'), hash = `COMPONENT_PISTOL_MK2_CAMO_SLIDE`}, + {name = 'camo_slide_finish2', label = _U('component_camo_slide_finish2'), hash = `COMPONENT_PISTOL_MK2_CAMO_02_SLIDE`}, + {name = 'camo_slide_finish3', label = _U('component_camo_slide_finish3'), hash = `COMPONENT_PISTOL_MK2_CAMO_03_SLIDE`}, + {name = 'camo_slide_finish4', label = _U('component_camo_slide_finish4'), hash = `COMPONENT_PISTOL_MK2_CAMO_04_SLIDE`}, + {name = 'camo_slide_finish5', label = _U('component_camo_slide_finish5'), hash = `COMPONENT_PISTOL_MK2_CAMO_05_SLIDE`}, + {name = 'camo_slide_finish6', label = _U('component_camo_slide_finish6'), hash = `COMPONENT_PISTOL_MK2_CAMO_06_SLIDE`}, + {name = 'camo_slide_finish7', label = _U('component_camo_slide_finish7'), hash = `COMPONENT_PISTOL_MK2_CAMO_07_SLIDE`}, + {name = 'camo_slide_finish8', label = _U('component_camo_slide_finish8'), hash = `COMPONENT_PISTOL_MK2_CAMO_08_SLIDE`}, + {name = 'camo_slide_finish9', label = _U('component_camo_slide_finish9'), hash = `COMPONENT_PISTOL_MK2_CAMO_09_SLIDE`}, + {name = 'camo_slide_finish10', label = _U('component_camo_slide_finish10'), hash = `COMPONENT_PISTOL_MK2_CAMO_10_SLIDE`}, + {name = 'camo_slide_finish11', label = _U('component_camo_slide_finish11'), hash = `COMPONENT_PISTOL_MK2_CAMO_IND_01_SLIDE`} + } + }, + { + name = 'WEAPON_PISTOL50', + label = _U('weapon_pistol50'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_PISTOL`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_PISTOL50_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_PISTOL50_CLIP_02`}, + {name = 'flashlight', label = _U('component_flashlight'), hash = `COMPONENT_AT_PI_FLSH`}, + {name = 'suppressor', label = _U('component_suppressor'), hash = `COMPONENT_AT_AR_SUPP_02`}, + {name = 'luxary_finish', label = _U('component_luxary_finish'), hash = `COMPONENT_PISTOL50_VARMOD_LUXE`} + } + }, + { + name = 'WEAPON_SNSPISTOL', + label = _U('weapon_snspistol'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_PISTOL`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_SNSPISTOL_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_SNSPISTOL_CLIP_02`}, + {name = 'luxary_finish', label = _U('component_luxary_finish'), hash = `COMPONENT_SNSPISTOL_VARMOD_LOWRIDER`} + } + }, + { + name = 'WEAPON_SNSPISTOL_MK2', + label = _U('weapon_snspistol_mk2'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_PISTOL`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_SNSPISTOL_MK2_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_SNSPISTOL_MK2_CLIP_02`}, + {name = 'ammo_tracer', label = _U('component_ammo_tracer'), hash = `COMPONENT_SNSPISTOL_MK2_CLIP_TRACER`}, + {name = 'ammo_incendiary', label = _U('component_ammo_incendiary'), hash = `COMPONENT_SNSPISTOL_MK2_CLIP_INCENDIARY`}, + {name = 'ammo_hollowpoint', label = _U('component_ammo_hollowpoint'), hash = `COMPONENT_SNSPISTOL_MK2_CLIP_HOLLOWPOINT`}, + {name = 'ammo_fmj', label = _U('component_ammo_fmj'), hash = `COMPONENT_SNSPISTOL_MK2_CLIP_FMJ`}, + {name = 'scope', label = _U('component_scope'), hash = `COMPONENT_AT_PI_RAIL_02`}, + {name = 'flashlight', label = _U('component_flashlight'), hash = `COMPONENT_AT_PI_FLSH_03`}, + {name = 'suppressor', label = _U('component_suppressor'), hash = `COMPONENT_AT_PI_SUPP_02`}, + {name = 'compensator', label = _U('component_suppressor'), hash = `COMPONENT_AT_PI_COMP_02`}, + {name = 'camo_finish', label = _U('component_camo_finish'), hash = `COMPONENT_SNSPISTOL_MK2_CAMO`}, + {name = 'camo_finish2', label = _U('component_camo_finish2'), hash = `COMPONENT_SNSPISTOL_MK2_CAMO_02`}, + {name = 'camo_finish3', label = _U('component_camo_finish3'), hash = `COMPONENT_SNSPISTOL_MK2_CAMO_03`}, + {name = 'camo_finish4', label = _U('component_camo_finish4'), hash = `COMPONENT_SNSPISTOL_MK2_CAMO_04`}, + {name = 'camo_finish5', label = _U('component_camo_finish5'), hash = `COMPONENT_SNSPISTOL_MK2_CAMO_05`}, + {name = 'camo_finish6', label = _U('component_camo_finish6'), hash = `COMPONENT_SNSPISTOL_MK2_CAMO_06`}, + {name = 'camo_finish7', label = _U('component_camo_finish7'), hash = `COMPONENT_SNSPISTOL_MK2_CAMO_07`}, + {name = 'camo_finish8', label = _U('component_camo_finish8'), hash = `COMPONENT_SNSPISTOL_MK2_CAMO_08`}, + {name = 'camo_finish9', label = _U('component_camo_finish9'), hash = `COMPONENT_SNSPISTOL_MK2_CAMO_09`}, + {name = 'camo_finish10', label = _U('component_camo_finish10'), hash = `COMPONENT_SNSPISTOL_MK2_CAMO_10`}, + {name = 'camo_finish11', label = _U('component_camo_finish11'), hash = `COMPONENT_SNSPISTOL_MK2_CAMO_IND_01`}, + {name = 'camo_slide_finish', label = _U('component_camo_slide_finish'), hash = `COMPONENT_SNSPISTOL_MK2_CAMO_SLIDE`}, + {name = 'camo_slide_finish2', label = _U('component_camo_slide_finish2'), hash = `COMPONENT_SNSPISTOL_MK2_CAMO_02_SLIDE`}, + {name = 'camo_slide_finish3', label = _U('component_camo_slide_finish3'), hash = `COMPONENT_SNSPISTOL_MK2_CAMO_03_SLIDE`}, + {name = 'camo_slide_finish4', label = _U('component_camo_slide_finish4'), hash = `COMPONENT_SNSPISTOL_MK2_CAMO_04_SLIDE`}, + {name = 'camo_slide_finish5', label = _U('component_camo_slide_finish5'), hash = `COMPONENT_SNSPISTOL_MK2_CAMO_05_SLIDE`}, + {name = 'camo_slide_finish6', label = _U('component_camo_slide_finish6'), hash = `COMPONENT_SNSPISTOL_MK2_CAMO_06_SLIDE`}, + {name = 'camo_slide_finish7', label = _U('component_camo_slide_finish7'), hash = `COMPONENT_SNSPISTOL_MK2_CAMO_07_SLIDE`}, + {name = 'camo_slide_finish8', label = _U('component_camo_slide_finish8'), hash = `COMPONENT_SNSPISTOL_MK2_CAMO_08_SLIDE`}, + {name = 'camo_slide_finish9', label = _U('component_camo_slide_finish9'), hash = `COMPONENT_SNSPISTOL_MK2_CAMO_09_SLIDE`}, + {name = 'camo_slide_finish10', label = _U('component_camo_slide_finish10'), hash = `COMPONENT_SNSPISTOL_MK2_CAMO_10_SLIDE`}, + {name = 'camo_slide_finish11', label = _U('component_camo_slide_finish11'), hash = `COMPONENT_SNSPISTOL_MK2_CAMO_IND_01_SLIDE`} + } + }, + {name = 'WEAPON_STUNGUN', label = _U('weapon_stungun'), tints = Config.DefaultWeaponTints, components = {}}, + {name = 'WEAPON_RAYPISTOL', label = _U('weapon_raypistol'), tints = Config.DefaultWeaponTints, components = {}}, + { + name = 'WEAPON_VINTAGEPISTOL', + label = _U('weapon_vintagepistol'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_PISTOL`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_VINTAGEPISTOL_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_VINTAGEPISTOL_CLIP_02`}, + {name = 'suppressor', label = _U('component_suppressor'), hash = `COMPONENT_AT_PI_SUPP`} + } + }, + -- Shotguns + { + name = 'WEAPON_ASSAULTSHOTGUN', + label = _U('weapon_assaultshotgun'), + ammo = {label = _U('ammo_shells'), hash = `AMMO_SHOTGUN`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_ASSAULTSHOTGUN_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_ASSAULTSHOTGUN_CLIP_02`}, + {name = 'flashlight', label = _U('component_flashlight'), hash = `COMPONENT_AT_AR_FLSH`}, + {name = 'suppressor', label = _U('component_suppressor'), hash = `COMPONENT_AT_AR_SUPP`}, + {name = 'grip', label = _U('component_grip'), hash = `COMPONENT_AT_AR_AFGRIP`} + } + }, + {name = 'WEAPON_AUTOSHOTGUN', label = _U('weapon_autoshotgun'), tints = Config.DefaultWeaponTints, components = {}, ammo = {label = _U('ammo_shells'), hash = `AMMO_SHOTGUN`}}, + { + name = 'WEAPON_BULLPUPSHOTGUN', + label = _U('weapon_bullpupshotgun'), + ammo = {label = _U('ammo_shells'), hash = `AMMO_SHOTGUN`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'flashlight', label = _U('component_flashlight'), hash = `COMPONENT_AT_AR_FLSH`}, + {name = 'suppressor', label = _U('component_suppressor'), hash = `COMPONENT_AT_AR_SUPP_02`}, + {name = 'grip', label = _U('component_grip'), hash = `COMPONENT_AT_AR_AFGRIP`} + } + }, + { + name = 'WEAPON_COMBATSHOTGUN', + label = _U('weapon_combatshotgun'), + ammo = {label = _U('ammo_shells'), hash = `AMMO_SHOTGUN`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'flashlight', label = _U('component_flashlight'), hash = `COMPONENT_AT_AR_FLSH`}, + {name = 'suppressor', label = _U('component_suppressor'), hash = `COMPONENT_AT_AR_SUPP`} + } + }, + {name = 'WEAPON_DBSHOTGUN', label = _U('weapon_dbshotgun'), tints = Config.DefaultWeaponTints, components = {}, ammo = {label = _U('ammo_shells'), hash = `AMMO_SHOTGUN`}}, + { + name = 'WEAPON_HEAVYSHOTGUN', + label = _U('weapon_heavyshotgun'), + ammo = {label = _U('ammo_shells'), hash = `AMMO_SHOTGUN`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_HEAVYSHOTGUN_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_HEAVYSHOTGUN_CLIP_02`}, + {name = 'clip_drum', label = _U('component_clip_drum'), hash = `COMPONENT_HEAVYSHOTGUN_CLIP_03`}, + {name = 'flashlight', label = _U('component_flashlight'), hash = `COMPONENT_AT_AR_FLSH`}, + {name = 'suppressor', label = _U('component_suppressor'), hash = `COMPONENT_AT_AR_SUPP_02`}, + {name = 'grip', label = _U('component_grip'), hash = `COMPONENT_AT_AR_AFGRIP`} + } + }, + {name = 'WEAPON_MUSKET', label = _U('weapon_musket'), tints = Config.DefaultWeaponTints, components = {}, ammo = {label = _U('ammo_rounds'), hash = `AMMO_SHOTGUN`}}, + { + name = 'WEAPON_PUMPSHOTGUN', + label = _U('weapon_pumpshotgun'), + ammo = {label = _U('ammo_shells'), hash = `AMMO_SHOTGUN`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'flashlight', label = _U('component_flashlight'), hash = `COMPONENT_AT_AR_FLSH`}, + {name = 'suppressor', label = _U('component_suppressor'), hash = `COMPONENT_AT_SR_SUPP`}, + {name = 'luxary_finish', label = _U('component_luxary_finish'), hash = `COMPONENT_PUMPSHOTGUN_VARMOD_LOWRIDER`} + } + }, + { + name = 'WEAPON_PUMPSHOTGUN_MK2', + label = _U('weapon_pumpshotgun_mk2'), + ammo = {label = _U('ammo_shells'), hash = `AMMO_SHOTGUN`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'shells_default', label = _U('component_shells_default'), hash = `COMPONENT_PUMPSHOTGUN_MK2_CLIP_01`}, + {name = 'shells_incendiary', label = _U('component_shells_incendiary'), hash = `COMPONENT_PUMPSHOTGUN_MK2_CLIP_INCENDIARY`}, + {name = 'shells_armor', label = _U('component_shells_armor'), hash = `COMPONENT_PUMPSHOTGUN_MK2_CLIP_ARMORPIERCING`}, + {name = 'shells_hollowpoint', label = _U('component_shells_hollowpoint'), hash = `COMPONENT_PUMPSHOTGUN_MK2_CLIP_HOLLOWPOINT`}, + {name = 'shells_explosive', label = _U('component_shells_explosive'), hash = `COMPONENT_PUMPSHOTGUN_MK2_CLIP_EXPLOSIVE`}, + {name = 'scope_holo', label = _U('component_scope_holo'), hash = `COMPONENT_AT_SIGHTS`}, + {name = 'scope_small', label = _U('component_scope_small'), hash = `COMPONENT_AT_SCOPE_MACRO_MK2`}, + {name = 'scope_medium', label = _U('component_scope_medium'), hash = `COMPONENT_AT_SCOPE_SMALL_MK2`}, + {name = 'flashlight', label = _U('component_flashlight'), hash = `COMPONENT_AT_AR_FLSH`}, + {name = 'suppressor', label = _U('component_suppressor'), hash = `COMPONENT_AT_SR_SUPP_03`}, + {name = 'muzzle_squared', label = _U('component_muzzle_squared'), hash = `COMPONENT_AT_MUZZLE_08`}, + {name = 'camo_finish', label = _U('component_camo_finish'), hash = `COMPONENT_PUMPSHOTGUN_MK2_CAMO`}, + {name = 'camo_finish2', label = _U('component_camo_finish2'), hash = `COMPONENT_PUMPSHOTGUN_MK2_CAMO_02`}, + {name = 'camo_finish3', label = _U('component_camo_finish3'), hash = `COMPONENT_PUMPSHOTGUN_MK2_CAMO_03`}, + {name = 'camo_finish4', label = _U('component_camo_finish4'), hash = `COMPONENT_PUMPSHOTGUN_MK2_CAMO_04`}, + {name = 'camo_finish5', label = _U('component_camo_finish5'), hash = `COMPONENT_PUMPSHOTGUN_MK2_CAMO_05`}, + {name = 'camo_finish6', label = _U('component_camo_finish6'), hash = `COMPONENT_PUMPSHOTGUN_MK2_CAMO_06`}, + {name = 'camo_finish7', label = _U('component_camo_finish7'), hash = `COMPONENT_PUMPSHOTGUN_MK2_CAMO_07`}, + {name = 'camo_finish8', label = _U('component_camo_finish8'), hash = `COMPONENT_PUMPSHOTGUN_MK2_CAMO_08`}, + {name = 'camo_finish9', label = _U('component_camo_finish9'), hash = `COMPONENT_PUMPSHOTGUN_MK2_CAMO_09`}, + {name = 'camo_finish10', label = _U('component_camo_finish10'), hash = `COMPONENT_PUMPSHOTGUN_MK2_CAMO_10`}, + {name = 'camo_finish11', label = _U('component_camo_finish11'), hash = `COMPONENT_PUMPSHOTGUN_MK2_CAMO_IND_01`} + } + }, + { + name = 'WEAPON_SAWNOFFSHOTGUN', + label = _U('weapon_sawnoffshotgun'), + ammo = {label = _U('ammo_shells'), hash = `AMMO_SHOTGUN`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'luxary_finish', label = _U('component_luxary_finish'), hash = `COMPONENT_SAWNOFFSHOTGUN_VARMOD_LUXE`} + } + }, + -- SMG & LMG + { + name = 'WEAPON_ASSAULTSMG', + label = _U('weapon_assaultsmg'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_SMG`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_ASSAULTSMG_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_ASSAULTSMG_CLIP_02`}, + {name = 'flashlight', label = _U('component_flashlight'), hash = `COMPONENT_AT_AR_FLSH`}, + {name = 'scope', label = _U('component_scope'), hash = `COMPONENT_AT_SCOPE_MACRO`}, + {name = 'suppressor', label = _U('component_suppressor'), hash = `COMPONENT_AT_AR_SUPP_02`}, + {name = 'luxary_finish', label = _U('component_luxary_finish'), hash = `COMPONENT_ASSAULTSMG_VARMOD_LOWRIDER`} + } + }, + { + name = 'WEAPON_COMBATMG', + label = _U('weapon_combatmg'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_MG`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_COMBATMG_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_COMBATMG_CLIP_02`}, + {name = 'scope', label = _U('component_scope'), hash = `COMPONENT_AT_SCOPE_MEDIUM`}, + {name = 'grip', label = _U('component_grip'), hash = `COMPONENT_AT_AR_AFGRIP`}, + {name = 'luxary_finish', label = _U('component_luxary_finish'), hash = `COMPONENT_COMBATMG_VARMOD_LOWRIDER`} + } + }, + { + name = 'WEAPON_COMBATMG_MK2', + label = _U('weapon_combatmg_mk2'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_MG`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_COMBATMG_MK2_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_COMBATMG_MK2_CLIP_02`}, + {name = 'ammo_tracer', label = _U('component_ammo_tracer'), hash = `COMPONENT_COMBATMG_MK2_CLIP_TRACER`}, + {name = 'ammo_incendiary', label = _U('component_ammo_incendiary'), hash = `COMPONENT_COMBATMG_MK2_CLIP_INCENDIARY`}, + {name = 'ammo_hollowpoint', label = _U('component_ammo_hollowpoint'), hash = `COMPONENT_COMBATMG_MK2_CLIP_ARMORPIERCING`}, + {name = 'ammo_fmj', label = _U('component_ammo_fmj'), hash = `COMPONENT_COMBATMG_MK2_CLIP_FMJ`}, + {name = 'grip', label = _U('component_grip'), hash = `COMPONENT_AT_AR_AFGRIP_02`}, + {name = 'scope_holo', label = _U('component_scope_holo'), hash = `COMPONENT_AT_SIGHTS`}, + {name = 'scope_medium', label = _U('component_scope_medium'), hash = `COMPONENT_AT_SCOPE_SMALL_MK2`}, + {name = 'scope_large', label = _U('component_scope_large'), hash = `COMPONENT_AT_SCOPE_MEDIUM_MK2`}, + {name = 'muzzle_flat', label = _U('component_muzzle_flat'), hash = `COMPONENT_AT_MUZZLE_01`}, + {name = 'muzzle_tactical', label = _U('component_muzzle_tactical'), hash = `COMPONENT_AT_MUZZLE_02`}, + {name = 'muzzle_fat', label = _U('component_muzzle_fat'), hash = `COMPONENT_AT_MUZZLE_03`}, + {name = 'muzzle_precision', label = _U('component_muzzle_precision'), hash = `COMPONENT_AT_MUZZLE_04`}, + {name = 'muzzle_heavy', label = _U('component_muzzle_heavy'), hash = `COMPONENT_AT_MUZZLE_05`}, + {name = 'muzzle_slanted', label = _U('component_muzzle_slanted'), hash = `COMPONENT_AT_MUZZLE_06`}, + {name = 'muzzle_split', label = _U('component_muzzle_split'), hash = `COMPONENT_AT_MUZZLE_07`}, + {name = 'barrel_default', label = _U('component_barrel_default'), hash = `COMPONENT_AT_MG_BARREL_01`}, + {name = 'barrel_heavy', label = _U('component_barrel_heavy'), hash = `COMPONENT_AT_MG_BARREL_02`}, + {name = 'camo_finish', label = _U('component_camo_finish'), hash = `COMPONENT_COMBATMG_MK2_CAMO`}, + {name = 'camo_finish2', label = _U('component_camo_finish2'), hash = `COMPONENT_COMBATMG_MK2_CAMO_02`}, + {name = 'camo_finish3', label = _U('component_camo_finish3'), hash = `COMPONENT_COMBATMG_MK2_CAMO_03`}, + {name = 'camo_finish4', label = _U('component_camo_finish4'), hash = `COMPONENT_COMBATMG_MK2_CAMO_04`}, + {name = 'camo_finish5', label = _U('component_camo_finish5'), hash = `COMPONENT_COMBATMG_MK2_CAMO_05`}, + {name = 'camo_finish6', label = _U('component_camo_finish6'), hash = `COMPONENT_COMBATMG_MK2_CAMO_06`}, + {name = 'camo_finish7', label = _U('component_camo_finish7'), hash = `COMPONENT_COMBATMG_MK2_CAMO_07`}, + {name = 'camo_finish8', label = _U('component_camo_finish8'), hash = `COMPONENT_COMBATMG_MK2_CAMO_08`}, + {name = 'camo_finish9', label = _U('component_camo_finish9'), hash = `COMPONENT_COMBATMG_MK2_CAMO_09`}, + {name = 'camo_finish10', label = _U('component_camo_finish10'), hash = `COMPONENT_COMBATMG_MK2_CAMO_10`}, + {name = 'camo_finish11', label = _U('component_camo_finish11'), hash = `COMPONENT_COMBATMG_MK2_CAMO_IND_01`} + } + }, + { + name = 'WEAPON_COMBATPDW', + label = _U('weapon_combatpdw'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_SMG`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_COMBATPDW_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_COMBATPDW_CLIP_02`}, + {name = 'clip_drum', label = _U('component_clip_drum'), hash = `COMPONENT_COMBATPDW_CLIP_03`}, + {name = 'flashlight', label = _U('component_flashlight'), hash = `COMPONENT_AT_AR_FLSH`}, + {name = 'grip', label = _U('component_grip'), hash = `COMPONENT_AT_AR_AFGRIP`}, + {name = 'scope', label = _U('component_scope'), hash = `COMPONENT_AT_SCOPE_SMALL`} + } + }, + { + name = 'WEAPON_GUSENBERG', + label = _U('weapon_gusenberg'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_MG`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_GUSENBERG_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_GUSENBERG_CLIP_02`} + } + }, + { + name = 'WEAPON_MACHINEPISTOL', + label = _U('weapon_machinepistol'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_PISTOL`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_MACHINEPISTOL_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_MACHINEPISTOL_CLIP_02`}, + {name = 'clip_drum', label = _U('component_clip_drum'), hash = `COMPONENT_MACHINEPISTOL_CLIP_03`}, + {name = 'suppressor', label = _U('component_suppressor'), hash = `COMPONENT_AT_PI_SUPP`} + } + }, + { + name = 'WEAPON_MG', + label = _U('weapon_mg'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_MG`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_MG_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_MG_CLIP_02`}, + {name = 'scope', label = _U('component_scope'), hash = `COMPONENT_AT_SCOPE_SMALL_02`}, + {name = 'luxary_finish', label = _U('component_luxary_finish'), hash = `COMPONENT_MG_VARMOD_LOWRIDER`} + } + }, + { + name = 'WEAPON_MICROSMG', + label = _U('weapon_microsmg'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_SMG`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_MICROSMG_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_MICROSMG_CLIP_02`}, + {name = 'flashlight', label = _U('component_flashlight'), hash = `COMPONENT_AT_PI_FLSH`}, + {name = 'scope', label = _U('component_scope'), hash = `COMPONENT_AT_SCOPE_MACRO`}, + {name = 'suppressor', label = _U('component_suppressor'), hash = `COMPONENT_AT_AR_SUPP_02`}, + {name = 'luxary_finish', label = _U('component_luxary_finish'), hash = `COMPONENT_MICROSMG_VARMOD_LUXE`} + } + }, + { + name = 'WEAPON_MINISMG', + label = _U('weapon_minismg'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_SMG`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_MINISMG_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_MINISMG_CLIP_02`} + } + }, + { + name = 'WEAPON_SMG', + label = _U('weapon_smg'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_SMG`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_SMG_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_SMG_CLIP_02`}, + {name = 'clip_drum', label = _U('component_clip_drum'), hash = `COMPONENT_SMG_CLIP_03`}, + {name = 'flashlight', label = _U('component_flashlight'), hash = `COMPONENT_AT_AR_FLSH`}, + {name = 'scope', label = _U('component_scope'), hash = `COMPONENT_AT_SCOPE_MACRO_02`}, + {name = 'suppressor', label = _U('component_suppressor'), hash = `COMPONENT_AT_PI_SUPP`}, + {name = 'luxary_finish', label = _U('component_luxary_finish'), hash = `COMPONENT_SMG_VARMOD_LUXE`} + } + }, + { + name = 'WEAPON_SMG_MK2', + label = _U('weapon_smg_mk2'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_SMG`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_SMG_MK2_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_SMG_MK2_CLIP_02`}, + {name = 'ammo_tracer', label = _U('component_ammo_tracer'), hash = `COMPONENT_SMG_MK2_CLIP_TRACER`}, + {name = 'ammo_incendiary', label = _U('component_ammo_incendiary'), hash = `COMPONENT_SMG_MK2_CLIP_INCENDIARY`}, + {name = 'ammo_hollowpoint', label = _U('component_ammo_hollowpoint'), hash = `COMPONENT_SMG_MK2_CLIP_HOLLOWPOINT`}, + {name = 'ammo_fmj', label = _U('component_ammo_fmj'), hash = `COMPONENT_SMG_MK2_CLIP_FMJ`}, + {name = 'flashlight', label = _U('component_flashlight'), hash = `COMPONENT_AT_AR_FLSH`}, + {name = 'scope_holo', label = _U('component_scope_holo'), hash = `COMPONENT_AT_SIGHTS_SMG`}, + {name = 'scope_small', label = _U('component_scope_small'), hash = `COMPONENT_AT_SCOPE_MACRO_02_SMG_MK2`}, + {name = 'scope_medium', label = _U('component_scope_medium'), hash = `COMPONENT_AT_SCOPE_SMALL_SMG_MK2`}, + {name = 'suppressor', label = _U('component_suppressor'), hash = `COMPONENT_AT_PI_SUPP`}, + {name = 'muzzle_flat', label = _U('component_muzzle_flat'), hash = `COMPONENT_AT_MUZZLE_01`}, + {name = 'muzzle_tactical', label = _U('component_muzzle_tactical'), hash = `COMPONENT_AT_MUZZLE_02`}, + {name = 'muzzle_fat', label = _U('component_muzzle_fat'), hash = `COMPONENT_AT_MUZZLE_03`}, + {name = 'muzzle_precision', label = _U('component_muzzle_precision'), hash = `COMPONENT_AT_MUZZLE_04`}, + {name = 'muzzle_heavy', label = _U('component_muzzle_heavy'), hash = `COMPONENT_AT_MUZZLE_05`}, + {name = 'muzzle_slanted', label = _U('component_muzzle_slanted'), hash = `COMPONENT_AT_MUZZLE_06`}, + {name = 'muzzle_split', label = _U('component_muzzle_split'), hash = `COMPONENT_AT_MUZZLE_07`}, + {name = 'barrel_default', label = _U('component_barrel_default'), hash = `COMPONENT_AT_SB_BARREL_01`}, + {name = 'barrel_heavy', label = _U('component_barrel_heavy'), hash = `COMPONENT_AT_SB_BARREL_02`}, + {name = 'camo_finish', label = _U('component_camo_finish'), hash = `COMPONENT_SMG_MK2_CAMO`}, + {name = 'camo_finish2', label = _U('component_camo_finish2'), hash = `COMPONENT_SMG_MK2_CAMO_02`}, + {name = 'camo_finish3', label = _U('component_camo_finish3'), hash = `COMPONENT_SMG_MK2_CAMO_03`}, + {name = 'camo_finish4', label = _U('component_camo_finish4'), hash = `COMPONENT_SMG_MK2_CAMO_04`}, + {name = 'camo_finish5', label = _U('component_camo_finish5'), hash = `COMPONENT_SMG_MK2_CAMO_05`}, + {name = 'camo_finish6', label = _U('component_camo_finish6'), hash = `COMPONENT_SMG_MK2_CAMO_06`}, + {name = 'camo_finish7', label = _U('component_camo_finish7'), hash = `COMPONENT_SMG_MK2_CAMO_07`}, + {name = 'camo_finish8', label = _U('component_camo_finish8'), hash = `COMPONENT_SMG_MK2_CAMO_08`}, + {name = 'camo_finish9', label = _U('component_camo_finish9'), hash = `COMPONENT_SMG_MK2_CAMO_09`}, + {name = 'camo_finish10', label = _U('component_camo_finish10'), hash = `COMPONENT_SMG_MK2_CAMO_10`}, + {name = 'camo_finish11', label = _U('component_camo_finish11'), hash = `COMPONENT_SMG_MK2_CAMO_IND_01`} + } + }, + {name = 'WEAPON_RAYCARBINE', label = _U('weapon_raycarbine'), ammo = {label = _U('ammo_rounds'), hash = `AMMO_SMG`}, tints = Config.DefaultWeaponTints, components = {}}, + -- Rifles + { + name = 'WEAPON_ADVANCEDRIFLE', + label = _U('weapon_advancedrifle'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_RIFLE`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_ADVANCEDRIFLE_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_ADVANCEDRIFLE_CLIP_02`}, + {name = 'flashlight', label = _U('component_flashlight'), hash = `COMPONENT_AT_AR_FLSH`}, + {name = 'scope', label = _U('component_scope'), hash = `COMPONENT_AT_SCOPE_SMALL`}, + {name = 'suppressor', label = _U('component_suppressor'), hash = `COMPONENT_AT_AR_SUPP`}, + {name = 'luxary_finish', label = _U('component_luxary_finish'), hash = `COMPONENT_ADVANCEDRIFLE_VARMOD_LUXE`} + } + }, + { + name = 'WEAPON_ASSAULTRIFLE', + label = _U('weapon_assaultrifle'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_RIFLE`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_ASSAULTRIFLE_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_ASSAULTRIFLE_CLIP_02`}, + {name = 'clip_drum', label = _U('component_clip_drum'), hash = `COMPONENT_ASSAULTRIFLE_CLIP_03`}, + {name = 'flashlight', label = _U('component_flashlight'), hash = `COMPONENT_AT_AR_FLSH`}, + {name = 'scope', label = _U('component_scope'), hash = `COMPONENT_AT_SCOPE_MACRO`}, + {name = 'suppressor', label = _U('component_suppressor'), hash = `COMPONENT_AT_AR_SUPP_02`}, + {name = 'grip', label = _U('component_grip'), hash = `COMPONENT_AT_AR_AFGRIP`}, + {name = 'luxary_finish', label = _U('component_luxary_finish'), hash = `COMPONENT_ASSAULTRIFLE_VARMOD_LUXE`} + } + }, + { + name = 'WEAPON_ASSAULTRIFLE_MK2', + label = _U('weapon_assaultrifle_mk2'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_RIFLE`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_ASSAULTRIFLE_MK2_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_ASSAULTRIFLE_MK2_CLIP_02`}, + {name = 'ammo_tracer', label = _U('component_ammo_tracer'), hash = `COMPONENT_ASSAULTRIFLE_MK2_CLIP_TRACER`}, + {name = 'ammo_incendiary', label = _U('component_ammo_incendiary'), hash = `COMPONENT_ASSAULTRIFLE_MK2_CLIP_INCENDIARY`}, + {name = 'ammo_armor', label = _U('component_ammo_armor'), hash = `COMPONENT_ASSAULTRIFLE_MK2_CLIP_ARMORPIERCING`}, + {name = 'ammo_fmj', label = _U('component_ammo_fmj'), hash = `COMPONENT_ASSAULTRIFLE_MK2_CLIP_FMJ`}, + {name = 'grip', label = _U('component_grip'), hash = `COMPONENT_AT_AR_AFGRIP_02`}, + {name = 'flashlight', label = _U('component_flashlight'), hash = `COMPONENT_AT_AR_FLSH`}, + {name = 'scope_holo', label = _U('component_scope_holo'), hash = `COMPONENT_AT_SIGHTS`}, + {name = 'scope_small', label = _U('component_scope_small'), hash = `COMPONENT_AT_SCOPE_MACRO_MK2`}, + {name = 'scope_large', label = _U('component_scope_large'), hash = `COMPONENT_AT_SCOPE_MEDIUM_MK2`}, + {name = 'suppressor', label = _U('component_suppressor'), hash = `COMPONENT_AT_AR_SUPP_02`}, + {name = 'muzzle_flat', label = _U('component_muzzle_flat'), hash = `COMPONENT_AT_MUZZLE_01`}, + {name = 'muzzle_tactical', label = _U('component_muzzle_tactical'), hash = `COMPONENT_AT_MUZZLE_02`}, + {name = 'muzzle_fat', label = _U('component_muzzle_fat'), hash = `COMPONENT_AT_MUZZLE_03`}, + {name = 'muzzle_precision', label = _U('component_muzzle_precision'), hash = `COMPONENT_AT_MUZZLE_04`}, + {name = 'muzzle_heavy', label = _U('component_muzzle_heavy'), hash = `COMPONENT_AT_MUZZLE_05`}, + {name = 'muzzle_slanted', label = _U('component_muzzle_slanted'), hash = `COMPONENT_AT_MUZZLE_06`}, + {name = 'muzzle_split', label = _U('component_muzzle_split'), hash = `COMPONENT_AT_MUZZLE_07`}, + {name = 'barrel_default', label = _U('component_barrel_default'), hash = `COMPONENT_AT_AR_BARREL_01`}, + {name = 'barrel_heavy', label = _U('component_barrel_heavy'), hash = `COMPONENT_AT_AR_BARREL_02`}, + {name = 'camo_finish', label = _U('component_camo_finish'), hash = `COMPONENT_ASSAULTRIFLE_MK2_CAMO`}, + {name = 'camo_finish2', label = _U('component_camo_finish2'), hash = `COMPONENT_ASSAULTRIFLE_MK2_CAMO_02`}, + {name = 'camo_finish3', label = _U('component_camo_finish3'), hash = `COMPONENT_ASSAULTRIFLE_MK2_CAMO_03`}, + {name = 'camo_finish4', label = _U('component_camo_finish4'), hash = `COMPONENT_ASSAULTRIFLE_MK2_CAMO_04`}, + {name = 'camo_finish5', label = _U('component_camo_finish5'), hash = `COMPONENT_ASSAULTRIFLE_MK2_CAMO_05`}, + {name = 'camo_finish6', label = _U('component_camo_finish6'), hash = `COMPONENT_ASSAULTRIFLE_MK2_CAMO_06`}, + {name = 'camo_finish7', label = _U('component_camo_finish7'), hash = `COMPONENT_ASSAULTRIFLE_MK2_CAMO_07`}, + {name = 'camo_finish8', label = _U('component_camo_finish8'), hash = `COMPONENT_ASSAULTRIFLE_MK2_CAMO_08`}, + {name = 'camo_finish9', label = _U('component_camo_finish9'), hash = `COMPONENT_ASSAULTRIFLE_MK2_CAMO_09`}, + {name = 'camo_finish10', label = _U('component_camo_finish10'), hash = `COMPONENT_ASSAULTRIFLE_MK2_CAMO_10`}, + {name = 'camo_finish11', label = _U('component_camo_finish11'), hash = `COMPONENT_ASSAULTRIFLE_MK2_CAMO_IND_01`} + } + }, + { + name = 'WEAPON_BULLPUPRIFLE', + label = _U('weapon_bullpuprifle'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_RIFLE`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_BULLPUPRIFLE_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_BULLPUPRIFLE_CLIP_02`}, + {name = 'flashlight', label = _U('component_flashlight'), hash = `COMPONENT_AT_AR_FLSH`}, + {name = 'scope', label = _U('component_scope'), hash = `COMPONENT_AT_SCOPE_SMALL`}, + {name = 'suppressor', label = _U('component_suppressor'), hash = `COMPONENT_AT_AR_SUPP`}, + {name = 'grip', label = _U('component_grip'), hash = `COMPONENT_AT_AR_AFGRIP`}, + {name = 'luxary_finish', label = _U('component_luxary_finish'), hash = `COMPONENT_BULLPUPRIFLE_VARMOD_LOW`} + } + }, + { + name = 'WEAPON_BULLPUPRIFLE_MK2', + label = _U('weapon_bullpuprifle_mk2'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_RIFLE`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_BULLPUPRIFLE_MK2_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_BULLPUPRIFLE_MK2_CLIP_02`}, + {name = 'ammo_tracer', label = _U('component_ammo_tracer'), hash = `COMPONENT_BULLPUPRIFLE_MK2_CLIP_TRACER`}, + {name = 'ammo_incendiary', label = _U('component_ammo_incendiary'), hash = `COMPONENT_BULLPUPRIFLE_MK2_CLIP_INCENDIARY`}, + {name = 'ammo_armor', label = _U('component_ammo_armor'), hash = `COMPONENT_BULLPUPRIFLE_MK2_CLIP_ARMORPIERCING`}, + {name = 'ammo_fmj', label = _U('component_ammo_fmj'), hash = `COMPONENT_BULLPUPRIFLE_MK2_CLIP_FMJ`}, + {name = 'flashlight', label = _U('component_flashlight'), hash = `COMPONENT_AT_AR_FLSH`}, + {name = 'scope_holo', label = _U('component_scope_holo'), hash = `COMPONENT_AT_SIGHTS`}, + {name = 'scope_small', label = _U('component_scope_small'), hash = `COMPONENT_AT_SCOPE_MACRO_02_MK2`}, + {name = 'scope_medium', label = _U('component_scope_medium'), hash = `COMPONENT_AT_SCOPE_SMALL_MK2`}, + {name = 'barrel_default', label = _U('component_barrel_default'), hash = `COMPONENT_AT_BP_BARREL_01`}, + {name = 'barrel_heavy', label = _U('component_barrel_heavy'), hash = `COMPONENT_AT_BP_BARREL_02`}, + {name = 'suppressor', label = _U('component_suppressor'), hash = `COMPONENT_AT_AR_SUPP`}, + {name = 'muzzle_flat', label = _U('component_muzzle_flat'), hash = `COMPONENT_AT_MUZZLE_01`}, + {name = 'muzzle_tactical', label = _U('component_muzzle_tactical'), hash = `COMPONENT_AT_MUZZLE_02`}, + {name = 'muzzle_fat', label = _U('component_muzzle_fat'), hash = `COMPONENT_AT_MUZZLE_03`}, + {name = 'muzzle_precision', label = _U('component_muzzle_precision'), hash = `COMPONENT_AT_MUZZLE_04`}, + {name = 'muzzle_heavy', label = _U('component_muzzle_heavy'), hash = `COMPONENT_AT_MUZZLE_05`}, + {name = 'muzzle_slanted', label = _U('component_muzzle_slanted'), hash = `COMPONENT_AT_MUZZLE_06`}, + {name = 'muzzle_split', label = _U('component_muzzle_split'), hash = `COMPONENT_AT_MUZZLE_07`}, + {name = 'grip', label = _U('component_grip'), hash = `COMPONENT_AT_AR_AFGRIP_02`}, + {name = 'camo_finish', label = _U('component_camo_finish'), hash = `COMPONENT_BULLPUPRIFLE_MK2_CAMO`}, + {name = 'camo_finish2', label = _U('component_camo_finish2'), hash = `COMPONENT_BULLPUPRIFLE_MK2_CAMO_02`}, + {name = 'camo_finish3', label = _U('component_camo_finish3'), hash = `COMPONENT_BULLPUPRIFLE_MK2_CAMO_03`}, + {name = 'camo_finish4', label = _U('component_camo_finish4'), hash = `COMPONENT_BULLPUPRIFLE_MK2_CAMO_04`}, + {name = 'camo_finish5', label = _U('component_camo_finish5'), hash = `COMPONENT_BULLPUPRIFLE_MK2_CAMO_05`}, + {name = 'camo_finish6', label = _U('component_camo_finish6'), hash = `COMPONENT_BULLPUPRIFLE_MK2_CAMO_06`}, + {name = 'camo_finish7', label = _U('component_camo_finish7'), hash = `COMPONENT_BULLPUPRIFLE_MK2_CAMO_07`}, + {name = 'camo_finish8', label = _U('component_camo_finish8'), hash = `COMPONENT_BULLPUPRIFLE_MK2_CAMO_08`}, + {name = 'camo_finish9', label = _U('component_camo_finish9'), hash = `COMPONENT_BULLPUPRIFLE_MK2_CAMO_09`}, + {name = 'camo_finish10', label = _U('component_camo_finish10'), hash = `COMPONENT_BULLPUPRIFLE_MK2_CAMO_10`}, + {name = 'camo_finish11', label = _U('component_camo_finish11'), hash = `COMPONENT_BULLPUPRIFLE_MK2_CAMO_IND_01`} + } + }, + { + name = 'WEAPON_CARBINERIFLE', + label = _U('weapon_carbinerifle'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_RIFLE`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_CARBINERIFLE_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_CARBINERIFLE_CLIP_02`}, + {name = 'clip_box', label = _U('component_clip_box'), hash = `COMPONENT_CARBINERIFLE_CLIP_03`}, + {name = 'flashlight', label = _U('component_flashlight'), hash = `COMPONENT_AT_AR_FLSH`}, + {name = 'scope', label = _U('component_scope'), hash = `COMPONENT_AT_SCOPE_MEDIUM`}, + {name = 'suppressor', label = _U('component_suppressor'), hash = `COMPONENT_AT_AR_SUPP`}, + {name = 'grip', label = _U('component_grip'), hash = `COMPONENT_AT_AR_AFGRIP`}, + {name = 'luxary_finish', label = _U('component_luxary_finish'), hash = `COMPONENT_CARBINERIFLE_VARMOD_LUXE`} + } + }, + { + name = 'WEAPON_CARBINERIFLE_MK2', + label = _U('weapon_carbinerifle_mk2'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_RIFLE`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_CARBINERIFLE_MK2_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_CARBINERIFLE_MK2_CLIP_02`}, + {name = 'ammo_tracer', label = _U('component_ammo_tracer'), hash = `COMPONENT_CARBINERIFLE_MK2_CLIP_TRACER`}, + {name = 'ammo_incendiary', label = _U('component_ammo_incendiary'), hash = `COMPONENT_CARBINERIFLE_MK2_CLIP_INCENDIARY`}, + {name = 'ammo_armor', label = _U('component_ammo_armor'), hash = `COMPONENT_CARBINERIFLE_MK2_CLIP_ARMORPIERCING`}, + {name = 'ammo_fmj', label = _U('component_ammo_fmj'), hash = `COMPONENT_CARBINERIFLE_MK2_CLIP_FMJ`}, + {name = 'grip', label = _U('component_grip'), hash = `COMPONENT_AT_AR_AFGRIP_02`}, + {name = 'flashlight', label = _U('component_flashlight'), hash = `COMPONENT_AT_AR_FLSH`}, + {name = 'scope_holo', label = _U('component_scope_holo'), hash = `COMPONENT_AT_SIGHTS`}, + {name = 'scope_medium', label = _U('component_scope_medium'), hash = `COMPONENT_AT_SCOPE_MACRO_MK2`}, + {name = 'scope_large', label = _U('component_scope_large'), hash = `COMPONENT_AT_SCOPE_MEDIUM_MK2`}, + {name = 'suppressor', label = _U('component_suppressor'), hash = `COMPONENT_AT_AR_SUPP`}, + {name = 'muzzle_flat', label = _U('component_muzzle_flat'), hash = `COMPONENT_AT_MUZZLE_01`}, + {name = 'muzzle_tactical', label = _U('component_muzzle_tactical'), hash = `COMPONENT_AT_MUZZLE_02`}, + {name = 'muzzle_fat', label = _U('component_muzzle_fat'), hash = `COMPONENT_AT_MUZZLE_03`}, + {name = 'muzzle_precision', label = _U('component_muzzle_precision'), hash = `COMPONENT_AT_MUZZLE_04`}, + {name = 'muzzle_heavy', label = _U('component_muzzle_heavy'), hash = `COMPONENT_AT_MUZZLE_05`}, + {name = 'muzzle_slanted', label = _U('component_muzzle_slanted'), hash = `COMPONENT_AT_MUZZLE_06`}, + {name = 'muzzle_split', label = _U('component_muzzle_split'), hash = `COMPONENT_AT_MUZZLE_07`}, + {name = 'barrel_default', label = _U('component_barrel_default'), hash = `COMPONENT_AT_CR_BARREL_01`}, + {name = 'barrel_heavy', label = _U('component_barrel_heavy'), hash = `COMPONENT_AT_CR_BARREL_02`}, + {name = 'camo_finish', label = _U('component_camo_finish'), hash = `COMPONENT_CARBINERIFLE_MK2_CAMO`}, + {name = 'camo_finish2', label = _U('component_camo_finish2'), hash = `COMPONENT_CARBINERIFLE_MK2_CAMO_02`}, + {name = 'camo_finish3', label = _U('component_camo_finish3'), hash = `COMPONENT_CARBINERIFLE_MK2_CAMO_03`}, + {name = 'camo_finish4', label = _U('component_camo_finish4'), hash = `COMPONENT_CARBINERIFLE_MK2_CAMO_04`}, + {name = 'camo_finish5', label = _U('component_camo_finish5'), hash = `COMPONENT_CARBINERIFLE_MK2_CAMO_05`}, + {name = 'camo_finish6', label = _U('component_camo_finish6'), hash = `COMPONENT_CARBINERIFLE_MK2_CAMO_06`}, + {name = 'camo_finish7', label = _U('component_camo_finish7'), hash = `COMPONENT_CARBINERIFLE_MK2_CAMO_07`}, + {name = 'camo_finish8', label = _U('component_camo_finish8'), hash = `COMPONENT_CARBINERIFLE_MK2_CAMO_08`}, + {name = 'camo_finish9', label = _U('component_camo_finish9'), hash = `COMPONENT_CARBINERIFLE_MK2_CAMO_09`}, + {name = 'camo_finish10', label = _U('component_camo_finish10'), hash = `COMPONENT_CARBINERIFLE_MK2_CAMO_10`}, + {name = 'camo_finish11', label = _U('component_camo_finish11'), hash = `COMPONENT_CARBINERIFLE_MK2_CAMO_IND_01`} + } + }, + { + name = 'WEAPON_COMPACTRIFLE', + label = _U('weapon_compactrifle'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_RIFLE`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_COMPACTRIFLE_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_COMPACTRIFLE_CLIP_02`}, + {name = 'clip_drum', label = _U('component_clip_drum'), hash = `COMPONENT_COMPACTRIFLE_CLIP_03`} + } + }, + { + name = 'WEAPON_MILITARYRIFLE', + label = _U('weapon_militaryrifle'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_RIFLE`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_MILITARYRIFLE_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_MILITARYRIFLE_CLIP_02`}, + {name = 'ironsights', label = _U('component_ironsights'), hash = `COMPONENT_MILITARYRIFLE_SIGHT_01`}, + {name = 'scope', label = _U('component_scope'), hash = `COMPONENT_AT_SCOPE_SMALL`}, + {name = 'flashlight', label = _U('component_flashlight'), hash = `COMPONENT_AT_AR_FLSH`}, + {name = 'suppressor', label = _U('component_suppressor'), hash = `COMPONENT_AT_AR_SUPP`} + } + }, + { + name = 'WEAPON_SPECIALCARBINE', + label = _U('weapon_specialcarbine'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_RIFLE`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_SPECIALCARBINE_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_SPECIALCARBINE_CLIP_02`}, + {name = 'clip_drum', label = _U('component_clip_drum'), hash = `COMPONENT_SPECIALCARBINE_CLIP_03`}, + {name = 'flashlight', label = _U('component_flashlight'), hash = `COMPONENT_AT_AR_FLSH`}, + {name = 'scope', label = _U('component_scope'), hash = `COMPONENT_AT_SCOPE_MEDIUM`}, + {name = 'suppressor', label = _U('component_suppressor'), hash = `COMPONENT_AT_AR_SUPP_02`}, + {name = 'grip', label = _U('component_grip'), hash = `COMPONENT_AT_AR_AFGRIP`}, + {name = 'luxary_finish', label = _U('component_luxary_finish'), hash = `COMPONENT_SPECIALCARBINE_VARMOD_LOWRIDER`} + } + }, + { + name = 'WEAPON_SPECIALCARBINE_MK2', + label = _U('weapon_specialcarbine_mk2'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_RIFLE`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_SPECIALCARBINE_MK2_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_SPECIALCARBINE_MK2_CLIP_02`}, + {name = 'ammo_tracer', label = _U('component_ammo_tracer'), hash = `COMPONENT_SPECIALCARBINE_MK2_CLIP_TRACER`}, + {name = 'ammo_incendiary', label = _U('component_ammo_incendiary'), hash = `COMPONENT_SPECIALCARBINE_MK2_CLIP_INCENDIARY`}, + {name = 'ammo_armor', label = _U('component_ammo_armor'), hash = `COMPONENT_SPECIALCARBINE_MK2_CLIP_ARMORPIERCING`}, + {name = 'ammo_fmj', label = _U('component_ammo_fmj'), hash = `COMPONENT_SPECIALCARBINE_MK2_CLIP_FMJ`}, + {name = 'flashlight', label = _U('component_flashlight'), hash = `COMPONENT_AT_AR_FLSH`}, + {name = 'scope_holo', label = _U('component_scope_holo'), hash = `COMPONENT_AT_SIGHTS`}, + {name = 'scope_small', label = _U('component_scope_small'), hash = `COMPONENT_AT_SCOPE_MACRO_MK2`}, + {name = 'scope_large', label = _U('component_scope_large'), hash = `COMPONENT_AT_SCOPE_MEDIUM_MK2`}, + {name = 'suppressor', label = _U('component_suppressor'), hash = `COMPONENT_AT_AR_SUPP_02`}, + {name = 'muzzle_flat', label = _U('component_muzzle_flat'), hash = `COMPONENT_AT_MUZZLE_01`}, + {name = 'muzzle_tactical', label = _U('component_muzzle_tactical'), hash = `COMPONENT_AT_MUZZLE_02`}, + {name = 'muzzle_fat', label = _U('component_muzzle_fat'), hash = `COMPONENT_AT_MUZZLE_03`}, + {name = 'muzzle_precision', label = _U('component_muzzle_precision'), hash = `COMPONENT_AT_MUZZLE_04`}, + {name = 'muzzle_heavy', label = _U('component_muzzle_heavy'), hash = `COMPONENT_AT_MUZZLE_05`}, + {name = 'muzzle_slanted', label = _U('component_muzzle_slanted'), hash = `COMPONENT_AT_MUZZLE_06`}, + {name = 'muzzle_split', label = _U('component_muzzle_split'), hash = `COMPONENT_AT_MUZZLE_07`}, + {name = 'grip', label = _U('component_grip'), hash = `COMPONENT_AT_AR_AFGRIP_02`}, + {name = 'barrel_default', label = _U('component_barrel_default'), hash = `COMPONENT_AT_SC_BARREL_01`}, + {name = 'barrel_heavy', label = _U('component_barrel_heavy'), hash = `COMPONENT_AT_SC_BARREL_02`}, + {name = 'camo_finish', label = _U('component_camo_finish'), hash = `COMPONENT_SPECIALCARBINE_MK2_CAMO`}, + {name = 'camo_finish2', label = _U('component_camo_finish2'), hash = `COMPONENT_SPECIALCARBINE_MK2_CAMO_02`}, + {name = 'camo_finish3', label = _U('component_camo_finish3'), hash = `COMPONENT_SPECIALCARBINE_MK2_CAMO_03`}, + {name = 'camo_finish4', label = _U('component_camo_finish4'), hash = `COMPONENT_SPECIALCARBINE_MK2_CAMO_04`}, + {name = 'camo_finish5', label = _U('component_camo_finish5'), hash = `COMPONENT_SPECIALCARBINE_MK2_CAMO_05`}, + {name = 'camo_finish6', label = _U('component_camo_finish6'), hash = `COMPONENT_SPECIALCARBINE_MK2_CAMO_06`}, + {name = 'camo_finish7', label = _U('component_camo_finish7'), hash = `COMPONENT_SPECIALCARBINE_MK2_CAMO_07`}, + {name = 'camo_finish8', label = _U('component_camo_finish8'), hash = `COMPONENT_SPECIALCARBINE_MK2_CAMO_08`}, + {name = 'camo_finish9', label = _U('component_camo_finish9'), hash = `COMPONENT_SPECIALCARBINE_MK2_CAMO_09`}, + {name = 'camo_finish10', label = _U('component_camo_finish10'), hash = `COMPONENT_SPECIALCARBINE_MK2_CAMO_10`}, + {name = 'camo_finish11', label = _U('component_camo_finish11'), hash = `COMPONENT_SPECIALCARBINE_MK2_CAMO_IND_01`} + } + }, + -- Sniper + { + name = 'WEAPON_HEAVYSNIPER', + label = _U('weapon_heavysniper'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_SNIPER`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'scope', label = _U('component_scope'), hash = `COMPONENT_AT_SCOPE_LARGE`}, + {name = 'scope_advanced', label = _U('component_scope_advanced'), hash = `COMPONENT_AT_SCOPE_MAX`} + } + }, + { + name = 'WEAPON_HEAVYSNIPER_MK2', + label = _U('weapon_heavysniper_mk2'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_SNIPER`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_HEAVYSNIPER_MK2_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_HEAVYSNIPER_MK2_CLIP_02`}, + {name = 'ammo_incendiary', label = _U('component_ammo_incendiary'), hash = `COMPONENT_HEAVYSNIPER_MK2_CLIP_INCENDIARY`}, + {name = 'ammo_armor', label = _U('component_ammo_armor'), hash = `COMPONENT_HEAVYSNIPER_MK2_CLIP_ARMORPIERCING`}, + {name = 'ammo_fmj', label = _U('component_ammo_fmj'), hash = `COMPONENT_HEAVYSNIPER_MK2_CLIP_FMJ`}, + {name = 'ammo_explosive', label = _U('component_ammo_explosive'), hash = `COMPONENT_HEAVYSNIPER_MK2_CLIP_EXPLOSIVE`}, + {name = 'scope_zoom', label = _U('component_scope_zoom'), hash = `COMPONENT_AT_SCOPE_LARGE_MK2`}, + {name = 'scope_advanced', label = _U('component_scope_advanced'), hash = `COMPONENT_AT_SCOPE_MAX`}, + {name = 'scope_nightvision', label = _U('component_scope_nightvision'), hash = `COMPONENT_AT_SCOPE_NV`}, + {name = 'scope_thermal', label = _U('component_scope_thermal'), hash = `COMPONENT_AT_SCOPE_THERMAL`}, + {name = 'suppressor', label = _U('component_suppressor'), hash = `COMPONENT_AT_SR_SUPP_03`}, + {name = 'muzzle_squared', label = _U('component_muzzle_squared'), hash = `COMPONENT_AT_MUZZLE_08`}, + {name = 'muzzle_bell', label = _U('component_muzzle_bell'), hash = `COMPONENT_AT_MUZZLE_09`}, + {name = 'barrel_default', label = _U('component_barrel_default'), hash = `COMPONENT_AT_SR_BARREL_01`}, + {name = 'barrel_heavy', label = _U('component_barrel_heavy'), hash = `COMPONENT_AT_SR_BARREL_02`}, + {name = 'camo_finish', label = _U('component_camo_finish'), hash = `COMPONENT_HEAVYSNIPER_MK2_CAMO`}, + {name = 'camo_finish2', label = _U('component_camo_finish2'), hash = `COMPONENT_HEAVYSNIPER_MK2_CAMO_02`}, + {name = 'camo_finish3', label = _U('component_camo_finish3'), hash = `COMPONENT_HEAVYSNIPER_MK2_CAMO_03`}, + {name = 'camo_finish4', label = _U('component_camo_finish4'), hash = `COMPONENT_HEAVYSNIPER_MK2_CAMO_04`}, + {name = 'camo_finish5', label = _U('component_camo_finish5'), hash = `COMPONENT_HEAVYSNIPER_MK2_CAMO_05`}, + {name = 'camo_finish6', label = _U('component_camo_finish6'), hash = `COMPONENT_HEAVYSNIPER_MK2_CAMO_06`}, + {name = 'camo_finish7', label = _U('component_camo_finish7'), hash = `COMPONENT_HEAVYSNIPER_MK2_CAMO_07`}, + {name = 'camo_finish8', label = _U('component_camo_finish8'), hash = `COMPONENT_HEAVYSNIPER_MK2_CAMO_08`}, + {name = 'camo_finish9', label = _U('component_camo_finish9'), hash = `COMPONENT_HEAVYSNIPER_MK2_CAMO_09`}, + {name = 'camo_finish10', label = _U('component_camo_finish10'), hash = `COMPONENT_HEAVYSNIPER_MK2_CAMO_10`}, + {name = 'camo_finish11', label = _U('component_camo_finish11'), hash = `COMPONENT_HEAVYSNIPER_MK2_CAMO_IND_01`} + } + }, + { + name = 'WEAPON_MARKSMANRIFLE', + label = _U('weapon_marksmanrifle'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_SNIPER`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_MARKSMANRIFLE_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_MARKSMANRIFLE_CLIP_02`}, + {name = 'flashlight', label = _U('component_flashlight'), hash = `COMPONENT_AT_AR_FLSH`}, + {name = 'scope', label = _U('component_scope'), hash = `COMPONENT_AT_SCOPE_LARGE_FIXED_ZOOM`}, + {name = 'suppressor', label = _U('component_suppressor'), hash = `COMPONENT_AT_AR_SUPP`}, + {name = 'grip', label = _U('component_grip'), hash = `COMPONENT_AT_AR_AFGRIP`}, + {name = 'luxary_finish', label = _U('component_luxary_finish'), hash = `COMPONENT_MARKSMANRIFLE_VARMOD_LUXE`} + } + }, + { + name = 'WEAPON_MARKSMANRIFLE_MK2', + label = _U('weapon_marksmanrifle_mk2'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_SNIPER`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'clip_default', label = _U('component_clip_default'), hash = `COMPONENT_MARKSMANRIFLE_MK2_CLIP_01`}, + {name = 'clip_extended', label = _U('component_clip_extended'), hash = `COMPONENT_MARKSMANRIFLE_MK2_CLIP_02`}, + {name = 'ammo_tracer', label = _U('component_ammo_tracer'), hash = `COMPONENT_MARKSMANRIFLE_MK2_CLIP_TRACER`}, + {name = 'ammo_incendiary', label = _U('component_ammo_incendiary'), hash = `COMPONENT_MARKSMANRIFLE_MK2_CLIP_INCENDIARY`}, + {name = 'ammo_armor', label = _U('component_ammo_armor'), hash = `COMPONENT_MARKSMANRIFLE_MK2_CLIP_ARMORPIERCING`}, + {name = 'ammo_fmj', label = _U('component_ammo_fmj'), hash = `COMPONENT_MARKSMANRIFLE_MK2_CLIP_FMJ`}, + {name = 'scope_holo', label = _U('component_scope_holo'), hash = `COMPONENT_AT_SIGHTS`}, + {name = 'scope_large', label = _U('component_scope_large'), hash = `COMPONENT_AT_SCOPE_MEDIUM_MK2`}, + {name = 'scope_zoom', label = _U('component_scope_zoom'), hash = `COMPONENT_AT_SCOPE_LARGE_FIXED_ZOOM_MK2`}, + {name = 'flashlight', label = _U('component_flashlight'), hash = `COMPONENT_AT_AR_FLSH`}, + {name = 'suppressor', label = _U('component_suppressor'), hash = `COMPONENT_AT_AR_SUPP`}, + {name = 'muzzle_flat', label = _U('component_muzzle_flat'), hash = `COMPONENT_AT_MUZZLE_01`}, + {name = 'muzzle_tactical', label = _U('component_muzzle_tactical'), hash = `COMPONENT_AT_MUZZLE_02`}, + {name = 'muzzle_fat', label = _U('component_muzzle_fat'), hash = `COMPONENT_AT_MUZZLE_03`}, + {name = 'muzzle_precision', label = _U('component_muzzle_precision'), hash = `COMPONENT_AT_MUZZLE_04`}, + {name = 'muzzle_heavy', label = _U('component_muzzle_heavy'), hash = `COMPONENT_AT_MUZZLE_05`}, + {name = 'muzzle_slanted', label = _U('component_muzzle_slanted'), hash = `COMPONENT_AT_MUZZLE_06`}, + {name = 'muzzle_split', label = _U('component_muzzle_split'), hash = `COMPONENT_AT_MUZZLE_07`}, + {name = 'barrel_default', label = _U('component_barrel_default'), hash = `COMPONENT_AT_MRFL_BARREL_01`}, + {name = 'barrel_heavy', label = _U('component_barrel_heavy'), hash = `COMPONENT_AT_MRFL_BARREL_02`}, + {name = 'grip', label = _U('component_grip'), hash = `COMPONENT_AT_AR_AFGRIP_02`}, + {name = 'camo_finish', label = _U('component_camo_finish'), hash = `COMPONENT_MARKSMANRIFLE_MK2_CAMO`}, + {name = 'camo_finish2', label = _U('component_camo_finish2'), hash = `COMPONENT_MARKSMANRIFLE_MK2_CAMO_02`}, + {name = 'camo_finish3', label = _U('component_camo_finish3'), hash = `COMPONENT_MARKSMANRIFLE_MK2_CAMO_03`}, + {name = 'camo_finish4', label = _U('component_camo_finish4'), hash = `COMPONENT_MARKSMANRIFLE_MK2_CAMO_04`}, + {name = 'camo_finish5', label = _U('component_camo_finish5'), hash = `COMPONENT_MARKSMANRIFLE_MK2_CAMO_05`}, + {name = 'camo_finish6', label = _U('component_camo_finish6'), hash = `COMPONENT_MARKSMANRIFLE_MK2_CAMO_06`}, + {name = 'camo_finish7', label = _U('component_camo_finish7'), hash = `COMPONENT_MARKSMANRIFLE_MK2_CAMO_07`}, + {name = 'camo_finish8', label = _U('component_camo_finish8'), hash = `COMPONENT_MARKSMANRIFLE_MK2_CAMO_08`}, + {name = 'camo_finish9', label = _U('component_camo_finish9'), hash = `COMPONENT_MARKSMANRIFLE_MK2_CAMO_09`}, + {name = 'camo_finish10', label = _U('component_camo_finish10'), hash = `COMPONENT_MARKSMANRIFLE_MK2_CAMO_10`}, + {name = 'camo_finish11', label = _U('component_camo_finish11'), hash = `COMPONENT_MARKSMANRIFLE_MK2_CAMO_IND_01`} + } + }, + { + name = 'WEAPON_SNIPERRIFLE', + label = _U('weapon_sniperrifle'), + ammo = {label = _U('ammo_rounds'), hash = `AMMO_SNIPER`}, + tints = Config.DefaultWeaponTints, + components = { + {name = 'scope', label = _U('component_scope'), hash = `COMPONENT_AT_SCOPE_LARGE`}, + {name = 'scope_advanced', label = _U('component_scope_advanced'), hash = `COMPONENT_AT_SCOPE_MAX`}, + {name = 'suppressor', label = _U('component_suppressor'), hash = `COMPONENT_AT_AR_SUPP_02`}, + {name = 'luxary_finish', label = _U('component_luxary_finish'), hash = `COMPONENT_SNIPERRIFLE_VARMOD_LUXE`} + } + }, + -- Heavy / Launchers + {name = 'WEAPON_COMPACTLAUNCHER', label = _U('weapon_compactlauncher'), tints = Config.DefaultWeaponTints, components = {}, ammo = {label = _U('ammo_grenadelauncher'), hash = `AMMO_GRENADELAUNCHER`}}, + {name = 'WEAPON_FIREWORK', label = _U('weapon_firework'), components = {}, ammo = {label = _U('ammo_firework'), hash = `AMMO_FIREWORK`}}, + {name = 'WEAPON_GRENADELAUNCHER', label = _U('weapon_grenadelauncher'), tints = Config.DefaultWeaponTints, components = {}, ammo = {label = _U('ammo_grenadelauncher'), hash = `AMMO_GRENADELAUNCHER`}}, + {name = 'WEAPON_HOMINGLAUNCHER', label = _U('weapon_hominglauncher'), tints = Config.DefaultWeaponTints, components = {}, ammo = {label = _U('ammo_rockets'), hash = `AMMO_HOMINGLAUNCHER`}}, + {name = 'WEAPON_MINIGUN', label = _U('weapon_minigun'), tints = Config.DefaultWeaponTints, components = {}, ammo = {label = _U('ammo_rounds'), hash = `AMMO_MINIGUN`}}, + {name = 'WEAPON_RAILGUN', label = _U('weapon_railgun'), tints = Config.DefaultWeaponTints, components = {}, ammo = {label = _U('ammo_rounds'), hash = `AMMO_RAILGUN`}}, + {name = 'WEAPON_RPG', label = _U('weapon_rpg'), tints = Config.DefaultWeaponTints, components = {}, ammo = {label = _U('ammo_rockets'), hash = `AMMO_RPG`}}, + {name = 'WEAPON_RAYMINIGUN', label = _U('weapon_rayminigun'), tints = Config.DefaultWeaponTints, components = {}, ammo = {label = _U('ammo_rounds'), hash = `AMMO_MINIGUN`}}, + -- Thrown + {name = 'WEAPON_BALL', label = _U('weapon_ball'), components = {}, ammo = {label = _U('ammo_ball'), hash = `AMMO_BALL`}}, + {name = 'WEAPON_BZGAS', label = _U('weapon_bzgas'), components = {}, ammo = {label = _U('ammo_bzgas'), hash = `AMMO_BZGAS`}}, + {name = 'WEAPON_FLARE', label = _U('weapon_flare'), components = {}, ammo = {label = _U('ammo_flare'), hash = `AMMO_FLARE`}}, + {name = 'WEAPON_GRENADE', label = _U('weapon_grenade'), components = {}, ammo = {label = _U('ammo_grenade'), hash = `AMMO_GRENADE`}}, + {name = 'WEAPON_PETROLCAN', label = _U('weapon_petrolcan'), components = {}, ammo = {label = _U('ammo_petrol'), hash = `AMMO_PETROLCAN`}}, + {name = 'WEAPON_HAZARDCAN', label = _U('weapon_hazardcan'), components = {}, ammo = {label = _U('ammo_petrol'), hash = `AMMO_PETROLCAN`}}, + {name = 'WEAPON_MOLOTOV', label = _U('weapon_molotov'), components = {}, ammo = {label = _U('ammo_molotov'), hash = `AMMO_MOLOTOV`}}, + {name = 'WEAPON_PROXMINE', label = _U('weapon_proxmine'), components = {}, ammo = {label = _U('ammo_proxmine'), hash = `AMMO_PROXMINE`}}, + {name = 'WEAPON_PIPEBOMB', label = _U('weapon_pipebomb'), components = {}, ammo = {label = _U('ammo_pipebomb'), hash = `AMMO_PIPEBOMB`}}, + {name = 'WEAPON_SNOWBALL', label = _U('weapon_snowball'), components = {}, ammo = {label = _U('ammo_snowball'), hash = `AMMO_SNOWBALL`}}, + {name = 'WEAPON_STICKYBOMB', label = _U('weapon_stickybomb'), components = {}, ammo = {label = _U('ammo_stickybomb'), hash = `AMMO_STICKYBOMB`}}, + {name = 'WEAPON_SMOKEGRENADE', label = _U('weapon_smokegrenade'), components = {}, ammo = {label = _U('ammo_smokebomb'), hash = `AMMO_SMOKEGRENADE`}}, + -- Tools + {name = 'WEAPON_FIREEXTINGUISHER', label = _U('weapon_fireextinguisher'), components = {}, ammo = {label = _U('ammo_charge'), hash = `AMMO_FIREEXTINGUISHER`}}, + {name = 'WEAPON_DIGISCANNER', label = _U('weapon_digiscanner'), components = {}}, + {name = 'GADGET_PARACHUTE', label = _U('gadget_parachute'), components = {}} +} diff --git a/[esx]/es_extended/es_extended.sql b/[esx]/es_extended/es_extended.sql new file mode 100644 index 00000000..7ba35556 --- /dev/null +++ b/[esx]/es_extended/es_extended.sql @@ -0,0 +1,53 @@ +CREATE DATABASE IF NOT EXISTS `es_extended`; +USE `es_extended`; + +CREATE TABLE `users` ( + `identifier` VARCHAR(60) NOT NULL, + `accounts` LONGTEXT NULL DEFAULT NULL, + `group` VARCHAR(50) NULL DEFAULT 'user', + `inventory` LONGTEXT NULL DEFAULT NULL, + `job` VARCHAR(20) NULL DEFAULT 'unemployed', + `job_grade` INT NULL DEFAULT 0, + `loadout` LONGTEXT NULL DEFAULT NULL, + `position` VARCHAR(255) NULL DEFAULT '{"x":-269.4,"y":-955.3,"z":31.2,"heading":205.8}', + + PRIMARY KEY (`identifier`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `items` ( + `name` VARCHAR(50) NOT NULL, + `label` VARCHAR(50) NOT NULL, + `weight` INT NOT NULL DEFAULT 1, + `rare` TINYINT NOT NULL DEFAULT 0, + `can_remove` TINYINT NOT NULL DEFAULT 1, + + PRIMARY KEY (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `job_grades` ( + `id` INT NOT NULL AUTO_INCREMENT, + `job_name` VARCHAR(50) DEFAULT NULL, + `grade` INT NOT NULL, + `name` VARCHAR(50) NOT NULL, + `label` VARCHAR(50) NOT NULL, + `salary` INT NOT NULL, + `skin_male` LONGTEXT NOT NULL, + `skin_female` LONGTEXT NOT NULL, + + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +INSERT INTO `job_grades` VALUES (1,'unemployed',0,'unemployed','Unemployed',200,'{}','{}'); + +CREATE TABLE `jobs` ( + `name` VARCHAR(50) NOT NULL, + `label` VARCHAR(50) DEFAULT NULL, + + PRIMARY KEY (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +INSERT INTO `jobs` VALUES ('unemployed','Unemployed'); diff --git a/[esx]/es_extended/fxmanifest.lua b/[esx]/es_extended/fxmanifest.lua new file mode 100644 index 00000000..738565d9 --- /dev/null +++ b/[esx]/es_extended/fxmanifest.lua @@ -0,0 +1,93 @@ +fx_version 'adamant' + +game 'gta5' + +description 'ES Extended' + +version 'legacy' + +shared_scripts { + 'locale.lua', + 'locales/de.lua', + 'locales/br.lua', + 'locales/fr.lua', + 'locales/en.lua', + 'locales/fi.lua', + 'locales/sv.lua', + 'locales/pl.lua', + 'locales/cs.lua', + 'locales/sc.lua', + 'locales/tc.lua', + + 'config.lua', + 'config.weapons.lua', +} + +server_scripts { + '@async/async.lua', + '@mysql-async/lib/MySQL.lua', + + 'server/common.lua', + 'server/classes/player.lua', + 'server/functions.lua', + 'server/paycheck.lua', + 'server/main.lua', + 'server/commands.lua', + + 'common/modules/math.lua', + 'common/modules/table.lua', + 'common/functions.lua' +} + +client_scripts { + 'client/common.lua', + 'client/entityiter.lua', + 'client/functions.lua', + 'client/wrapper.lua', + 'client/main.lua', + + 'client/modules/death.lua', + 'client/modules/scaleform.lua', + 'client/modules/streaming.lua', + + 'common/modules/math.lua', + 'common/modules/table.lua', + 'common/functions.lua' +} + +ui_page { + 'html/ui.html' +} + +files { + 'imports.lua', + 'locale.js', + 'html/ui.html', + + 'html/css/app.css', + + 'html/js/mustache.min.js', + 'html/js/wrapper.js', + 'html/js/app.js', + + 'html/fonts/pdown.ttf', + 'html/fonts/bankgothic.ttf', + + 'html/img/accounts/bank.png', + 'html/img/accounts/black_money.png', + 'html/img/accounts/money.png' +} + +exports { + 'getSharedObject' +} + +server_exports { + 'getSharedObject' +} + +dependencies { + 'mysql-async', + 'async', + 'spawnmanager', +} \ No newline at end of file diff --git a/[esx]/es_extended/html/css/app.css b/[esx]/es_extended/html/css/app.css new file mode 100644 index 00000000..7c4c63f1 --- /dev/null +++ b/[esx]/es_extended/html/css/app.css @@ -0,0 +1,88 @@ +@font-face { + font-family: 'Pricedown'; + src: url('../fonts/pdown.ttf') +} + +@font-face { + font-family: 'bankgothic'; + src: url('../fonts/bankgothic.ttf') +} + +html { + overflow: hidden; +} + +#hud { + opacity: 0.0; + position: absolute; + font-family: 'Pricedown'; + font-size: 35px; + color: white; + padding: 4px; + text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; + text-align: right; + top: 80; + right: 40; +} + +#inventory_notifications { + font-family: bankgothic; + position: absolute; + right: 40; + bottom: 40; + font-size: 2em; + font-weight: bold; + color: #FFF; + text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; +} + +.menu { + font-family: 'Open Sans', sans-serif; + min-width: 400px; + min-height: 250px; + color: #fff; + position: absolute; + left: 40; + top: 0; +} + +.menu .head { + font-family: 'Open Sans', sans-serif; + font-size: 28px; + padding: 10px; + background: #1A1A1A; + border-bottom: 3px solid #BC1635; + border-radius: 10px 10px 0 0; + -webkit-border-radius: 10px 10px 0 0; + -moz-border-radius: 10px 10px 0 0; + -o-border-radius: 10px 10px 0 0; + box-shadow: inset 0px 1px 0 rgba(255, 255, 255, 0.28); + -webkit-box-shadow: inset 0px 1px 0 rgba(255, 255, 255, 0.28); + -moz-box-shadow: inset 0px 1px 0 rgba(255, 255, 255, 0.28); + -o-box-shadow: inset 0px 1px 0 rgba(255, 255, 255, 0.28); + box-shadow: 1px 1px 10px 4px rgba(0, 0, 0, 0.4); +} + +.menu .head span { + font-family: 'Pricedown'; + font-size: 28px; + padding-left: 15px; + padding-top: 6px; +} + +.menu .menu-items .menu-item { + font-family: 'Open Sans', sans-serif; + font-size: 14px; + height: 40px; + display: block; + background-color: #f1f1f1; + box-shadow: inset 1px 0px 0px 1px #b8b8b8; + height: 32px; + line-height: 32px; + color: #3A3A3A; + text-align: center; +} + +.menu .menu-items .menu-item.selected { + background-color: #ccc; +} diff --git a/[esx]/es_extended/html/fonts/bankgothic.ttf b/[esx]/es_extended/html/fonts/bankgothic.ttf new file mode 100644 index 00000000..f3d8049b Binary files /dev/null and b/[esx]/es_extended/html/fonts/bankgothic.ttf differ diff --git a/[esx]/es_extended/html/fonts/pdown.ttf b/[esx]/es_extended/html/fonts/pdown.ttf new file mode 100644 index 00000000..69c76cf3 Binary files /dev/null and b/[esx]/es_extended/html/fonts/pdown.ttf differ diff --git a/[esx]/es_extended/html/img/accounts/bank.png b/[esx]/es_extended/html/img/accounts/bank.png new file mode 100644 index 00000000..eb36dc8e Binary files /dev/null and b/[esx]/es_extended/html/img/accounts/bank.png differ diff --git a/[esx]/es_extended/html/img/accounts/black_money.png b/[esx]/es_extended/html/img/accounts/black_money.png new file mode 100644 index 00000000..a42f6aa5 Binary files /dev/null and b/[esx]/es_extended/html/img/accounts/black_money.png differ diff --git a/[esx]/es_extended/html/img/accounts/money.png b/[esx]/es_extended/html/img/accounts/money.png new file mode 100644 index 00000000..e05c91b0 Binary files /dev/null and b/[esx]/es_extended/html/img/accounts/money.png differ diff --git a/[esx]/es_extended/html/js/app.js b/[esx]/es_extended/html/js/app.js new file mode 100644 index 00000000..dce07feb --- /dev/null +++ b/[esx]/es_extended/html/js/app.js @@ -0,0 +1,120 @@ +(() => { + + ESX = {}; + ESX.HUDElements = []; + + ESX.setHUDDisplay = function (opacity) { + $('#hud').css('opacity', opacity); + }; + + ESX.insertHUDElement = function (name, index, priority, html, data) { + ESX.HUDElements.push({ + name: name, + index: index, + priority: priority, + html: html, + data: data + }); + + ESX.HUDElements.sort((a, b) => { + return a.index - b.index || b.priority - a.priority; + }); + }; + + ESX.updateHUDElement = function (name, data) { + for (let i = 0; i < ESX.HUDElements.length; i++) { + if (ESX.HUDElements[i].name == name) { + ESX.HUDElements[i].data = data; + } + } + + ESX.refreshHUD(); + }; + + ESX.deleteHUDElement = function (name) { + for (let i = 0; i < ESX.HUDElements.length; i++) { + if (ESX.HUDElements[i].name == name) { + ESX.HUDElements.splice(i, 1); + } + } + + ESX.refreshHUD(); + }; + + ESX.resetHUDElements = function () { + ESX.HUDElements = []; + ESX.refreshHUD(); + }; + + ESX.refreshHUD = function () { + $('#hud').html(''); + + for (let i = 0; i < ESX.HUDElements.length; i++) { + let html = Mustache.render(ESX.HUDElements[i].html, ESX.HUDElements[i].data); + $('#hud').append(html); + } + }; + + ESX.inventoryNotification = function (add, label, count) { + let notif = ''; + + if (add) { + notif += '+'; + } else { + notif += '-'; + } + + if (count) { + notif += count + ' ' + label; + } else { + notif += ' ' + label; + } + + let elem = $('
' + notif + '
'); + $('#inventory_notifications').append(elem); + + $(elem).delay(3000).fadeOut(1000, function () { + elem.remove(); + }); + }; + + window.onData = (data) => { + switch (data.action) { + case 'setHUDDisplay': { + ESX.setHUDDisplay(data.opacity); + break; + } + + case 'insertHUDElement': { + ESX.insertHUDElement(data.name, data.index, data.priority, data.html, data.data); + break; + } + + case 'updateHUDElement': { + ESX.updateHUDElement(data.name, data.data); + break; + } + + case 'deleteHUDElement': { + ESX.deleteHUDElement(data.name); + break; + } + + case 'resetHUDElements': { + ESX.resetHUDElements(); + break; + } + + case 'inventoryNotification': { + ESX.inventoryNotification(data.add, data.item, data.count); + } + } + }; + + window.onload = function (e) { + window.addEventListener('message', (event) => { + onData(event.data); + }); + }; + +})(); diff --git a/[esx]/es_extended/html/js/mustache.min.js b/[esx]/es_extended/html/js/mustache.min.js new file mode 100644 index 00000000..520cfcb9 --- /dev/null +++ b/[esx]/es_extended/html/js/mustache.min.js @@ -0,0 +1 @@ +(function defineMustache(global,factory){if(typeof exports==="object"&&exports&&typeof exports.nodeName!=="string"){factory(exports)}else if(typeof define==="function"&&define.amd){define(["exports"],factory)}else{global.Mustache={};factory(global.Mustache)}})(this,function mustacheFactory(mustache){var objectToString=Object.prototype.toString;var isArray=Array.isArray||function isArrayPolyfill(object){return objectToString.call(object)==="[object Array]"};function isFunction(object){return typeof object==="function"}function typeStr(obj){return isArray(obj)?"array":typeof obj}function escapeRegExp(string){return string.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function hasProperty(obj,propName){return obj!=null&&typeof obj==="object"&&propName in obj}var regExpTest=RegExp.prototype.test;function testRegExp(re,string){return regExpTest.call(re,string)}var nonSpaceRe=/\S/;function isWhitespace(string){return!testRegExp(nonSpaceRe,string)}var entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function escapeHtml(string){return String(string).replace(/[&<>"'`=\/]/g,function fromEntityMap(s){return entityMap[s]})}var whiteRe=/\s*/;var spaceRe=/\s+/;var equalsRe=/\s*=/;var curlyRe=/\s*\}/;var tagRe=/#|\^|\/|>|\{|&|=|!/;function parseTemplate(template,tags){if(!template)return[];var sections=[];var tokens=[];var spaces=[];var hasTag=false;var nonSpace=false;function stripSpace(){if(hasTag&&!nonSpace){while(spaces.length)delete tokens[spaces.pop()]}else{spaces=[]}hasTag=false;nonSpace=false}var openingTagRe,closingTagRe,closingCurlyRe;function compileTags(tagsToCompile){if(typeof tagsToCompile==="string")tagsToCompile=tagsToCompile.split(spaceRe,2);if(!isArray(tagsToCompile)||tagsToCompile.length!==2)throw new Error("Invalid tags: "+tagsToCompile);openingTagRe=new RegExp(escapeRegExp(tagsToCompile[0])+"\\s*");closingTagRe=new RegExp("\\s*"+escapeRegExp(tagsToCompile[1]));closingCurlyRe=new RegExp("\\s*"+escapeRegExp("}"+tagsToCompile[1]))}compileTags(tags||mustache.tags);var scanner=new Scanner(template);var start,type,value,chr,token,openSection;while(!scanner.eos()){start=scanner.pos;value=scanner.scanUntil(openingTagRe);if(value){for(var i=0,valueLength=value.length;i0?sections[sections.length-1][4]:nestedTokens;break;default:collector.push(token)}}return nestedTokens}function Scanner(string){this.string=string;this.tail=string;this.pos=0}Scanner.prototype.eos=function eos(){return this.tail===""};Scanner.prototype.scan=function scan(re){var match=this.tail.match(re);if(!match||match.index!==0)return"";var string=match[0];this.tail=this.tail.substring(string.length);this.pos+=string.length;return string};Scanner.prototype.scanUntil=function scanUntil(re){var index=this.tail.search(re),match;switch(index){case-1:match=this.tail;this.tail="";break;case 0:match="";break;default:match=this.tail.substring(0,index);this.tail=this.tail.substring(index)}this.pos+=match.length;return match};function Context(view,parentContext){this.view=view;this.cache={".":this.view};this.parent=parentContext}Context.prototype.push=function push(view){return new Context(view,this)};Context.prototype.lookup=function lookup(name){var cache=this.cache;var value;if(cache.hasOwnProperty(name)){value=cache[name]}else{var context=this,names,index,lookupHit=false;while(context){if(name.indexOf(".")>0){value=context.view;names=name.split(".");index=0;while(value!=null&&index")value=this.renderPartial(token,context,partials,originalTemplate);else if(symbol==="&")value=this.unescapedValue(token,context);else if(symbol==="name")value=this.escapedValue(token,context);else if(symbol==="text")value=this.rawValue(token);if(value!==undefined)buffer+=value}return buffer};Writer.prototype.renderSection=function renderSection(token,context,partials,originalTemplate){var self=this;var buffer="";var value=context.lookup(token[1]);function subRender(template){return self.render(template,context,partials)}if(!value)return;if(isArray(value)){for(var j=0,valueLength=value.length;j { + + let ESXWrapper = {}; + ESXWrapper.MessageSize = 1024; + ESXWrapper.messageId = 0; + + window.SendMessage = function (namespace, type, msg) { + + ESXWrapper.messageId = (ESXWrapper.messageId < 65535) ? ESXWrapper.messageId + 1 : 0; + const str = JSON.stringify(msg); + + for (let i = 0; i < str.length; i++) { + + let count = 0; + let chunk = ''; + + while (count < ESXWrapper.MessageSize && i < str.length) { + + chunk += str[i]; + + count++; + i++; + } + + i--; + + const data = { + __type: type, + id: ESXWrapper.messageId, + chunk: chunk + } + + if (i == str.length - 1) + data.end = true; + + $.post('http://' + namespace + '/__chunk', JSON.stringify(data)); + + } + + } + +})() diff --git a/[esx]/es_extended/html/ui.html b/[esx]/es_extended/html/ui.html new file mode 100644 index 00000000..653f41d8 --- /dev/null +++ b/[esx]/es_extended/html/ui.html @@ -0,0 +1,14 @@ + + + + + + +
+
+ + + + + + \ No newline at end of file diff --git a/[esx]/es_extended/imports.lua b/[esx]/es_extended/imports.lua new file mode 100644 index 00000000..71dd9f47 --- /dev/null +++ b/[esx]/es_extended/imports.lua @@ -0,0 +1,10 @@ +ESX = exports['es_extended']:getSharedObject() + +if not IsDuplicityVersion() then -- Only register this event for the client + AddEventHandler('esx:setPlayerData', function(key, val, last) + if GetInvokingResource() == 'es_extended' then + ESX.PlayerData[key] = val + if OnPlayerData ~= nil then OnPlayerData(key, val, last) end + end + end) +end \ No newline at end of file diff --git a/[esx]/es_extended/locale.js b/[esx]/es_extended/locale.js new file mode 100644 index 00000000..4b5390f8 --- /dev/null +++ b/[esx]/es_extended/locale.js @@ -0,0 +1,65 @@ +var locale = []; + +/** + * Similar to the concept of gettext, this function returns the + * localized string for the parsed string. The function supports + * wrapping. + * + * @param {string} args The string we want localized + * @return {string} Returns the localized string + * + */ +function _U() { + var args = arguments; + var string = args[0]; + + // Was a string specified? + if (!string) { + console.log('locale.js: no string was parsed'); + return 'locale.js: no string was parsed'; + } + + // Has the locale file been set? + if (locale.length == 0) { + console.log('locale.js: no locale has been set'); + return 'locale.js: no locale has been set'; + } + + // Does the translation exist? + if (!locale[string]) { + console.log('locale.js: translation [{0}] does not exist'.format(string)); + return 'locale.js: translation [{0}] does not exist'.format(string); + } + + // Do we need to format the string? + if (args.length == 1) { + return capitalize(locale[string]); + } else { + return formatString(args); + } +} + +function formatString(args) { + var string = capitalize(locale[args[0]]); + + for (var i = 1; i < args.length; i++) { + string = string.replace(/%s/, args[i]); + } + + return string; +} + +function capitalize(string) { + return string[0].toUpperCase() + string.slice(1); +} + +// https://stackoverflow.com/a/35359503 +String.prototype.format = function () { + var args = arguments; + return this.replace(/{(\d+)}/g, function (match, number) { + return typeof args[number] != 'undefined' + ? args[number] + : match + ; + }); +}; diff --git a/[esx]/es_extended/locale.lua b/[esx]/es_extended/locale.lua new file mode 100644 index 00000000..68de6651 --- /dev/null +++ b/[esx]/es_extended/locale.lua @@ -0,0 +1,21 @@ +Locales = {} + +function _(str, ...) -- Translate string + + if Locales[Config.Locale] ~= nil then + + if Locales[Config.Locale][str] ~= nil then + return string.format(Locales[Config.Locale][str], ...) + else + return 'Translation [' .. Config.Locale .. '][' .. str .. '] does not exist' + end + + else + return 'Locale [' .. Config.Locale .. '] does not exist' + end + +end + +function _U(str, ...) -- Translate string first char uppercase + return tostring(_(str, ...):gsub("^%l", string.upper)) +end diff --git a/[esx]/es_extended/locales/br.lua b/[esx]/es_extended/locales/br.lua new file mode 100644 index 00000000..d63f2867 --- /dev/null +++ b/[esx]/es_extended/locales/br.lua @@ -0,0 +1,225 @@ +Locales['br'] = { + -- Inventory + ['inventory'] = 'inventário %s / %s', + ['use'] = 'usar', + ['give'] = 'dar', + ['remove'] = 'remover', + ['return'] = 'voltar', + ['give_to'] = 'dar para', + ['amount'] = 'quantidade', + ['giveammo'] = 'dar munição', + ['amountammo'] = 'quantidade de munição', + ['noammo'] = 'voce não tem todas essas munições!', + ['gave_item'] = 'voce deu ~y~%sx~s~ ~b~%s~s~ para ~y~%s~s~', + ['received_item'] = 'voce recebeu ~y~%sx~s~ ~b~%s~s~ de ~b~%s~s~', + ['gave_weapon'] = 'você deu ~b~%s~s~ para ~y~%s~s~', + ['gave_weapon_ammo'] = 'você deu ~o~%sx %s~s~ para ~b~%s~s~ de ~y~%s~s~', + ['gave_weapon_withammo'] = 'você deu ~b~%s~s~ com ~o~%sx %s~s~ para ~y~%s~s~', + ['gave_weapon_hasalready'] = '~y~%s~s~ já tem um(a) ~y~%s~s~', + ['gave_weapon_noweapon'] = 'não tem essa arma ~y~%s~s~', + ['received_weapon'] = 'você recebeu ~b~%s~s~ de ~b~%s~s~', + ['received_weapon_ammo'] = 'você recebeu ~o~%sx %s~s~ para a sua(o seu) ~b~%s~s~ de ~b~%s~s~', + ['received_weapon_withammo'] = 'você recebeu ~b~%s~s~ com ~o~%sx %s~s~ de ~b~%s~s~', + ['received_weapon_hasalready'] = '~b~%s~s~ tentou lhe dar uma ~y~%s~s~, mas você já tem um(a)', + ['received_weapon_noweapon'] = '~b~%s~s~ tentou lhe dar munição para ~y~%s~s~, mas você não tem um(a)', + ['gave_account_money'] = 'voce deu ~g~$%s~s~ (%s) para ~y~%s~s~', + ['received_account_money'] = 'voce recebeu ~g~$%s~s~ (%s) de ~b~%s~s~', + ['amount_invalid'] = 'quantidade inválida', + ['players_nearby'] = 'nenhum cidadão por perto', + ['ex_inv_lim'] = 'ação não e possivel, excedendo o limite de estoque para ~y~%s~s~', + ['imp_invalid_quantity'] = 'ação impossível, quantidade inválida', + ['imp_invalid_amount'] = 'ação impossível, valor invalido', + ['threw_standard'] = 'você jogou ~y~%sx~s~ ~b~%s~s~', + ['threw_account'] = 'você jogou ~g~$%s~s~ ~b~%s~s~', + ['threw_weapon'] = 'você jogou ~b~%s~s~', + ['threw_weapon_ammo'] = 'você jogou ~b~%s~s~ com ~o~%sx %s~s~', + ['threw_weapon_already'] = 'você já esta com essa arma', + ['threw_cannot_pickup'] = 'você não pode pegar porque seu inventário está cheio!', + ['threw_pickup_prompt'] = 'pressione ~y~E~s~ para pegar', + + -- Key mapping + ['keymap_showinventory'] = 'exibir inventario', + + -- Salary related + ['received_salary'] = 'voce recebeu seu salário: ~g~$%s~s~ ', + ['received_help'] = 'voce recebeu seu cheque de bem-estar: ~g~$%s~s~ ', + ['company_nomoney'] = 'a empresa em que voce esta empregado esta muito pobre para pagar seu salário', + ['received_paycheck'] = 'recebeu dinheiro', + ['bank'] = 'banco', + ['account_bank'] = 'banco', + ['account_black_money'] = 'dinheiro sujo', + ['account_money'] = 'dinheiro', + + ['act_imp'] = 'ação impossível', + ['in_vehicle'] = 'voce não pode dar nada para alguem no veículo', + + -- Commands + ['command_car'] = 'spawn um carro', + ['command_car_car'] = 'nome do carro', + ['command_cardel'] = 'excluir veículo', + ['command_cardel_radius'] = 'optional, delete every vehicle within the specified radius', + ['command_clear'] = 'limpar o chat', + ['command_clearall'] = 'limpar o chat para todos', + ['command_clearinventory'] = 'remover todos os itens do inventário', + ['command_clearloadout'] = 'remova todas as armas do carregamento', + ['command_giveaccountmoney'] = 'dar dinheiro da conta', + ['command_giveaccountmoney_account'] = 'conta', + ['command_giveaccountmoney_amount'] = 'amount', + ['command_giveaccountmoney_invalid'] = 'conta inválida', + ['command_giveitem'] = 'dar item', + ['command_giveitem_item'] = 'item', + ['command_giveitem_count'] = 'count', + ['command_giveweapon'] = 'dar arma', + ['command_giveweapon_weapon'] = 'arma', + ['command_giveweapon_ammo'] = 'ammo count', + ['command_giveweapon_hasalready'] = 'player already has that weapon', + ['command_giveweaponcomponent'] = 'give weapon component', + ['command_giveweaponcomponent_component'] = 'component name', + ['command_giveweaponcomponent_invalid'] = 'invalid weapon component', + ['command_giveweaponcomponent_hasalready'] = 'player already has that weapon component', + ['command_giveweaponcomponent_missingweapon'] = 'player does not have that weapon', + ['command_save'] = 'save a player to database', + ['command_saveall'] = 'save all players to database', + ['command_setaccountmoney'] = 'set account money for a player', + ['command_setaccountmoney_amount'] = 'amount of money to set', + ['command_setcoords'] = 'teleport to coordinates', + ['command_setcoords_x'] = 'x axis', + ['command_setcoords_y'] = 'y axis', + ['command_setcoords_z'] = 'z axis', + ['command_setjob'] = 'atribuir um trabalho a um usuario', + ['command_setjob_job'] = 'o trabalho que voce deseja atribuir', + ['command_setjob_grade'] = 'o nivel de emprego', + ['command_setjob_invalid'] = 'the job, grade or both are invalid', + ['command_setgroup'] = 'set player group', + ['command_setgroup_group'] = 'group name', + ['commanderror_argumentmismatch'] = 'argument count mismatch (passed %s, wanted %s)', + ['commanderror_argumentmismatch_number'] = 'argument #%s type mismatch (passed string, wanted number)', + ['commanderror_invaliditem'] = 'item invalido', + ['commanderror_invalidweapon'] = 'invalid weapon', + ['commanderror_console'] = 'that command can not be run from console', + ['commanderror_invalidcommand'] = '^3%s^0 is not an valid command!', + ['commanderror_invalidplayerid'] = 'there is no player online matching that server id', + ['commandgeneric_playerid'] = 'o ID do jogador', + + -- Locale settings + ['locale_digit_grouping_symbol'] = ' ', + ['locale_currency'] = 'R$%s', + + -- Weapons + ['weapon_knife'] = 'faca', + ['weapon_nightstick'] = 'cacetete', + ['weapon_hammer'] = 'martelo', + ['weapon_bat'] = 'bastao', + ['weapon_golfclub'] = 'golf club', + ['weapon_crowbar'] = 'pe de cabra', + ['weapon_pistol'] = 'pistola', + ['weapon_combatpistol'] = 'pistola de combate', + ['weapon_appistol'] = 'ap pistola', + ['weapon_pistol50'] = 'pistola .50', + ['weapon_microsmg'] = 'micro smg', + ['weapon_smg'] = 'smg', + ['weapon_assaultsmg'] = 'smg de assalto', + ['weapon_assaultrifle'] = 'rifle de assalto', + ['weapon_carbinerifle'] = 'carabina rifle', + ['weapon_advancedrifle'] = 'rifle avançado', + ['weapon_mg'] = 'mg', + ['weapon_combatmg'] = 'combate mg', + ['weapon_pumpshotgun'] = 'espingarda', + ['weapon_sawnoffshotgun'] = 'espingarda serrada', + ['weapon_assaultshotgun'] = 'espingarda de assalto', + ['weapon_bullpupshotgun'] = 'espingarda de bullpup', + ['weapon_stungun'] = 'arma de choque', + ['weapon_sniperrifle'] = 'sniper rifle', + ['weapon_heavysniper'] = 'heavy sniper', + ['weapon_grenadelauncher'] = 'lançador de granada', + ['weapon_rpg'] = 'lançador de foguetes', + ['weapon_minigun'] = 'minigun', + ['weapon_grenade'] = 'granada', + ['weapon_stickybomb'] = 'bomba pegajosa', + ['weapon_smokegrenade'] = 'granada de fumaça', + ['weapon_bzgas'] = 'bz gas', + ['weapon_molotov'] = 'molotov', + ['weapon_fireextinguisher'] = 'extintor', + ['weapon_petrolcan'] = 'galao de combustivel', + ['weapon_ball'] = 'bola', + ['weapon_snspistol'] = 'sns pistol', + ['weapon_bottle'] = 'garrafa', + ['weapon_gusenberg'] = 'gusenberg sweeper', + ['weapon_specialcarbine'] = 'carabina especial', + ['weapon_heavypistol'] = 'heavy pistol', + ['weapon_bullpuprifle'] = 'bullpup rifle', + ['weapon_dagger'] = 'punhal', + ['weapon_vintagepistol'] = 'vintage pistol', + ['weapon_firework'] = 'fogos de artificio', + ['weapon_musket'] = 'mosquete', + ['weapon_heavyshotgun'] = 'heavy shotgun', + ['weapon_marksmanrifle'] = 'marksman rifle', + ['weapon_hominglauncher'] = 'homing launcher', + ['weapon_proxmine'] = 'mina de proximidade', + ['weapon_snowball'] = 'bola de neve', + ['weapon_flaregun'] = 'sinalizador', + ['weapon_combatpdw'] = 'combat pdw', + ['weapon_marksmanpistol'] = 'marksman pistol', + ['weapon_knuckle'] = 'soco ingles', + ['weapon_hatchet'] = 'machado', + ['weapon_railgun'] = 'railgun', + ['weapon_machete'] = 'facão', + ['weapon_machinepistol'] = 'machine pistol', + ['weapon_switchblade'] = 'canivete', + ['weapon_revolver'] = 'heavy revolver', + ['weapon_dbshotgun'] = 'espingarda de cano duplo', + ['weapon_compactrifle'] = 'compact rifle', + ['weapon_autoshotgun'] = 'auto shotgun', + ['weapon_battleaxe'] = 'battle axe', + ['weapon_compactlauncher'] = 'compact launcher', + ['weapon_minismg'] = 'mini smg', + ['weapon_pipebomb'] = 'bomba caseira', + ['weapon_poolcue'] = 'taco de sinuca', + ['weapon_wrench'] = 'chave de cano', + ['weapon_flashlight'] = 'laterna', + ['gadget_parachute'] = 'paraquedas', + ['weapon_flare'] = 'flare', + ['weapon_doubleaction'] = 'double-Action Revolver', + + -- Weapon Components + ['component_clip_default'] = 'aderência padrão', + ['component_clip_extended'] = 'aderência prolongada', + ['component_clip_drum'] = 'drum Magazine', + ['component_clip_box'] = 'box Magazine', + ['component_flashlight'] = 'lanterna', + ['component_scope'] = 'mira', + ['component_scope_advanced'] = 'mira avançada', + ['component_suppressor'] = 'supressor', + ['component_grip'] = 'grip', + ['component_luxary_finish'] = 'acabamento de arma de luxo', + + -- Weapon Ammo + ['ammo_rounds'] = 'round(s)', + ['ammo_shells'] = 'shell(s)', + ['ammo_charge'] = 'charge', + ['ammo_petrol'] = 'gallons of fuel', + ['ammo_firework'] = 'firework(s)', + ['ammo_rockets'] = 'rocket(s)', + ['ammo_grenadelauncher'] = 'grenade(s)', + ['ammo_grenade'] = 'grenade(s)', + ['ammo_stickybomb'] = 'bomb(s)', + ['ammo_pipebomb'] = 'bomb(s)', + ['ammo_smokebomb'] = 'bomb(s)', + ['ammo_molotov'] = 'cocktail(s)', + ['ammo_proxmine'] = 'mine(s)', + ['ammo_bzgas'] = 'can(s)', + ['ammo_ball'] = 'ball(s)', + ['ammo_snowball'] = 'snowball(s)', + ['ammo_flare'] = 'flare(s)', + ['ammo_flaregun'] = 'flare(s)', + + -- Weapon Tints + ['tint_default'] = 'default skin', + ['tint_green'] = 'green skin', + ['tint_gold'] = 'gold skin', + ['tint_pink'] = 'pink skin', + ['tint_army'] = 'army skin', + ['tint_lspd'] = 'blue skin', + ['tint_orange'] = 'orange skin', + ['tint_platinum'] = 'platinum skin', +} diff --git a/[esx]/es_extended/locales/cs.lua b/[esx]/es_extended/locales/cs.lua new file mode 100644 index 00000000..27963467 --- /dev/null +++ b/[esx]/es_extended/locales/cs.lua @@ -0,0 +1,225 @@ +Locales['cs'] = { + -- Inventory + ['inventory'] = 'inventář %s / %s', + ['use'] = 'použít', + ['give'] = 'dát', + ['remove'] = 'zahodit', + ['return'] = 'zpět', + ['give_to'] = 'dát', + ['amount'] = 'množství', + ['giveammo'] = 'dát munici', + ['amountammo'] = 'množství munice', + ['noammo'] = 'nemáte dostatek munice!', + ['gave_item'] = 'dali jste ~y~%sx~s~ ~b~%s~s~ ~y~%s~s~', + ['received_item'] = 'obdrželi jste ~y~%sx~s~ ~b~%s~s~ od ~b~%s~s~', + ['gave_weapon'] = 'dal jsi ~b~%s~s~ hráči ~y~%s~s~', + ['gave_weapon_ammo'] = 'dal jsi ~o~%sx %s~s~ za ~b~%s~s~ to ~y~%s~s~', + ['gave_weapon_withammo'] = 'dal jwi ~b~%s~s~ s ~o~%sx %s~s~ to ~y~%s~s~', + ['gave_weapon_hasalready'] = '~y~%s~s~ již má ~y~%s~s~', + ['gave_weapon_noweapon'] = '~y~%s~s~ nemá tuhle zbraň', + ['received_weapon'] = 'obdrzel jsi ~b~%s~s~ od ~b~%s~s~', + ['received_weapon_ammo'] = 'obdrzel jsi ~o~%sx %s~s~ za tvůj ~b~%s~s~ od ~b~%s~s~', + ['received_weapon_withammo'] = 'obdzel jsi ~b~%s~s~ s ~o~%sx %s~s~ od ~b~%s~s~', + ['received_weapon_hasalready'] = '~b~%s~s~ se pokusil ti dat ~y~%s~s~, ale jiz tento predmet jednou mas', + ['received_weapon_noweapon'] = '~b~%s~s~ se pokusil ti dat naboje pro ~y~%s~s~, ale tuhle zbran nemas', + ['gave_account_money'] = 'dali jste ~g~$%s~s~ (%s) ~y~%s~s~', + ['received_account_money'] = 'obdrželi jste ~g~$%s~s~ (%s) od ~b~%s~s~', + ['amount_invalid'] = 'neplatné množství', + ['players_nearby'] = 'žádní hráči poblíž', + ['ex_inv_lim'] = 'akce není možná, překročen limit inventáře pro ~y~%s~s~', + ['imp_invalid_quantity'] = 'akce není možná, neplatný počet', + ['imp_invalid_amount'] = 'akce není možná, neplatné množství', + ['threw_standard'] = 'vyhodil jsi ~y~%sx~s~ ~b~%s~s~', + ['threw_account'] = 'vyhodil jsi ~g~$%s~s~ ~b~%s~s~', + ['threw_weapon'] = 'vzhodil jsi ~b~%s~s~', + ['threw_weapon_ammo'] = 'vyhodil jsi ~b~%s~s~ s ~o~%sx %s~s~', + ['threw_weapon_already'] = 'jiz stejnou zbraan mas', + ['threw_cannot_pickup'] = 'tohle nemuzes sebrat, protoze tvuj inventar je plny', + ['threw_pickup_prompt'] = 'stiskni ~y~E~s~ po zvednuti', + + -- Key mapping + ['keymap_showinventory'] = 'zobrazit inventar', + + -- Salary related + ['received_salary'] = 'obdrželi jste výplatu: ~g~$%s~s~', + ['received_help'] = 'obdrželi jste sociální dávku: ~g~$%s~s~', + ['company_nomoney'] = 'společnost u které jste zaměstananí nemá peníze na váš plat', + ['received_paycheck'] = 'obdržena výplata', + ['bank'] = 'bankovní účet', + ['account_bank'] = 'banka', + ['account_black_money'] = 'spinave penize', + ['account_money'] = 'kapesne', + + ['act_imp'] = 'akce není možná', + ['in_vehicle'] = 'nemůže nic dát osobě ve vozidle', + + -- Commands + ['command_car'] = 'spawn an vehicle', + ['command_car_car'] = 'vehicle spawn name or hash', + ['command_cardel'] = 'delete vehicle in proximity', + ['command_cardel_radius'] = 'optional, delete every vehicle within the specified radius', + ['command_clear'] = 'clear chat', + ['command_clearall'] = 'clear chat for all players', + ['command_clearinventory'] = 'clear player inventory', + ['command_clearloadout'] = 'clear a player loadout', + ['command_giveaccountmoney'] = 'give account money', + ['command_giveaccountmoney_account'] = 'valid account name', + ['command_giveaccountmoney_amount'] = 'amount to add', + ['command_giveaccountmoney_invalid'] = 'invalid account name', + ['command_giveitem'] = 'give an item to a player', + ['command_giveitem_item'] = 'item name', + ['command_giveitem_count'] = 'item count', + ['command_giveweapon'] = 'give a weapon to a player', + ['command_giveweapon_weapon'] = 'weapon name', + ['command_giveweapon_ammo'] = 'ammo count', + ['command_giveweapon_hasalready'] = 'player already has that weapon', + ['command_giveweaponcomponent'] = 'give weapon component', + ['command_giveweaponcomponent_component'] = 'component name', + ['command_giveweaponcomponent_invalid'] = 'invalid weapon component', + ['command_giveweaponcomponent_hasalready'] = 'player already has that weapon component', + ['command_giveweaponcomponent_missingweapon'] = 'player does not have that weapon', + ['command_save'] = 'save a player to database', + ['command_saveall'] = 'save all players to database', + ['command_setaccountmoney'] = 'set account money for a player', + ['command_setaccountmoney_amount'] = 'amount of money to set', + ['command_setcoords'] = 'teleport to coordinates', + ['command_setcoords_x'] = 'x axis', + ['command_setcoords_y'] = 'y axis', + ['command_setcoords_z'] = 'z axis', + ['command_setjob'] = 'set job for a player', + ['command_setjob_job'] = 'job name', + ['command_setjob_grade'] = 'job grade', + ['command_setjob_invalid'] = 'the job, grade or both are invalid', + ['command_setgroup'] = 'set player group', + ['command_setgroup_group'] = 'group name', + ['commanderror_argumentmismatch'] = 'argument count mismatch (passed %s, wanted %s)', + ['commanderror_argumentmismatch_number'] = 'argument #%s type mismatch (passed string, wanted number)', + ['commanderror_invaliditem'] = 'invalid item name', + ['commanderror_invalidweapon'] = 'invalid weapon', + ['commanderror_console'] = 'that command can not be run from console', + ['commanderror_invalidcommand'] = '^3%s^0 is not an valid command!', + ['commanderror_invalidplayerid'] = 'there is no player online matching that server id', + ['commandgeneric_playerid'] = 'player id', + + -- Locale settings + ['locale_digit_grouping_symbol'] = ' ', + ['locale_currency'] = '$%s', + + -- Weapons + ['weapon_knife'] = 'nuz', + ['weapon_nightstick'] = 'policejni obusek', + ['weapon_hammer'] = 'kladivo', + ['weapon_bat'] = 'basseballka', + ['weapon_golfclub'] = 'gollfova hul', + ['weapon_crowbar'] = 'pacidlo', + ['weapon_pistol'] = 'pistole', + ['weapon_combatpistol'] = 'utocna pistole', + ['weapon_appistol'] = 'ap pistole', + ['weapon_pistol50'] = 'pistole .50', + ['weapon_microsmg'] = 'micro smg', + ['weapon_smg'] = 'smg', + ['weapon_assaultsmg'] = 'utocne smg', + ['weapon_assaultrifle'] = 'utocna puska', + ['weapon_carbinerifle'] = 'carbine puska', + ['weapon_advancedrifle'] = 'pokrocily puska', + ['weapon_mg'] = 'mg', + ['weapon_combatmg'] = 'utocne mg', + ['weapon_pumpshotgun'] = 'pumpovana brokovnice', + ['weapon_sawnoffshotgun'] = 'upilovana brokovnice', + ['weapon_assaultshotgun'] = 'utocna brokovnice', + ['weapon_bullpupshotgun'] = 'bullpup brokovnice', + ['weapon_stungun'] = 'tazer', + ['weapon_sniperrifle'] = 'sniperka', + ['weapon_heavysniper'] = 'tezka sniperka', + ['weapon_grenadelauncher'] = 'launcher granatu', + ['weapon_rpg'] = 'raketomet', + ['weapon_minigun'] = 'minigun', + ['weapon_grenade'] = 'granat', + ['weapon_stickybomb'] = 'lepkava bomba', + ['weapon_smokegrenade'] = 'kourovy granat', + ['weapon_bzgas'] = 'bz gas', + ['weapon_molotov'] = 'molotov koktejl', + ['weapon_fireextinguisher'] = 'hasicak', + ['weapon_petrolcan'] = 'kanystr', + ['weapon_ball'] = 'koule', + ['weapon_snspistol'] = 'sns pistole', + ['weapon_bottle'] = 'lahev', + ['weapon_gusenberg'] = 'gusenberguv zametac', + ['weapon_specialcarbine'] = 'specialni karabina', + ['weapon_heavypistol'] = 'tezka pistole', + ['weapon_bullpuprifle'] = 'bullpup puska', + ['weapon_dagger'] = 'dyka', + ['weapon_vintagepistol'] = 'velmi stara pistole', + ['weapon_firework'] = 'ohnostroj', + ['weapon_musket'] = 'musketa', + ['weapon_heavyshotgun'] = 'tezka brokovnice', + ['weapon_marksmanrifle'] = 'puska strelce', + ['weapon_hominglauncher'] = 'navadeci launcher', + ['weapon_proxmine'] = 'mina na blizko', + ['weapon_snowball'] = 'snehova koule', + ['weapon_flaregun'] = 'svetlice', + ['weapon_combatpdw'] = 'utocne pdw', + ['weapon_marksmanpistol'] = 'pistole strelce', + ['weapon_knuckle'] = 'knuckledusters', + ['weapon_hatchet'] = 'sekerka', + ['weapon_railgun'] = 'vlakovy launcher', + ['weapon_machete'] = 'maceta', + ['weapon_machinepistol'] = 'kulomet', + ['weapon_switchblade'] = 'vystrelovaci nuz', + ['weapon_revolver'] = 'tezky revolver', + ['weapon_dbshotgun'] = 'dvouhlavnova brokovnice', + ['weapon_compactrifle'] = 'kompaktni puska', + ['weapon_autoshotgun'] = 'automaticka brokovnice', + ['weapon_battleaxe'] = 'bojova sekera', + ['weapon_compactlauncher'] = 'kompaktni launcher', + ['weapon_minismg'] = 'mini smg', + ['weapon_pipebomb'] = 'dymkova bomba', + ['weapon_poolcue'] = 'kulecnikove tago', + ['weapon_wrench'] = 'klic na trubky', + ['weapon_flashlight'] = 'baterka', + ['gadget_parachute'] = 'padak', + ['weapon_flare'] = 'svetlice', + ['weapon_doubleaction'] = 'dvojhlavnovy revolver', + + -- Weapon Components + ['component_clip_default'] = 'zakladni rukojet', + ['component_clip_extended'] = 'prodloucena rukojet', + ['component_clip_drum'] = 'drum Magazine', + ['component_clip_box'] = 'krabice s naboji', + ['component_flashlight'] = 'baterka', + ['component_scope'] = 'zamerovac', + ['component_scope_advanced'] = 'pokrocily zamerovac', + ['component_suppressor'] = 'tlumic', + ['component_grip'] = 'rukojet', + ['component_luxary_finish'] = 'luxusni vzhled zbrane', + + -- Weapon Ammo + ['ammo_rounds'] = 'naboj(e)', + ['ammo_shells'] = 'patrona(y)', + ['ammo_charge'] = 'naboj(e)', + ['ammo_petrol'] = 'galonu paliva', + ['ammo_firework'] = 'ohnostroj(e)', + ['ammo_rockets'] = 'raketa(y)', + ['ammo_grenadelauncher'] = 'granat(y)', + ['ammo_grenade'] = 'granat(y)', + ['ammo_stickybomb'] = 'bomba(y)', + ['ammo_pipebomb'] = 'bomba(y)', + ['ammo_smokebomb'] = 'bomba(y)', + ['ammo_molotov'] = 'koktejl(y)', + ['ammo_proxmine'] = 'mina(y)', + ['ammo_bzgas'] = 'kanystr(y)', + ['ammo_ball'] = 'koule', + ['ammo_snowball'] = 'snehova(e) koule', + ['ammo_flare'] = 'svetlice', + ['ammo_flaregun'] = 'svetlice', + + -- Weapon Tints + ['tint_default'] = 'zakladni skin', + ['tint_green'] = 'zeleny skin', + ['tint_gold'] = 'zlaty skin', + ['tint_pink'] = 'ruzovy skin', + ['tint_army'] = 'armadni skin', + ['tint_lspd'] = 'modry skin', + ['tint_orange'] = 'oranzovy skin', + ['tint_platinum'] = 'platinovy skin', +} diff --git a/[esx]/es_extended/locales/de.lua b/[esx]/es_extended/locales/de.lua new file mode 100644 index 00000000..30ae1a18 --- /dev/null +++ b/[esx]/es_extended/locales/de.lua @@ -0,0 +1,225 @@ +Locales['de'] = { + -- Inventory + ['inventory'] = 'inventar %s / %s', + ['use'] = 'benutzen', + ['give'] = 'geben', + ['remove'] = 'entfernen', + ['return'] = 'zurück', + ['give_to'] = 'geben an', + ['amount'] = 'betrag', + ['giveammo'] = 'munition geben', + ['amountammo'] = 'anzahl der munition', + ['noammo'] = 'du hast keine munition!', + ['gave_item'] = 'du gibst ~y~%sx~s~ ~b~%s~s~ an ~y~%s~s~', + ['received_item'] = 'du empfängst ~y~%sx~s~ ~b~%s~s~ von ~b~%s~s~', + ['gave_weapon'] = 'du gibst ~b~%s~s~ an ~y~%s~s~', + ['gave_weapon_ammo'] = 'du gibst ~o~%sx %s~s~ von ~b~%s~s~ an ~y~%s~s~', + ['gave_weapon_withammo'] = 'du gibst ~b~%s~s~ mit ~o~%sx %s~s~ an ~y~%s~s~', + ['gave_weapon_hasalready'] = '~y~%s~s~ hat bereits eine(n) ~y~%s~s~', + ['gave_weapon_noweapon'] = '~y~%s~s~ hat diese Waffe nicht', + ['received_weapon'] = 'du erhälst ~b~%s~s~ von ~b~%s~s~', + ['received_weapon_ammo'] = 'du erhälst ~o~%sx %s~s~ für dein ~b~%s~s~ von ~b~%s~s~', + ['received_weapon_withammo'] = 'du erhälst ~b~%s~s~ mit ~o~%sx %s~s~ von ~b~%s~s~', + ['received_weapon_hasalready'] = '~b~%s~s~ hat versucht dir eine(n) ~y~%s~s~ zu geben, aber du hast bereits eine(n)', + ['received_weapon_noweapon'] = '~b~%s~s~ ahat versucht dir Munition für eine(n) ~y~%s~s~, aber du besitzt diese Waffe nicht', + ['gave_account_money'] = 'du gibst ~g~$%s~s~ (%s) an ~y~%s~s~', + ['received_account_money'] = 'du empfängst ~g~$%s~s~ (%s) von ~b~%s~s~', + ['amount_invalid'] = 'ungültiger Betrag', + ['players_nearby'] = 'keine Spieler in der Nähe', + ['ex_inv_lim'] = 'aktion nicht möglich, Inventarlimit überschritten für ~y~%s~s~', + ['imp_invalid_quantity'] = 'aktion nicht möglich, ungültige Anzahl', + ['imp_invalid_amount'] = 'aktion nicht möglich, ungültiger Betrag', + ['threw_standard'] = 'you threw ~y~%sx~s~ ~b~%s~s~', + ['threw_account'] = 'du wirfst ~g~$%s~s~ ~b~%s~s~ weg', + ['threw_weapon'] = 'du wirfst ~b~%s~s~ weg', + ['threw_weapon_ammo'] = 'du wirfst ~b~%s~s~ mit ~o~%sx %s~s~ weg', + ['threw_weapon_already'] = 'Du hast bereits diese Waffe', + ['threw_cannot_pickup'] = 'Du kannst das nicht aufheben, da dein Inventar voll ist', + ['threw_pickup_prompt'] = 'drücke ~y~E~s~ um aufzuheben', + + -- Key mapping + ['keymap_showinventory'] = 'inventar anzeigen', + + -- Salary related + ['received_salary'] = 'du hast dein Gehalt erhalten: ~g~$%s~s~', + ['received_help'] = 'du hast deine Sozialhilfe erhalten: ~g~$%s~s~', + ['company_nomoney'] = 'die Firma in der du angestellt bist, ist zu arm um dein Gehalt zu zahlen', + ['received_paycheck'] = 'erhaltener Gehaltsscheck', + ['bank'] = 'bank', + ['account_bank'] = 'bank', + ['account_black_money'] = 'dirty Money', + ['account_money'] = 'cash', + + ['act_imp'] = 'Aktion nicht möglich', + ['in_vehicle'] = 'du kannst keine Items in einem Fahrzeug weitergeben', + + -- Commands + ['command_car'] = 'spawn an vehicle', + ['command_car_car'] = 'vehicle spawn name or hash', + ['command_cardel'] = 'delete vehicle in proximity', + ['command_cardel_radius'] = 'optional, delete every vehicle within the specified radius', + ['command_clear'] = 'clear chat', + ['command_clearall'] = 'clear chat for all players', + ['command_clearinventory'] = 'clear player inventory', + ['command_clearloadout'] = 'clear a player loadout', + ['command_giveaccountmoney'] = 'give account money', + ['command_giveaccountmoney_account'] = 'valid account name', + ['command_giveaccountmoney_amount'] = 'amount to add', + ['command_giveaccountmoney_invalid'] = 'invalid account name', + ['command_giveitem'] = 'give an item to a player', + ['command_giveitem_item'] = 'item name', + ['command_giveitem_count'] = 'item count', + ['command_giveweapon'] = 'give a weapon to a player', + ['command_giveweapon_weapon'] = 'weapon name', + ['command_giveweapon_ammo'] = 'ammo count', + ['command_giveweapon_hasalready'] = 'player already has that weapon', + ['command_giveweaponcomponent'] = 'give weapon component', + ['command_giveweaponcomponent_component'] = 'component name', + ['command_giveweaponcomponent_invalid'] = 'invalid weapon component', + ['command_giveweaponcomponent_hasalready'] = 'player already has that weapon component', + ['command_giveweaponcomponent_missingweapon'] = 'player does not have that weapon', + ['command_save'] = 'save a player to database', + ['command_saveall'] = 'save all players to database', + ['command_setaccountmoney'] = 'set account money for a player', + ['command_setaccountmoney_amount'] = 'amount of money to set', + ['command_setcoords'] = 'teleport to coordinates', + ['command_setcoords_x'] = 'x axis', + ['command_setcoords_y'] = 'y axis', + ['command_setcoords_z'] = 'z axis', + ['command_setjob'] = 'set job for a player', + ['command_setjob_job'] = 'job name', + ['command_setjob_grade'] = 'job grade', + ['command_setjob_invalid'] = 'the job, grade or both are invalid', + ['command_setgroup'] = 'set player group', + ['command_setgroup_group'] = 'group name', + ['commanderror_argumentmismatch'] = 'argument count mismatch (passed %s, wanted %s)', + ['commanderror_argumentmismatch_number'] = 'argument #%s type mismatch (passed string, wanted number)', + ['commanderror_invaliditem'] = 'invalid item name', + ['commanderror_invalidweapon'] = 'invalid weapon', + ['commanderror_console'] = 'that command can not be run from console', + ['commanderror_invalidcommand'] = '^3%s^0 is not an valid command!', + ['commanderror_invalidplayerid'] = 'there is no player online matching that server id', + ['commandgeneric_playerid'] = 'player id', + + -- Locale settings + ['locale_digit_grouping_symbol'] = ' ', + ['locale_currency'] = '$%s', + + -- Weapons + ['weapon_knife'] = 'Messer', + ['weapon_nightstick'] = 'Schlagstock', + ['weapon_hammer'] = 'Hammer', + ['weapon_bat'] = 'Schläger', + ['weapon_golfclub'] = 'Golfschläger', + ['weapon_crowbar'] = 'Brecheisen', + ['weapon_pistol'] = 'Pistole', + ['weapon_combatpistol'] = 'Kampfpistole', + ['weapon_appistol'] = 'AP Pistole', + ['weapon_pistol50'] = 'Pistole .50', + ['weapon_microsmg'] = 'Mikro SMG', + ['weapon_smg'] = 'SMG', + ['weapon_assaultsmg'] = 'Kampf SMG', + ['weapon_assaultrifle'] = 'Kampfgewehr', + ['weapon_carbinerifle'] = 'Karabinergewehr', + ['weapon_advancedrifle'] = 'Advancedgewehr', + ['weapon_mg'] = 'MG', + ['weapon_combatmg'] = 'Kampf MG', + ['weapon_pumpshotgun'] = 'Pumpgun', + ['weapon_sawnoffshotgun'] = 'Abgesägte Schrotflinte', + ['weapon_assaultshotgun'] = 'Kampf Schrotflinte', + ['weapon_bullpupshotgun'] = 'Bullpup Schrotflinte', + ['weapon_stungun'] = 'Tazer', + ['weapon_sniperrifle'] = 'Scharfschützengewehr', + ['weapon_heavysniper'] = 'Schweres Sniper', + ['weapon_grenadelauncher'] = 'Granatwerfer', + ['weapon_rpg'] = 'RPG', + ['weapon_minigun'] = 'Minigun', + ['weapon_grenade'] = 'Granate', + ['weapon_stickybomb'] = 'Haftbombe', + ['weapon_smokegrenade'] = 'Rauchgranate', + ['weapon_bzgas'] = 'BZ Gas', + ['weapon_molotov'] = 'Molotov Cocktail', + ['weapon_fireextinguisher'] = 'Feuerlöscher', + ['weapon_petrolcan'] = 'Benzinkanister', + ['weapon_ball'] = 'Ball', + ['weapon_snspistol'] = 'SNS Pistole', + ['weapon_bottle'] = 'Flasche', + ['weapon_gusenberg'] = 'Gusenberg', + ['weapon_specialcarbine'] = 'Spezialkarabiner', + ['weapon_heavypistol'] = 'Schwere Pistole', + ['weapon_bullpuprifle'] = 'Bullpupgewehr', + ['weapon_dagger'] = 'Dolch', + ['weapon_vintagepistol'] = 'Vintage Pistole', + ['weapon_firework'] = 'Feuerwerk', + ['weapon_musket'] = 'Muskete', + ['weapon_heavyshotgun'] = 'Schwere Schrotflinte', + ['weapon_marksmanrifle'] = 'Marksmangewehr', + ['weapon_hominglauncher'] = 'Homing Launcher', + ['weapon_proxmine'] = 'Annäherungsmine', + ['weapon_snowball'] = 'Schneeball', + ['weapon_flaregun'] = 'Leuchtpistole', + ['weapon_combatpdw'] = 'Kampf PDW', + ['weapon_marksmanpistol'] = 'Marksman Pistole', + ['weapon_knuckle'] = 'Schlagring', + ['weapon_hatchet'] = 'Axt', + ['weapon_railgun'] = 'Railgun', + ['weapon_machete'] = 'Machete', + ['weapon_machinepistol'] = 'Maschinenpistole', + ['weapon_switchblade'] = 'Klappmesser', + ['weapon_revolver'] = 'Schwerer Revolver', + ['weapon_dbshotgun'] = 'Doppelläufige Schrotflinte', + ['weapon_compactrifle'] = 'Kampfgewehr', + ['weapon_autoshotgun'] = 'Auto Schrotflinte', + ['weapon_battleaxe'] = 'Kampfaxt', + ['weapon_compactlauncher'] = 'Kompakt Granatwerfer', + ['weapon_minismg'] = 'Mini SMG', + ['weapon_pipebomb'] = 'Rohrbombe', + ['weapon_poolcue'] = 'Billiard-Kö', + ['weapon_wrench'] = 'Rohrzange', + ['weapon_flashlight'] = 'Taschenlampe', + ['gadget_parachute'] = 'Fallschirm', + ['weapon_flare'] = 'Leuchtpistole', + ['weapon_doubleaction'] = 'double-Action Revolver', + + -- Weapon Components + ['component_clip_default'] = 'standart Griff', + ['component_clip_extended'] = 'erweiterter Griff', + ['component_clip_drum'] = 'trommelmagazin', + ['component_clip_box'] = 'kastenmagazin', + ['component_flashlight'] = 'taschenlampe', + ['component_scope'] = 'zielfernrohr', + ['component_scope_advanced'] = 'erweitertes Zielfernrohr', + ['component_suppressor'] = 'schalldämpfer', + ['component_grip'] = 'griff', + ['component_luxary_finish'] = 'luxus Waffen Design', + + -- Weapon Ammo + ['ammo_rounds'] = 'kugel(n)', + ['ammo_shells'] = 'schrotpatrone(n)', + ['ammo_charge'] = 'ladung', + ['ammo_petrol'] = 'liter Benzin', + ['ammo_firework'] = 'feuerwerksrakete(n)', + ['ammo_rockets'] = 'rakete(n)', + ['ammo_grenadelauncher'] = 'granate(n)', + ['ammo_grenade'] = 'granate(n)', + ['ammo_stickybomb'] = 'bombe(n)', + ['ammo_pipebomb'] = 'bombe(n)', + ['ammo_smokebomb'] = 'bombe(n)', + ['ammo_molotov'] = 'cocktail(s)', + ['ammo_proxmine'] = 'mine(n)', + ['ammo_bzgas'] = 'can(n)', + ['ammo_ball'] = 'ball', + ['ammo_snowball'] = 'schneebälle', + ['ammo_flare'] = 'signalfackel(n)', + ['ammo_flaregun'] = 'signalfackeln(munition)', + + -- Weapon Tints + ['tint_default'] = 'standard', + ['tint_green'] = 'grün', + ['tint_gold'] = 'gold', + ['tint_pink'] = 'pink', + ['tint_army'] = 'camouflage', + ['tint_lspd'] = 'blau', + ['tint_orange'] = 'orange', + ['tint_platinum'] = 'platin', +} diff --git a/[esx]/es_extended/locales/en.lua b/[esx]/es_extended/locales/en.lua new file mode 100644 index 00000000..dd086601 --- /dev/null +++ b/[esx]/es_extended/locales/en.lua @@ -0,0 +1,346 @@ +Locales['en'] = { + -- Inventory + ['inventory'] = 'inventory %s / %s', + ['use'] = 'use', + ['give'] = 'give', + ['remove'] = 'throw', + ['return'] = 'return', + ['give_to'] = 'give to', + ['amount'] = 'amount', + ['giveammo'] = 'give ammo', + ['amountammo'] = 'amount of ammo', + ['noammo'] = 'you do not have enough ammo!', + ['gave_item'] = 'you gave ~y~%sx~s~ ~b~%s~s~ to ~y~%s~s~', + ['received_item'] = 'you received ~y~%sx~s~ ~b~%s~s~ from ~b~%s~s~', + ['gave_weapon'] = 'you gave ~b~%s~s~ to ~y~%s~s~', + ['gave_weapon_ammo'] = 'you gave ~o~%sx %s~s~ for ~b~%s~s~ to ~y~%s~s~', + ['gave_weapon_withammo'] = 'you gave ~b~%s~s~ with ~o~%sx %s~s~ to ~y~%s~s~', + ['gave_weapon_hasalready'] = '~y~%s~s~ already has a ~y~%s~s~', + ['gave_weapon_noweapon'] = '~y~%s~s~ does not have that weapon', + ['received_weapon'] = 'you received ~b~%s~s~ from ~b~%s~s~', + ['received_weapon_ammo'] = 'you received ~o~%sx %s~s~ for your ~b~%s~s~ from ~b~%s~s~', + ['received_weapon_withammo'] = 'you received ~b~%s~s~ with ~o~%sx %s~s~ from ~b~%s~s~', + ['received_weapon_hasalready'] = '~b~%s~s~ attempted to give you a ~y~%s~s~, but you already have one', + ['received_weapon_noweapon'] = '~b~%s~s~ attempted to give you ammo for a ~y~%s~s~, but you dont have one', + ['gave_account_money'] = 'you gave ~g~$%s~s~ (%s) to ~y~%s~s~', + ['received_account_money'] = 'you received ~g~$%s~s~ (%s) from ~b~%s~s~', + ['amount_invalid'] = 'invalid amount', + ['players_nearby'] = 'no players nearby', + ['ex_inv_lim'] = 'action not possible, exceeding inventory limit for ~y~%s~s~', + ['imp_invalid_quantity'] = 'action impossible, invalid quantity', + ['imp_invalid_amount'] = 'action impossible, invalid amount', + ['threw_standard'] = 'you threw ~y~%sx~s~ ~b~%s~s~', + ['threw_account'] = 'you threw ~g~$%s~s~ ~b~%s~s~', + ['threw_weapon'] = 'you threw ~b~%s~s~', + ['threw_weapon_ammo'] = 'you threw ~b~%s~s~ with ~o~%sx %s~s~', + ['threw_weapon_already'] = 'you already carry the same weapon', + ['threw_cannot_pickup'] = 'you cannot pickup that because your inventory is full!', + ['threw_pickup_prompt'] = 'press ~y~E~s~ to pickup', + + -- Key mapping + ['keymap_showinventory'] = 'show Inventory', + + -- Salary related + ['received_salary'] = 'you received your salary: ~g~$%s~s~', + ['received_help'] = 'you received your welfare check: ~g~$%s~s~', + ['company_nomoney'] = 'the company you\'re employeed at is too poor to pay out your salary', + ['received_paycheck'] = 'received paycheck', + ['bank'] = 'maze Bank', + ['account_bank'] = 'bank', + ['account_black_money'] = 'dirty Money', + ['account_money'] = 'cash', + + ['act_imp'] = 'action impossible', + ['in_vehicle'] = 'you cannot give anything to someone in a vehicle', + + -- Commands + ['command_car'] = 'spawn a vehicle', + ['command_car_car'] = 'vehicle spawn name or hash', + ['command_cardel'] = 'delete vehicle in proximity', + ['command_cardel_radius'] = 'optional, delete every vehicle within the specified radius', + ['command_clear'] = 'clear chat', + ['command_clearall'] = 'clear chat for all players', + ['command_clearinventory'] = 'clear player inventory', + ['command_clearloadout'] = 'clear a player loadout', + ['command_giveaccountmoney'] = 'give account money', + ['command_giveaccountmoney_account'] = 'valid account name', + ['command_giveaccountmoney_amount'] = 'amount to add', + ['command_giveaccountmoney_invalid'] = 'invalid account name', + ['command_giveitem'] = 'give an item to a player', + ['command_giveitem_item'] = 'item name', + ['command_giveitem_count'] = 'item count', + ['command_giveweapon'] = 'give a weapon to a player', + ['command_giveweapon_weapon'] = 'weapon name', + ['command_giveweapon_ammo'] = 'ammo count', + ['command_giveweapon_hasalready'] = 'player already has that weapon', + ['command_giveweaponcomponent'] = 'give weapon component', + ['command_giveweaponcomponent_component'] = 'component name', + ['command_giveweaponcomponent_invalid'] = 'invalid weapon component', + ['command_giveweaponcomponent_hasalready'] = 'player already has that weapon component', + ['command_giveweaponcomponent_missingweapon'] = 'player does not have that weapon', + ['command_save'] = 'save a player to database', + ['command_saveall'] = 'save all players to database', + ['command_setaccountmoney'] = 'set account money for a player', + ['command_setaccountmoney_amount'] = 'amount of money to set', + ['command_setcoords'] = 'teleport to coordinates', + ['command_setcoords_x'] = 'x axis', + ['command_setcoords_y'] = 'y axis', + ['command_setcoords_z'] = 'z axis', + ['command_setjob'] = 'set job for a player', + ['command_setjob_job'] = 'job name', + ['command_setjob_grade'] = 'job grade', + ['command_setjob_invalid'] = 'the job, grade or both are invalid', + ['command_setgroup'] = 'set player group', + ['command_setgroup_group'] = 'group name', + ['commanderror_argumentmismatch'] = 'argument count mismatch (passed %s, wanted %s)', + ['commanderror_argumentmismatch_number'] = 'argument #%s type mismatch (passed string, wanted number)', + ['commanderror_invaliditem'] = 'invalid item name', + ['commanderror_invalidweapon'] = 'invalid weapon', + ['commanderror_console'] = 'that command cannot be run from console', + ['commanderror_invalidcommand'] = '^3%s^0 is not a valid command!', + ['commanderror_invalidplayerid'] = 'there is no player online matching that server id', + ['commandgeneric_playerid'] = 'player id', + + -- Locale settings + ['locale_digit_grouping_symbol'] = ',', + ['locale_currency'] = '$%s', + + -- Weapons + + -- Melee + ['weapon_dagger'] = 'Dagger', + ['weapon_bat'] = 'Bat', + ['weapon_battleaxe'] = 'Battle Axe', + ['weapon_bottle'] = 'Bottle', + ['weapon_crowbar'] = 'Crowbar', + ['weapon_flashlight'] = 'Flashlight', + ['weapon_golfclub'] = 'Golf Club', + ['weapon_hammer'] = 'Hammer', + ['weapon_hatchet'] = 'Hatchet', + ['weapon_knife'] = 'Knife', + ['weapon_knuckle'] = 'Knuckledusters', + ['weapon_machete'] = 'Machete', + ['weapon_nightstick'] = 'Nightstick', + ['weapon_wrench'] = 'Pipe Wrench', + ['weapon_poolcue'] = 'Pool Cue', + ['weapon_stone_hatchet'] = 'Stone Hatchet', + ['weapon_switchblade'] = 'Switchblade', + + -- Handguns + ['weapon_appistol'] = 'AP Pistol', + ['weapon_ceramicpistol'] = 'Ceramic Pistol', + ['weapon_combatpistol'] = 'Combat Pistol', + ['weapon_doubleaction'] = 'Double-Action Revolver', + ['weapon_navyrevolver'] = 'Navy Revolver', + ['weapon_flaregun'] = 'Flaregun', + ['weapon_gadgetpistol'] = 'Gadget Pistol', + ['weapon_heavypistol'] = 'Heavy Pistol', + ['weapon_revolver'] = 'Heavy Revolver', + ['weapon_revolver_mk2'] = 'Heavy Revolver MK2', + ['weapon_marksmanpistol'] = 'Marksman Pistol', + ['weapon_pistol'] = 'Pistol', + ['weapon_pistol_mk2'] = 'Pistol MK2', + ['weapon_pistol50'] = 'Pistol .50', + ['weapon_snspistol'] = 'SNS Pistol', + ['weapon_snspistol_mk2'] = 'SNS Pistol MK2', + ['weapon_stungun'] = 'Taser', + ['weapon_raypistol'] = 'Up-N-Atomizer', + ['weapon_vintagepistol'] = 'Vintage Pistol', + + -- Shotguns + ['weapon_assaultshotgun'] = 'Assault Shotgun', + ['weapon_autoshotgun'] = 'Auto Shotgun', + ['weapon_bullpupshotgun'] = 'Bullpup Shotgun', + ['weapon_combatshotgun'] = 'Combat Shotgun', + ['weapon_dbshotgun'] = 'Double Barrel Shotgun', + ['weapon_heavyshotgun'] = 'Heavy Shotgun', + ['weapon_musket'] = 'Musket', + ['weapon_pumpshotgun'] = 'Pump Shotgun', + ['weapon_pumpshotgun_mk2'] = 'Pump Shotgun MK2', + ['weapon_sawnoffshotgun'] = 'Sawed Off Shotgun', + + -- SMG & LMG + ['weapon_assaultsmg'] = 'Assault SMG', + ['weapon_combatmg'] = 'Combat MG', + ['weapon_combatmg'] = 'Combat MG MK2', + ['weapon_combatpdw'] = 'Combat PDW', + ['weapon_gusenberg'] = 'Gusenberg Sweeper', + ['weapon_machinepistol'] = 'Machine Pistol', + ['weapon_mg'] = 'MG', + ['weapon_microsmg'] = 'Micro SMG', + ['weapon_minismg'] = 'Mini SMG', + ['weapon_smg'] = 'SMG', + ['weapon_smg_mk2'] = 'SMG MK2', + ['weapon_raycarbine'] = 'Unholy Hellbringer', + + -- Rifles + ['weapon_advancedrifle'] = 'Advanced Rifle', + ['weapon_assaultrifle'] = 'Assault Rifle', + ['weapon_assaultrifle_mk2'] = 'Assault Rifle MK2', + ['weapon_bullpuprifle'] = 'Bullpup Rifle', + ['weapon_bullpuprifle_mk2'] = 'Bullpup Rifle MK2', + ['weapon_carbinerifle'] = 'Carbine Rifle', + ['weapon_carbinerifle_mk2'] = 'Carbine Rifle MK2', + ['weapon_compactrifle'] = 'Compact Rifle', + ['weapon_militaryrifle'] = 'Military Rifle', + ['weapon_specialcarbine'] = 'Special Carbine', + ['weapon_specialcarbine_mk2'] = 'Special Carbine MK2', + + -- Sniper + ['weapon_heavysniper'] = 'Heavy Sniper', + ['weapon_heavysniper_mk2'] = 'Heavy Sniper MK2', + ['weapon_marksmanrifle'] = 'Marksman Rifle', + ['weapon_marksmanrifle_mk2'] = 'Marksman Rifle MK2', + ['weapon_sniperrifle'] = 'Sniper Rifle', + + -- Heavy / Launchers + ['weapon_compactlauncher'] = 'Compact Launcher', + ['weapon_firework'] = 'Firework Launcher', + ['weapon_grenadelauncher'] = 'Grenade Launcher', + ['weapon_hominglauncher'] = 'Homing Launcher', + ['weapon_minigun'] = 'Minigun', + ['weapon_railgun'] = 'Railgun', + ['weapon_rpg'] = 'Rocket Launcher', + ['weapon_rayminigun'] = 'Widowmaker', + + -- Thrown + ['weapon_ball'] = 'Baseball', + ['weapon_bzgas'] = 'BZ Gas', + ['weapon_flare'] = 'Flare', + ['weapon_grenade'] = 'Grenade', + ['weapon_petrolcan'] = 'Jerrycan', + ['weapon_hazardcan'] = 'Hazardous Jerrycan', + ['weapon_molotov'] = 'Molotov Cocktail', + ['weapon_proxmine'] = 'Proximity Mine', + ['weapon_pipebomb'] = 'Pipe Bomb', + ['weapon_snowball'] = 'Snowball', + ['weapon_stickybomb'] = 'Sticky Bomb', + ['weapon_smokegrenade'] = 'Tear Gas', + + -- Special + ['weapon_fireextinguisher'] = 'Fire Extinguisher', + ['weapon_digiscanner'] = 'Digital Scanner', + ['weapon_garbagebag'] = 'Garbage Bag', + ['weapon_handcuffs'] = 'Handcuffs', + ['gadget_nightvision'] = 'Night Vision', + ['gadget_parachute'] = 'parachute', + + -- Weapon Components + ['component_knuckle_base'] = 'base Model', + ['component_knuckle_pimp'] = 'the Pimp', + ['component_knuckle_ballas'] = 'the Ballas', + ['component_knuckle_dollar'] = 'the Hustler', + ['component_knuckle_diamond'] = 'the Rock', + ['component_knuckle_hate'] = 'the Hater', + ['component_knuckle_love'] = 'the Lover', + ['component_knuckle_player'] = 'the Player', + ['component_knuckle_king'] = 'the King', + ['component_knuckle_vagos'] = 'the Vagos', + + ['component_luxary_finish'] = 'luxary Weapon Finish', + + ['component_handle_default'] = 'default Handle', + ['component_handle_vip'] = 'vIP Handle', + ['component_handle_bodyguard'] = 'bodyguard Handle', + + ['component_vip_finish'] = 'vIP Finish', + ['component_bodyguard_finish'] = 'bodyguard Finish', + + ['component_camo_finish'] = 'digital Camo', + ['component_camo_finish2'] = 'brushstroke Camo', + ['component_camo_finish3'] = 'woodland Camo', + ['component_camo_finish4'] = 'skull Camo', + ['component_camo_finish5'] = 'sessanta Nove Camo', + ['component_camo_finish6'] = 'perseus Camo', + ['component_camo_finish7'] = 'leopard Camo', + ['component_camo_finish8'] = 'zebra Camo', + ['component_camo_finish9'] = 'geometric Camo', + ['component_camo_finish10'] = 'boom Camo', + ['component_camo_finish11'] = 'patriotic Camo', + + ['component_camo_slide_finish'] = 'digital Slide Camo', + ['component_camo_slide_finish2'] = 'brushstroke Slide Camo', + ['component_camo_slide_finish3'] = 'woodland Slide Camo', + ['component_camo_slide_finish4'] = 'skull Slide Camo', + ['component_camo_slide_finish5'] = 'sessanta Nove Slide Camo', + ['component_camo_slide_finish6'] = 'perseus Slide Camo', + ['component_camo_slide_finish7'] = 'leopard Slide Camo', + ['component_camo_slide_finish8'] = 'zebra Slide Camo', + ['component_camo_slide_finish9'] = 'geometric Slide Camo', + ['component_camo_slide_finish10'] = 'boom Slide Camo', + ['component_camo_slide_finish11'] = 'patriotic Slide Camo', + + ['component_clip_default'] = 'default Magazine', + ['component_clip_extended'] = 'extended Magazine', + ['component_clip_drum'] = 'drum Magazine', + ['component_clip_box'] = 'box Magazine', + + ['component_scope_holo'] = 'holographic Scope', + ['component_scope_small'] = 'small Scope', + ['component_scope_medium'] = 'medium Scope', + ['component_scope_large'] = 'large Scope', + ['component_scope'] = 'mounted Scope', + ['component_scope_advanced'] = 'advanced Scope', + ['component_ironsights'] = 'ironsights', + + ['component_suppressor'] = 'suppressor', + ['component_compensator'] = 'compensator', + + ['component_muzzle_flat'] = 'flat Muzzle Brake', + ['component_muzzle_tactical'] = 'tactical Muzzle Brake', + ['component_muzzle_fat'] = 'fat-End Muzzle Brake', + ['component_muzzle_precision'] = 'precision Muzzle Brake', + ['component_muzzle_heavy'] = 'heavy Duty Muzzle Brake', + ['component_muzzle_slanted'] = 'slanted Muzzle Brake', + ['component_muzzle_split'] = 'split-End Muzzle Brake', + ['component_muzzle_squared'] = 'squared Muzzle Brake', + + ['component_flashlight'] = 'flashlight', + ['component_grip'] = 'grip', + + ['component_barrel_default'] = 'default Barrel', + ['component_barrel_heavy'] = 'heavy Barrel', + + ['component_ammo_tracer'] = 'tracer Ammo', + ['component_ammo_incendiary'] = 'incendiary Ammo', + ['component_ammo_hollowpoint'] = 'hollowpoint Ammo', + ['component_ammo_fmj'] = 'fMJ Ammo', + ['component_ammo_armor'] = 'armor Piercing Ammo', + ['component_ammo_explosive'] = 'armor Piercing Incendiary Ammo', + + ['component_shells_default'] = 'default Shells', + ['component_shells_incendiary'] = 'dragons Breath Shells', + ['component_shells_armor'] = 'steel Buckshot Shells', + ['component_shells_hollowpoint'] = 'flechette Shells', + ['component_shells_explosive'] = 'explosive Slug Shells', + + -- Weapon Ammo + ['ammo_rounds'] = 'round(s)', + ['ammo_shells'] = 'shell(s)', + ['ammo_charge'] = 'charge', + ['ammo_petrol'] = 'gallons of fuel', + ['ammo_firework'] = 'firework(s)', + ['ammo_rockets'] = 'rocket(s)', + ['ammo_grenadelauncher'] = 'grenade(s)', + ['ammo_grenade'] = 'grenade(s)', + ['ammo_stickybomb'] = 'bomb(s)', + ['ammo_pipebomb'] = 'bomb(s)', + ['ammo_smokebomb'] = 'bomb(s)', + ['ammo_molotov'] = 'cocktail(s)', + ['ammo_proxmine'] = 'mine(s)', + ['ammo_bzgas'] = 'can(s)', + ['ammo_ball'] = 'ball(s)', + ['ammo_snowball'] = 'snowball(s)', + ['ammo_flare'] = 'flare(s)', + ['ammo_flaregun'] = 'flare(s)', + + -- Weapon Tints + ['tint_default'] = 'default skin', + ['tint_green'] = 'green skin', + ['tint_gold'] = 'gold skin', + ['tint_pink'] = 'pink skin', + ['tint_army'] = 'army skin', + ['tint_lspd'] = 'blue skin', + ['tint_orange'] = 'orange skin', + ['tint_platinum'] = 'platinum skin', +} diff --git a/[esx]/es_extended/locales/fi.lua b/[esx]/es_extended/locales/fi.lua new file mode 100644 index 00000000..e69271b8 --- /dev/null +++ b/[esx]/es_extended/locales/fi.lua @@ -0,0 +1,225 @@ +Locales['fi'] = { + -- Inventory + ['inventory'] = 'reppu %s / %s', + ['use'] = 'käytä', + ['give'] = 'anna', + ['remove'] = 'poista', + ['return'] = 'takaisin', + ['give_to'] = 'give to', + ['amount'] = 'määrä', + ['giveammo'] = 'anna ammuksia', + ['amountammo'] = 'ammusten määrä', + ['noammo'] = 'sinulla ei ole ammuksia!', + ['gave_item'] = 'sinä annoit ~y~%sx~s~ ~b~%s~s~ henkilölle ~y~%s~s~', + ['received_item'] = 'sinä sait ~y~%sx~s~ ~b~%s~s~ henkilöltä ~b~%s~s~', + ['gave_weapon'] = 'you gave ~y~1x~s~ ~b~%s~s~ to ~y~%s~s~', + ['gave_weapon_ammo'] = 'you gave ~o~%sx %s~s~ for ~b~%s~s~ to ~y~%s~s~', + ['gave_weapon_withammo'] = 'you gave ~y~1x~s~ ~b~%s~s~ with ~o~%sx %s~s~ to ~y~%s~s~', + ['gave_weapon_hasalready'] = '~y~%s~s~ already have an ~y~%s~s~', + ['gave_weapon_noweapon'] = '~y~%s~s~ does not have that weapon', + ['received_weapon'] = 'you received ~y~1x~s~ ~b~%s~s~ from ~b~%s~s~', + ['received_weapon_ammo'] = 'you received ~o~%sx %s~s~ for your ~b~%s~s~ from ~b~%s~s~', + ['received_weapon_withammo'] = 'you received ~y~1x~s~ ~b~%s~s~ with ~o~%sx %s~s~ from ~b~%s~s~', + ['received_weapon_hasalready'] = '~b~%s~s~ attempted to give you an ~y~%s~s~, but you already have one', + ['received_weapon_noweapon'] = '~b~%s~s~ attempted to give you ammo for an ~y~%s~s~, but you dont have one', + ['gave_account_money'] = 'sinä annoit ~g~$%s~s~ (%s) henkilölle ~y~%s~s~', + ['received_account_money'] = 'sinä sait ~g~$%s~s~ (%s) henkilöltä ~b~%s~s~', + ['amount_invalid'] = 'virheellinen määrä', + ['players_nearby'] = 'ei pelaajia lähettyvillä', + ['ex_inv_lim'] = 'toiminto mahdoton, reppu alkaa olla täysi ~y~%s~s~', + ['imp_invalid_quantity'] = 'toiminto mahdoton, virheellinen määrä', + ['imp_invalid_amount'] = 'toiminto mahdoton, virhellinen summa', + ['threw_standard'] = 'you threw ~y~%sx~s~ ~b~%s~s~', + ['threw_account'] = 'you threw ~g~$%s~s~ ~b~%s~s~', + ['threw_weapon'] = 'you threw ~y~1x~s~ ~b~%s~s~', + ['threw_weapon_ammo'] = 'you threw ~y~1x~s~ ~b~%s~s~ with ~o~%sx %s~s~', + ['threw_weapon_already'] = 'you already carry the same weapon', + ['threw_cannot_pickup'] = 'you cannot pickup that because your inventory is full!', + ['threw_pickup_prompt'] = 'press ~y~E~s~ to pickup', + + -- Key mapping + ['keymap_showinventory'] = 'show Inventory', + + -- Salary related + ['received_salary'] = 'sinä vastaanotit palkkaa: ~g~$%s~s~', + ['received_help'] = 'sinä vastaanotit valtion tukea: ~g~$%s~s~', + ['company_nomoney'] = 'yritys jolle teet töitä on köyhä eikä voi maksaa palkkaasi', + ['received_paycheck'] = 'sait palkan', + ['bank'] = 'pankki', + ['account_bank'] = 'bank', + ['account_black_money'] = 'dirty Money', + ['account_money'] = 'cash', + + ['act_imp'] = 'toiminto mahdoton', + ['in_vehicle'] = 'et voi antaa ajoneuvossa olevalle mitään', + + -- Commands + ['command_car'] = 'spawn an vehicle', + ['command_car_car'] = 'vehicle spawn name or hash', + ['command_cardel'] = 'delete vehicle in proximity', + ['command_cardel_radius'] = 'optional, delete every vehicle within the specified radius', + ['command_clear'] = 'clear chat', + ['command_clearall'] = 'clear chat for all players', + ['command_clearinventory'] = 'clear player inventory', + ['command_clearloadout'] = 'clear a player loadout', + ['command_giveaccountmoney'] = 'give account money', + ['command_giveaccountmoney_account'] = 'valid account name', + ['command_giveaccountmoney_amount'] = 'amount to add', + ['command_giveaccountmoney_invalid'] = 'invalid account name', + ['command_giveitem'] = 'give an item to a player', + ['command_giveitem_item'] = 'item name', + ['command_giveitem_count'] = 'item count', + ['command_giveweapon'] = 'give a weapon to a player', + ['command_giveweapon_weapon'] = 'weapon name', + ['command_giveweapon_ammo'] = 'ammo count', + ['command_giveweapon_hasalready'] = 'player already has that weapon', + ['command_giveweaponcomponent'] = 'give weapon component', + ['command_giveweaponcomponent_component'] = 'component name', + ['command_giveweaponcomponent_invalid'] = 'invalid weapon component', + ['command_giveweaponcomponent_hasalready'] = 'player already has that weapon component', + ['command_giveweaponcomponent_missingweapon'] = 'player does not have that weapon', + ['command_save'] = 'save a player to database', + ['command_saveall'] = 'save all players to database', + ['command_setaccountmoney'] = 'set account money for a player', + ['command_setaccountmoney_amount'] = 'amount of money to set', + ['command_setcoords'] = 'teleport to coordinates', + ['command_setcoords_x'] = 'x axis', + ['command_setcoords_y'] = 'y axis', + ['command_setcoords_z'] = 'z axis', + ['command_setjob'] = 'set job for a player', + ['command_setjob_job'] = 'job name', + ['command_setjob_grade'] = 'job grade', + ['command_setjob_invalid'] = 'the job, grade or both are invalid', + ['command_setgroup'] = 'set player group', + ['command_setgroup_group'] = 'group name', + ['commanderror_argumentmismatch'] = 'argument count mismatch (passed %s, wanted %s)', + ['commanderror_argumentmismatch_number'] = 'argument #%s type mismatch (passed string, wanted number)', + ['commanderror_invaliditem'] = 'invalid item name', + ['commanderror_invalidweapon'] = 'invalid weapon', + ['commanderror_console'] = 'that command can not be run from console', + ['commanderror_invalidcommand'] = '^3%s^0 is not an valid command!', + ['commanderror_invalidplayerid'] = 'there is no player online matching that server id', + ['commandgeneric_playerid'] = 'player id', + + -- Locale settings + ['locale_digit_grouping_symbol'] = ' ', + ['locale_currency'] = '$%s', + + -- Weapons + ['weapon_knife'] = 'veitsi', + ['weapon_nightstick'] = 'pamppu', + ['weapon_hammer'] = 'vasara', + ['weapon_bat'] = 'pesäpallomaila', + ['weapon_golfclub'] = 'golf maila', + ['weapon_crowbar'] = 'sorkkarauta', + ['weapon_pistol'] = 'pistooli', + ['weapon_combatpistol'] = 'taistelu pistooli', + ['weapon_appistol'] = 'automaatti pistooli', + ['weapon_pistol50'] = '50 kaliiperinen pistooli', + ['weapon_microsmg'] = 'mikro konepistooli', + ['weapon_smg'] = 'konepistooli', + ['weapon_assaultsmg'] = 'rynnäkkö konepistooli', + ['weapon_assaultrifle'] = 'rynnäkkökivääri', + ['weapon_carbinerifle'] = 'karbiini kivääri', + ['weapon_advancedrifle'] = 'edistynyt kivääri', + ['weapon_mg'] = 'konekivääri', + ['weapon_combatmg'] = 'rynnäkkö konekivääri', + ['weapon_pumpshotgun'] = 'pumppu haulikko', + ['weapon_sawnoffshotgun'] = 'katkaistuhaulikko', + ['weapon_assaultshotgun'] = 'hyökkäyshaulikko', + ['weapon_bullpupshotgun'] = 'bullpup haulikko', + ['weapon_stungun'] = 'tainutusase', + ['weapon_sniperrifle'] = 'tarkkuuskivääri', + ['weapon_heavysniper'] = 'raskas tarkkuuskivääri', + ['weapon_grenadelauncher'] = 'kranaatinheitin', + ['weapon_rpg'] = 'raketinheitin', + ['weapon_minigun'] = 'minigun', + ['weapon_grenade'] = 'kranaatti', + ['weapon_stickybomb'] = 'tahma pommi', + ['weapon_smokegrenade'] = 'savu kranaatti', + ['weapon_bzgas'] = 'bz-kaasu', + ['weapon_molotov'] = 'polttopullo', + ['weapon_fireextinguisher'] = 'palosammutin', + ['weapon_petrolcan'] = 'jerrykannu', + ['weapon_ball'] = 'pallo', + ['weapon_snspistol'] = 'pienpistooli', + ['weapon_bottle'] = 'pullo', + ['weapon_gusenberg'] = 'tommy gun', + ['weapon_specialcarbine'] = 'G86C', + ['weapon_heavypistol'] = 'raskas pistooli', + ['weapon_bullpuprifle'] = 'bullpup kivääri', + ['weapon_dagger'] = 'tikari', + ['weapon_vintagepistol'] = 'vanha pistooli', + ['weapon_firework'] = 'ilotulitus', + ['weapon_musket'] = 'musketti', + ['weapon_heavyshotgun'] = 'raskas haulikko', + ['weapon_marksmanrifle'] = 'marksman kivääri', + ['weapon_hominglauncher'] = 'ohjautuva raketinheitin', + ['weapon_proxmine'] = 'lähellä räjähtävä miina', + ['weapon_snowball'] = 'lumipallo', + ['weapon_flaregun'] = 'valopyssy', + ['weapon_combatpdw'] = 'rynnäkkö pdw', + ['weapon_marksmanpistol'] = 'marksman pistooli', + ['weapon_knuckle'] = 'nyrkkirauta', + ['weapon_hatchet'] = 'kirves', + ['weapon_railgun'] = 'raidetykki', + ['weapon_machete'] = 'viidakkoveitsi', + ['weapon_machinepistol'] = 'konepistooli', + ['weapon_switchblade'] = 'stiletti', + ['weapon_revolver'] = 'raskas revolveri', + ['weapon_dbshotgun'] = 'kakspiippunen haulikko', + ['weapon_compactrifle'] = 'pikku AK', + ['weapon_autoshotgun'] = 'automaattinen haulikko', + ['weapon_battleaxe'] = 'Taistelukirves', + ['weapon_compactlauncher'] = 'pien kranaatinheitin', + ['weapon_minismg'] = 'mini konepistooli', + ['weapon_pipebomb'] = 'putkipommi', + ['weapon_poolcue'] = 'biljardimaila', + ['weapon_wrench'] = 'putkipihdit', + ['weapon_flashlight'] = 'taskulamppu', + ['gadget_parachute'] = 'laskuvarjo', + ['weapon_flare'] = 'hätäraketti', + ['weapon_doubleaction'] = 'double-Action Revolver', + + -- Weapon Components + ['component_clip_default'] = 'default Clip', + ['component_clip_extended'] = 'extended Clip', + ['component_clip_drum'] = 'drum Magazine', + ['component_clip_box'] = 'box Magazine', + ['component_flashlight'] = 'flashlight', + ['component_scope'] = 'scope', + ['component_scope_advanced'] = 'advanced Scope', + ['component_suppressor'] = 'suppressor', + ['component_grip'] = 'grip', + ['component_luxary_finish'] = 'luxary Weapon Finish', + + -- Weapon Ammo + ['ammo_rounds'] = 'round(s)', + ['ammo_shells'] = 'shell(s)', + ['ammo_charge'] = 'charge', + ['ammo_petrol'] = 'gallons of fuel', + ['ammo_firework'] = 'firework(s)', + ['ammo_rockets'] = 'rocket(s)', + ['ammo_grenadelauncher'] = 'grenade(s)', + ['ammo_grenade'] = 'grenade(s)', + ['ammo_stickybomb'] = 'bomb(s)', + ['ammo_pipebomb'] = 'bomb(s)', + ['ammo_smokebomb'] = 'bomb(s)', + ['ammo_molotov'] = 'cocktail(s)', + ['ammo_proxmine'] = 'mine(s)', + ['ammo_bzgas'] = 'can(s)', + ['ammo_ball'] = 'ball(s)', + ['ammo_snowball'] = 'snowball(s)', + ['ammo_flare'] = 'flare(s)', + ['ammo_flaregun'] = 'flare(s)', + + -- Weapon Tints + ['tint_default'] = 'default skin', + ['tint_green'] = 'green skin', + ['tint_gold'] = 'gold skin', + ['tint_pink'] = 'pink skin', + ['tint_army'] = 'army skin', + ['tint_lspd'] = 'blue skin', + ['tint_orange'] = 'orange skin', + ['tint_platinum'] = 'platinum skin', +} diff --git a/[esx]/es_extended/locales/fr.lua b/[esx]/es_extended/locales/fr.lua new file mode 100644 index 00000000..7512e33b --- /dev/null +++ b/[esx]/es_extended/locales/fr.lua @@ -0,0 +1,225 @@ +Locales['fr'] = { + -- Inventory + ['inventory'] = 'inventaire %s / %s', + ['use'] = 'utiliser', + ['give'] = 'donner', + ['remove'] = 'jeter', + ['return'] = 'retour', + ['give_to'] = 'donner à', + ['amount'] = 'quantité', + ['giveammo'] = 'donner munitions', + ['amountammo'] = 'nombre de munitions', + ['noammo'] = 'tu n\'as pas toutes ces munitions!', + ['gave_item'] = 'vous avez donné ~y~%sx~s~ ~b~%s~s~ à ~y~%s~s~', + ['received_item'] = 'vous avez reçu ~y~%sx~s~ ~b~%s~s~ par ~b~%s~s~', + ['gave_weapon'] = 'vous avez donné ~y~1x~s~ ~b~%s~s~ à ~y~%s~s~', + ['gave_weapon_ammo'] = 'vous avez donné ~o~%sx %s~s~ pour ~b~%s~s~ à ~y~%s~s~', + ['gave_weapon_withammo'] = 'vous avez donné ~y~1x~s~ ~b~%s~s~ avec ~o~%sx %s~s~ à ~y~%s~s~', + ['gave_weapon_hasalready'] = '~y~%s~s~ a déjà ~y~%s~s~', + ['gave_weapon_noweapon'] = '~y~%s~s~ n\'a pas cette arme', + ['received_weapon'] = 'vous recevez ~y~1x~s~ ~b~%s~s~ de ~b~%s~s~', + ['received_weapon_ammo'] = 'vous avez reçu ~o~%sx %s~s~ pour votre ~b~%s~s~ de ~b~%s~s~', + ['received_weapon_withammo'] = 'vous avez reçu ~y~1x~s~ ~b~%s~s~ avec ~o~%sx %s~s~ de ~b~%s~s~', + ['received_weapon_hasalready'] = '~b~%s~s~ a tenté de vous donner ~y~%s~s~, mais vous en aviez déjà un exemplaire', + ['received_weapon_noweapon'] = '~b~%s~s~ tente de vous donner des munitions pour ~y~%s~s~, mais vous n\'en avez pas', + ['gave_account_money'] = 'vous avez donné ~g~$%s~s~ (%s) à ~y~%s~s~', + ['received_account_money'] = 'vous avez reçu ~g~$%s~s~ (%s) par ~b~%s~s~', + ['amount_invalid'] = 'montant invalide', + ['players_nearby'] = 'aucun joueur à proximité', + ['ex_inv_lim'] = 'action impossible, depassement de la limite d\'inventaire pour ~y~%s~s~', + ['imp_invalid_quantity'] = 'action impossible, ~r~quantité invalide', + ['imp_invalid_amount'] = 'action impossible, ~r~montant invalide', + ['threw_standard'] = 'vous avez jeté ~y~%sx~s~ ~b~%s~s~', + ['threw_account'] = 'vous avez jeté ~g~$%s~s~ ~b~%s~s~', + ['threw_weapon'] = 'vous avez jeté ~y~1x~s~ ~b~%s~s~', + ['threw_weapon_ammo'] = 'vous avez jeté ~y~1x~s~ ~b~%s~s~ avec ~o~%sx %s~s~', + ['threw_weapon_already'] = 'vous portez déjà cette arme', + ['threw_cannot_pickup'] = 'vous ne pouvez pas ramasser ça votre inventaire est plein !', + ['threw_pickup_prompt'] = 'appuyez sur ~y~E~s~ pour ramasser', + + -- Key mapping + ['keymap_showinventory'] = 'montrer l\'inventaire', + + -- Salary related + ['received_salary'] = 'vous avez reçu votre salaire: ~g~$%s~s~', + ['received_help'] = 'vous avez reçu une aide de l\'état: ~g~$%s~s~', + ['company_nomoney'] = 'votre entreprise n\'a plus d\'argent pour vous payer!', + ['received_paycheck'] = 'paiement reçu', + ['bank'] = 'banque', + ['account_bank'] = 'banque', + ['account_black_money'] = 'argent sale', + ['account_money'] = 'espèces', + + ['act_imp'] = 'action impossible', + ['in_vehicle'] = 'Vous ne pouvez rien donner à quelqu\'un dans un véhicule', + + -- Commands + ['command_car'] = 'faire appaitre un véhicule', + ['command_car_car'] = 'nom ou hash du véhicule', + ['command_cardel'] = 'supprimer le véhicule à proximité', + ['command_cardel_radius'] = 'optionnel, supprime les véhicules dans un rayon spécifié', + ['command_clear'] = 'vider le chat', + ['command_clearall'] = 'vider le chat pour tous', + ['command_clearinventory'] = 'vider l\'inventaire d\'un joueur', + ['command_clearloadout'] = 'vider le loadout d\'un joueur', + ['command_giveaccountmoney'] = 'donner de l\'argent sur un compte', + ['command_giveaccountmoney_account'] = 'nom de compte valide', + ['command_giveaccountmoney_amount'] = 'quantité à ajouter', + ['command_giveaccountmoney_invalid'] = 'nom de compte invalide', + ['command_giveitem'] = 'donner un objet à un joueur', + ['command_giveitem_item'] = 'nom de l\'objet', + ['command_giveitem_count'] = 'quantité de l\'objet', + ['command_giveweapon'] = 'donner une arme à un joueur', + ['command_giveweapon_weapon'] = 'nom de l\'arme', + ['command_giveweapon_ammo'] = 'quantité de munitions', + ['command_giveweapon_hasalready'] = 'le joueur a déjà cette arme', + ['command_giveweaponcomponent'] = 'donner un accessoire d\'arme', + ['command_giveweaponcomponent_component'] = 'nom de l\'accessoire', + ['command_giveweaponcomponent_invalid'] = 'accessoire invalide', + ['command_giveweaponcomponent_hasalready'] = 'le joueur a déjà cet accessoire', + ['command_giveweaponcomponent_missingweapon'] = 'le joueur n\'a pas cette arme', + ['command_save'] = 'sauvegarder un joueur dans la base de données', + ['command_saveall'] = 'sauvegarder tous les joueurs dans la base de données', + ['command_setaccountmoney'] = 'définir la somme d\'argent pour un joueur', + ['command_setaccountmoney_amount'] = 'quantité d\'argent à définir', + ['command_setcoords'] = 'se téléporter aux coordonnées', + ['command_setcoords_x'] = 'axe X', + ['command_setcoords_y'] = 'axe Y', + ['command_setcoords_z'] = 'axe Z', + ['command_setjob'] = 'assigner job à un joueur', + ['command_setjob_job'] = 'nom du job', + ['command_setjob_grade'] = 'grade du job', + ['command_setjob_invalid'] = 'le job, le grade ou les deux sont invalides', + ['command_setgroup'] = 'assigner un groupe à un joueur', + ['command_setgroup_group'] = 'nom du groupe', + ['commanderror_argumentmismatch'] = 'argument count mismatch (passed %s, wanted %s)', + ['commanderror_argumentmismatch_number'] = 'argument #%s type mismatch (passed string, wanted number)', + ['commanderror_invaliditem'] = 'nom de l\'objet invalide', + ['commanderror_invalidweapon'] = 'arme invalide', + ['commanderror_console'] = 'cette commande ne peut pas être utilisée dans la console', + ['commanderror_invalidcommand'] = '^3%s^0 n\'est pas une commande valide!', + ['commanderror_invalidplayerid'] = 'il n\'ya aucun joueur avec cet ID en jeu', + ['commandgeneric_playerid'] = 'id joueur', + + -- Locale settings + ['locale_digit_grouping_symbol'] = ' ', + ['locale_currency'] = '$%s', + + -- Weapons + ['weapon_knife'] = 'couteau', + ['weapon_nightstick'] = 'matraque', + ['weapon_hammer'] = 'marteau', + ['weapon_bat'] = 'batte', + ['weapon_golfclub'] = 'club de golf', + ['weapon_crowbar'] = 'pied de biche', + ['weapon_pistol'] = 'pistolet', + ['weapon_combatpistol'] = 'pistolet de combat', + ['weapon_appistol'] = 'pistolet automatique', + ['weapon_pistol50'] = 'pistolet calibre 50', + ['weapon_microsmg'] = 'micro smg', + ['weapon_smg'] = 'smg', + ['weapon_assaultsmg'] = 'smg d\'assaut', + ['weapon_assaultrifle'] = 'fusil d\'assaut', + ['weapon_carbinerifle'] = 'carabine d\'assaut', + ['weapon_advancedrifle'] = 'fusil avancé', + ['weapon_mg'] = 'mitrailleuse', + ['weapon_combatmg'] = 'mitrailleuse de combat', + ['weapon_pumpshotgun'] = 'fusil à pompe', + ['weapon_sawnoffshotgun'] = 'carabine à canon scié', + ['weapon_assaultshotgun'] = 'carabine d\'assaut', + ['weapon_bullpupshotgun'] = 'carabine bullpup', + ['weapon_stungun'] = 'tazer', + ['weapon_sniperrifle'] = 'fusil de sniper', + ['weapon_heavysniper'] = 'fusil de sniper lourd', + ['weapon_grenadelauncher'] = 'lance-grenade', + ['weapon_rpg'] = 'lance-rocket', + ['weapon_minigun'] = 'minigun', + ['weapon_grenade'] = 'grenade', + ['weapon_stickybomb'] = 'bombe collante', + ['weapon_smokegrenade'] = 'grenade fumigène', + ['weapon_bzgas'] = 'grenade à gaz bz', + ['weapon_molotov'] = 'cocktail molotov', + ['weapon_fireextinguisher'] = 'extincteur', + ['weapon_petrolcan'] = 'jerrican d\'essence', + ['weapon_ball'] = 'balle', + ['weapon_snspistol'] = 'pistolet sns', + ['weapon_bottle'] = 'bouteille', + ['weapon_gusenberg'] = 'balayeuse gusenberg', + ['weapon_specialcarbine'] = 'carabine spéciale', + ['weapon_heavypistol'] = 'pistolet lourd', + ['weapon_bullpuprifle'] = 'fusil bullpup', + ['weapon_dagger'] = 'poignard', + ['weapon_vintagepistol'] = 'pistolet vintage', + ['weapon_firework'] = 'feu d\'artifice', + ['weapon_musket'] = 'mousquet', + ['weapon_heavyshotgun'] = 'fusil à pompe lourd', + ['weapon_marksmanrifle'] = 'fusil marksman', + ['weapon_hominglauncher'] = 'lance tête-chercheuse', + ['weapon_proxmine'] = 'mine de proximité', + ['weapon_snowball'] = 'boule de neige', + ['weapon_flaregun'] = 'lance fusée de détresse', + ['weapon_combatpdw'] = 'arme de défense personnelle', + ['weapon_marksmanpistol'] = 'pistolet marksman', + ['weapon_knuckle'] = 'poing américain', + ['weapon_hatchet'] = 'hachette', + ['weapon_railgun'] = 'canon éléctrique', + ['weapon_machete'] = 'machette', + ['weapon_machinepistol'] = 'pistolet mitrailleur', + ['weapon_switchblade'] = 'couteau à cran d\'arrêt', + ['weapon_revolver'] = 'revolver', + ['weapon_dbshotgun'] = 'fusil à pompe double canon', + ['weapon_compactrifle'] = 'fusil compact', + ['weapon_autoshotgun'] = 'fusil à pompe automatique', + ['weapon_battleaxe'] = 'hache de combat', + ['weapon_compactlauncher'] = 'lanceur compact', + ['weapon_minismg'] = 'mini smg', + ['weapon_pipebomb'] = 'bombe tuyau', + ['weapon_poolcue'] = 'queue de billard', + ['weapon_wrench'] = 'clé', + ['weapon_flashlight'] = 'lampe torche', + ['gadget_parachute'] = 'parachute', + ['weapon_flare'] = 'fusée de détresse', + ['weapon_doubleaction'] = 'revolver double action', + + -- Weapon Components + ['component_clip_default'] = 'chargeur par défaut', + ['component_clip_extended'] = 'chargeur grande capacité', + ['component_clip_drum'] = 'chargeur tambour', + ['component_clip_box'] = 'chargeur très grande capacité', + ['component_flashlight'] = 'torche', + ['component_scope'] = 'viseur', + ['component_scope_advanced'] = 'lunette', + ['component_suppressor'] = 'réducteur de son', + ['component_grip'] = 'poignée', + ['component_luxary_finish'] = 'finition de luxe', + + -- Weapon Ammo + ['ammo_rounds'] = 'cartouche(s)', + ['ammo_shells'] = 'obus', + ['ammo_charge'] = 'charge(s)', + ['ammo_petrol'] = 'jerrican d\'essence', + ['ammo_firework'] = 'feu(x) d\'artifice', + ['ammo_rockets'] = 'roquette(s)', + ['ammo_grenadelauncher'] = 'grenade(s)', + ['ammo_grenade'] = 'grenade(s)', + ['ammo_stickybomb'] = 'bombe(s)', + ['ammo_pipebomb'] = 'bombe(s)', + ['ammo_smokebomb'] = 'bombe(s)', + ['ammo_molotov'] = 'cocktail(s)', + ['ammo_proxmine'] = 'mine(s)', + ['ammo_bzgas'] = 'grenade(s)', + ['ammo_ball'] = 'balle(s)', + ['ammo_snowball'] = 'boule(s) de neige', + ['ammo_flare'] = 'fusée(s) éclairante(s)', + ['ammo_flaregun'] = 'fusée(s)', + + -- Weapon Tints + ['tint_default'] = 'skin par défaut', + ['tint_green'] = 'skin vert', + ['tint_gold'] = 'skin doré', + ['tint_pink'] = 'skin rose', + ['tint_army'] = 'skin militaire', + ['tint_lspd'] = 'skin bleu', + ['tint_orange'] = 'skin orange', + ['tint_platinum'] = 'skin platine', +} diff --git a/[esx]/es_extended/locales/pl.lua b/[esx]/es_extended/locales/pl.lua new file mode 100644 index 00000000..35012487 --- /dev/null +++ b/[esx]/es_extended/locales/pl.lua @@ -0,0 +1,224 @@ +Locales['pl'] = { + -- Inventory + ['inventory'] = 'ekwipunek %s / %s', + ['use'] = 'użyj', + ['give'] = 'daj', + ['remove'] = 'usuń', + ['return'] = 'wróć', + ['give_to'] = 'daj dla', + ['amount'] = 'ilość', + ['giveammo'] = 'daj amunicje', + ['amountammo'] = 'ilość amunicji', + ['noammo'] = 'nie posiadasz wystarczającej ilości amunicji!', + ['gave_item'] = 'dałeś/aś ~y~%sx~s~ ~b~%s~s~ dla ~y~%s~s~', + ['received_item'] = 'otrzymałeś/aś ~y~%sx~s~ ~b~%s~s~ od ~b~%s~s~', + ['gave_weapon'] = 'dałeś/aś ~b~%s~s~ dla ~y~%s~s~', + ['gave_weapon_ammo'] = 'dałeś/aś ~o~%sx %s~s~ do ~b~%s~s~ dla ~y~%s~s~', + ['gave_weapon_withammo'] = 'dałeś/aś ~b~%s~s~ z ~o~%sx %s~s~ dla ~y~%s~s~', + ['gave_weapon_hasalready'] = '~y~%s~s~ już posiada ~y~%s~s~', + ['gave_weapon_noweapon'] = '~y~%s~s~ nie posiada tej broni', + ['received_weapon'] = 'otrzymałeś/aś ~b~%s~s~ od ~b~%s~s~', + ['received_weapon_ammo'] = 'otrzymałeś/aś ~o~%sx %s~s~ do twojego ~b~%s~s~ od ~b~%s~s~', + ['received_weapon_withammo'] = 'otrzymałeś/aś ~b~%s~s~ z ~o~%sx %s~s~ od ~b~%s~s~', + ['received_weapon_hasalready'] = '~b~%s~s~ próbował/a przekazać ci ~y~%s~s~, lecz już posiadasz jedno', + ['received_weapon_noweapon'] = '~b~%s~s~ próbował/a przekazać ci amunicje do ~y~%s~s~, lecz nie posiadasz tej broni', + ['gave_account_money'] = 'dałeś/aś ~g~%s$~s~ (%s) dla ~y~%s~s~', + ['received_account_money'] = 'otrzymałeś/aś ~g~%s$~s~ (%s) od ~b~%s~s~', + ['amount_invalid'] = 'nieprawidłowa ilość', + ['players_nearby'] = 'brak graczy w pobliżu', + ['ex_inv_lim'] = 'akcja nie jest możliwa, nie możesz mieć więcej ~y~%s~s~', + ['imp_invalid_quantity'] = 'akcja jest niemożliwa, nieprawidłowa ilość', + ['imp_invalid_amount'] = 'akcja jest niemożliwa, nieprawidłowa kwota', + ['threw_standard'] = 'wyrzuciłeś/aś ~y~%sx~s~ ~b~%s~s~', + ['threw_account'] = 'wyrzuciłeś/aś ~g~$%s~s~ ~b~%s~s~', + ['threw_weapon'] = 'wyrzuciłeś/aś ~b~%s~s~', + ['threw_weapon_ammo'] = 'wyrzuciłeś/aś ~b~%s~s~ z ~o~%sx %s~s~', + ['threw_weapon_already'] = 'już posiadasz taką samą broń', + ['threw_cannot_pickup'] = 'nie możesz tego podnieść, gdyż masz pełny ekwipunek!', + ['threw_pickup_prompt'] = 'naciśnij ~y~E~s~ aby podnieść', + + -- Key mapping + ['keymap_showinventory'] = 'pokaż ekwipunek', + + -- Salary related + ['received_salary'] = 'otrzymałeś/aś wynagrodzenie: ~g~%s$~s~', + ['received_help'] = 'otrzymałeś/aś zapomogę: ~g~$%s~s~', + ['company_nomoney'] = 'firma, w której pracujesz, jest zbyt biedna, by wypłacić twoją pensję', + ['received_paycheck'] = 'otrzymano wypłate', + ['bank'] = 'bank', + ['account_bank'] = 'bank', + ['account_black_money'] = 'brudne pieniądze', + ['account_money'] = 'pieniądze', + ['act_imp'] = 'działanie niemożliwe', + ['in_vehicle'] = 'nie możesz przekazywać przedmiotów w pojeździe', + + -- Commands + ['command_car'] = 'przywołaj pojazd', + ['command_car_car'] = 'nazwa lub hash przywołanego pojazdu', + ['command_cardel'] = 'usuń pojazd w pobliżu', + ['command_cardel_radius'] = 'opcjonalnie usuń każdy pojazd w obszarze', + ['command_clear'] = 'wyczyść czat', + ['command_clearall'] = 'wyczyść czat dla wszystkich graczy', + ['command_clearinventory'] = 'wyczyść ekwipunek gracza', + ['command_clearloadout'] = 'wyczyść wyposarzenie gracza', + ['command_giveaccountmoney'] = 'daj pieniądze na podany typ konta', + ['command_giveaccountmoney_account'] = 'prawidłowy typ konta', + ['command_giveaccountmoney_amount'] = 'ilość do dodania', + ['command_giveaccountmoney_invalid'] = 'nieprawidłowy typ konta', + ['command_giveitem'] = 'daj przedmiot graczowi', + ['command_giveitem_item'] = 'nazwa przedmiotu', + ['command_giveitem_count'] = 'ilość przedimotu', + ['command_giveweapon'] = 'daj broń graczowi', + ['command_giveweapon_weapon'] = 'nazwa broni', + ['command_giveweapon_ammo'] = 'ilość amunicji', + ['command_giveweapon_hasalready'] = 'gracz już posiada tą broń', + ['command_giveweaponcomponent'] = 'daj komponent do broni graczowi', + ['command_giveweaponcomponent_component'] = 'nazwa komponentu', + ['command_giveweaponcomponent_invalid'] = 'nieprawidłowy komponent do broni', + ['command_giveweaponcomponent_hasalready'] = 'gracz już posiada ten komponent do tej broni', + ['command_giveweaponcomponent_missingweapon'] = 'gracz nie posiada tej broni', + ['command_save'] = 'zapisz gracza w bazie danych', + ['command_saveall'] = 'zapisz wszystkich graczy w bazie danych', + ['command_setaccountmoney'] = 'ustaw ilość pieniędzy danego konta dla gracza', + ['command_setaccountmoney_amount'] = 'ilość pieniędzy do ustawienia', + ['command_setcoords'] = 'teleportuj na koordynaty', + ['command_setcoords_x'] = 'x axis', + ['command_setcoords_y'] = 'y axis', + ['command_setcoords_z'] = 'z axis', + ['command_setjob'] = 'ustaw prace dla gracza', + ['command_setjob_job'] = 'nazwa pracy', + ['command_setjob_grade'] = 'stanowisko w pracy', + ['command_setjob_invalid'] = 'praca, stanowisko lub obydwa są nieprawidłowe', + ['command_setgroup'] = 'ustaw grupe gracza', + ['command_setgroup_group'] = 'nazwa grupy', + ['commanderror_argumentmismatch'] = 'nieprawiłowa ilość argumentów (przeszło %s, wymagane %s)', + ['commanderror_argumentmismatch_number'] = 'nieprawidłowy typ argumentu #%s (przeszedł tekst, wymagany numer)', + ['commanderror_invaliditem'] = 'nieprawidłowa nazwa przedmiotu', + ['commanderror_invalidweapon'] = 'nieprawidłowa broń', + ['commanderror_console'] = 'podana komenda nie może zostać uruchomiona przez konsole', + ['commanderror_invalidcommand'] = '^3%s^0 nie jest poprawną komendą!', + ['commanderror_invalidplayerid'] = 'brak dostepnego gracza pasującego do podanego id serwerowego', + ['commandgeneric_playerid'] = 'id gracza', + + -- Locale settings + ['locale_digit_grouping_symbol'] = ',', + ['locale_currency'] = '$%s', + + -- Weapons + ['weapon_knife'] = 'nóż', + ['weapon_nightstick'] = 'pałka', + ['weapon_hammer'] = 'młotek', + ['weapon_bat'] = 'kij', + ['weapon_golfclub'] = 'kij golfowy', + ['weapon_crowbar'] = 'łom', + ['weapon_pistol'] = 'pistolet', + ['weapon_combatpistol'] = 'pistolet bojowy', + ['weapon_appistol'] = 'ap pistol', + ['weapon_pistol50'] = 'pistol .50', + ['weapon_microsmg'] = 'micro smg', + ['weapon_smg'] = 'smg', + ['weapon_assaultsmg'] = 'assault smg', + ['weapon_assaultrifle'] = 'assault rifle', + ['weapon_carbinerifle'] = 'carbine rifle', + ['weapon_advancedrifle'] = 'advanced rifle', + ['weapon_mg'] = 'mg', + ['weapon_combatmg'] = 'combat mg', + ['weapon_pumpshotgun'] = 'pump shotgun', + ['weapon_sawnoffshotgun'] = 'sawed off shotgun', + ['weapon_assaultshotgun'] = 'assault shotgun', + ['weapon_bullpupshotgun'] = 'bullpup shotgun', + ['weapon_stungun'] = 'tazer', + ['weapon_sniperrifle'] = 'karabin snajperski', + ['weapon_heavysniper'] = 'ciężki karabin snajperski', + ['weapon_grenadelauncher'] = 'granatnik', + ['weapon_rpg'] = 'wyrzutnia rakiet', + ['weapon_minigun'] = 'minigun', + ['weapon_grenade'] = 'granat', + ['weapon_stickybomb'] = 'ładunek przylepny', + ['weapon_smokegrenade'] = 'granat dymny', + ['weapon_bzgas'] = 'bz gas', + ['weapon_molotov'] = 'koktajl Mołotowa', + ['weapon_fireextinguisher'] = 'gaśnica', + ['weapon_petrolcan'] = 'kanister', + ['weapon_ball'] = 'piłka', + ['weapon_snspistol'] = 'sns pistolet', + ['weapon_bottle'] = 'butelka', + ['weapon_gusenberg'] = 'gusenberg sweeper', + ['weapon_specialcarbine'] = 'special carbine', + ['weapon_heavypistol'] = 'heavy pistol', + ['weapon_bullpuprifle'] = 'karabin wyborowy', + ['weapon_dagger'] = 'sztylet', + ['weapon_vintagepistol'] = 'vintage pistol', + ['weapon_firework'] = 'fajerwerki', + ['weapon_musket'] = 'muszkiet', + ['weapon_heavyshotgun'] = 'ciężki shotgun', + ['weapon_marksmanrifle'] = 'marksman rifle', + ['weapon_hominglauncher'] = 'program uruchamiający', + ['weapon_proxmine'] = 'mina zbliżeniowa', + ['weapon_snowball'] = 'śnieżka', + ['weapon_flaregun'] = 'flara', + ['weapon_combatpdw'] = 'combat pdw', + ['weapon_marksmanpistol'] = 'marksman pistol', + ['weapon_knuckle'] = 'kastety', + ['weapon_hatchet'] = 'toporek', + ['weapon_railgun'] = 'karabin', + ['weapon_machete'] = 'meczeta', + ['weapon_machinepistol'] = 'pistolet maszynowy', + ['weapon_switchblade'] = 'scyzoryk', + ['weapon_revolver'] = 'ciężki rewolwer', + ['weapon_dbshotgun'] = 'dwururka', + ['weapon_compactrifle'] = 'compact rifle', + ['weapon_autoshotgun'] = 'auto shotgun', + ['weapon_battleaxe'] = 'topór bitewny', + ['weapon_compactlauncher'] = 'compact launcher', + ['weapon_minismg'] = 'mini smg', + ['weapon_pipebomb'] = 'bomba rurowa', + ['weapon_poolcue'] = 'kij bilardowy', + ['weapon_wrench'] = 'klucz do rur', + ['weapon_flashlight'] = 'latarka', + ['gadget_parachute'] = 'spadochron', + ['weapon_flare'] = 'pistolet sygnałowy', + ['weapon_doubleaction'] = 'double-Action Revolver', + + -- Weapon Components + ['component_clip_default'] = 'domyślny tłumik', + ['component_clip_extended'] = 'rozszerzony tłumik', + ['component_clip_drum'] = 'magazynek bębnowy', + ['component_clip_box'] = 'magazynek', + ['component_flashlight'] = 'latarka', + ['component_scope'] = 'luneta', + ['component_scope_advanced'] = 'zaawansowana luneta', + ['component_suppressor'] = 'tłumik', + ['component_grip'] = 'uchwyt', + ['component_luxary_finish'] = 'luksusowe wykończenie broni', + + -- Weapon Ammo + ['ammo_rounds'] = 'nabój/oi', + ['ammo_shells'] = 'pocisk(ów)', + ['ammo_charge'] = 'naładowania', + ['ammo_petrol'] = 'galon(y) paliwa', + ['ammo_firework'] = 'fajerwerka/i', + ['ammo_rockets'] = 'rakieta/y', + ['ammo_grenadelauncher'] = 'granat(y)', + ['ammo_grenade'] = 'granat(y)', + ['ammo_stickybomb'] = 'bomba/y', + ['ammo_pipebomb'] = 'bomba/y', + ['ammo_smokebomb'] = 'bomba/y', + ['ammo_molotov'] = 'kontail(e)', + ['ammo_proxmine'] = 'mina/y', + ['ammo_bzgas'] = 'puszka/ek', + ['ammo_ball'] = 'kula/e', + ['ammo_snowball'] = 'snieżka/i', + ['ammo_flare'] = 'flara/y', + ['ammo_flaregun'] = 'flara/y', + + -- Weapon Tints + ['tint_default'] = 'domyślny skin', + ['tint_green'] = 'zielony skin', + ['tint_gold'] = 'złoty skin', + ['tint_pink'] = 'różowy skin', + ['tint_army'] = 'wojskowy skin', + ['tint_lspd'] = 'niebieski skin', + ['tint_orange'] = 'pomarańczowy skin', + ['tint_platinum'] = 'platynowy skin', +} diff --git a/[esx]/es_extended/locales/sc.lua b/[esx]/es_extended/locales/sc.lua new file mode 100644 index 00000000..229403de --- /dev/null +++ b/[esx]/es_extended/locales/sc.lua @@ -0,0 +1,225 @@ +Locales['sc'] = { + -- Inventory + ['inventory'] = '库存 %s / %s', + ['use'] = '使用', + ['give'] = '赠送', + ['remove'] = '丢弃', + ['return'] = '返回', + ['give_to'] = '赠给', + ['amount'] = '数量', + ['giveammo'] = '赠送弹药', + ['amountammo'] = '弹药量', + ['noammo'] = '你没有足够的弹药!', + ['gave_item'] = '你把~y~%sx~s~~b~%s~s~赠给了~y~%s~s~', + ['received_item'] = '你收到~y~%sx~s~~b~%s~s~,来自~b~%s~s~', + ['gave_weapon'] = '你把~b~%s~s~赠给了~y~%s~s~', + ['gave_weapon_ammo'] = '你把~o~%sx~s~~b~%s~s~ %s~s~赠给了~y~%s~s~', + ['gave_weapon_withammo'] = '你把~b~%s~s~和~o~%sx~s~ %s~s~赠给了~y~%s~s~', + ['gave_weapon_hasalready'] = '~y~%s~s~已经拥有~y~%s~s~', + ['gave_weapon_noweapon'] = '~y~%s~s~没有那个武器', + ['received_weapon'] = '你收到了~b~%s~s~,来自~b~%s~s~', + ['received_weapon_ammo'] = '你收到了~o~%sx~s~ %s~s~(~b~%s~s~),来自~b~%s~s~', + ['received_weapon_withammo'] = '你收到了~b~%s~s~和~o~%sx~s~ %s~s~,来自~b~%s~s~', + ['received_weapon_hasalready'] = '~b~%s~s~试图给你~y~%s~s~,但你已经拥有了', + ['received_weapon_noweapon'] = '~b~%s~s~试图给你~y~%s~s~弹药,但你没有那个武器', + ['gave_account_money'] = '你将 ~g~$%s~s~ (%s) 给予 ~y~%s~s~', + ['received_account_money'] = '你收到了~g~$%s~s~ (%s) 来自 ~b~%s~s~', + ['amount_invalid'] = '无效数量', + ['players_nearby'] = '附近没有玩家', + ['ex_inv_lim'] = '操作失败, 超过~y~%s~s~的物品栏限制', + ['imp_invalid_quantity'] = '操作失败,无效数量', + ['imp_invalid_amount'] = '操作失败,无效金额', + ['threw_standard'] = '你丢弃了~y~%sx~s~~b~%s~s~', + ['threw_account'] = '你丢弃了~g~$%s~s~~b~%s~s~', + ['threw_weapon'] = '你丢弃了~b~%s~s~', + ['threw_weapon_ammo'] = '你丢弃了~b~%s~s~和~o~%sx%s~s~', + ['threw_weapon_already'] = '你已经有同样的武器了', + ['threw_cannot_pickup'] = '你不能再拿起那个了,因为你的库存已经满了', + ['threw_pickup_prompt'] = '按 ~y~E~s~ 拿起', + + -- Key mapping + ['keymap_showinventory'] = '显示库存', + + -- Salary related + ['received_salary'] = '你收到了你的工资: ~g~$%s~s~', + ['received_help'] = '你领取到了你的失业救济金: ~g~$%s~s~', + ['company_nomoney'] = '你受雇的公司太穷了,无法支付你的工资。', + ['received_paycheck'] = '收到转账', + ['bank'] = '花园银行', + ['account_bank'] = '银行', + ['account_black_money'] = '黑钱', + ['account_money'] = '现金', + + ['act_imp'] = '操作失败', + ['in_vehicle'] = '请离开载具', + + -- Commands + ['command_car'] = '生成载具', + ['command_car_car'] = '生成载具的模型名称或哈希值', + ['command_cardel'] = '删除附近的载具', + ['command_cardel_radius'] = '可选,删除指定半径内的所有车辆', + ['command_clear'] = '清除聊天记录', + ['command_clearall'] = '清除所有玩家的聊天记录', + ['command_clearinventory'] = '清除玩家库存', + ['command_clearloadout'] = '清除玩家皮肤', + ['command_giveaccountmoney'] = '给帐户钱', + ['command_giveaccountmoney_account'] = '有效的帐户名', + ['command_giveaccountmoney_amount'] = '添加的数量', + ['command_giveaccountmoney_invalid'] = '无效的帐户名', + ['command_giveitem'] = '给玩家一件物品', + ['command_giveitem_item'] = '物品名称', + ['command_giveitem_count'] = '物品数目', + ['command_giveweapon'] = '给玩家一件武器', + ['command_giveweapon_weapon'] = '武器名称', + ['command_giveweapon_ammo'] = '弹药数目', + ['command_giveweapon_hasalready'] = '该玩家已经拥有该武器', + ['command_giveweaponcomponent'] = '给武器配件', + ['command_giveweaponcomponent_component'] = '配件名称', + ['command_giveweaponcomponent_invalid'] = '无效的武器配件', + ['command_giveweaponcomponent_hasalready'] = '玩家已经拥有该武器配件', + ['command_giveweaponcomponent_missingweapon'] = '该玩家没有那个武器', + ['command_save'] = '保存玩家数据至数据库', + ['command_saveall'] = '保存所有玩家数据至数据库', + ['command_setaccountmoney'] = '为玩家设置帐户资金', + ['command_setaccountmoney_amount'] = '要设定的金额', + ['command_setcoords'] = '传送到坐标', + ['command_setcoords_x'] = 'x 轴', + ['command_setcoords_y'] = 'y 轴', + ['command_setcoords_z'] = 'z 轴', + ['command_setjob'] = '为玩家设定工作', + ['command_setjob_job'] = '工作名称', + ['command_setjob_grade'] = '工作等级', + ['command_setjob_invalid'] = '工作、等级或两者都无效', + ['command_setgroup'] = '设置玩家用户组', + ['command_setgroup_group'] = '用户组名称', + ['commanderror_argumentmismatch'] = '参数计数不匹配(该类型为%s, 需要传递 %s)', + ['commanderror_argumentmismatch_number'] = '参数 #%s 类型不匹配(该类型为字符串,需要传递数字类型)', + ['commanderror_invaliditem'] = '无效的物品名称', + ['commanderror_invalidweapon'] = '无效武器', + ['commanderror_console'] = '该命令不能从控制台运行', + ['commanderror_invalidcommand'] = '^3%s^0 不是有效的命令!', + ['commanderror_invalidplayerid'] = '没有在线玩家匹配到该服务id', + ['commandgeneric_playerid'] = '玩家id', + + -- Locale settings + ['locale_digit_grouping_symbol'] = ',', + ['locale_currency'] = '$%s', + + -- Weapons + ['weapon_knife'] = '小刀', + ['weapon_nightstick'] = '警棍', + ['weapon_hammer'] = '铁锤', + ['weapon_bat'] = '棒球棍', + ['weapon_golfclub'] = '高尔夫球杆', + ['weapon_crowbar'] = '撬棍', + ['weapon_pistol'] = '手枪', + ['weapon_combatpistol'] = '战斗手枪', + ['weapon_appistol'] = '穿甲手枪', + ['weapon_pistol50'] = '0.5 口径手枪', + ['weapon_microsmg'] = '微型冲锋枪', + ['weapon_smg'] = '冲锋枪', + ['weapon_assaultsmg'] = '突击冲锋枪', + ['weapon_assaultrifle'] = '突击步枪', + ['weapon_carbinerifle'] = '卡宾步枪', + ['weapon_advancedrifle'] = '高级步枪', + ['weapon_mg'] = '机枪', + ['weapon_combatmg'] = '战斗机枪', + ['weapon_pumpshotgun'] = '泵动式霰弹枪', + ['weapon_sawnoffshotgun'] = '短管霰弹枪', + ['weapon_assaultshotgun'] = '突击霰弹枪', + ['weapon_bullpupshotgun'] = '无托式霰弹枪', + ['weapon_stungun'] = '电击枪', + ['weapon_sniperrifle'] = '狙击步枪', + ['weapon_heavysniper'] = '重型狙击步枪', + ['weapon_grenadelauncher'] = '榴弹发射器', + ['weapon_rpg'] = '火箭炮', + ['weapon_minigun'] = '火神机枪', + ['weapon_grenade'] = '手榴弹', + ['weapon_stickybomb'] = '黏弹', + ['weapon_smokegrenade'] = '烟雾弹', + ['weapon_bzgas'] = '催泪瓦斯', + ['weapon_molotov'] = '汽油弹', + ['weapon_fireextinguisher'] = '灭火器', + ['weapon_petrolcan'] = '汽油桶', + ['weapon_ball'] = '棒球', + ['weapon_snspistol'] = '劣质手枪', + ['weapon_bottle'] = '酒瓶', + ['weapon_gusenberg'] = '古森柏冲锋枪', + ['weapon_specialcarbine'] = '特制卡宾枪', + ['weapon_heavypistol'] = '重型手枪', + ['weapon_bullpuprifle'] = '无托式步枪', + ['weapon_dagger'] = '匕首', + ['weapon_vintagepistol'] = '老式手枪', + ['weapon_firework'] = '烟花发射器', + ['weapon_musket'] = '老式火枪', + ['weapon_heavyshotgun'] = '重型霰弹枪', + ['weapon_marksmanrifle'] = '射手步枪', + ['weapon_hominglauncher'] = '制导火箭发射器', + ['weapon_proxmine'] = '感应地雷', + ['weapon_snowball'] = '雪球', + ['weapon_flaregun'] = '信号枪', + ['weapon_combatpdw'] = '作战自卫冲锋枪', + ['weapon_marksmanpistol'] = '射手手枪', + ['weapon_knuckle'] = '手指虎', + ['weapon_hatchet'] = '手斧', + ['weapon_railgun'] = '电磁轨道炮', + ['weapon_machete'] = '开山刀', + ['weapon_machinepistol'] = '冲锋手枪', + ['weapon_switchblade'] = '弹簧刀', + ['weapon_revolver'] = '重型左轮手枪', + ['weapon_dbshotgun'] = '双管霰弹枪', + ['weapon_compactrifle'] = '紧凑型步枪', + ['weapon_autoshotgun'] = '半自动霰弹枪', + ['weapon_battleaxe'] = '战斧', + ['weapon_compactlauncher'] = '紧凑型榴弹发射器', + ['weapon_minismg'] = '迷你冲锋枪', + ['weapon_pipebomb'] = '土制炸弹', + ['weapon_poolcue'] = '台球杆', + ['weapon_wrench'] = '管钳扳手', + ['weapon_flashlight'] = '手电筒', + ['gadget_parachute'] = '降落伞', + ['weapon_flare'] = '信号棒', + ['weapon_doubleaction'] = '双动式左轮手枪', + + -- Weapon Components + ['component_clip_default'] = '默认弹夹', + ['component_clip_extended'] = '扩容弹夹', + ['component_clip_drum'] = '鼓式弹夹', + ['component_clip_box'] = '盒型弹匣', + ['component_flashlight'] = '手电筒', + ['component_scope'] = '瞄准镜', + ['component_scope_advanced'] = '高级瞄准镜', + ['component_suppressor'] = '消音器', + ['component_grip'] = '握把', + ['component_luxary_finish'] = '奢华涂饰', + + -- Weapon Ammo + ['ammo_rounds'] = '发(子弹)', + ['ammo_shells'] = '发(子弹)', + ['ammo_charge'] = '喷', + ['ammo_petrol'] = '加仑(燃料)', + ['ammo_firework'] = '发(烟花弹)', + ['ammo_rockets'] = '枚(火箭弹)', + ['ammo_grenadelauncher'] = '发(榴弹)', + ['ammo_grenade'] = '枚(手榴弹)', + ['ammo_stickybomb'] = '枚(炸弹)', + ['ammo_pipebomb'] = '枚(炸弹)', + ['ammo_smokebomb'] = '枚(炸弹)', + ['ammo_molotov'] = '瓶(汽油瓶)', + ['ammo_proxmine'] = '个(地雷)', + ['ammo_bzgas'] = '罐', + ['ammo_ball'] = '个(球)', + ['ammo_snowball'] = '个(雪球)', + ['ammo_flare'] = '根(信号棒)', + ['ammo_flaregun'] = '发(信号弹)', + + -- Weapon Tints + ['tint_default'] = '默认色调', + ['tint_green'] = '绿色调', + ['tint_gold'] = '金色调', + ['tint_pink'] = '粉色调', + ['tint_army'] = '军用色调', + ['tint_lspd'] = '洛圣都警局色调', + ['tint_orange'] = '橙色调', + ['tint_platinum'] = '铂金色调', +} diff --git a/[esx]/es_extended/locales/sv.lua b/[esx]/es_extended/locales/sv.lua new file mode 100644 index 00000000..25c682f0 --- /dev/null +++ b/[esx]/es_extended/locales/sv.lua @@ -0,0 +1,225 @@ +Locales['sv'] = { + -- Inventory + ['inventory'] = 'mitt förråd %s / %s', + ['use'] = 'använd', + ['give'] = 'ge', + ['remove'] = 'kasta', + ['return'] = 'gå tillbaka', + ['give_to'] = 'ge till', + ['amount'] = 'antal', + ['giveammo'] = 'ge ammunition', + ['amountammo'] = 'mängd ammunition', + ['noammo'] = 'du har inte tillräckligt med ammunition!', + ['gave_item'] = 'du gav ~y~%sx~s~ ~b~%s~s~ till ~y~%s~s~', + ['received_item'] = 'du tog emot ~y~%sx~s~ ~b~%s~s~ från ~b~%s~s~', + ['gave_weapon'] = 'du gav ~b~%s~s~ till ~y~%s~s~', + ['gave_weapon_ammo'] = 'du gav ~o~%sx %s~s~ för ~b~%s~s~ till ~y~%s~s~', + ['gave_weapon_withammo'] = 'du gav ~b~%s~s~ med ~o~%sx %s~s~ till ~y~%s~s~', + ['gave_weapon_hasalready'] = '~y~%s~s~ har redan en ~y~%s~s~', + ['gave_weapon_noweapon'] = '~y~%s~s~ har inte det vapnet', + ['received_weapon'] = 'du tog emot ~b~%s~s~ från ~b~%s~s~', + ['received_weapon_ammo'] = 'du tog emot ~o~%sx %s~s~ för ~b~%s~s~ från ~b~%s~s~', + ['received_weapon_withammo'] = 'du tog emot ~b~%s~s~ med ~o~%sx %s~s~ från ~b~%s~s~', + ['received_weapon_hasalready'] = '~b~%s~s~ försökte ge dig en ~y~%s~s~, men det vapnet har du redan', + ['received_weapon_noweapon'] = '~b~%s~s~ försökte ge dig ammunition för ett ~y~%s~s~, men du har inget sådant vapen', + ['gave_account_money'] = 'du gav ~g~%s SEK~s~ (%s) till ~y~%s~s~', + ['received_account_money'] = 'du tog emot ~g~%s SEK~s~ (%s) från ~b~%s~s~', + ['amount_invalid'] = 'ogiltig mängd', + ['players_nearby'] = 'det finns inga spelare nära', + ['ex_inv_lim'] = 'åtgärd inte möjligt, översteg förråd gräns för ~y~%s~s~', + ['imp_invalid_quantity'] = 'åtgärd omöjlig, ogiltig mängd', + ['imp_invalid_amount'] = 'åtgärd omöjlig, ogiltig belopp', + ['threw_standard'] = 'du kastade ~y~%sx~s~ ~b~%s~s~', + ['threw_account'] = 'du kastade ~g~%s SEK~s~ ~b~%s~s~', + ['threw_weapon'] = 'du kastade ~b~%s~s~', + ['threw_weapon_ammo'] = 'du kastade ~b~%s~s~ med ~o~%sx %s~s~', + ['threw_weapon_already'] = 'du har redan ett sådant vapen på dig', + ['threw_cannot_pickup'] = 'du kan inte plocka upp det på grund av att det kommer ej få plats i ditt förråd!', + ['threw_pickup_prompt'] = 'tryck ~y~E~s~ för att plocka upp', + + -- Key mapping + ['keymap_showinventory'] = 'öppna inventory', + + -- Salary related + ['received_salary'] = 'du har mottagit din lön på ~g~%s SEK~s~', + ['received_help'] = 'du har mottagit bidrag på ~g~%s SEK~s~', + ['company_nomoney'] = 'företaget du är anställt hos har inte råd att betala ut din lön', + ['received_paycheck'] = 'mottagit lön', + ['bank'] = 'bank', + ['account_bank'] = 'bank', + ['account_black_money'] = 'svarta pengar', + ['account_money'] = 'kontakter', + + ['act_imp'] = 'åtgärd omöjlig', + ['in_vehicle'] = 'du kan inte ge saker till en som sitter i ett fordon!', + + -- Commands + ['command_car'] = 'spawna ett fordon', + ['command_car_car'] = 'namn på fordon eller hash', + ['command_cardel'] = 'radera fordon i närheten', + ['command_cardel_radius'] = 'valfri, radera alla fordon inom den angivna radien', + ['command_clear'] = 'töm chatten', + ['command_clearall'] = 'töm chatten för alla spelare', + ['command_clearinventory'] = 'töm en spelares inventory', + ['command_clearloadout'] = 'töm en spelares loadout', + ['command_giveaccountmoney'] = 'ge pengar för ett konto', + ['command_giveaccountmoney_account'] = 'giltigt kontonamn', + ['command_giveaccountmoney_amount'] = 'mängd att ge', + ['command_giveaccountmoney_invalid'] = 'kontonamnet är ej giltigt', + ['command_giveitem'] = 'ge ett item till en spelare', + ['command_giveitem_item'] = 'itemnamn', + ['command_giveitem_count'] = 'mängd av itemet', + ['command_giveweapon'] = 'ge ett vapen till en spelare', + ['command_giveweapon_weapon'] = 'vapennamn', + ['command_giveweapon_ammo'] = 'hur mycket ammo att ge', + ['command_giveweapon_hasalready'] = 'spelaren har redan ett sådant vapen', + ['command_giveweaponcomponent'] = 'ge vapen komponent', + ['command_giveweaponcomponent_component'] = 'vapenkomponent', + ['command_giveweaponcomponent_invalid'] = 'det vapenkomponentet är ej giltigt', + ['command_giveweaponcomponent_hasalready'] = 'spelaren har redan det vapenkomponent', + ['command_giveweaponcomponent_missingweapon'] = 'spelaren har ej det vapnet', + ['command_save'] = 'spara en spelare i databas', + ['command_saveall'] = 'spara alla spelare i databas', + ['command_setaccountmoney'] = 'bestäm ny balans på ett spelarkonto', + ['command_setaccountmoney_amount'] = 'ny balans', + ['command_setcoords'] = 'teleportera till koordinater', + ['command_setcoords_x'] = 'x axel', + ['command_setcoords_y'] = 'y axel', + ['command_setcoords_z'] = 'z axel', + ['command_setjob'] = 'välj jobb för en spelare', + ['command_setjob_job'] = 'jobbnamn', + ['command_setjob_grade'] = 'jobbnivå', + ['command_setjob_invalid'] = 'jobbet, nivån eller båda är ej giltiga', + ['command_setgroup'] = 'välj grupp åt en spelare', + ['command_setgroup_group'] = 'gruppnamn', + ['commanderror_argumentmismatch'] = 'argumentstorlek mismatch (gav %s, ville ha %s)', + ['commanderror_argumentmismatch_number'] = 'argument #%s typ mismatch (gav string, ville ha number)', + ['commanderror_invaliditem'] = 'ej giltigt item', + ['commanderror_invalidweapon'] = 'ej giltigt vapen', + ['commanderror_console'] = 'detta kommando kan ej executas i konsol', + ['commanderror_invalidcommand'] = '^3%s^0 är inte ett giltigt kommando!', + ['commanderror_invalidplayerid'] = 'det finns ingen spelare som matchar det angivna server id', + ['commandgeneric_playerid'] = 'spelarid', + + -- Locale settings + ['locale_digit_grouping_symbol'] = ' ', + ['locale_currency'] = '%s SEK', + + -- Weapons + ['weapon_knife'] = 'kniv', + ['weapon_nightstick'] = 'batong', + ['weapon_hammer'] = 'hammare', + ['weapon_bat'] = 'slagträ', + ['weapon_golfclub'] = 'golf club', + ['weapon_crowbar'] = 'kofot', + ['weapon_pistol'] = 'pistol', + ['weapon_combatpistol'] = 'combat pistol', + ['weapon_appistol'] = 'ap pistol', + ['weapon_pistol50'] = 'pistol .50', + ['weapon_microsmg'] = 'micro smg', + ['weapon_smg'] = 'smg', + ['weapon_assaultsmg'] = 'assault smg', + ['weapon_assaultrifle'] = 'assault rifle', + ['weapon_carbinerifle'] = 'carbine rifle', + ['weapon_advancedrifle'] = 'advanced rifle', + ['weapon_mg'] = 'mg', + ['weapon_combatmg'] = 'combat mg', + ['weapon_pumpshotgun'] = 'pump shotgun', + ['weapon_sawnoffshotgun'] = 'sawed off shotgun', + ['weapon_assaultshotgun'] = 'assault shotgun', + ['weapon_bullpupshotgun'] = 'bullpup shotgun', + ['weapon_stungun'] = 'elchockpistol', + ['weapon_sniperrifle'] = 'prickskyttegevär', + ['weapon_heavysniper'] = 'tung prickskytt', + ['weapon_grenadelauncher'] = 'granatkastare', + ['weapon_rpg'] = 'raketgevär', + ['weapon_minigun'] = 'minigun', + ['weapon_grenade'] = 'granat', + ['weapon_stickybomb'] = 'klibbig bomb', + ['weapon_smokegrenade'] = 'rökgranat', + ['weapon_bzgas'] = 'bz gas', + ['weapon_molotov'] = 'molotov cocktail', + ['weapon_fireextinguisher'] = 'brandsläckare', + ['weapon_petrolcan'] = 'bensindunk', + ['weapon_ball'] = 'boll', + ['weapon_snspistol'] = 'sns pistol', + ['weapon_bottle'] = 'flaska', + ['weapon_gusenberg'] = 'gusenberg sweeper', + ['weapon_specialcarbine'] = 'special carbine', + ['weapon_heavypistol'] = 'heavy pistol', + ['weapon_bullpuprifle'] = 'bullpup rifle', + ['weapon_dagger'] = 'dolk', + ['weapon_vintagepistol'] = 'vintage pistol', + ['weapon_firework'] = 'fyrverkeriraket', + ['weapon_musket'] = 'musköt', + ['weapon_heavyshotgun'] = 'heavy shotgun', + ['weapon_marksmanrifle'] = 'marksman rifle', + ['weapon_hominglauncher'] = 'homing launcher', + ['weapon_proxmine'] = 'proximity mine', + ['weapon_snowball'] = 'snöboll', + ['weapon_flaregun'] = 'signalpistol', + ['weapon_combatpdw'] = 'combat pdw', + ['weapon_marksmanpistol'] = 'marksman pistol', + ['weapon_knuckle'] = 'knogjärn', + ['weapon_hatchet'] = 'yxa', + ['weapon_railgun'] = 'railgun', + ['weapon_machete'] = 'machete', + ['weapon_machinepistol'] = 'machine pistol', + ['weapon_switchblade'] = 'switchblade', + ['weapon_revolver'] = 'heavy revolver', + ['weapon_dbshotgun'] = 'double barrel shotgun', + ['weapon_compactrifle'] = 'compact rifle', + ['weapon_autoshotgun'] = 'auto shotgun', + ['weapon_battleaxe'] = 'stridsyxa', + ['weapon_compactlauncher'] = 'compact launcher', + ['weapon_minismg'] = 'mini smg', + ['weapon_pipebomb'] = 'pipe bomb', + ['weapon_poolcue'] = 'biljardkö', + ['weapon_wrench'] = 'skiftnyckel', + ['weapon_flashlight'] = 'ficklampa', + ['gadget_parachute'] = 'fallskärm', + ['weapon_flare'] = 'blossa', + ['weapon_doubleaction'] = 'double-Action Revolver', + + -- Weapon Components + ['component_clip_default'] = 'standard magg', + ['component_clip_extended'] = 'förlängd magg', + ['component_clip_drum'] = 'trummagasin', + ['component_clip_box'] = 'lådmagasin', + ['component_flashlight'] = 'ficklampa', + ['component_scope'] = 'sikte', + ['component_scope_advanced'] = 'advancerat sikte', + ['component_suppressor'] = 'ljuddämpare', + ['component_grip'] = 'handtag', + ['component_luxary_finish'] = 'lyxvapen behandling', + + -- Weapon Ammo + ['ammo_rounds'] = 'ammunition', + ['ammo_shells'] = 'hagel', + ['ammo_charge'] = 'laddning', + ['ammo_petrol'] = 'liter bensin', + ['ammo_firework'] = 'fyrverkeri', + ['ammo_rockets'] = 'raket', + ['ammo_grenadelauncher'] = 'granat(er)', + ['ammo_grenade'] = 'granat(er)', + ['ammo_stickybomb'] = 'bomb(er)', + ['ammo_pipebomb'] = 'bomb(er)', + ['ammo_smokebomb'] = 'bomb(er)', + ['ammo_molotov'] = 'cocktail(s)', + ['ammo_proxmine'] = 'bomb(er)', + ['ammo_bzgas'] = 'burk(ar)', + ['ammo_ball'] = 'boll(ar)', + ['ammo_snowball'] = 'snöboll(ar)', + ['ammo_flare'] = 'lysraket(er)', + ['ammo_flaregun'] = 'lysraket(er)', + + -- Weapon Tints + ['tint_default'] = 'standardutseende', + ['tint_green'] = 'grönskinn', + ['tint_gold'] = 'guldskinn', + ['tint_pink'] = 'råsaskinn', + ['tint_army'] = 'arméskinn', + ['tint_lspd'] = 'blåskinn', + ['tint_orange'] = 'orangeskinn', + ['tint_platinum'] = 'platinaskinn', +} diff --git a/[esx]/es_extended/locales/tc.lua b/[esx]/es_extended/locales/tc.lua new file mode 100644 index 00000000..663259fb --- /dev/null +++ b/[esx]/es_extended/locales/tc.lua @@ -0,0 +1,225 @@ +Locales['tc'] = { + -- Inventory + ['inventory'] = '背包 %s / %s', + ['use'] = '使用', + ['give'] = '給', + ['remove'] = '丟棄', + ['return'] = '返回', + ['give_to'] = '給予', + ['amount'] = '數量', + ['giveammo'] = '給予子彈', + ['amountammo'] = '子彈量', + ['noammo'] = '您沒有足夠的子彈!', + ['gave_item'] = '您把~y~%sx~s~~b~%s~s~給予了~y~%s~s~', + ['received_item'] = '您收到~y~%sx~s~~b~%s~s~,來自~b~%s~s~', + ['gave_weapon'] = '您把~b~%s~s~給予了~y~%s~s~', + ['gave_weapon_ammo'] = '您把~o~%sx~s~~b~%s~s~ %s~s~給予了~y~%s~s~', + ['gave_weapon_withammo'] = '您把~b~%s~s~和~o~%sx~s~ %s~s~給予了~y~%s~s~', + ['gave_weapon_hasalready'] = '~y~%s~s~已經有~y~%s~s~', + ['gave_weapon_noweapon'] = '~y~%s~s~沒有那把武器', + ['received_weapon'] = '您收到了~b~%s~s~,來自~b~%s~s~', + ['received_weapon_ammo'] = '您收到了~o~%sx~s~ %s~s~(~b~%s~s~),來自~b~%s~s~', + ['received_weapon_withammo'] = '您收到了~b~%s~s~和~o~%sx~s~ %s~s~,來自~b~%s~s~', + ['received_weapon_hasalready'] = '~b~%s~s~嘗試给您~y~%s~s~,但您已经有了', + ['received_weapon_noweapon'] = '~b~%s~s~嘗試给您~y~%s~s~子彈,但是您沒有那把武器', + ['gave_account_money'] = '您將 ~g~$%s~s~ (%s) 给予 ~y~%s~s~', + ['received_account_money'] = '您收到了~g~$%s~s~ (%s) 来自 ~b~%s~s~', + ['amount_invalid'] = '無效的數量', + ['players_nearby'] = '附近沒有玩家', + ['ex_inv_lim'] = '操作失敗, 超過~y~%s~s~物品欄位的限制', + ['imp_invalid_quantity'] = '操作失敗,無效的數量', + ['imp_invalid_amount'] = '操作失敗,無效的金額', + ['threw_standard'] = '您丟棄了~y~%sx~s~~b~%s~s~', + ['threw_account'] = '您丟棄了~g~$%s~s~~b~%s~s~', + ['threw_weapon'] = '您丟棄了~b~%s~s~', + ['threw_weapon_ammo'] = '您丟棄了~b~%s~s~和~o~%sx%s~s~', + ['threw_weapon_already'] = '您已經有相同的武器了', + ['threw_cannot_pickup'] = '您不能再撿起該物品,因為您的背包已經滿了', + ['threw_pickup_prompt'] = '按下 ~y~E~s~ 撿起', + + -- Key mapping + ['keymap_showinventory'] = '顯示背包', + + -- Salary related + ['received_salary'] = '您收到您的薪水: ~g~$%s~s~', + ['received_help'] = '你領取到了你的失業救濟金: ~g~$%s~s~', + ['company_nomoney'] = '您的公司太窮了,無法給予您薪水。', + ['received_paycheck'] = '收到轉帳', + ['bank'] = '花園銀行', + ['account_bank'] = '銀行', + ['account_black_money'] = '黑錢', + ['account_money'] = '現金', + + ['act_imp'] = '操作失敗', + ['in_vehicle'] = '請離開載具', + + -- Commands + ['command_car'] = '生成載具', + ['command_car_car'] = '生成載具的模型名稱或希哈值', + ['command_cardel'] = '刪除附近的載具', + ['command_cardel_radius'] = '可選擇,刪除指定半徑內的所有車輛', + ['command_clear'] = '清除聊天紀錄', + ['command_clearall'] = '清除所有玩家的聊天紀錄', + ['command_clearinventory'] = '清除玩家背包', + ['command_clearloadout'] = '清除玩家人物造型', + ['command_giveaccountmoney'] = '給予帳戶錢', + ['command_giveaccountmoney_account'] = '有效的帳戶名稱', + ['command_giveaccountmoney_amount'] = '添加的數量', + ['command_giveaccountmoney_invalid'] = '無效的帳戶名稱', + ['command_giveitem'] = '給玩家一個物品', + ['command_giveitem_item'] = '物品名稱', + ['command_giveitem_count'] = '物品數量', + ['command_giveweapon'] = '给玩家一把武器', + ['command_giveweapon_weapon'] = '武器名稱', + ['command_giveweapon_ammo'] = '子彈數量', + ['command_giveweapon_hasalready'] = '該玩家已經擁有了該武器', + ['command_giveweaponcomponent'] = '給予武器配件', + ['command_giveweaponcomponent_component'] = '配件名稱', + ['command_giveweaponcomponent_invalid'] = '無效的武器配件', + ['command_giveweaponcomponent_hasalready'] = '該玩家已經擁有了武器配件', + ['command_giveweaponcomponent_missingweapon'] = '該玩家沒有那把武器', + ['command_save'] = '保存玩家數據至資料庫', + ['command_saveall'] = '保存所有玩家數據至資料庫', + ['command_setaccountmoney'] = '為玩家設置賬戶資金', + ['command_setaccountmoney_amount'] = '要設置的金額', + ['command_setcoords'] = '傳送到座標上', + ['command_setcoords_x'] = 'x 軸', + ['command_setcoords_y'] = 'y 軸', + ['command_setcoords_z'] = 'z 軸', + ['command_setjob'] = '設定該玩家職業', + ['command_setjob_job'] = '職業名稱', + ['command_setjob_grade'] = '職業階級', + ['command_setjob_invalid'] = '職業、階級或者兩者都無效', + ['command_setgroup'] = '設定玩家群組階級', + ['command_setgroup_group'] = '玩家群組階級名稱', + ['commanderror_argumentmismatch'] = '參數數量不正確(該類型為%s, 需要給予 %s)', + ['commanderror_argumentmismatch_number'] = '參數 #%s 類型不匹配(該類型為字串,需要給予的數字類型)', + ['commanderror_invaliditem'] = '無效的物品名稱', + ['commanderror_invalidweapon'] = '無效武器', + ['commanderror_console'] = '該指令不能從控制台執行', + ['commanderror_invalidcommand'] = '^3%s^0 不是有效的指令!', + ['commanderror_invalidplayerid'] = '無效的玩家ID', + ['commandgeneric_playerid'] = '玩家id', + + -- Locale settings + ['locale_digit_grouping_symbol'] = ',', + ['locale_currency'] = '$%s', + + -- Weapons + ['weapon_knife'] = '刀', + ['weapon_nightstick'] = '警棍', + ['weapon_hammer'] = '錘子', + ['weapon_bat'] = '棒球棍', + ['weapon_golfclub'] = '高爾夫球棍', + ['weapon_crowbar'] = '撬棍', + ['weapon_pistol'] = '手槍', + ['weapon_combatpistol'] = '戰鬥手槍', + ['weapon_appistol'] = '穿甲手槍', + ['weapon_pistol50'] = '.50口徑手槍', + ['weapon_microsmg'] = '迷你衝鋒槍', + ['weapon_smg'] = '衝鋒槍', + ['weapon_assaultsmg'] = '突擊衝鋒槍', + ['weapon_assaultrifle'] = '突擊步槍', + ['weapon_carbinerifle'] = '卡賓槍步槍', + ['weapon_advancedrifle'] = '精準步槍', + ['weapon_mg'] = '機槍', + ['weapon_combatmg'] = '戰鬥機槍', + ['weapon_pumpshotgun'] = '霰彈槍', + ['weapon_sawnoffshotgun'] = '削短型霰彈槍', + ['weapon_assaultshotgun'] = '突擊霰彈槍', + ['weapon_bullpupshotgun'] = '泵動式霰彈槍', + ['weapon_stungun'] = '電擊槍', + ['weapon_sniperrifle'] = '狙擊步槍', + ['weapon_heavysniper'] = '重型狙擊槍', + ['weapon_grenadelauncher'] = '榴彈砲', + ['weapon_rpg'] = '火箭炮', + ['weapon_minigun'] = '火神機槍', + ['weapon_grenade'] = '手榴彈', + ['weapon_stickybomb'] = '黏彈', + ['weapon_smokegrenade'] = '煙霧彈', + ['weapon_bzgas'] = '催淚瓦斯', + ['weapon_molotov'] = '汽油彈', + ['weapon_fireextinguisher'] = '滅火器', + ['weapon_petrolcan'] = '汽油桶', + ['weapon_ball'] = '棒球', + ['weapon_snspistol'] = '劣質手槍', + ['weapon_bottle'] = '酒瓶', + ['weapon_gusenberg'] = '古森柏衝鋒槍', + ['weapon_specialcarbine'] = '特製卡賓槍', + ['weapon_heavypistol'] = '重型手槍', + ['weapon_bullpuprifle'] = 'AUG突擊步槍', + ['weapon_dagger'] = '匕首', + ['weapon_vintagepistol'] = '老式手槍', + ['weapon_firework'] = '煙火發射器', + ['weapon_musket'] = '老式火槍', + ['weapon_heavyshotgun'] = '重型霰彈槍', + ['weapon_marksmanrifle'] = '精確射手步槍', + ['weapon_hominglauncher'] = '火箭彈發射器', + ['weapon_proxmine'] = '感應地雷', + ['weapon_snowball'] = '雪球', + ['weapon_flaregun'] = '信號槍', + ['weapon_combatpdw'] = '戰鬥自衛衝鋒槍', + ['weapon_marksmanpistol'] = '神射手槍', + ['weapon_knuckle'] = '指虎', + ['weapon_hatchet'] = '斧頭', + ['weapon_railgun'] = '電磁軌彈炮', + ['weapon_machete'] = '開山刀', + ['weapon_machinepistol'] = '衝鋒手槍', + ['weapon_switchblade'] = '蝴蝶刀', + ['weapon_revolver'] = '重左輪手槍', + ['weapon_dbshotgun'] = '雙槍霰彈槍', + ['weapon_compactrifle'] = '半自動步槍', + ['weapon_autoshotgun'] = '半自動霰彈槍', + ['weapon_battleaxe'] = '戰斧', + ['weapon_compactlauncher'] = '精簡榴彈發射器', + ['weapon_minismg'] = '迷你衝鋒槍', + ['weapon_pipebomb'] = '土製炸彈', + ['weapon_poolcue'] = '桌球桿', + ['weapon_wrench'] = '扳手', + ['weapon_flashlight'] = '手電筒', + ['gadget_parachute'] = '降落傘', + ['weapon_flare'] = '信號棒', + ['weapon_doubleaction'] = '左輪手槍', + + -- Weapon Components + ['component_clip_default'] = '默認彈夾', + ['component_clip_extended'] = '延伸彈夾', + ['component_clip_drum'] = '彈鼓式彈匣', + ['component_clip_box'] = '盒式彈匣', + ['component_flashlight'] = '手電筒', + ['component_scope'] = '瞄準鏡', + ['component_scope_advanced'] = '高級瞄準鏡', + ['component_suppressor'] = '消音管', + ['component_grip'] = '握把', + ['component_luxary_finish'] = '豪華塗裝', + + -- Weapon Ammo + ['ammo_rounds'] = '發(子彈)', + ['ammo_shells'] = '發(子彈)', + ['ammo_charge'] = '噴', + ['ammo_petrol'] = '加崙(燃料)', + ['ammo_firework'] = '發(煙火子彈)', + ['ammo_rockets'] = '枚(火箭彈)', + ['ammo_grenadelauncher'] = '發(榴彈)', + ['ammo_grenade'] = '枚(手榴彈)', + ['ammo_stickybomb'] = '枚(炸彈)', + ['ammo_pipebomb'] = '枚(炸彈)', + ['ammo_smokebomb'] = '枚(炸彈)', + ['ammo_molotov'] = '瓶(汽油瓶)', + ['ammo_proxmine'] = '個(地雷)', + ['ammo_bzgas'] = '罐', + ['ammo_ball'] = '顆(球)', + ['ammo_snowball'] = '顆(雪球)', + ['ammo_flare'] = '根(信號棒)', + ['ammo_flaregun'] = '發(信號彈)', + + -- Weapon Tints + ['tint_default'] = '默認色調', + ['tint_green'] = '綠色調', + ['tint_gold'] = '金色調', + ['tint_pink'] = '粉色調', + ['tint_army'] = '軍用色調', + ['tint_lspd'] = '洛聖都警察局色調', + ['tint_orange'] = '橘色調', + ['tint_platinum'] = '柏金色調', +} diff --git a/[esx]/es_extended/server/classes/player.lua b/[esx]/es_extended/server/classes/player.lua new file mode 100644 index 00000000..148210b4 --- /dev/null +++ b/[esx]/es_extended/server/classes/player.lua @@ -0,0 +1,503 @@ +function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory, weight, job, loadout, name, coords) + local self = {} + + self.accounts = accounts + self.coords = coords + self.group = group + self.identifier = identifier + self.inventory = inventory + self.job = job + self.loadout = loadout + self.name = name + self.playerId = playerId + self.source = playerId + self.variables = {} + self.weight = weight + self.maxWeight = Config.MaxWeight + if Config.Multichar then self.license = 'license'..string.sub(identifier, 6) else self.license = 'license:'..identifier end + + ExecuteCommand(('add_principal identifier.%s group.%s'):format(self.license, self.group)) + + self.triggerEvent = function(eventName, ...) + TriggerClientEvent(eventName, self.source, ...) + end + + self.setCoords = function(coords) + self.updateCoords(coords) + self.triggerEvent('esx:teleport', coords) + end + + self.updateCoords = function(coords) + self.coords = {x = ESX.Math.Round(coords.x, 1), y = ESX.Math.Round(coords.y, 1), z = ESX.Math.Round(coords.z, 1), heading = ESX.Math.Round(coords.heading or 0.0, 1)} + end + + self.getCoords = function(vector) + if vector then + return vector3(self.coords.x, self.coords.y, self.coords.z) + else + return self.coords + end + end + + self.kick = function(reason) + DropPlayer(self.source, reason) + end + + self.setMoney = function(money) + money = ESX.Math.Round(money) + self.setAccountMoney('money', money) + end + + self.getMoney = function() + return self.getAccount('money').money + end + + self.addMoney = function(money) + money = ESX.Math.Round(money) + self.addAccountMoney('money', money) + end + + self.removeMoney = function(money) + money = ESX.Math.Round(money) + self.removeAccountMoney('money', money) + end + + self.getIdentifier = function() + return self.identifier + end + + self.setGroup = function(newGroup) + ExecuteCommand(('remove_principal identifier.%s group.%s'):format(self.license, self.group)) + self.group = newGroup + ExecuteCommand(('add_principal identifier.%s group.%s'):format(self.license, self.group)) + end + + self.getGroup = function() + return self.group + end + + self.set = function(k, v) + self.variables[k] = v + end + + self.get = function(k) + return self.variables[k] + end + + self.getAccounts = function(minimal) + if minimal then + local minimalAccounts = {} + + for k,v in ipairs(self.accounts) do + minimalAccounts[v.name] = v.money + end + + return minimalAccounts + else + return self.accounts + end + end + + self.getAccount = function(account) + for k,v in ipairs(self.accounts) do + if v.name == account then + return v + end + end + end + + self.getInventory = function(minimal) + if minimal then + local minimalInventory = {} + + for k,v in ipairs(self.inventory) do + if v.count > 0 then + minimalInventory[v.name] = v.count + end + end + + return minimalInventory + else + return self.inventory + end + end + + self.getJob = function() + return self.job + end + + self.getLoadout = function(minimal) + if minimal then + local minimalLoadout = {} + + for k,v in ipairs(self.loadout) do + minimalLoadout[v.name] = {ammo = v.ammo} + if v.tintIndex > 0 then minimalLoadout[v.name].tintIndex = v.tintIndex end + + if #v.components > 0 then + local components = {} + + for k2,component in ipairs(v.components) do + if component ~= 'clip_default' then + table.insert(components, component) + end + end + + if #components > 0 then + minimalLoadout[v.name].components = components + end + end + end + + return minimalLoadout + else + return self.loadout + end + end + + self.getName = function() + return self.name + end + + self.setName = function(newName) + self.name = newName + end + + self.setAccountMoney = function(accountName, money) + if money >= 0 then + local account = self.getAccount(accountName) + + if account then + local prevMoney = account.money + local newMoney = ESX.Math.Round(money) + account.money = newMoney + + self.triggerEvent('esx:setAccountMoney', account) + end + end + end + + self.addAccountMoney = function(accountName, money) + if money > 0 then + local account = self.getAccount(accountName) + + if account then + local newMoney = account.money + ESX.Math.Round(money) + account.money = newMoney + + self.triggerEvent('esx:setAccountMoney', account) + end + end + end + + self.removeAccountMoney = function(accountName, money) + if money > 0 then + local account = self.getAccount(accountName) + + if account then + local newMoney = account.money - ESX.Math.Round(money) + account.money = newMoney + + self.triggerEvent('esx:setAccountMoney', account) + end + end + end + + self.getInventoryItem = function(name) + for k,v in ipairs(self.inventory) do + if v.name == name then + return v + end + end + + return + end + + self.addInventoryItem = function(name, count) + local item = self.getInventoryItem(name) + + if item then + count = ESX.Math.Round(count) + item.count = item.count + count + self.weight = self.weight + (item.weight * count) + + TriggerEvent('esx:onAddInventoryItem', self.source, item.name, item.count) + self.triggerEvent('esx:addInventoryItem', item.name, item.count) + end + end + + self.removeInventoryItem = function(name, count) + local item = self.getInventoryItem(name) + + if item then + count = ESX.Math.Round(count) + local newCount = item.count - count + + if newCount >= 0 then + item.count = newCount + self.weight = self.weight - (item.weight * count) + + TriggerEvent('esx:onRemoveInventoryItem', self.source, item.name, item.count) + self.triggerEvent('esx:removeInventoryItem', item.name, item.count) + end + end + end + + self.setInventoryItem = function(name, count) + local item = self.getInventoryItem(name) + + if item and count >= 0 then + count = ESX.Math.Round(count) + + if count > item.count then + self.addInventoryItem(item.name, count - item.count) + else + self.removeInventoryItem(item.name, item.count - count) + end + end + end + + self.getWeight = function() + return self.weight + end + + self.getMaxWeight = function() + return self.maxWeight + end + + self.canCarryItem = function(name, count) + local currentWeight, itemWeight = self.weight, ESX.Items[name].weight + local newWeight = currentWeight + (itemWeight * count) + + return newWeight <= self.maxWeight + end + + self.canSwapItem = function(firstItem, firstItemCount, testItem, testItemCount) + local firstItemObject = self.getInventoryItem(firstItem) + local testItemObject = self.getInventoryItem(testItem) + + if firstItemObject.count >= firstItemCount then + local weightWithoutFirstItem = ESX.Math.Round(self.weight - (firstItemObject.weight * firstItemCount)) + local weightWithTestItem = ESX.Math.Round(weightWithoutFirstItem + (testItemObject.weight * testItemCount)) + + return weightWithTestItem <= self.maxWeight + end + + return false + end + + self.setMaxWeight = function(newWeight) + self.maxWeight = newWeight + self.triggerEvent('esx:setMaxWeight', self.maxWeight) + end + + self.setJob = function(job, grade) + grade = tostring(grade) + local lastJob = json.decode(json.encode(self.job)) + + if ESX.DoesJobExist(job, grade) then + local jobObject, gradeObject = ESX.Jobs[job], ESX.Jobs[job].grades[grade] + + self.job.id = jobObject.id + self.job.name = jobObject.name + self.job.label = jobObject.label + + self.job.grade = tonumber(grade) + self.job.grade_name = gradeObject.name + self.job.grade_label = gradeObject.label + self.job.grade_salary = gradeObject.salary + + if gradeObject.skin_male then + self.job.skin_male = json.decode(gradeObject.skin_male) + else + self.job.skin_male = {} + end + + if gradeObject.skin_female then + self.job.skin_female = json.decode(gradeObject.skin_female) + else + self.job.skin_female = {} + end + + TriggerEvent('esx:setJob', self.source, self.job, lastJob) + self.triggerEvent('esx:setJob', self.job) + else + print(('[es_extended] [^3WARNING^7] Ignoring invalid .setJob() usage for "%s"'):format(self.identifier)) + end + end + + self.addWeapon = function(weaponName, ammo) + if not self.hasWeapon(weaponName) then + local weaponLabel = ESX.GetWeaponLabel(weaponName) + + table.insert(self.loadout, { + name = weaponName, + ammo = ammo, + label = weaponLabel, + components = {}, + tintIndex = 0 + }) + + self.triggerEvent('esx:addWeapon', weaponName, ammo) + self.triggerEvent('esx:addInventoryItem', weaponLabel, false, true) + end + end + + self.addWeaponComponent = function(weaponName, weaponComponent) + local loadoutNum, weapon = self.getWeapon(weaponName) + + if weapon then + local component = ESX.GetWeaponComponent(weaponName, weaponComponent) + + if component then + if not self.hasWeaponComponent(weaponName, weaponComponent) then + table.insert(self.loadout[loadoutNum].components, weaponComponent) + self.triggerEvent('esx:addWeaponComponent', weaponName, weaponComponent) + self.triggerEvent('esx:addInventoryItem', component.label, false, true) + end + end + end + end + + self.addWeaponAmmo = function(weaponName, ammoCount) + local loadoutNum, weapon = self.getWeapon(weaponName) + + if weapon then + weapon.ammo = weapon.ammo + ammoCount + self.triggerEvent('esx:setWeaponAmmo', weaponName, weapon.ammo) + end + end + + self.updateWeaponAmmo = function(weaponName, ammoCount) + local loadoutNum, weapon = self.getWeapon(weaponName) + + if weapon then + if ammoCount < weapon.ammo then + weapon.ammo = ammoCount + end + end + end + + self.setWeaponTint = function(weaponName, weaponTintIndex) + local loadoutNum, weapon = self.getWeapon(weaponName) + + if weapon then + local weaponNum, weaponObject = ESX.GetWeapon(weaponName) + + if weaponObject.tints and weaponObject.tints[weaponTintIndex] then + self.loadout[loadoutNum].tintIndex = weaponTintIndex + self.triggerEvent('esx:setWeaponTint', weaponName, weaponTintIndex) + self.triggerEvent('esx:addInventoryItem', weaponObject.tints[weaponTintIndex], false, true) + end + end + end + + self.getWeaponTint = function(weaponName) + local loadoutNum, weapon = self.getWeapon(weaponName) + + if weapon then + return weapon.tintIndex + end + + return 0 + end + + self.removeWeapon = function(weaponName) + local weaponLabel + + for k,v in ipairs(self.loadout) do + if v.name == weaponName then + weaponLabel = v.label + + for k2,v2 in ipairs(v.components) do + self.removeWeaponComponent(weaponName, v2) + end + + table.remove(self.loadout, k) + break + end + end + + if weaponLabel then + self.triggerEvent('esx:removeWeapon', weaponName) + self.triggerEvent('esx:removeInventoryItem', weaponLabel, false, true) + end + end + + self.removeWeaponComponent = function(weaponName, weaponComponent) + local loadoutNum, weapon = self.getWeapon(weaponName) + + if weapon then + local component = ESX.GetWeaponComponent(weaponName, weaponComponent) + + if component then + if self.hasWeaponComponent(weaponName, weaponComponent) then + for k,v in ipairs(self.loadout[loadoutNum].components) do + if v == weaponComponent then + table.remove(self.loadout[loadoutNum].components, k) + break + end + end + + self.triggerEvent('esx:removeWeaponComponent', weaponName, weaponComponent) + self.triggerEvent('esx:removeInventoryItem', component.label, false, true) + end + end + end + end + + self.removeWeaponAmmo = function(weaponName, ammoCount) + local loadoutNum, weapon = self.getWeapon(weaponName) + + if weapon then + weapon.ammo = weapon.ammo - ammoCount + self.triggerEvent('esx:setWeaponAmmo', weaponName, weapon.ammo) + end + end + + self.hasWeaponComponent = function(weaponName, weaponComponent) + local loadoutNum, weapon = self.getWeapon(weaponName) + + if weapon then + for k,v in ipairs(weapon.components) do + if v == weaponComponent then + return true + end + end + + return false + else + return false + end + end + + self.hasWeapon = function(weaponName) + for k,v in ipairs(self.loadout) do + if v.name == weaponName then + return true + end + end + + return false + end + + self.getWeapon = function(weaponName) + for k,v in ipairs(self.loadout) do + if v.name == weaponName then + return k, v + end + end + + return + end + + self.showNotification = function(msg) + self.triggerEvent('esx:showNotification', msg) + end + + self.showHelpNotification = function(msg, thisFrame, beep, duration) + self.triggerEvent('esx:showHelpNotification', msg, thisFrame, beep, duration) + end + + return self +end diff --git a/[esx]/es_extended/server/commands.lua b/[esx]/es_extended/server/commands.lua new file mode 100644 index 00000000..cdc668aa --- /dev/null +++ b/[esx]/es_extended/server/commands.lua @@ -0,0 +1,217 @@ +ESX.RegisterCommand('setcoords', 'admin', function(xPlayer, args, showError) + xPlayer.setCoords({x = args.x, y = args.y, z = args.z}) +end, false, {help = _U('command_setcoords'), validate = true, arguments = { + {name = 'x', help = _U('command_setcoords_x'), type = 'number'}, + {name = 'y', help = _U('command_setcoords_y'), type = 'number'}, + {name = 'z', help = _U('command_setcoords_z'), type = 'number'} +}}) + +ESX.RegisterCommand('setjob', 'admin', function(xPlayer, args, showError) + if ESX.DoesJobExist(args.job, args.grade) then + args.playerId.setJob(args.job, args.grade) + else + showError(_U('command_setjob_invalid')) + end +end, true, {help = _U('command_setjob'), validate = true, arguments = { + {name = 'playerId', help = _U('commandgeneric_playerid'), type = 'player'}, + {name = 'job', help = _U('command_setjob_job'), type = 'string'}, + {name = 'grade', help = _U('command_setjob_grade'), type = 'number'} +}}) + +ESX.RegisterCommand('car', 'admin', function(xPlayer, args, showError) + if not args.car then args.car = "baller2" end + xPlayer.triggerEvent('esx:spawnVehicle', args.car) +end, false, {help = _U('command_car'), validate = false, arguments = { + {name = 'car', help = _U('command_car_car'), type = 'any'} +}}) + +ESX.RegisterCommand({'cardel', 'dv'}, 'admin', function(xPlayer, args, showError) + if not args.radius then args.radius = 4 end + xPlayer.triggerEvent('esx:deleteVehicle', args.radius) +end, false, {help = _U('command_cardel'), validate = false, arguments = { + {name = 'radius', help = _U('command_cardel_radius'), type = 'any'} +}}) + +ESX.RegisterCommand('setaccountmoney', 'admin', function(xPlayer, args, showError) + if args.playerId.getAccount(args.account) then + args.playerId.setAccountMoney(args.account, args.amount) + else + showError(_U('command_giveaccountmoney_invalid')) + end +end, true, {help = _U('command_setaccountmoney'), validate = true, arguments = { + {name = 'playerId', help = _U('commandgeneric_playerid'), type = 'player'}, + {name = 'account', help = _U('command_giveaccountmoney_account'), type = 'string'}, + {name = 'amount', help = _U('command_setaccountmoney_amount'), type = 'number'} +}}) + +ESX.RegisterCommand('giveaccountmoney', 'admin', function(xPlayer, args, showError) + if args.playerId.getAccount(args.account) then + args.playerId.addAccountMoney(args.account, args.amount) + else + showError(_U('command_giveaccountmoney_invalid')) + end +end, true, {help = _U('command_giveaccountmoney'), validate = true, arguments = { + {name = 'playerId', help = _U('commandgeneric_playerid'), type = 'player'}, + {name = 'account', help = _U('command_giveaccountmoney_account'), type = 'string'}, + {name = 'amount', help = _U('command_giveaccountmoney_amount'), type = 'number'} +}}) + +ESX.RegisterCommand('giveitem', 'admin', function(xPlayer, args, showError) + args.playerId.addInventoryItem(args.item, args.count) +end, true, {help = _U('command_giveitem'), validate = true, arguments = { + {name = 'playerId', help = _U('commandgeneric_playerid'), type = 'player'}, + {name = 'item', help = _U('command_giveitem_item'), type = 'item'}, + {name = 'count', help = _U('command_giveitem_count'), type = 'number'} +}}) + +ESX.RegisterCommand('giveweapon', 'admin', function(xPlayer, args, showError) + if args.playerId.hasWeapon(args.weapon) then + showError(_U('command_giveweapon_hasalready')) + else + args.playerId.addWeapon(args.weapon, args.ammo) + end +end, true, {help = _U('command_giveweapon'), validate = true, arguments = { + {name = 'playerId', help = _U('commandgeneric_playerid'), type = 'player'}, + {name = 'weapon', help = _U('command_giveweapon_weapon'), type = 'weapon'}, + {name = 'ammo', help = _U('command_giveweapon_ammo'), type = 'number'} +}}) + +ESX.RegisterCommand('giveweaponcomponent', 'admin', function(xPlayer, args, showError) + if args.playerId.hasWeapon(args.weaponName) then + local component = ESX.GetWeaponComponent(args.weaponName, args.componentName) + + if component then + if args.playerId.hasWeaponComponent(args.weaponName, args.componentName) then + showError(_U('command_giveweaponcomponent_hasalready')) + else + args.playerId.addWeaponComponent(args.weaponName, args.componentName) + end + else + showError(_U('command_giveweaponcomponent_invalid')) + end + else + showError(_U('command_giveweaponcomponent_missingweapon')) + end +end, true, {help = _U('command_giveweaponcomponent'), validate = true, arguments = { + {name = 'playerId', help = _U('commandgeneric_playerid'), type = 'player'}, + {name = 'weaponName', help = _U('command_giveweapon_weapon'), type = 'weapon'}, + {name = 'componentName', help = _U('command_giveweaponcomponent_component'), type = 'string'} +}}) + +ESX.RegisterCommand({'clear', 'cls'}, 'user', function(xPlayer, args, showError) + xPlayer.triggerEvent('chat:clear') +end, false, {help = _U('command_clear')}) + +ESX.RegisterCommand({'clearall', 'clsall'}, 'admin', function(xPlayer, args, showError) + TriggerClientEvent('chat:clear', -1) +end, false, {help = _U('command_clearall')}) + +ESX.RegisterCommand('clearinventory', 'admin', function(xPlayer, args, showError) + for k,v in ipairs(args.playerId.inventory) do + if v.count > 0 then + args.playerId.setInventoryItem(v.name, 0) + end + end +end, true, {help = _U('command_clearinventory'), validate = true, arguments = { + {name = 'playerId', help = _U('commandgeneric_playerid'), type = 'player'} +}}) + +ESX.RegisterCommand('clearloadout', 'admin', function(xPlayer, args, showError) + for i=#args.playerId.loadout, 1, -1 do + args.playerId.removeWeapon(args.playerId.loadout[i].name) + end +end, true, {help = _U('command_clearloadout'), validate = true, arguments = { + {name = 'playerId', help = _U('commandgeneric_playerid'), type = 'player'} +}}) + +ESX.RegisterCommand('setgroup', 'admin', function(xPlayer, args, showError) + if not args.playerId then args.playerId = xPlayer.source end + if args.group == "superadmin" then args.group = "admin" end + args.playerId.setGroup(args.group) +end, true, {help = _U('command_setgroup'), validate = true, arguments = { + {name = 'playerId', help = _U('commandgeneric_playerid'), type = 'player'}, + {name = 'group', help = _U('command_setgroup_group'), type = 'string'}, +}}) + +ESX.RegisterCommand('save', 'admin', function(xPlayer, args, showError) + ESX.SavePlayer(args.playerId) +end, true, {help = _U('command_save'), validate = true, arguments = { + {name = 'playerId', help = _U('commandgeneric_playerid'), type = 'player'} +}}) + +ESX.RegisterCommand('saveall', 'admin', function(xPlayer, args, showError) + ESX.SavePlayers() +end, true, {help = _U('command_saveall')}) + +ESX.RegisterCommand('group', {"user", "admin"}, function(xPlayer, args, showError) + print(xPlayer.getName()..", You are currently: ^5".. xPlayer.getGroup()) +end, true) + +ESX.RegisterCommand('job', {"user", "admin"}, function(xPlayer, args, showError) +print(xPlayer.getName()..", You are currently: ^5".. xPlayer.getJob().name.. "^0 - ^5".. xPlayer.getJob().grade_label) +end, true) + +ESX.RegisterCommand('info', {"user", "admin"}, function(xPlayer, args, showError) + local job = xPlayer.getJob().name + local jobgrade = xPlayer.getJob().grade_name + print("^2ID : ^5"..xPlayer.source.." ^0| ^2Name:^5"..xPlayer.getName().." ^0 | ^2Group:^5"..xPlayer.getGroup().."^0 | ^2Job:^5".. job.."") + end, true) + +ESX.RegisterCommand('coords', "admin", function(xPlayer, args, showError) + print("".. xPlayer.getName().. ": ^5".. xPlayer.getCoords(true)) +end, true) + +ESX.RegisterCommand('tpm', "admin", function(xPlayer, args, showError) + xPlayer.triggerEvent("esx:tpm") +end, true) + +ESX.RegisterCommand('goto', "admin", function(xPlayer, args, showError) + local targetCoords = args.playerId.getCoords() + xPlayer.setCoords(targetCoords) +end, true, {help = _U('goto'), validate = true, arguments = { + {name = 'playerId', help = _U('commandgeneric_playerid'), type = 'player'} +}}) + +ESX.RegisterCommand('bring', "admin", function(xPlayer, args, showError) + local playerCoords = xPlayer.getCoords() + args.playerId.setCoords(playerCoords) +end, true, {help = _U('bring'), validate = true, arguments = { + {name = 'playerId', help = _U('commandgeneric_playerid'), type = 'player'} +}}) + +ESX.RegisterCommand('kill', "admin", function(xPlayer, args, showError) + args.playerId.triggerEvent('esx:killPlayer') +end, true, {help = _U('kill'), validate = true, arguments = { +{name = 'playerId', help = _U('commandgeneric_playerid'), type = 'player'} +}}) + +ESX.RegisterCommand('freeze', "admin", function(xPlayer, args, showError) + args.playerId.triggerEvent('esx:freezePlayer', "freeze") +end, true, {help = _U('kill'), validate = true, arguments = { +{name = 'playerId', help = _U('commandgeneric_playerid'), type = 'player'} +}}) + +ESX.RegisterCommand('unfreeze', "admin", function(xPlayer, args, showError) + args.playerId.triggerEvent('esx:freezePlayer', "unfreeze") +end, true, {help = _U('kill'), validate = true, arguments = { +{name = 'playerId', help = _U('commandgeneric_playerid'), type = 'player'} +}}) + +ESX.RegisterCommand('reviveall', "admin", function(xPlayer, args, showError) + for _, playerId in ipairs(GetPlayers()) do + TriggerClientEvent('esx_ambulancejob:revive', playerId) + end +end, false) + +ESX.RegisterCommand("noclip", 'admin', function(xPlayer, args, showError) + xPlayer.triggerEvent('esx:noclip') +end, false) + +ESX.RegisterCommand('players', "admin", function(xPlayer, args, showError) + local xAll = ESX.GetPlayers() + print("^5"..#xAll.." ^2online player(s)^0") + for i=1, #xAll, 1 do + local xPlayer = ESX.GetPlayerFromId(xAll[i]) + print("^1[ ^2ID : ^5"..xPlayer.source.." ^0| ^2Name : ^5"..xPlayer.getName().." ^0 | ^2Group : ^5"..xPlayer.getGroup().." ^0 | ^2Identifier : ^5".. xPlayer.identifier .."^1]^0\n") + end +end, true) diff --git a/[esx]/es_extended/server/common.lua b/[esx]/es_extended/server/common.lua new file mode 100644 index 00000000..1eb6aa62 --- /dev/null +++ b/[esx]/es_extended/server/common.lua @@ -0,0 +1,77 @@ +ESX = {} +ESX.Players = {} +ESX.UsableItemsCallbacks = {} +ESX.Items = {} +ESX.ServerCallbacks = {} +ESX.TimeoutCount = -1 +ESX.CancelledTimeouts = {} +ESX.Pickups = {} +ESX.PickupId = 0 +ESX.Jobs = {} +ESX.RegisteredCommands = {} + +AddEventHandler('esx:getSharedObject', function(cb) + cb(ESX) +end) + +function getSharedObject() + return ESX +end + +MySQL.ready(function() + MySQL.Async.fetchAll('SELECT * FROM items', {}, function(result) + for k,v in ipairs(result) do + ESX.Items[v.name] = { + label = v.label, + weight = v.weight, + rare = v.rare, + canRemove = v.can_remove + } + end + end) + + local Jobs = {} + MySQL.Async.fetchAll('SELECT * FROM jobs', {}, function(jobs) + for k,v in ipairs(jobs) do + Jobs[v.name] = v + Jobs[v.name].grades = {} + end + + MySQL.Async.fetchAll('SELECT * FROM job_grades', {}, function(jobGrades) + for k,v in ipairs(jobGrades) do + if Jobs[v.job_name] then + Jobs[v.job_name].grades[tostring(v.grade)] = v + else + print(('[^3WARNING^7] Ignoring job grades for ^5"%s"^0 due to missing job'):format(v.job_name)) + end + end + + for k2,v2 in pairs(Jobs) do + if ESX.Table.SizeOf(v2.grades) == 0 then + Jobs[v2.name] = nil + print(('[^3WARNING^7] Ignoring job ^5"%s"^0due to no job grades found'):format(v2.name)) + end + end + ESX.Jobs = Jobs + print('[^2INFO^7] ESX ^5Legacy^0 initialized') + ESX.StartDBSync() + ESX.StartPayCheck() + end) + end) +end) + +RegisterServerEvent('esx:clientLog') +AddEventHandler('esx:clientLog', function(msg) + if Config.EnableDebug then + print(('[^2TRACE^7] %s^7'):format(msg)) + end +end) + +RegisterServerEvent('esx:triggerServerCallback') +AddEventHandler('esx:triggerServerCallback', function(name, requestId, ...) + local playerId = source + + ESX.TriggerServerCallback(name, requestId, playerId, function(...) + TriggerClientEvent('esx:serverCallback', playerId, requestId, ...) + end, ...) +end) diff --git a/[esx]/es_extended/server/functions.lua b/[esx]/es_extended/server/functions.lua new file mode 100644 index 00000000..a1d3977c --- /dev/null +++ b/[esx]/es_extended/server/functions.lua @@ -0,0 +1,314 @@ +ESX.Trace = function(msg) + if Config.EnableDebug then + print(('[^2TRACE^7] %s^7'):format(msg)) + end +end + +ESX.SetTimeout = function(msec, cb) + local id = ESX.TimeoutCount + 1 + + SetTimeout(msec, function() + if ESX.CancelledTimeouts[id] then + ESX.CancelledTimeouts[id] = nil + else + cb() + end + end) + + ESX.TimeoutCount = id + + return id +end + +ESX.RegisterCommand = function(name, group, cb, allowConsole, suggestion) + if type(name) == 'table' then + for k,v in ipairs(name) do + ESX.RegisterCommand(v, group, cb, allowConsole, suggestion) + end + + return + end + + if ESX.RegisteredCommands[name] then + print(('[^3WARNING^7] Command ^5"%s" already registered, overriding command'):format(name)) + + if ESX.RegisteredCommands[name].suggestion then + TriggerClientEvent('chat:removeSuggestion', -1, ('/%s'):format(name)) + end + end + + if suggestion then + if not suggestion.arguments then suggestion.arguments = {} end + if not suggestion.help then suggestion.help = '' end + + TriggerClientEvent('chat:addSuggestion', -1, ('/%s'):format(name), suggestion.help, suggestion.arguments) + end + + ESX.RegisteredCommands[name] = {group = group, cb = cb, allowConsole = allowConsole, suggestion = suggestion} + + RegisterCommand(name, function(playerId, args, rawCommand) + local command = ESX.RegisteredCommands[name] + + if not command.allowConsole and playerId == 0 then + print(('[^3WARNING^7] ^5%s'):format(_U('commanderror_console'))) + else + local xPlayer, error = ESX.GetPlayerFromId(playerId), nil + + if command.suggestion then + if command.suggestion.validate then + if #args ~= #command.suggestion.arguments then + error = _U('commanderror_argumentmismatch', #args, #command.suggestion.arguments) + end + end + + if not error and command.suggestion.arguments then + local newArgs = {} + + for k,v in ipairs(command.suggestion.arguments) do + if v.type then + if v.type == 'number' then + local newArg = tonumber(args[k]) + + if newArg then + newArgs[v.name] = newArg + else + error = _U('commanderror_argumentmismatch_number', k) + end + elseif v.type == 'player' or v.type == 'playerId' then + local targetPlayer = tonumber(args[k]) + + if args[k] == 'me' then targetPlayer = playerId end + + if targetPlayer then + local xTargetPlayer = ESX.GetPlayerFromId(targetPlayer) + + if xTargetPlayer then + if v.type == 'player' then + newArgs[v.name] = xTargetPlayer + else + newArgs[v.name] = targetPlayer + end + else + error = _U('commanderror_invalidplayerid') + end + else + error = _U('commanderror_argumentmismatch_number', k) + end + elseif v.type == 'string' then + newArgs[v.name] = args[k] + elseif v.type == 'item' then + if ESX.Items[args[k]] then + newArgs[v.name] = args[k] + else + error = _U('commanderror_invaliditem') + end + elseif v.type == 'weapon' then + if ESX.GetWeapon(args[k]) then + newArgs[v.name] = string.upper(args[k]) + else + error = _U('commanderror_invalidweapon') + end + elseif v.type == 'any' then + newArgs[v.name] = args[k] + end + end + + if error then break end + end + + args = newArgs + end + end + + if error then + if playerId == 0 then + print(('[^3WARNING^7] %s^7'):format(error)) + else + xPlayer.triggerEvent('chat:addMessage', {args = {'^1SYSTEM', error}}) + end + else + cb(xPlayer or false, args, function(msg) + if playerId == 0 then + print(('[^3WARNING^7] %s^7'):format(msg)) + else + xPlayer.triggerEvent('chat:addMessage', {args = {'^1SYSTEM', msg}}) + end + end) + end + end + end, true) + + if type(group) == 'table' then + for k,v in ipairs(group) do + ExecuteCommand(('add_ace group.%s command.%s allow'):format(v, name)) + end + else + ExecuteCommand(('add_ace group.%s command.%s allow'):format(group, name)) + end +end + +ESX.ClearTimeout = function(id) + ESX.CancelledTimeouts[id] = true +end + +ESX.RegisterServerCallback = function(name, cb) + ESX.ServerCallbacks[name] = cb +end + +ESX.TriggerServerCallback = function(name, requestId, source, cb, ...) + if ESX.ServerCallbacks[name] then + ESX.ServerCallbacks[name](source, cb, ...) + else + print(('[^3WARNING^7] Server callback ^5"%s"^0 does not exist. ^1Please Check The Server File for Errors!'):format(name)) + end +end + +local savePlayers = -1 +Citizen.CreateThread(function() + savePlayers = MySQL.Sync.store("UPDATE users SET `accounts` = ?, `job` = ?, `job_grade` = ?, `group` = ?, `position` = ?, `inventory` = ?, `loadout` = ? WHERE `identifier` = ?") +end) + +ESX.SavePlayer = function(xPlayer, cb) + local asyncTasks = {} + + table.insert(asyncTasks, function(cb2) + MySQL.Async.execute(savePlayers, { + json.encode(xPlayer.getAccounts(true)), + xPlayer.job.name, + xPlayer.job.grade, + xPlayer.getGroup(), + json.encode(xPlayer.getCoords()), + json.encode(xPlayer.getInventory(true)), + json.encode(xPlayer.getLoadout(true)), + xPlayer.getIdentifier() + }, function(rowsChanged) + cb2() + end) + end) + + Async.parallel(asyncTasks, function(results) + print(('[^2INFO^7] Saved player ^5"%s^7"'):format(xPlayer.getName())) + + if cb then + cb() + end + end) +end + +ESX.SavePlayers = function(cb) + local xPlayers, asyncTasks = ESX.GetPlayers(), {} + + for i=1, #xPlayers, 1 do + table.insert(asyncTasks, function(cb2) + local xPlayer = ESX.GetPlayerFromId(xPlayers[i]) + ESX.SavePlayer(xPlayer, cb2) + end) + end + + Async.parallelLimit(asyncTasks, 8, function(results) + print(('[^2INFO^7] Saved ^5%s^0 player(s)'):format(#xPlayers)) + if cb then + cb() + end + end) +end + +ESX.StartDBSync = function() + function saveData() + ESX.SavePlayers() + SetTimeout(10 * 60 * 1000, saveData) + end + + SetTimeout(10 * 60 * 1000, saveData) +end + +ESX.GetPlayers = function() + local sources = {} + + for k,v in pairs(ESX.Players) do + table.insert(sources, k) + end + + return sources +end + +ESX.GetExtendedPlayers = function(key, val) + local xPlayers = {} + for k, v in pairs(ESX.Players) do + if key then + if (key == 'job' and v.job.name == val) or v[key] == val then + table.insert(xPlayers, v) + end + else + table.insert(xPlayers, v) + end + end + return xPlayers +end + +ESX.GetPlayerFromId = function(source) + return ESX.Players[tonumber(source)] +end + +ESX.GetPlayerFromIdentifier = function(identifier) + for k,v in pairs(ESX.Players) do + if v.identifier == identifier then + return v + end + end +end + +ESX.GetIdentifier = function(playerId) + for k,v in ipairs(GetPlayerIdentifiers(playerId)) do + if string.match(v, 'license:') then + local identifier = string.gsub(v, 'license:', '') + return identifier + end + end +end + +ESX.RegisterUsableItem = function(item, cb) + ESX.UsableItemsCallbacks[item] = cb +end + +ESX.UseItem = function(source, item) + ESX.UsableItemsCallbacks[item](source, item) +end + +ESX.GetItemLabel = function(item) + if ESX.Items[item] then + return ESX.Items[item].label + end +end + +ESX.CreatePickup = function(type, name, count, label, playerId, components, tintIndex) + local pickupId = (ESX.PickupId == 65635 and 0 or ESX.PickupId + 1) + local xPlayer = ESX.GetPlayerFromId(playerId) + local coords = xPlayer.getCoords() + + ESX.Pickups[pickupId] = { + type = type, name = name, + count = count, label = label, + coords = coords + } + + if type == 'item_weapon' then + ESX.Pickups[pickupId].components = components + ESX.Pickups[pickupId].tintIndex = tintIndex + end + + TriggerClientEvent('esx:createPickup', -1, pickupId, label, coords, type, name, components, tintIndex) + ESX.PickupId = pickupId +end + +ESX.DoesJobExist = function(job, grade) + grade = tostring(grade) + + if job and grade then + if ESX.Jobs[job] and ESX.Jobs[job].grades[grade] then + return true + end + end + + return false +end diff --git a/[esx]/es_extended/server/main.lua b/[esx]/es_extended/server/main.lua new file mode 100644 index 00000000..bb5bfcd8 --- /dev/null +++ b/[esx]/es_extended/server/main.lua @@ -0,0 +1,598 @@ +local NewPlayer, LoadPlayer = -1, -1 +Citizen.CreateThread(function() + SetMapName('San Andreas') + SetGameType('ESX Legacy') + + local query = '`accounts`, `job`, `job_grade`, `group`, `position`, `inventory`, `skin`, `loadout`' -- Select these fields from the database + if Config.Multichar or Config.Identity then -- append these fields to the select query + query = query..', `firstname`, `lastname`, `dateofbirth`, `sex`, `height`' + end + + if Config.Multichar then -- insert identity data with creation + MySQL.Async.store("INSERT INTO `users` SET `accounts` = ?, `identifier` = ?, `group` = ?, `firstname` = ?, `lastname` = ?, `dateofbirth` = ?, `sex` = ?, `height` = ?", function(storeId) + NewPlayer = storeId + end) + else + MySQL.Async.store("INSERT INTO `users` SET `accounts` = ?, `identifier` = ?, `group` = ?", function(storeId) + NewPlayer = storeId + end) + end + + MySQL.Async.store("SELECT "..query.." FROM `users` WHERE identifier = ?", function(storeId) + LoadPlayer = storeId + end) +end) + +if Config.Multichar then + AddEventHandler('esx:onPlayerJoined', function(src, char, data) + if not ESX.Players[src] then + local identifier = char..':'..ESX.GetIdentifier(src) + if data then + createESXPlayer(identifier, src, data) + else + loadESXPlayer(identifier, src, false) + end + end + end) +else + RegisterNetEvent('esx:onPlayerJoined') + AddEventHandler('esx:onPlayerJoined', function() + if not ESX.Players[source] then + onPlayerJoined(source) + end + end) +end + +function onPlayerJoined(playerId) + local identifier = ESX.GetIdentifier(playerId) + if identifier then + if ESX.GetPlayerFromIdentifier(identifier) then + DropPlayer(playerId, ('there was an error loading your character!\nError code: identifier-active-ingame\n\nThis error is caused by a player on this server who has the same identifier as you have. Make sure you are not playing on the same Rockstar account.\n\nYour Rockstar identifier: %s'):format(identifier)) + else + MySQL.Async.fetchScalar('SELECT 1 FROM users WHERE identifier = @identifier', { + ['@identifier'] = identifier + }, function(result) + if result then + loadESXPlayer(identifier, playerId, false) + else createESXPlayer(identifier, playerId) end + end) + end + else + DropPlayer(playerId, 'there was an error loading your character!\nError code: identifier-missing-ingame\n\nThe cause of this error is not known, your identifier could not be found. Please come back later or report this problem to the server administration team.') + end +end + +function createESXPlayer(identifier, playerId, data) + local accounts = {} + + for account,money in pairs(Config.StartingAccountMoney) do + accounts[account] = money + end + + if IsPlayerAceAllowed(playerId, "command") then + print(('^2[INFO] ^0 Player ^5%s ^0Has been granted admin permissions via ^5Ace Perms.^7'):format(playerId)) + defaultGroup = "admin" + else + defaultGroup = "user" + end + + if not Config.Multichar then + MySQL.Async.execute(NewPlayer, { + json.encode(accounts), + identifier, + defaultGroup, + }, function(rowsChanged) + loadESXPlayer(identifier, playerId, true) + end) + else + MySQL.Async.execute(NewPlayer, { + json.encode(accounts), + identifier, + defaultGroup, + data.firstname, + data.lastname, + data.dateofbirth, + data.sex, + data.height, + }, function(rowsChanged) + loadESXPlayer(identifier, playerId, true) + end) + end +end + +AddEventHandler('playerConnecting', function(name, setCallback, deferrals) + deferrals.defer() + local playerId = source + local identifier = ESX.GetIdentifier(playerId) + Citizen.Wait(100) + + if identifier then + if ESX.GetPlayerFromIdentifier(identifier) then + deferrals.done(('There was an error loading your character!\nError code: identifier-active\n\nThis error is caused by a player on this server who has the same identifier as you have. Make sure you are not playing on the same account.\n\nYour identifier: %s'):format(identifier)) + else + deferrals.done() + end + else + deferrals.done('There was an error loading your character!\nError code: identifier-missing\n\nThe cause of this error is not known, your identifier could not be found. Please come back later or report this problem to the server administration team.') + end +end) + +function loadESXPlayer(identifier, playerId, isNew) + local tasks = {} + + local userData = { + accounts = {}, + inventory = {}, + job = {}, + loadout = {}, + playerName = GetPlayerName(playerId), + weight = 0 + } + + table.insert(tasks, function(cb) + MySQL.Async.fetchAll(LoadPlayer, { identifier + }, function(result) + local job, grade, jobObject, gradeObject = result[1].job, tostring(result[1].job_grade) + local foundAccounts, foundItems = {}, {} + + -- Accounts + if result[1].accounts and result[1].accounts ~= '' then + local accounts = json.decode(result[1].accounts) + + for account,money in pairs(accounts) do + foundAccounts[account] = money + end + end + + for account,label in pairs(Config.Accounts) do + table.insert(userData.accounts, { + name = account, + money = foundAccounts[account] or Config.StartingAccountMoney[account] or 0, + label = label + }) + end + + -- Job + if ESX.DoesJobExist(job, grade) then + jobObject, gradeObject = ESX.Jobs[job], ESX.Jobs[job].grades[grade] + else + print(('[^3WARNING^7] Ignoring invalid job for %s [job: %s, grade: %s]'):format(identifier, job, grade)) + job, grade = 'unemployed', '0' + jobObject, gradeObject = ESX.Jobs[job], ESX.Jobs[job].grades[grade] + end + + userData.job.id = jobObject.id + userData.job.name = jobObject.name + userData.job.label = jobObject.label + + userData.job.grade = tonumber(grade) + userData.job.grade_name = gradeObject.name + userData.job.grade_label = gradeObject.label + userData.job.grade_salary = gradeObject.salary + + userData.job.skin_male = {} + userData.job.skin_female = {} + + if gradeObject.skin_male then userData.job.skin_male = json.decode(gradeObject.skin_male) end + if gradeObject.skin_female then userData.job.skin_female = json.decode(gradeObject.skin_female) end + + -- Inventory + if result[1].inventory and result[1].inventory ~= '' then + local inventory = json.decode(result[1].inventory) + + for name,count in pairs(inventory) do + local item = ESX.Items[name] + + if item then + foundItems[name] = count + else + print(('[^3WARNING^7] Ignoring invalid item "%s" for "%s"'):format(name, identifier)) + end + end + end + + for name,item in pairs(ESX.Items) do + local count = foundItems[name] or 0 + if count > 0 then userData.weight = userData.weight + (item.weight * count) end + + table.insert(userData.inventory, { + name = name, + count = count, + label = item.label, + weight = item.weight, + usable = ESX.UsableItemsCallbacks[name] ~= nil, + rare = item.rare, + canRemove = item.canRemove + }) + end + + table.sort(userData.inventory, function(a, b) + return a.label < b.label + end) + + -- Group + if result[1].group then + if result[1].group == "superadmin" then + userData.group = "admin" + else + userData.group = result[1].group + end + else + userData.group = 'user' + end + + -- Loadout + if result[1].loadout and result[1].loadout ~= '' then + local loadout = json.decode(result[1].loadout) + + for name,weapon in pairs(loadout) do + local label = ESX.GetWeaponLabel(name) + + if label then + if not weapon.components then weapon.components = {} end + if not weapon.tintIndex then weapon.tintIndex = 0 end + + table.insert(userData.loadout, { + name = name, + ammo = weapon.ammo, + label = label, + components = weapon.components, + tintIndex = weapon.tintIndex + }) + end + end + end + + -- Position + if result[1].position and result[1].position ~= '' then + userData.coords = json.decode(result[1].position) + else + print('[^3WARNING^7] Column ^5"position"^0 in ^5"users"^0 table is missing required default value. Using backup coords, fix your database.') + userData.coords = {x = -269.4, y = -955.3, z = 31.2, heading = 205.8} + end + + -- Skin + if result[1].skin and result[1].skin ~= '' then + userData.skin = json.decode(result[1].skin) + else + if userData.sex == 'f' then userData.skin = {sex=1} else userData.skin = {sex=0} end + end + + -- Identity + if result[1].firstname and result[1].firstname ~= '' then + userData.firstname = result[1].firstname + userData.lastname = result[1].lastname + userData.playerName = userData.firstname..' '..userData.lastname + if result[1].dateofbirth then userData.dateofbirth = result[1].dateofbirth end + if result[1].sex then userData.sex = result[1].sex end + if result[1].height then userData.height = result[1].height end + end + + cb() + end) + end) + + Async.parallel(tasks, function(results) + local xPlayer = CreateExtendedPlayer(playerId, identifier, userData.group, userData.accounts, userData.inventory, userData.weight, userData.job, userData.loadout, userData.playerName, userData.coords) + ESX.Players[playerId] = xPlayer + + if userData.firstname then + xPlayer.set('firstName', userData.firstname) + xPlayer.set('lastName', userData.lastname) + if userData.dateofbirth then xPlayer.set('dateofbirth', userData.dateofbirth) end + if userData.sex then xPlayer.set('sex', userData.sex) end + if userData.height then xPlayer.set('height', userData.height) end + end + + TriggerEvent('esx:playerLoaded', playerId, xPlayer, isNew) + + xPlayer.triggerEvent('esx:playerLoaded', { + accounts = xPlayer.getAccounts(), + coords = xPlayer.getCoords(), + identifier = xPlayer.getIdentifier(), + inventory = xPlayer.getInventory(), + job = xPlayer.getJob(), + loadout = xPlayer.getLoadout(), + maxWeight = xPlayer.getMaxWeight(), + money = xPlayer.getMoney(), + dead = false + }, isNew, userData.skin) + + xPlayer.triggerEvent('esx:createMissingPickups', ESX.Pickups) + xPlayer.triggerEvent('esx:registerSuggestions', ESX.RegisteredCommands) + print(('[^2INFO^0] Player ^5"%s" ^0has connected to the server. ID: ^5%s^7'):format(xPlayer.getName(), playerId)) + end) +end + +AddEventHandler('chatMessage', function(playerId, author, message) + if message:sub(1, 1) == '/' and playerId > 0 then + CancelEvent() + local commandName = message:sub(1):gmatch("%w+")() + TriggerClientEvent('chat:addMessage', playerId, {args = {'^1SYSTEM', _U('commanderror_invalidcommand', commandName)}}) + end +end) + +AddEventHandler('playerDropped', function(reason) + local playerId = source + local xPlayer = ESX.GetPlayerFromId(playerId) + + if xPlayer then + TriggerEvent('esx:playerDropped', playerId, reason) + + ESX.SavePlayer(xPlayer, function() + ESX.Players[playerId] = nil + end) + end +end) + +if Config.Multichar then + AddEventHandler('esx:playerLogout', function(playerId) + local xPlayer = ESX.GetPlayerFromId(playerId) + if xPlayer then + TriggerEvent('esx:playerDropped', playerId, reason) + + ESX.SavePlayer(xPlayer, function() + ESX.Players[playerId] = nil + end) + end + TriggerClientEvent("esx:onPlayerLogout", playerId) + end) +end + +RegisterNetEvent('esx:updateCoords') +AddEventHandler('esx:updateCoords', function(coords) + local xPlayer = ESX.GetPlayerFromId(source) + + if xPlayer then + xPlayer.updateCoords(coords) + end +end) + +RegisterNetEvent('esx:updateWeaponAmmo') +AddEventHandler('esx:updateWeaponAmmo', function(weaponName, ammoCount) + local xPlayer = ESX.GetPlayerFromId(source) + + if xPlayer then + xPlayer.updateWeaponAmmo(weaponName, ammoCount) + end +end) + +RegisterNetEvent('esx:giveInventoryItem') +AddEventHandler('esx:giveInventoryItem', function(target, type, itemName, itemCount) + local playerId = source + local sourceXPlayer = ESX.GetPlayerFromId(playerId) + local targetXPlayer = ESX.GetPlayerFromId(target) + + if type == 'item_standard' then + local sourceItem = sourceXPlayer.getInventoryItem(itemName) + + if itemCount > 0 and sourceItem.count >= itemCount then + if targetXPlayer.canCarryItem(itemName, itemCount) then + sourceXPlayer.removeInventoryItem(itemName, itemCount) + targetXPlayer.addInventoryItem (itemName, itemCount) + + sourceXPlayer.showNotification(_U('gave_item', itemCount, sourceItem.label, targetXPlayer.name)) + targetXPlayer.showNotification(_U('received_item', itemCount, sourceItem.label, sourceXPlayer.name)) + else + sourceXPlayer.showNotification(_U('ex_inv_lim', targetXPlayer.name)) + end + else + sourceXPlayer.showNotification(_U('imp_invalid_quantity')) + end + elseif type == 'item_account' then + if itemCount > 0 and sourceXPlayer.getAccount(itemName).money >= itemCount then + sourceXPlayer.removeAccountMoney(itemName, itemCount) + targetXPlayer.addAccountMoney (itemName, itemCount) + + sourceXPlayer.showNotification(_U('gave_account_money', ESX.Math.GroupDigits(itemCount), Config.Accounts[itemName], targetXPlayer.name)) + targetXPlayer.showNotification(_U('received_account_money', ESX.Math.GroupDigits(itemCount), Config.Accounts[itemName], sourceXPlayer.name)) + else + sourceXPlayer.showNotification(_U('imp_invalid_amount')) + end + elseif type == 'item_weapon' then + if sourceXPlayer.hasWeapon(itemName) then + local weaponLabel = ESX.GetWeaponLabel(itemName) + + if not targetXPlayer.hasWeapon(itemName) then + local _, weapon = sourceXPlayer.getWeapon(itemName) + local _, weaponObject = ESX.GetWeapon(itemName) + itemCount = weapon.ammo + + sourceXPlayer.removeWeapon(itemName) + targetXPlayer.addWeapon(itemName, itemCount) + + if weaponObject.ammo and itemCount > 0 then + local ammoLabel = weaponObject.ammo.label + sourceXPlayer.showNotification(_U('gave_weapon_withammo', weaponLabel, itemCount, ammoLabel, targetXPlayer.name)) + targetXPlayer.showNotification(_U('received_weapon_withammo', weaponLabel, itemCount, ammoLabel, sourceXPlayer.name)) + else + sourceXPlayer.showNotification(_U('gave_weapon', weaponLabel, targetXPlayer.name)) + targetXPlayer.showNotification(_U('received_weapon', weaponLabel, sourceXPlayer.name)) + end + else + sourceXPlayer.showNotification(_U('gave_weapon_hasalready', targetXPlayer.name, weaponLabel)) + targetXPlayer.showNotification(_U('received_weapon_hasalready', sourceXPlayer.name, weaponLabel)) + end + end + elseif type == 'item_ammo' then + if sourceXPlayer.hasWeapon(itemName) then + local weaponNum, weapon = sourceXPlayer.getWeapon(itemName) + + if targetXPlayer.hasWeapon(itemName) then + local _, weaponObject = ESX.GetWeapon(itemName) + + if weaponObject.ammo then + local ammoLabel = weaponObject.ammo.label + + if weapon.ammo >= itemCount then + sourceXPlayer.removeWeaponAmmo(itemName, itemCount) + targetXPlayer.addWeaponAmmo(itemName, itemCount) + + sourceXPlayer.showNotification(_U('gave_weapon_ammo', itemCount, ammoLabel, weapon.label, targetXPlayer.name)) + targetXPlayer.showNotification(_U('received_weapon_ammo', itemCount, ammoLabel, weapon.label, sourceXPlayer.name)) + end + end + else + sourceXPlayer.showNotification(_U('gave_weapon_noweapon', targetXPlayer.name)) + targetXPlayer.showNotification(_U('received_weapon_noweapon', sourceXPlayer.name, weapon.label)) + end + end + end +end) + +RegisterNetEvent('esx:removeInventoryItem') +AddEventHandler('esx:removeInventoryItem', function(type, itemName, itemCount) + local playerId = source + local xPlayer = ESX.GetPlayerFromId(source) + + if type == 'item_standard' then + if itemCount == nil or itemCount < 1 then + xPlayer.showNotification(_U('imp_invalid_quantity')) + else + local xItem = xPlayer.getInventoryItem(itemName) + + if (itemCount > xItem.count or xItem.count < 1) then + xPlayer.showNotification(_U('imp_invalid_quantity')) + else + xPlayer.removeInventoryItem(itemName, itemCount) + local pickupLabel = ('~y~%s~s~ [~b~%s~s~]'):format(xItem.label, itemCount) + ESX.CreatePickup('item_standard', itemName, itemCount, pickupLabel, playerId) + xPlayer.showNotification(_U('threw_standard', itemCount, xItem.label)) + end + end + elseif type == 'item_account' then + if itemCount == nil or itemCount < 1 then + xPlayer.showNotification(_U('imp_invalid_amount')) + else + local account = xPlayer.getAccount(itemName) + + if (itemCount > account.money or account.money < 1) then + xPlayer.showNotification(_U('imp_invalid_amount')) + else + xPlayer.removeAccountMoney(itemName, itemCount) + local pickupLabel = ('~y~%s~s~ [~g~%s~s~]'):format(account.label, _U('locale_currency', ESX.Math.GroupDigits(itemCount))) + ESX.CreatePickup('item_account', itemName, itemCount, pickupLabel, playerId) + xPlayer.showNotification(_U('threw_account', ESX.Math.GroupDigits(itemCount), string.lower(account.label))) + end + end + elseif type == 'item_weapon' then + itemName = string.upper(itemName) + + if xPlayer.hasWeapon(itemName) then + local _, weapon = xPlayer.getWeapon(itemName) + local _, weaponObject = ESX.GetWeapon(itemName) + local components, pickupLabel = ESX.Table.Clone(weapon.components) + xPlayer.removeWeapon(itemName) + + if weaponObject.ammo and weapon.ammo > 0 then + local ammoLabel = weaponObject.ammo.label + pickupLabel = ('~y~%s~s~ [~g~%s~s~ %s]'):format(weapon.label, weapon.ammo, ammoLabel) + xPlayer.showNotification(_U('threw_weapon_ammo', weapon.label, weapon.ammo, ammoLabel)) + else + pickupLabel = ('~y~%s~s~'):format(weapon.label) + xPlayer.showNotification(_U('threw_weapon', weapon.label)) + end + + ESX.CreatePickup('item_weapon', itemName, weapon.ammo, pickupLabel, playerId, components, weapon.tintIndex) + end + end +end) + +RegisterNetEvent('esx:useItem') +AddEventHandler('esx:useItem', function(itemName) + local xPlayer = ESX.GetPlayerFromId(source) + local count = xPlayer.getInventoryItem(itemName).count + + if count > 0 then + ESX.UseItem(source, itemName) + else + xPlayer.showNotification(_U('act_imp')) + end +end) + +RegisterNetEvent('esx:onPickup') +AddEventHandler('esx:onPickup', function(pickupId) + local pickup, xPlayer, success = ESX.Pickups[pickupId], ESX.GetPlayerFromId(source) + + if pickup then + if pickup.type == 'item_standard' then + if xPlayer.canCarryItem(pickup.name, pickup.count) then + xPlayer.addInventoryItem(pickup.name, pickup.count) + success = true + else + xPlayer.showNotification(_U('threw_cannot_pickup')) + end + elseif pickup.type == 'item_account' then + success = true + xPlayer.addAccountMoney(pickup.name, pickup.count) + elseif pickup.type == 'item_weapon' then + if xPlayer.hasWeapon(pickup.name) then + xPlayer.showNotification(_U('threw_weapon_already')) + else + success = true + xPlayer.addWeapon(pickup.name, pickup.count) + xPlayer.setWeaponTint(pickup.name, pickup.tintIndex) + + for k,v in ipairs(pickup.components) do + xPlayer.addWeaponComponent(pickup.name, v) + end + end + end + + if success then + ESX.Pickups[pickupId] = nil + TriggerClientEvent('esx:removePickup', -1, pickupId) + end + end +end) + +ESX.RegisterServerCallback('esx:getPlayerData', function(source, cb) + local xPlayer = ESX.GetPlayerFromId(source) + + cb({ + identifier = xPlayer.identifier, + accounts = xPlayer.getAccounts(), + inventory = xPlayer.getInventory(), + job = xPlayer.getJob(), + loadout = xPlayer.getLoadout(), + money = xPlayer.getMoney() + }) +end) + +ESX.RegisterServerCallback('esx:getOtherPlayerData', function(source, cb, target) + local xPlayer = ESX.GetPlayerFromId(target) + + cb({ + identifier = xPlayer.identifier, + accounts = xPlayer.getAccounts(), + inventory = xPlayer.getInventory(), + job = xPlayer.getJob(), + loadout = xPlayer.getLoadout(), + money = xPlayer.getMoney() + }) +end) + +ESX.RegisterServerCallback('esx:getPlayerNames', function(source, cb, players) + players[source] = nil + + for playerId,v in pairs(players) do + local xPlayer = ESX.GetPlayerFromId(playerId) + + if xPlayer then + players[playerId] = xPlayer.getName() + else + players[playerId] = nil + end + end + + cb(players) +end) + +AddEventHandler('txAdmin:events:scheduledRestart', function(eventData) + if eventData.secondsRemaining == 60 then + Citizen.CreateThread(function() + Citizen.Wait(50000) + ESX.SavePlayers() + end) + end +end) diff --git a/[esx]/es_extended/server/paycheck.lua b/[esx]/es_extended/server/paycheck.lua new file mode 100644 index 00000000..293898f9 --- /dev/null +++ b/[esx]/es_extended/server/paycheck.lua @@ -0,0 +1,44 @@ +ESX.StartPayCheck = function() + function payCheck() + local xPlayers = ESX.GetPlayers() + + for i=1, #xPlayers, 1 do + local xPlayer = ESX.GetPlayerFromId(xPlayers[i]) + local job = xPlayer.job.grade_name + local salary = xPlayer.job.grade_salary + + if salary > 0 then + if job == 'unemployed' then -- unemployed + xPlayer.addAccountMoney('bank', salary) + TriggerClientEvent('esx:showAdvancedNotification', xPlayer.source, _U('bank'), _U('received_paycheck'), _U('received_help', salary), 'CHAR_BANK_MAZE', 9) + elseif Config.EnableSocietyPayouts then -- possibly a society + TriggerEvent('esx_society:getSociety', xPlayer.job.name, function (society) + if society ~= nil then -- verified society + TriggerEvent('esx_addonaccount:getSharedAccount', society.account, function (account) + if account.money >= salary then -- does the society money to pay its employees? + xPlayer.addAccountMoney('bank', salary) + account.removeMoney(salary) + + TriggerClientEvent('esx:showAdvancedNotification', xPlayer.source, _U('bank'), _U('received_paycheck'), _U('received_salary', salary), 'CHAR_BANK_MAZE', 9) + else + TriggerClientEvent('esx:showAdvancedNotification', xPlayer.source, _U('bank'), '', _U('company_nomoney'), 'CHAR_BANK_MAZE', 1) + end + end) + else -- not a society + xPlayer.addAccountMoney('bank', salary) + TriggerClientEvent('esx:showAdvancedNotification', xPlayer.source, _U('bank'), _U('received_paycheck'), _U('received_salary', salary), 'CHAR_BANK_MAZE', 9) + end + end) + else -- generic job + xPlayer.addAccountMoney('bank', salary) + TriggerClientEvent('esx:showAdvancedNotification', xPlayer.source, _U('bank'), _U('received_paycheck'), _U('received_salary', salary), 'CHAR_BANK_MAZE', 9) + end + end + + end + + SetTimeout(Config.PaycheckInterval, payCheck) + end + + SetTimeout(Config.PaycheckInterval, payCheck) +end diff --git a/[esx]/es_extended/version.json b/[esx]/es_extended/version.json new file mode 100644 index 00000000..477b5b19 --- /dev/null +++ b/[esx]/es_extended/version.json @@ -0,0 +1,5 @@ +{ + "version": "legacy", + "commit" : "1.3.5", + "changelog": "\n- Base resources updated to use ESX Legacy improvements\n - Improved functionality for ESX.GetExtendedPlayers to return specific players only\n - " +} diff --git a/[esx]/esx_identity/.editorconfig b/[esx]/esx_identity/.editorconfig new file mode 100644 index 00000000..9b425256 --- /dev/null +++ b/[esx]/esx_identity/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_size = 4 +indent_style = tab +end_of_line = crlf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/[esx]/esx_identity/LICENSE b/[esx]/esx_identity/LICENSE new file mode 100644 index 00000000..30ace6a8 --- /dev/null +++ b/[esx]/esx_identity/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + {one line to give the program's name and a brief idea of what it does.} + Copyright (C) {year} {name of author} + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + {project} Copyright (C) {year} {fullname} + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. \ No newline at end of file diff --git a/[esx]/esx_identity/README.md b/[esx]/esx_identity/README.md new file mode 100644 index 00000000..2d466b10 --- /dev/null +++ b/[esx]/esx_identity/README.md @@ -0,0 +1,53 @@ +# esx_identity + +## Requirements +* Dependencies For Full Functionality + * [esx_skin](https://github.com/ESX-Org/esx_skin) + * [esx_policejob](https://github.com/ESX-Org/esx_policejob) + * [esx_society](https://github.com/ESX-Org/esx_society) + +## Download & Installation + +### Using [fvm](https://github.com/qlaffont/fvm-installer) +``` +fvm install --save --folder=esx esx-org/esx_identity +``` + +### Using Git +``` +cd resources +git clone https://github.com/ESX-Org/esx_identity [esx]/esx_identity +``` + +### Manually +- Download https://github.com/ESX-Org/esx_identity/archive/master.zip +- Put it in the `[esx]` directory + +## Installation +- Import `esx_identity.sql` in your database +- Add this to your `server.cfg`: + +``` +start esx_identity +``` + +- If you are using esx_policejob or esx_society, you need to enable the following in the scripts' `config.lua`: +```Config.EnableESXIdentity = true``` + +### Commands +``` +/char +/chardel +``` + +# Legal +### License +esx_identity - rp characters + +Copyright (C) 2015-2020 Jérémie N'gadi + +This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version. + +This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details. + +You should have received a copy Of the GNU General Public License along with this program. If Not, see http://www.gnu.org/licenses/. diff --git a/[esx]/esx_identity/client/main.lua b/[esx]/esx_identity/client/main.lua new file mode 100644 index 00000000..cf5359c1 --- /dev/null +++ b/[esx]/esx_identity/client/main.lua @@ -0,0 +1,93 @@ +ESX = nil +local loadingScreenFinished = false + +Citizen.CreateThread(function() + while ESX == nil do + TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + Citizen.Wait(0) + end +end) + +RegisterNetEvent('esx_identity:alreadyRegistered') +AddEventHandler('esx_identity:alreadyRegistered', function() + while not loadingScreenFinished do + Citizen.Wait(100) + end + + TriggerEvent('esx_skin:playerRegistered') +end) + +AddEventHandler('esx:loadingScreenOff', function() + loadingScreenFinished = true +end) + +if not Config.UseDeferrals then + local guiEnabled, isDead = false, false + + AddEventHandler('esx:onPlayerDeath', function(data) + isDead = true + end) + + AddEventHandler('esx:onPlayerSpawn', function(spawn) + isDead = false + end) + + function EnableGui(state) + SetNuiFocus(state, state) + guiEnabled = state + + SendNUIMessage({ + type = "enableui", + enable = state + }) + end + + RegisterNetEvent('esx_identity:showRegisterIdentity') + AddEventHandler('esx_identity:showRegisterIdentity', function() + TriggerEvent('esx_skin:resetFirstSpawn') + + if not isDead then + EnableGui(true) + end + end) + + RegisterNUICallback('register', function(data, cb) + ESX.TriggerServerCallback('esx_identity:registerIdentity', function(callback) + if callback then + ESX.ShowNotification(_U('thank_you_for_registering')) + EnableGui(false) + if not ESX.GetConfig().Multichar then TriggerEvent('esx_skin:playerRegistered') end + else + ESX.ShowNotification(_U('registration_error')) + end + end, data) + end) + + Citizen.CreateThread(function() + while true do + Citizen.Wait(5) + + if guiEnabled then + DisableControlAction(0, 1, true) -- LookLeftRight + DisableControlAction(0, 2, true) -- LookUpDown + DisableControlAction(0, 106, true) -- VehicleMouseControlOverride + DisableControlAction(0, 142, true) -- MeleeAttackAlternate + DisableControlAction(0, 30, true) -- MoveLeftRight + DisableControlAction(0, 31, true) -- MoveUpDown + DisableControlAction(0, 21, true) -- disable sprint + DisableControlAction(0, 24, true) -- disable attack + DisableControlAction(0, 25, true) -- disable aim + DisableControlAction(0, 47, true) -- disable weapon + DisableControlAction(0, 58, true) -- disable weapon + DisableControlAction(0, 263, true) -- disable melee + DisableControlAction(0, 264, true) -- disable melee + DisableControlAction(0, 257, true) -- disable melee + DisableControlAction(0, 140, true) -- disable melee + DisableControlAction(0, 141, true) -- disable melee + DisableControlAction(0, 143, true) -- disable melee + DisableControlAction(0, 75, true) -- disable exit vehicle + DisableControlAction(27, 75, true) -- disable exit vehicle + end + end + end) +end diff --git a/[esx]/esx_identity/config.lua b/[esx]/esx_identity/config.lua new file mode 100644 index 00000000..2c21e317 --- /dev/null +++ b/[esx]/esx_identity/config.lua @@ -0,0 +1,29 @@ +Config = {} +Config.Locale = 'en' + +-- [Config.EnableCommands] +-- Enables Commands Such As /char and /chardel +Config.EnableCommands = true + +-- [Config.UseSteamID] +-- Changes the identifiers from Rockstar License To Steam. In order to use this, you will have to have +-- made edits to your ESX in order to use Steam identifiers all around, because new ESX uses Rockstar +-- license. I just made it easier for people that convert to steam identifiers. + +-- [Config.UseDeferrals] +-- EXPERIMENTAL Character Registration Method. This will allow players to create identities in deferrals +-- before they ever join the server. This still needs time of testing to see what issues that we have +-- in linux servers and windows servers, and which artifacts it will work on, and which artifacts it +-- will not work on. If you don't know a lot about this, I would suggest to set it false for now. +Config.UseDeferrals = false -- EXPERIMENTAL Character Registration Method. + + +-- These values are for the second input validation in server/main.lua +Config.MaxNameLength = 20 +Config.MinHeight = 45 +Config.MaxHeight = 96 +Config.LowestYear = 1900 +Config.HighestYear = 2021 + +Config.FullCharDelete = false +Config.EnableDebugging = false diff --git a/[esx]/esx_identity/esx_identity.sql b/[esx]/esx_identity/esx_identity.sql new file mode 100644 index 00000000..ed5a3b06 --- /dev/null +++ b/[esx]/esx_identity/esx_identity.sql @@ -0,0 +1,9 @@ +USE `es_extended`; + +ALTER TABLE `users` + ADD COLUMN `firstname` VARCHAR(16) NULL DEFAULT NULL, + ADD COLUMN `lastname` VARCHAR(16) NULL DEFAULT NULL, + ADD COLUMN `dateofbirth` VARCHAR(10) NULL DEFAULT NULL, + ADD COLUMN `sex` VARCHAR(1) NULL DEFAULT NULL, + ADD COLUMN `height` INT NULL DEFAULT NULL +; diff --git a/[esx]/esx_identity/fxmanifest.lua b/[esx]/esx_identity/fxmanifest.lua new file mode 100644 index 00000000..72cf2823 --- /dev/null +++ b/[esx]/esx_identity/fxmanifest.lua @@ -0,0 +1,41 @@ +fx_version 'adamant' + +game 'gta5' + +description 'ESX Identity' + +version '1.4.0' + +server_scripts { + '@es_extended/locale.lua', + '@mysql-async/lib/MySQL.lua', + 'locales/en.lua', + 'locales/es.lua', + 'locales/cs.lua', + 'locales/pl.lua', + 'locales/fi.lua', + 'config.lua', + 'server/main.lua' +} + +client_scripts { + '@es_extended/locale.lua', + 'locales/en.lua', + 'locales/es.lua', + 'locales/cs.lua', + 'locales/pl.lua', + 'locales/fi.lua', + 'config.lua', + 'client/main.lua' +} + +ui_page 'html/index.html' + +files { + 'html/index.html', + 'html/js/script.js', + 'html/css/style.css', + 'html/img/esx_identity.png' +} + +dependency 'es_extended' diff --git a/[esx]/esx_identity/html/css/style.css b/[esx]/esx_identity/html/css/style.css new file mode 100644 index 00000000..eaa2535e --- /dev/null +++ b/[esx]/esx_identity/html/css/style.css @@ -0,0 +1,127 @@ +body { + font-family: sans-serif; + overflow: hidden; + display: none; + color: #000000; +} + +.dialog { + width: 332px; + opacity : 0.95; + position : absolute; + margin-left: auto; + margin-right: auto; + top : 30.0%; + padding: 10px; + left : 50%; /* à 50%/50% du parent référent */ + transform : translate(-50%); /* décalage de 50% de sa propre taille */ + background-color: #B7B7B7; + border-radius : 4px; + box-shadow: 0px 0px 50px 0px #000; + border-left:5px solid #000; + border:1px inset; + margin:5px; + margin-bottom:20px; + color: #000000; +} + +input { + width: 100%; + padding: 10px; + text-align:left; + color: #000000; +} + +::placeholder { /* Chrome, Firefox, Opera, Safari 10.1+ */ + color: black; + opacity: 1; /* Firefox */ +} + +.radio-toolbar input[type="radio"] { + opacity: 0; + position: absolute; + width: 36%; +} + +.radio-toolbar label { + display: inline-block; + margin-top: 5px; + background-color: #ddd; + padding: 10px 20px; + font-family: sans-serif, Arial; + font-size: 16px; + color: #000000; + border: 2px solid #444; + border-radius: 4px; + width: 36%; +} + +.radio-toolbar input[type="radio"]:checked + label { + width: 36%; + background-color:#3399FF; + border-color: #0033FF; + color: #000000; +} + +.radio-toolbar input[type="radio"]:focus + label { + border: 2px solid #444; + width: 36%; + color: #000000; +} + +.radio-toolbar label:hover { + background-color: #dfd; + width: 36%; + color: #000000; +} + +button { + display: block; + margin-top: 5px; + padding: 10px; + background-color: #373737; + border: 2px solid #444; + color: #FFFFFF; + width: 100%; +} + +h1 { + display: block; + margin-top: 5px; + margin-right: 5px; + padding: 10px; + background-color: #506be6; + color: #000000; + width: 93%; + text-align: center; +} + +.range-wrap { + position: relative; + margin: 0 auto 3rem; +} + +.range { + width: 100%; +} + +.bubble { + background: #3399FF; + color: black; + padding: 4px 12px; + position: absolute; + border-radius: 4px; + left: 50%; + transform: translateX(-50%); +} + +.bubble::after { + content: ""; + position: absolute; + width: 2px; + height: 2px; + background: #3399FF; + color: black; + top: -1px; + left: 50%; +} \ No newline at end of file diff --git a/[esx]/esx_identity/html/img/esx_identity.png b/[esx]/esx_identity/html/img/esx_identity.png new file mode 100644 index 00000000..dcfc17c4 Binary files /dev/null and b/[esx]/esx_identity/html/img/esx_identity.png differ diff --git a/[esx]/esx_identity/html/index.html b/[esx]/esx_identity/html/index.html new file mode 100644 index 00000000..182d344a --- /dev/null +++ b/[esx]/esx_identity/html/index.html @@ -0,0 +1,163 @@ + + + + + + + + + +
+ +
+
+
+
+
+
+ + + + + +
+
+
+ + +
+ +
+
If the submit button doesn't work, please ensure that you've entered the fields correctly.
+
+ + + + diff --git a/[esx]/esx_identity/html/index_heightslider.html b/[esx]/esx_identity/html/index_heightslider.html new file mode 100644 index 00000000..182d344a --- /dev/null +++ b/[esx]/esx_identity/html/index_heightslider.html @@ -0,0 +1,163 @@ + + + + + + + + + +
+ +
+
+
+
+
+
+ + + + + +
+
+
+ + +
+ +
+
If the submit button doesn't work, please ensure that you've entered the fields correctly.
+
+ + + + diff --git a/[esx]/esx_identity/html/index_heighttext.html b/[esx]/esx_identity/html/index_heighttext.html new file mode 100644 index 00000000..13896e58 --- /dev/null +++ b/[esx]/esx_identity/html/index_heighttext.html @@ -0,0 +1,150 @@ + + + + + + + + + +
+ +
+
+
+
+
+
+
+ + + + + +
+
+ +
+
If the submit button doesn't work, please ensure that you've entered the fields correctly.
+
+ + + + diff --git a/[esx]/esx_identity/html/index_options/index_heightslider.html b/[esx]/esx_identity/html/index_options/index_heightslider.html new file mode 100644 index 00000000..182d344a --- /dev/null +++ b/[esx]/esx_identity/html/index_options/index_heightslider.html @@ -0,0 +1,163 @@ + + + + + + + + + +
+ +
+
+
+
+
+
+ + + + + +
+
+
+ + +
+ +
+
If the submit button doesn't work, please ensure that you've entered the fields correctly.
+
+ + + + diff --git a/[esx]/esx_identity/html/index_options/index_heighttext.html b/[esx]/esx_identity/html/index_options/index_heighttext.html new file mode 100644 index 00000000..13896e58 --- /dev/null +++ b/[esx]/esx_identity/html/index_options/index_heighttext.html @@ -0,0 +1,150 @@ + + + + + + + + + +
+ +
+
+
+
+
+
+
+ + + + + +
+
+ +
+
If the submit button doesn't work, please ensure that you've entered the fields correctly.
+
+ + + + diff --git a/[esx]/esx_identity/html/js/script.js b/[esx]/esx_identity/html/js/script.js new file mode 100644 index 00000000..a6a5afce --- /dev/null +++ b/[esx]/esx_identity/html/js/script.js @@ -0,0 +1,34 @@ +$(function() { + window.addEventListener('message', function(event) { + if (event.data.type == "enableui") { + document.body.style.display = event.data.enable ? "block" : "none"; + } + }); + + $("#register").submit(function(event) { + event.preventDefault(); // Prevent form from submitting + + // Verify date + var date = $("#dateofbirth").val(); + var dateCheck = new Date($("#dateofbirth").val()); + + if (dateCheck == "Invalid Date") { + date == "invalid"; + } + else { + const ye = new Intl.DateTimeFormat('en', { year: 'numeric' }).format(dateCheck) + const mo = new Intl.DateTimeFormat('en', { month: '2-digit' }).format(dateCheck) + const da = new Intl.DateTimeFormat('en', { day: '2-digit' }).format(dateCheck) + + var formattedDate = `${mo}/${da}/${ye}`; + + $.post('http://esx_identity/register', JSON.stringify({ + firstname: $("#firstname").val(), + lastname: $("#lastname").val(), + dateofbirth: formattedDate, + sex: $("input[type='radio'][name='sex']:checked").val(), + height: $("#height").val() + })); + } + }); +}); diff --git a/[esx]/esx_identity/html/localization/cs_index(outofdate).html b/[esx]/esx_identity/html/localization/cs_index(outofdate).html new file mode 100644 index 00000000..1dd357a9 --- /dev/null +++ b/[esx]/esx_identity/html/localization/cs_index(outofdate).html @@ -0,0 +1,22 @@ + + + + + + + +
+
+

Register

+
+
+
+
+ Male + Female
+ +
+
+ + + diff --git a/[esx]/esx_identity/html/localization/fi_index(outofdate).html b/[esx]/esx_identity/html/localization/fi_index(outofdate).html new file mode 100644 index 00000000..87ca250a --- /dev/null +++ b/[esx]/esx_identity/html/localization/fi_index(outofdate).html @@ -0,0 +1,22 @@ + + + + + + + +
+
+

Rekistöröinti

+
+
+
+
+ Mies + Nainen
+ +
+
+ + + diff --git a/[esx]/esx_identity/html/localization/ko_index(outofdate).html b/[esx]/esx_identity/html/localization/ko_index(outofdate).html new file mode 100644 index 00000000..c04fe9b7 --- /dev/null +++ b/[esx]/esx_identity/html/localization/ko_index(outofdate).html @@ -0,0 +1,22 @@ + + + + + + + +
+
+

등록

+
+
+
+
+ 남자 + 여자
+ +
+
+ + + \ No newline at end of file diff --git a/[esx]/esx_identity/html/localization/sv_index(outofdate).html b/[esx]/esx_identity/html/localization/sv_index(outofdate).html new file mode 100644 index 00000000..7706c17b --- /dev/null +++ b/[esx]/esx_identity/html/localization/sv_index(outofdate).html @@ -0,0 +1,22 @@ + + + + + + + +
+
+

Registrera

+
+
+
+
+ Man + Kvinna
+ +
+
+ + + diff --git a/[esx]/esx_identity/locales/cs.lua b/[esx]/esx_identity/locales/cs.lua new file mode 100644 index 00000000..80c6a267 --- /dev/null +++ b/[esx]/esx_identity/locales/cs.lua @@ -0,0 +1,11 @@ +Locales['cs'] = { + ['show_registration'] = 'zobrazit registracni menu', + ['show_active_character'] = 'zobrazit aktivni postavy', + ['delete_character'] = 'smazat svou stavajici postavu a vytvorit novou', + ['deleted_character'] = 'vase postava byla smazana.', + ['not_registered'] = 'nemas zaregistrovanou postavu.', + ['active_character'] = '~b~aktivni postava:~s~ %s %s', + ['already_registered'] = 'jiz mas zaregistrovanou postavu.', + ['failed_identity'] = 'nastaveni vasi postavy selhalo, zkus to prosim znovu pozdeji nebo kontaktuj majitele serveru!', + ['create_a_character'] = 'aby jsi mohl/a hrat, tak se musis registrovat.' +} diff --git a/[esx]/esx_identity/locales/en.lua b/[esx]/esx_identity/locales/en.lua new file mode 100644 index 00000000..165ee7ae --- /dev/null +++ b/[esx]/esx_identity/locales/en.lua @@ -0,0 +1,33 @@ +Locales['en'] = { + ['show_active_character'] = 'Show Active Character', + ['active_character'] = 'Active Character: ~b~%s~s~', + ['error_active_character'] = "There was an error retrieving your name. Please contact an admin.", + ['delete_character'] = 'Delete Your Character And Create A New One', + ['deleted_character'] = 'Your character has been deleted.', + ['error_delete_character'] = "There was an error deleting your character. Please contact an admin.", + ['thank_you_for_registering'] = "Thank you for registering. Have fun.", + ['registration_error'] = "There was an error during registration. Please contact an admin.", + ['debug_xPlayer_get_first_name'] = "Return Your First Name", + ['debug_xPlayer_get_last_name'] = "Return Your Last Name", + ['debug_xPlayer_get_full_name'] = "Return Your Full Name", + ['debug_xPlayer_get_sex'] = "Return Your Sex", + ['debug_xPlayer_get_dob'] = "Return Your DOB", + ['debug_xPlayer_get_height'] = "Return Your Height", + ['error_debug_xPlayer_get_first_name'] = "There was an error retrieving your first name.", + ['error_debug_xPlayer_get_last_name'] = "There was an error retrieving your last name.", + ['error_debug_xPlayer_get_full_name'] = "There was an error retrieving your full name.", + ['error_debug_xPlayer_get_sex'] = "There was an error retrieving your sex.", + ['error_debug_xPlayer_get_dob'] = "There was an error retrieving your date of birth.", + ['error_debug_xPlayer_get_height'] = "There was an error retrieving your height.", + ['return_debug_xPlayer_get_first_name'] = "First Name: ~b~%s", + ['return_debug_xPlayer_get_last_name'] = "Last Name: ~b~%s", + ['return_debug_xPlayer_get_full_name'] = "Full Name: ~b~%s", + ['return_debug_xPlayer_get_sex'] = "Sex: ~b~%s", + ['return_debug_xPlayer_get_dob'] = "DOB: ~b~%s", + ['return_debug_xPlayer_get_height'] = "Height: ~b~%s Inches", + ['data_incorrect'] = 'Data entered incorrectly. Please try again.', + ['invalid_format'] = 'Data formatted incorrectly. Please try again.', + ['no_identifier'] = 'There was an error loading your character!\nError code: identifier-missing\n\nThe cause of this error is not known, your identifier could not be found. Please come back later or report this problem to the server administration team.', + ['missing_identity'] = 'There was an error loading your character!\nError code: identity-missing\n\nIt seems like your identity is missing, try connecting again.', + ['deleted_identity'] = 'Your character has been deleted. Please login again in order to create a new character.' +} diff --git a/[esx]/esx_identity/locales/es.lua b/[esx]/esx_identity/locales/es.lua new file mode 100644 index 00000000..2352d302 --- /dev/null +++ b/[esx]/esx_identity/locales/es.lua @@ -0,0 +1,33 @@ +Locales['es'] = { + ['show_active_character'] = 'Mostrar personaje activo', + ['active_character'] = 'Personaje activo: ~b~%s~s~', + ['error_active_character'] = "Se produjo un error al recuperar tu nombre. Por favor contacta con un administrador", + ['delete_character'] = 'Elimina tu personaje y crea uno nuevo', + ['deleted_character'] = 'Tu personaje ha sido eliminado', + ['error_delete_character'] = "Se produjo un error al eliminar tu personaje. Por favor contacta con un administrador", + ['thank_you_for_registering'] = "Gracias por registrarte. Que te diviertas", + ['registration_error'] = "Se ha producido un error durante el registro. Por favor contacta con un administrador", + ['debug_xPlayer_get_first_name'] = "Devuelve tu nombre", + ['debug_xPlayer_get_last_name'] = "Devuelve tu apellido", + ['debug_xPlayer_get_full_name'] = "Devuelve tu nombre completo", + ['debug_xPlayer_get_sex'] = "Devuelve tu sexo", + ['debug_xPlayer_get_dob'] = "Devuelve tu fecha de nacimiento", + ['debug_xPlayer_get_height'] = "Devuelve tu altura", + ['error_debug_xPlayer_get_first_name'] = "Se produjo un error al recuperar tu nombre", + ['error_debug_xPlayer_get_last_name'] = "Se produjo un error al recuperar tu apellido", + ['error_debug_xPlayer_get_full_name'] = "Se produjo un error al recuperar tu nombre completo", + ['error_debug_xPlayer_get_sex'] = "Se produjo un error al recuperar tu sexo", + ['error_debug_xPlayer_get_dob'] = "Se produjo un error al recuperar tu fecha de nacimiento", + ['error_debug_xPlayer_get_height'] = "Se produjo un error al recuperar tu altura", + ['return_debug_xPlayer_get_first_name'] = "Nombre: ~b~%s", + ['return_debug_xPlayer_get_last_name'] = "Apellido: ~b~%s", + ['return_debug_xPlayer_get_full_name'] = "Nombre completo: ~b~%s", + ['return_debug_xPlayer_get_sex'] = "Sexo: ~b~%s", + ['return_debug_xPlayer_get_dob'] = "Fecha de nacimiento: ~b~%s", + ['return_debug_xPlayer_get_height'] = "Altura: ~b~%s centímetros", + ['data_incorrect'] = 'Datos introducidos de forma incorrecta. Inténtalo de nuevo', + ['invalid_format'] = 'Datos con formato incorrecto. Inténtalo de nuevo', + ['no_identifier'] = '¡Se ha producido un error al cargar tu personaje!\nCódigo de error: identifier-missing\n\nSe desconoce la causa de este error, no se pudo encontrar su identificador. Regrese más tarde o informe este problema al equipo de administración del servidor', + ['missing_identity'] = '¡Se ha producido un error al cargar tu personaje!\nCódigo de error: identity-missing\n\nParece que falta su identidad, intente conectarse nuevamente', + ['deleted_identity'] = 'Tu personaje ha sido borrado. Vuelva a iniciar sesión para crear un nuevo personaje' +} diff --git a/[esx]/esx_identity/locales/fi.lua b/[esx]/esx_identity/locales/fi.lua new file mode 100644 index 00000000..a1720782 --- /dev/null +++ b/[esx]/esx_identity/locales/fi.lua @@ -0,0 +1,33 @@ +Locales['fi'] = { + ['show_active_character'] = 'Näytä nykyinen hahmosi', + ['active_character'] = 'Nykyinen hahmosi: ~b~%s~s~', + ['error_active_character'] = "Hahmosi hakemisessa ilmeni ongelma. Ota yhteyttä ylläpitoon.", + ['delete_character'] = 'Poista hahmosi ja luo uusi.', + ['deleted_character'] = 'Hahmosi on poistetu.', + ['error_delete_character'] = "Hahmosi poistossa ilmeni ongelma. Ota yhteyttä ylläpitoon.", + ['thank_you_for_registering'] = "Kiitos registeröitymisestä. Pidä hauskaa!", + ['registration_error'] = "Registeröinnissä ilmeni ongelma. Ota yhteyttä ylläpitoon.", + ['debug_xPlayer_get_first_name'] = "Palauta etunimi", + ['debug_xPlayer_get_last_name'] = "Palauta sukunimi", + ['debug_xPlayer_get_full_name'] = "Palauta kokonimi", + ['debug_xPlayer_get_sex'] = "Palauta sukupuoli", + ['debug_xPlayer_get_dob'] = "Palauta syntymäpäivä", + ['debug_xPlayer_get_height'] = "Palauta pituus", + ['error_debug_xPlayer_get_first_name'] = "Hahmosi etunimen haussa ilmeni ongelma.", + ['error_debug_xPlayer_get_last_name'] = "Hahmosi sukunimen haussa ilmeni ongelma.", + ['error_debug_xPlayer_get_full_name'] = "Hahmosi kokonimen haussa ilmeni ongelma.", + ['error_debug_xPlayer_get_sex'] = "Hahmosi sukupuolen haussa ilmeni ongelma.", + ['error_debug_xPlayer_get_dob'] = "Hahmosi syntymäpäivän haussa ilmeni ongelma.", + ['error_debug_xPlayer_get_height'] = "Hahmosi pituuden haussa ilmeni ongelma.", + ['return_debug_xPlayer_get_first_name'] = "Etunimi: ~b~%s", + ['return_debug_xPlayer_get_last_name'] = "Sukunimi: ~b~%s", + ['return_debug_xPlayer_get_full_name'] = "Kokonimi: ~b~%s", + ['return_debug_xPlayer_get_sex'] = "Sukupuoli: ~b~%s", + ['return_debug_xPlayer_get_dob'] = "Syntymäpäivä: ~b~%s", + ['return_debug_xPlayer_get_height'] = "Pituus: ~b~%s CM", + ['data_incorrect'] = 'Data syötetty väärin. Yritä uudelleen.', + ['invalid_format'] = 'Data syötetty väärässä muodossa. Yritä uudelleen.', + ['no_identifier'] = 'Hahmosi lataamisessa ilmeni ongelma!\nVirhekoodi: identifier-missing\n\nVirhekoodin syytä ei tiedetä, joten ota yhteyttä ylläpitoon.', + ['missing_identity'] = 'Hahmosi lataamisessa ilmeni ongelma!\nError code: identity-missing\n\nNäyttää että hahmoasi ei ole olemassa. Kokeile yhdistää uudelleen tai ota yhteyttä ylläpitoon', + ['deleted_identity'] = 'Hahmosi on poistetu. Yhdistä uudestaan palvelimelle luodaksesi uuden hahmosi.' +} diff --git a/[esx]/esx_identity/locales/pl.lua b/[esx]/esx_identity/locales/pl.lua new file mode 100644 index 00000000..72b2d38a --- /dev/null +++ b/[esx]/esx_identity/locales/pl.lua @@ -0,0 +1,33 @@ +Locales['pl'] = { + ['show_active_character'] = 'Pokaż aktywną postać', + ['active_character'] = 'Aktywna postać: ~b~%s~s~', + ['error_active_character'] = "Podczas pobierania Twojego imienia wystąpił błąd. Proszę skontaktować się z administratorem.", + ['delete_character'] = 'Usuń swoją postać i stwórz nową', + ['deleted_character'] = 'Twoja postać została usunięta.', + ['error_delete_character'] = "Wystąpił błąd podczas usuwania twojej postaci. Proszę skontaktować się z administratorem.", + ['thank_you_for_registering'] = "Dziękujemy za rejestrację. Baw się dobrze.", + ['registration_error'] = "Wystąpił błąd podczas rejestracji. Proszę skontaktować się z administratorem.", + ['debug_xPlayer_get_first_name'] = "Podaj swoje imię", + ['debug_xPlayer_get_last_name'] = "Podaj swoje nazwisko", + ['debug_xPlayer_get_full_name'] = "Podaj swoją pełną nazwę", + ['debug_xPlayer_get_sex'] = "Podaj swoją płeć", + ['debug_xPlayer_get_dob'] = "Podaj swoją datę urodzenia", + ['debug_xPlayer_get_height'] = "Podaj swój wzrost", + ['error_debug_xPlayer_get_first_name'] = "Podczas pobierania twojego imienia wystąpił błąd.", + ['error_debug_xPlayer_get_last_name'] = "Podczas pobierania twojego nazwiska wystąpił błąd.", + ['error_debug_xPlayer_get_full_name'] = "Podczas pobierania twojego pełnego imienia wystąpił błąd.", + ['error_debug_xPlayer_get_sex'] = "Podczas pobierania twojej płci wystąpił błąd.", + ['error_debug_xPlayer_get_dob'] = "Podczas pobierania daty urodzenia wystąpił błąd.", + ['error_debug_xPlayer_get_height'] = "Podczas pobierania wzrostu wystąpił błąd.", + ['return_debug_xPlayer_get_first_name'] = "Imię: ~b~%s", + ['return_debug_xPlayer_get_last_name'] = "Nazwisko: ~b~%s", + ['return_debug_xPlayer_get_full_name'] = "Pełna nazwa: ~b~%s", + ['return_debug_xPlayer_get_sex'] = "Płeć: ~b~%s", + ['return_debug_xPlayer_get_dob'] = "Data urodzenia: ~b~%s", + ['return_debug_xPlayer_get_height'] = "Wzrost: ~b~%s centymetrów", + ['data_incorrect'] = 'Data została wprowadzona niepoprawnie. Proszę spróbuj ponownie.', + ['invalid_format'] = 'Data została wprowadzona niepoprawnie. Proszę spróbuj ponownie.', + ['no_identifier'] = 'Wystąpił błąd podczas ładowania twojej postaci!\nKod błędu: identifier-missing\n\nPrzyczyna tego błędu nie jest znana, nie można znaleźć Twojego identyfikatora. Wróć później lub zgłoś ten problem zespołowi administracyjnemu serwera.', + ['missing_identity'] = 'Wystąpił błąd podczas ładowania twojej postaci!\nKod błędu: identity-missing\n\nWygląda na to, że brakuje Twojej tożsamości, spróbuj połączyć się ponownie.', + ['deleted_identity'] = 'Twoja postać została usunięta. Dołącz ponownie, aby utworzyć nową postać.' +} diff --git a/[esx]/esx_identity/server/main.lua b/[esx]/esx_identity/server/main.lua new file mode 100644 index 00000000..ba3de70b --- /dev/null +++ b/[esx]/esx_identity/server/main.lua @@ -0,0 +1,547 @@ +ESX = nil +TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) +local playerIdentity = {} +local alreadyRegistered = {} +local multichar = ESX.GetConfig().Multichar + +if multichar == nil then + ESX.GetIdentifier = function(playerId) + for k,v in ipairs(GetPlayerIdentifiers(playerId)) do + if string.match(v, 'license:') then + local identifier = string.gsub(v, 'license:', '') + return identifier + end + end + end +end + +if Config.UseDeferrals then + AddEventHandler('playerConnecting', function(playerName, setKickReason, deferrals) + deferrals.defer() + local playerId, identifier = source, ESX.GetIdentifier(source) + Citizen.Wait(100) + + if identifier then + MySQL.Async.fetchAll('SELECT firstname, lastname, dateofbirth, sex, height FROM users WHERE identifier = @identifier', { + ['@identifier'] = identifier + }, function(result) + if result[1] then + if result[1].firstname then + playerIdentity[identifier] = { + firstName = result[1].firstname, + lastName = result[1].lastname, + dateOfBirth = result[1].dateofbirth, + sex = result[1].sex, + height = result[1].height + } + + deferrals.done() + else + deferrals.presentCard([==[{"type": "AdaptiveCard","body":[{"type":"Container","items":[{"type":"ColumnSet","columns":[{"type":"Column","items":[{"type":"Input.Text","placeholder":"First Name","id":"firstname","maxLength":15},{"type":"Input.Text","placeholder":"Date of Birth (MM/DD/YYYY)","id":"dateofbirth","maxLength":10}],"width":"stretch"},{"type":"Column","width":"stretch","items":[{"type":"Input.Text","placeholder":"Last Name","id":"lastname","maxLength":15},{"type":"Input.Text","placeholder":"Height (48-96 inches)","id":"height","maxLength":2}]}]},{"type":"Input.ChoiceSet","placeholder":"Sex","choices":[{"title":"Male","value":"m"},{"title":"Female","value":"f"}],"style":"expanded","id":"sex"}]},{"type": "ActionSet","actions": [{"type":"Action.Submit","title":"Submit"}]}],"$schema": "http://adaptivecards.io/schemas/adaptive-card.json","version":"1.0"}]==], function(data, rawData) + if data.firstname == '' or data.lastname == '' or data.dateofbirth == '' or data.sex == '' or data.height == '' then + deferrals.done(_U('data_incorrect')) + else + if checkNameFormat(data.firstname) and checkNameFormat(data.lastname) and checkDOBFormat(data.dateofbirth) and checkSexFormat(data.sex) and checkHeightFormat(data.height) then + playerIdentity[identifier] = { + firstName = formatName(data.firstname), + lastName = formatName(data.lastname), + dateOfBirth = data.dateofbirth, + sex = data.sex, + height = tonumber(data.height), + saveToDatabase = true + } + + deferrals.done() + else + deferrals.done(_U('invalid_format')) + end + end + end) + end + else + deferrals.presentCard([==[{"type": "AdaptiveCard","body":[{"type":"Container","items":[{"type":"ColumnSet","columns":[{"type":"Column","items":[{"type":"Input.Text","placeholder":"First Name","id":"firstname","maxLength":15},{"type":"Input.Text","placeholder":"Date of Birth (MM/DD/YYYY)","id":"dateofbirth","maxLength":10}],"width":"stretch"},{"type":"Column","width":"stretch","items":[{"type":"Input.Text","placeholder":"Last Name","id":"lastname","maxLength":15},{"type":"Input.Text","placeholder":"Height (48-96 inches)","id":"height","maxLength":2}]}]},{"type":"Input.ChoiceSet","placeholder":"Sex","choices":[{"title":"Male","value":"m"},{"title":"Female","value":"f"}],"style":"expanded","id":"sex"}]},{"type": "ActionSet","actions": [{"type":"Action.Submit","title":"Submit"}]}],"$schema": "http://adaptivecards.io/schemas/adaptive-card.json","version":"1.0"}]==], function(data, rawData) + if data.firstname == '' or data.lastname == '' or data.dateofbirth == '' or data.sex == '' or data.height == '' then + deferrals.done(_U('data_incorrect')) + else + if checkNameFormat(data.firstname) and checkNameFormat(data.lastname) and checkDOBFormat(data.dateofbirth) and checkSexFormat(data.sex) and checkHeightFormat(data.height) then + playerIdentity[identifier] = { + firstName = formatName(data.firstname), + lastName = formatName(data.lastname), + dateOfBirth = data.dateofbirth, + sex = data.sex, + height = tonumber(data.height), + saveToDatabase = true + } + + deferrals.done() + else + deferrals.done(_U('invalid_format')) + end + end + end) + end + end) + else + deferrals.done(_U('no_identifier')) + end + end) + + RegisterNetEvent('esx:playerLoaded') + AddEventHandler('esx:playerLoaded', function(playerId, xPlayer) + if playerIdentity[xPlayer.identifier] then + local currentIdentity = playerIdentity[xPlayer.identifier] + + xPlayer.setName(('%s %s'):format(currentIdentity.firstName, currentIdentity.lastName)) + xPlayer.set('firstName', currentIdentity.firstName) + xPlayer.set('lastName', currentIdentity.lastName) + xPlayer.set('dateofbirth', currentIdentity.dateOfBirth) + xPlayer.set('sex', currentIdentity.sex) + xPlayer.set('height', currentIdentity.height) + + if currentIdentity.saveToDatabase then + saveIdentityToDatabase(xPlayer.identifier, currentIdentity) + end + + Citizen.Wait(5) + alreadyRegistered[xPlayer.identifier] = true + TriggerClientEvent('esx_identity:alreadyRegistered', xPlayer.source) + + playerIdentity[xPlayer.identifier] = nil + else + xPlayer.kick(_('missing_identity')) + end + end) + +elseif not Config.UseDeferrals then + if not multichar then + AddEventHandler('playerConnecting', function(playerName, setKickReason, deferrals) + deferrals.defer() + local playerId, identifier = source, ESX.GetIdentifier(source) + Citizen.Wait(40) + + if identifier then + MySQL.Async.fetchAll('SELECT firstname, lastname, dateofbirth, sex, height FROM users WHERE identifier = @identifier', { + ['@identifier'] = identifier + }, function(result) + if result[1] then + if result[1].firstname then + playerIdentity[identifier] = { + firstName = result[1].firstname, + lastName = result[1].lastname, + dateOfBirth = result[1].dateofbirth, + sex = result[1].sex, + height = result[1].height + } + + alreadyRegistered[identifier] = true + + deferrals.done() + else + playerIdentity[identifier] = nil + alreadyRegistered[identifier] = false + deferrals.done() + end + else + playerIdentity[identifier] = nil + alreadyRegistered[identifier] = false + deferrals.done() + end + end) + else + deferrals.done(_U('no_identifier')) + end + end) + + AddEventHandler('onResourceStart', function(resource) + if resource == GetCurrentResourceName() then + Citizen.Wait(300) + + while not ESX do + Citizen.Wait(10) + end + + local xPlayers = ESX.GetPlayers() + + for i=1, #xPlayers, 1 do + local xPlayer = ESX.GetPlayerFromId(xPlayers[i]) + + if xPlayer then + checkIdentity(xPlayer) + end + end + end + end) + + RegisterNetEvent('esx:playerLoaded') + AddEventHandler('esx:playerLoaded', function(playerId, xPlayer) + local currentIdentity = playerIdentity[xPlayer.identifier] + if currentIdentity and alreadyRegistered[xPlayer.identifier] == true then + + xPlayer.setName(('%s %s'):format(currentIdentity.firstName, currentIdentity.lastName)) + xPlayer.set('firstName', currentIdentity.firstName) + xPlayer.set('lastName', currentIdentity.lastName) + xPlayer.set('dateofbirth', currentIdentity.dateOfBirth) + xPlayer.set('sex', currentIdentity.sex) + xPlayer.set('height', currentIdentity.height) + + if currentIdentity.saveToDatabase then + saveIdentityToDatabase(xPlayer.identifier, currentIdentity) + end + + Citizen.Wait(10) + TriggerClientEvent('esx_identity:alreadyRegistered', xPlayer.source) + + playerIdentity[xPlayer.identifier] = nil + else + TriggerClientEvent('esx_identity:showRegisterIdentity', xPlayer.source) + end + end) + end + + ESX.RegisterServerCallback('esx_identity:registerIdentity', function(source, cb, data) + local xPlayer = ESX.GetPlayerFromId(source) + + if xPlayer then + if not alreadyRegistered[xPlayer.identifier] then + if checkNameFormat(data.firstname) and checkNameFormat(data.lastname) and checkSexFormat(data.sex) and checkDOBFormat(data.dateofbirth) and checkHeightFormat(data.height) then + playerIdentity[xPlayer.identifier] = { + firstName = formatName(data.firstname), + lastName = formatName(data.lastname), + dateOfBirth = data.dateofbirth, + sex = data.sex, + height = data.height + } + + local currentIdentity = playerIdentity[xPlayer.identifier] + + xPlayer.setName(('%s %s'):format(currentIdentity.firstName, currentIdentity.lastName)) + xPlayer.set('firstName', currentIdentity.firstName) + xPlayer.set('lastName', currentIdentity.lastName) + xPlayer.set('dateofbirth', currentIdentity.dateOfBirth) + xPlayer.set('sex', currentIdentity.sex) + xPlayer.set('height', currentIdentity.height) + + saveIdentityToDatabase(xPlayer.identifier, currentIdentity) + alreadyRegistered[xPlayer.identifier] = true + + playerIdentity[xPlayer.identifier] = nil + cb(true) + else + cb(false) + end + else + cb(false) + end + else + if multichar and checkNameFormat(data.firstname) and checkNameFormat(data.lastname) and checkSexFormat(data.sex) and checkDOBFormat(data.dateofbirth) and checkHeightFormat(data.height) then + TriggerEvent('esx_identity:completedRegistration', source, data) + cb(true) + end + end + end) + + function checkIdentity(xPlayer) + MySQL.Async.fetchAll('SELECT firstname, lastname, dateofbirth, sex, height FROM users WHERE identifier = @identifier', { + ['@identifier'] = xPlayer.identifier + }, function(result) + if result[1] then + if result[1].firstname then + playerIdentity[xPlayer.identifier] = { + firstName = result[1].firstname, + lastName = result[1].lastname, + dateOfBirth = result[1].dateofbirth, + sex = result[1].sex, + height = result[1].height + } + + alreadyRegistered[xPlayer.identifier] = true + + setIdentity(xPlayer) + else + playerIdentity[xPlayer.identifier] = nil + alreadyRegistered[xPlayer.identifier] = false + TriggerClientEvent('esx_identity:showRegisterIdentity', xPlayer.source) + end + else + TriggerClientEvent('esx_identity:showRegisterIdentity', xPlayer.source) + end + end) + end + + function setIdentity(xPlayer) + if alreadyRegistered[xPlayer.identifier] then + local currentIdentity = playerIdentity[xPlayer.identifier] + + xPlayer.setName(('%s %s'):format(currentIdentity.firstName, currentIdentity.lastName)) + xPlayer.set('firstName', currentIdentity.firstName) + xPlayer.set('lastName', currentIdentity.lastName) + xPlayer.set('dateofbirth', currentIdentity.dateOfBirth) + xPlayer.set('sex', currentIdentity.sex) + xPlayer.set('height', currentIdentity.height) + + if currentIdentity.saveToDatabase then + saveIdentityToDatabase(xPlayer.identifier, currentIdentity) + end + + playerIdentity[xPlayer.identifier] = nil + end + end +end + +if Config.EnableCommands then + ESX.RegisterCommand('char', 'user', function(xPlayer, args, showError) + if xPlayer and xPlayer.getName() then + xPlayer.showNotification(_U('active_character', xPlayer.getName())) + else + xPlayer.showNotification(_U('error_active_character')) + end + end, false, {help = _U('show_active_character')}) + + ESX.RegisterCommand('chardel', 'user', function(xPlayer, args, showError) + if xPlayer and xPlayer.getName() then + if Config.UseDeferrals then + xPlayer.kick(_('deleted_identity')) + Citizen.Wait(1500) + deleteIdentity(xPlayer) + xPlayer.showNotification(_U('deleted_character')) + playerIdentity[xPlayer.identifier] = nil + alreadyRegistered[xPlayer.identifier] = false + else + deleteIdentity(xPlayer) + xPlayer.showNotification(_U('deleted_character')) + playerIdentity[xPlayer.identifier] = nil + alreadyRegistered[xPlayer.identifier] = false + TriggerClientEvent('esx_identity:showRegisterIdentity', xPlayer.source) + end + else + xPlayer.showNotification(_U('error_delete_character')) + end + end, false, {help = _U('delete_character')}) +end + +if Config.EnableDebugging then + ESX.RegisterCommand('xPlayerGetFirstName', 'user', function(xPlayer, args, showError) + if xPlayer and xPlayer.get('firstName') then + xPlayer.showNotification(_U('return_debug_xPlayer_get_first_name', xPlayer.get('firstName'))) + else + xPlayer.showNotification(_U('error_debug_xPlayer_get_first_name')) + end + end, false, {help = _U('debug_xPlayer_get_first_name')}) + + ESX.RegisterCommand('xPlayerGetLastName', 'user', function(xPlayer, args, showError) + if xPlayer and xPlayer.get('lastName') then + xPlayer.showNotification(_U('return_debug_xPlayer_get_last_name', xPlayer.get('lastName'))) + else + xPlayer.showNotification(_U('error_debug_xPlayer_get_last_name')) + end + end, false, {help = _U('debug_xPlayer_get_last_name')}) + + ESX.RegisterCommand('xPlayerGetFullName', 'user', function(xPlayer, args, showError) + if xPlayer and xPlayer.getName() then + xPlayer.showNotification(_U('return_debug_xPlayer_get_full_name', xPlayer.getName())) + else + xPlayer.showNotification(_U('error_debug_xPlayer_get_full_name')) + end + end, false, {help = _U('debug_xPlayer_get_full_name')}) + + ESX.RegisterCommand('xPlayerGetSex', 'user', function(xPlayer, args, showError) + if xPlayer and xPlayer.get('sex') then + xPlayer.showNotification(_U('return_debug_xPlayer_get_sex', xPlayer.get('sex'))) + else + xPlayer.showNotification(_U('error_debug_xPlayer_get_sex')) + end + end, false, {help = _U('debug_xPlayer_get_sex')}) + + ESX.RegisterCommand('xPlayerGetDOB', 'user', function(xPlayer, args, showError) + if xPlayer and xPlayer.get('dateofbirth') then + xPlayer.showNotification(_U('return_debug_xPlayer_get_dob', xPlayer.get('dateofbirth'))) + else + xPlayer.showNotification(_U('error_debug_xPlayer_get_dob')) + end + end, false, {help = _U('debug_xPlayer_get_dob')}) + + ESX.RegisterCommand('xPlayerGetHeight', 'user', function(xPlayer, args, showError) + if xPlayer and xPlayer.get('height') then + xPlayer.showNotification(_U('return_debug_xPlayer_get_height', xPlayer.get('height'))) + else + xPlayer.showNotification(_U('error_debug_xPlayer_get_height')) + end + end, false, {help = _U('debug_xPlayer_get_height')}) +end + +function deleteIdentity(xPlayer) + if alreadyRegistered[xPlayer.identifier] then + xPlayer.setName(('%s %s'):format(nil, nil)) + xPlayer.set('firstName', nil) + xPlayer.set('lastName', nil) + xPlayer.set('dateofbirth', nil) + xPlayer.set('sex', nil) + xPlayer.set('height', nil) + + deleteIdentityFromDatabase(xPlayer) + end +end + +function saveIdentityToDatabase(identifier, identity) + MySQL.Sync.execute('UPDATE users SET firstname = @firstname, lastname = @lastname, dateofbirth = @dateofbirth, sex = @sex, height = @height WHERE identifier = @identifier', { + ['@identifier'] = identifier, + ['@firstname'] = identity.firstName, + ['@lastname'] = identity.lastName, + ['@dateofbirth'] = identity.dateOfBirth, + ['@sex'] = identity.sex, + ['@height'] = identity.height + }) +end + +function deleteIdentityFromDatabase(xPlayer) + MySQL.Sync.execute('UPDATE users SET firstname = @firstname, lastname = @lastname, dateofbirth = @dateofbirth, sex = @sex, height = @height , skin = @skin WHERE identifier = @identifier', { + ['@identifier'] = xPlayer.identifier, + ['@firstname'] = NULL, + ['@lastname'] = NULL, + ['@dateofbirth'] = NULL, + ['@sex'] = NULL, + ['@height'] = NULL, + ['@skin'] = NULL + }) + + if Config.FullCharDelete then + MySQL.Sync.execute('UPDATE addon_account_data SET money = 0 WHERE account_name = @account_name AND owner = @owner', { + ['@account_name'] = 'bank_savings', + ['@owner'] = xPlayer.identifier + }) + + MySQL.Sync.execute('UPDATE addon_account_data SET money = 0 WHERE account_name = @account_name AND owner = @owner', { + ['@account_name'] = 'caution', + ['@owner'] = xPlayer.identifier + }) + + MySQL.Sync.execute('UPDATE datastore_data SET data = @data WHERE name = @name AND owner = @owner', { + ['@data'] = '\'{}\'', + ['@name'] = 'user_ears', + ['@owner'] = xPlayer.identifier + }) + + MySQL.Sync.execute('UPDATE datastore_data SET data = @data WHERE name = @name AND owner = @owner', { + ['@data'] = '\'{}\'', + ['@name'] = 'user_glasses', + ['@owner'] = xPlayer.identifier + }) + + MySQL.Sync.execute('UPDATE datastore_data SET data = @data WHERE name = @name AND owner = @owner', { + ['@data'] = '\'{}\'', + ['@name'] = 'user_helmet', + ['@owner'] = xPlayer.identifier + }) + + MySQL.Sync.execute('UPDATE datastore_data SET data = @data WHERE name = @name AND owner = @owner', { + ['@data'] = '\'{}\'', + ['@name'] = 'user_mask', + ['@owner'] = xPlayer.identifier + }) + end +end + +function checkNameFormat(name) + if not checkAlphanumeric(name) then + if not checkForNumbers(name) then + local stringLength = string.len(name) + if stringLength > 0 and stringLength < Config.MaxNameLength then + return true + else + return false + end + else + return false + end + else + return false + end +end + +function checkDOBFormat(dob) + local date = tostring(dob) + if checkDate(date) then + return true + else + return false + end +end + +function checkSexFormat(sex) + if sex == "m" or sex == "M" or sex == "f" or sex == "F" then + return true + else + return false + end +end + +function checkHeightFormat(height) + local numHeight = tonumber(height) + if numHeight < Config.MinHeight and numHeight > Config.MaxHeight then + return false + else + return true + end +end + +function formatName(name) + local loweredName = convertToLowerCase(name) + local formattedName = convertFirstLetterToUpper(loweredName) + return formattedName +end + +function convertToLowerCase(str) + return string.lower(str) +end + +function convertFirstLetterToUpper(str) + return str:gsub("^%l", string.upper) +end + +function checkAlphanumeric(str) + return (string.match(str, "%W")) +end + +function checkForNumbers(str) + return (string.match(str,"%d")) +end + +function checkDate(str) + if string.match(str, '(%d%d)/(%d%d)/(%d%d%d%d)') ~= nil then + local m, d, y = string.match(str, '(%d+)/(%d+)/(%d+)') + m = tonumber(m) + d = tonumber(d) + y = tonumber(y) + if ((d <= 0) or (d > 31)) or ((m <= 0) or (m > 12)) or ((y <= Config.LowestYear) or (y > Config.HighestYear)) then + return false + elseif m == 4 or m == 6 or m == 9 or m == 11 then + if d > 30 then + return false + else + return true + end + elseif m == 2 then + if y%400 == 0 or (y%100 ~= 0 and y%4 == 0) then + if d > 29 then + return false + else + return true + end + else + if d > 28 then + return false + else + return true + end + end + else + if d > 31 then + return false + else + return true + end + end + else + return false + end +end diff --git a/[esx]/esx_menu_default/.editorconfig b/[esx]/esx_menu_default/.editorconfig new file mode 100644 index 00000000..9b425256 --- /dev/null +++ b/[esx]/esx_menu_default/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_size = 4 +indent_style = tab +end_of_line = crlf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/[esx]/esx_menu_default/LICENSE b/[esx]/esx_menu_default/LICENSE new file mode 100644 index 00000000..3b39cdcf --- /dev/null +++ b/[esx]/esx_menu_default/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + fxserver-esx_menu_default + Copyright (C) 2015 Jérémie N'gadi + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + fxserver-esx_menu_default Copyright (C) 2015 Jérémie N'gadi + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. \ No newline at end of file diff --git a/[esx]/esx_menu_default/README.md b/[esx]/esx_menu_default/README.md new file mode 100644 index 00000000..7a2235e4 --- /dev/null +++ b/[esx]/esx_menu_default/README.md @@ -0,0 +1,2 @@ +# esx_menu_default +ESX Menu Default diff --git a/[esx]/esx_menu_default/client/main.lua b/[esx]/esx_menu_default/client/main.lua new file mode 100644 index 00000000..a8b2f6f8 --- /dev/null +++ b/[esx]/esx_menu_default/client/main.lua @@ -0,0 +1,101 @@ +ESX = nil + +Citizen.CreateThread(function() + while ESX == nil do + Citizen.Wait(5) + TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + end + + local GUI, MenuType = {}, 'default' + GUI.Time = 0 + + local openMenu = function(namespace, name, data) + SendNUIMessage({ + action = 'openMenu', + namespace = namespace, + name = name, + data = data + }) + end + + local closeMenu = function(namespace, name) + SendNUIMessage({ + action = 'closeMenu', + namespace = namespace, + name = name, + data = data + }) + end + + ESX.UI.Menu.RegisterType(MenuType, openMenu, closeMenu) + + AddEventHandler('esx_menu_default:message:menu_submit', function(data) + local menu = ESX.UI.Menu.GetOpened(MenuType, data._namespace, data._name) + + if menu.submit ~= nil then + menu.submit(data, menu) + end + end) + + AddEventHandler('esx_menu_default:message:menu_cancel', function(data) + local menu = ESX.UI.Menu.GetOpened(MenuType, data._namespace, data._name) + + if menu.cancel ~= nil then + menu.cancel(data, menu) + end + end) + + AddEventHandler('esx_menu_default:message:menu_change', function(data) + local menu = ESX.UI.Menu.GetOpened(MenuType, data._namespace, data._name) + + for i=1, #data.elements, 1 do + menu.setElement(i, 'value', data.elements[i].value) + + if data.elements[i].selected then + menu.setElement(i, 'selected', true) + else + menu.setElement(i, 'selected', false) + end + end + + if menu.change ~= nil then + menu.change(data, menu) + end + end) + + Citizen.CreateThread(function() + while true do + Citizen.Wait(15) + + if IsControlPressed(0, 18) and IsInputDisabled(0) and (GetGameTimer() - GUI.Time) > 150 then + SendNUIMessage({action = 'controlPressed', control = 'ENTER'}) + GUI.Time = GetGameTimer() + end + + if IsControlPressed(0, 177) and IsInputDisabled(0) and (GetGameTimer() - GUI.Time) > 150 then + SendNUIMessage({action = 'controlPressed', control = 'BACKSPACE'}) + GUI.Time = GetGameTimer() + end + + if IsControlPressed(0, 27) and IsInputDisabled(0) and (GetGameTimer() - GUI.Time) > 200 then + SendNUIMessage({action = 'controlPressed', control = 'TOP'}) + GUI.Time = GetGameTimer() + end + + if IsControlPressed(0, 173) and IsInputDisabled(0) and (GetGameTimer() - GUI.Time) > 200 then + SendNUIMessage({action = 'controlPressed', control = 'DOWN'}) + GUI.Time = GetGameTimer() + end + + if IsControlPressed(0, 174) and IsInputDisabled(0) and (GetGameTimer() - GUI.Time) > 150 then + SendNUIMessage({action = 'controlPressed', control = 'LEFT'}) + GUI.Time = GetGameTimer() + end + + if IsControlPressed(0, 175) and IsInputDisabled(0) and (GetGameTimer() - GUI.Time) > 150 then + SendNUIMessage({action = 'controlPressed', control = 'RIGHT'}) + GUI.Time = GetGameTimer() + end + end + end) +end) diff --git a/[esx]/esx_menu_default/fxmanifest.lua b/[esx]/esx_menu_default/fxmanifest.lua new file mode 100644 index 00000000..ad8b00e9 --- /dev/null +++ b/[esx]/esx_menu_default/fxmanifest.lua @@ -0,0 +1,27 @@ +fx_version 'adamant' + +game 'gta5' + +description 'ESX Menu Default' + +version '1.0.4' + +client_scripts { + '@es_extended/client/wrapper.lua', + 'client/main.lua' +} + +ui_page { + 'html/ui.html' +} + +files { + 'html/ui.html', + 'html/css/app.css', + 'html/js/mustache.min.js', + 'html/js/app.js' +} + +dependencies { + 'es_extended' +} diff --git a/[esx]/esx_menu_default/html/css/app.css b/[esx]/esx_menu_default/html/css/app.css new file mode 100644 index 00000000..b03e1e9b --- /dev/null +++ b/[esx]/esx_menu_default/html/css/app.css @@ -0,0 +1,96 @@ +@font-face { + font-family: bankgothic; + src: url('../fonts/bankgothic.ttf'); +} + +@font-face { + font-family: pcdown; + src: url('../fonts/pdown.ttf'); +} + +.menu { + font-family: 'PT Sans Narrow', sans-serif; + font-size: 22px; + min-width: 400px; + color: #fff; + box-shadow: 0px 0px 50px 0px #000; + position: absolute; +} + +.menu.align-left { + left: 40; + top: 50%; + transform: translate(0, -50%); +} + +.menu.align-top-left { + left: 40; + top: 40; +} + +.menu.align-top { + left: 50%; + top: 40; + transform: translate(-50%, 0); +} + +.menu.align-top-right { + right: 10; + top: 40; +} + +.menu.align-right { + right: 40; + top: 50%; + transform: translate(0, -50%); +} + +.menu.align-bottom-right { + right: 40; + bottom: 40; +} + +.menu.align-bottom { + left: 50%; + bottom: 40; + transform: translate(-50%, 0); +} + +.menu.align-bottom-left { + left: 40; + bottom: 40; +} + +.menu.align-center { + left: 50%; + top: 50%; + transform: translate(-50%, -50%); +} + +.menu .head { + background-color: #4682B4; + text-align: center; + height: 40px; + line-height: 40px; +} + +.menu .menu-items { + max-height: 600px; + overflow-y: auto; +} + +.menu .menu-items .menu-item { + height: 40px; + display: block; + background-color: rgba(40, 40, 40, 1); + line-height: 32px; + color: #ffffff; + padding: 2px; + text-align: center; +} + +.menu .menu-items .menu-item.selected { + background-color: rgba(20, 20, 20, 1); + border-top: 2px solid #e76767; + border-bottom: 2px solid #e76767; +} diff --git a/[esx]/esx_menu_default/html/fonts/bankgothic.ttf b/[esx]/esx_menu_default/html/fonts/bankgothic.ttf new file mode 100644 index 00000000..f3d8049b Binary files /dev/null and b/[esx]/esx_menu_default/html/fonts/bankgothic.ttf differ diff --git a/[esx]/esx_menu_default/html/fonts/pdown.ttf b/[esx]/esx_menu_default/html/fonts/pdown.ttf new file mode 100644 index 00000000..69c76cf3 Binary files /dev/null and b/[esx]/esx_menu_default/html/fonts/pdown.ttf differ diff --git a/[esx]/esx_menu_default/html/js/app.js b/[esx]/esx_menu_default/html/js/app.js new file mode 100644 index 00000000..320fc386 --- /dev/null +++ b/[esx]/esx_menu_default/html/js/app.js @@ -0,0 +1,346 @@ +(function(){ + let MenuTpl = + '' + + '' + ; + + window.ESX_MENU = {}; + ESX_MENU.ResourceName = 'esx_menu_default'; + ESX_MENU.opened = {}; + ESX_MENU.focus = []; + ESX_MENU.pos = {}; + + ESX_MENU.open = function(namespace, name, data) { + if (typeof ESX_MENU.opened[namespace] == 'undefined') { + ESX_MENU.opened[namespace] = {}; + } + + if (typeof ESX_MENU.opened[namespace][name] != 'undefined') { + ESX_MENU.close(namespace, name); + } + + if (typeof ESX_MENU.pos[namespace] == 'undefined') { + ESX_MENU.pos[namespace] = {}; + } + + for (let i=0; i { + switch (data.action) { + + case 'openMenu': { + ESX_MENU.open(data.namespace, data.name, data.data); + break; + } + + case 'closeMenu': { + ESX_MENU.close(data.namespace, data.name); + break; + } + + case 'controlPressed': { + switch (data.control) { + + case 'ENTER': { + let focused = ESX_MENU.getFocused(); + + if (typeof focused != 'undefined') { + let menu = ESX_MENU.opened[focused.namespace][focused.name]; + let pos = ESX_MENU.pos[focused.namespace][focused.name]; + let elem = menu.elements[pos]; + + if (menu.elements.length > 0) { + ESX_MENU.submit(focused.namespace, focused.name, elem); + } + } + + break; + } + + case 'BACKSPACE': { + let focused = ESX_MENU.getFocused(); + + if (typeof focused != 'undefined') { + ESX_MENU.cancel(focused.namespace, focused.name); + } + + break; + } + + case 'TOP': { + let focused = ESX_MENU.getFocused(); + + if (typeof focused != 'undefined') { + let menu = ESX_MENU.opened[focused.namespace][focused.name]; + let pos = ESX_MENU.pos[focused.namespace][focused.name]; + + if (pos > 0) { + ESX_MENU.pos[focused.namespace][focused.name]--; + } else { + ESX_MENU.pos[focused.namespace][focused.name] = menu.elements.length - 1; + } + + let elem = menu.elements[ESX_MENU.pos[focused.namespace][focused.name]]; + + for (let i=0; i min) { + elem.value--; + ESX_MENU.change(focused.namespace, focused.name, elem); + } + + ESX_MENU.render(); + break; + } + + default: break; + } + + $('#menu_' + focused.namespace + '_' + focused.name).find('.menu-item.selected')[0].scrollIntoView(); + } + + break; + } + + case 'RIGHT': { + let focused = ESX_MENU.getFocused(); + + if (typeof focused != 'undefined') { + let menu = ESX_MENU.opened[focused.namespace][focused.name]; + let pos = ESX_MENU.pos[focused.namespace][focused.name]; + let elem = menu.elements[pos]; + + switch(elem.type) { + case 'default': break; + + case 'slider': { + if (typeof elem.options != 'undefined' && elem.value < elem.options.length - 1) { + elem.value++; + ESX_MENU.change(focused.namespace, focused.name, elem); + } + + if (typeof elem.max != 'undefined' && elem.value < elem.max) { + elem.value++; + ESX_MENU.change(focused.namespace, focused.name, elem); + } + + ESX_MENU.render(); + break; + } + + default: break; + } + + $('#menu_' + focused.namespace + '_' + focused.name).find('.menu-item.selected')[0].scrollIntoView(); + } + + break; + } + + default: break; + } + + break; + } + } + }; + + window.onload = function(e){ + window.addEventListener('message', (event) => { + onData(event.data); + }); + }; + +})(); diff --git a/[esx]/esx_menu_default/html/js/mustache.min.js b/[esx]/esx_menu_default/html/js/mustache.min.js new file mode 100644 index 00000000..520cfcb9 --- /dev/null +++ b/[esx]/esx_menu_default/html/js/mustache.min.js @@ -0,0 +1 @@ +(function defineMustache(global,factory){if(typeof exports==="object"&&exports&&typeof exports.nodeName!=="string"){factory(exports)}else if(typeof define==="function"&&define.amd){define(["exports"],factory)}else{global.Mustache={};factory(global.Mustache)}})(this,function mustacheFactory(mustache){var objectToString=Object.prototype.toString;var isArray=Array.isArray||function isArrayPolyfill(object){return objectToString.call(object)==="[object Array]"};function isFunction(object){return typeof object==="function"}function typeStr(obj){return isArray(obj)?"array":typeof obj}function escapeRegExp(string){return string.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function hasProperty(obj,propName){return obj!=null&&typeof obj==="object"&&propName in obj}var regExpTest=RegExp.prototype.test;function testRegExp(re,string){return regExpTest.call(re,string)}var nonSpaceRe=/\S/;function isWhitespace(string){return!testRegExp(nonSpaceRe,string)}var entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function escapeHtml(string){return String(string).replace(/[&<>"'`=\/]/g,function fromEntityMap(s){return entityMap[s]})}var whiteRe=/\s*/;var spaceRe=/\s+/;var equalsRe=/\s*=/;var curlyRe=/\s*\}/;var tagRe=/#|\^|\/|>|\{|&|=|!/;function parseTemplate(template,tags){if(!template)return[];var sections=[];var tokens=[];var spaces=[];var hasTag=false;var nonSpace=false;function stripSpace(){if(hasTag&&!nonSpace){while(spaces.length)delete tokens[spaces.pop()]}else{spaces=[]}hasTag=false;nonSpace=false}var openingTagRe,closingTagRe,closingCurlyRe;function compileTags(tagsToCompile){if(typeof tagsToCompile==="string")tagsToCompile=tagsToCompile.split(spaceRe,2);if(!isArray(tagsToCompile)||tagsToCompile.length!==2)throw new Error("Invalid tags: "+tagsToCompile);openingTagRe=new RegExp(escapeRegExp(tagsToCompile[0])+"\\s*");closingTagRe=new RegExp("\\s*"+escapeRegExp(tagsToCompile[1]));closingCurlyRe=new RegExp("\\s*"+escapeRegExp("}"+tagsToCompile[1]))}compileTags(tags||mustache.tags);var scanner=new Scanner(template);var start,type,value,chr,token,openSection;while(!scanner.eos()){start=scanner.pos;value=scanner.scanUntil(openingTagRe);if(value){for(var i=0,valueLength=value.length;i0?sections[sections.length-1][4]:nestedTokens;break;default:collector.push(token)}}return nestedTokens}function Scanner(string){this.string=string;this.tail=string;this.pos=0}Scanner.prototype.eos=function eos(){return this.tail===""};Scanner.prototype.scan=function scan(re){var match=this.tail.match(re);if(!match||match.index!==0)return"";var string=match[0];this.tail=this.tail.substring(string.length);this.pos+=string.length;return string};Scanner.prototype.scanUntil=function scanUntil(re){var index=this.tail.search(re),match;switch(index){case-1:match=this.tail;this.tail="";break;case 0:match="";break;default:match=this.tail.substring(0,index);this.tail=this.tail.substring(index)}this.pos+=match.length;return match};function Context(view,parentContext){this.view=view;this.cache={".":this.view};this.parent=parentContext}Context.prototype.push=function push(view){return new Context(view,this)};Context.prototype.lookup=function lookup(name){var cache=this.cache;var value;if(cache.hasOwnProperty(name)){value=cache[name]}else{var context=this,names,index,lookupHit=false;while(context){if(name.indexOf(".")>0){value=context.view;names=name.split(".");index=0;while(value!=null&&index")value=this.renderPartial(token,context,partials,originalTemplate);else if(symbol==="&")value=this.unescapedValue(token,context);else if(symbol==="name")value=this.escapedValue(token,context);else if(symbol==="text")value=this.rawValue(token);if(value!==undefined)buffer+=value}return buffer};Writer.prototype.renderSection=function renderSection(token,context,partials,originalTemplate){var self=this;var buffer="";var value=context.lookup(token[1]);function subRender(template){return self.render(template,context,partials)}if(!value)return;if(isArray(value)){for(var j=0,valueLength=value.length;j + + + + + + + + + + + + + + + + + + diff --git a/[esx]/esx_menu_dialog/.editorconfig b/[esx]/esx_menu_dialog/.editorconfig new file mode 100644 index 00000000..9b425256 --- /dev/null +++ b/[esx]/esx_menu_dialog/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_size = 4 +indent_style = tab +end_of_line = crlf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/[esx]/esx_menu_dialog/LICENSE b/[esx]/esx_menu_dialog/LICENSE new file mode 100644 index 00000000..4a59a7ce --- /dev/null +++ b/[esx]/esx_menu_dialog/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + fxserver-esx_menu_dialog + Copyright (C) 2015 Jérémie N'gadi + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + fxserver-esx_menu_dialog Copyright (C) 2015 Jérémie N'gadi + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. \ No newline at end of file diff --git a/[esx]/esx_menu_dialog/README.md b/[esx]/esx_menu_dialog/README.md new file mode 100644 index 00000000..b10470a1 --- /dev/null +++ b/[esx]/esx_menu_dialog/README.md @@ -0,0 +1,38 @@ +# esx_menu_dialog +Simple script used for inputs. + +## Download & Installation + +### Using [fvm](https://github.com/qlaffont/fvm-installer) +``` +fvm install --save --folder=esx esx-org/esx_menu_dialog +``` + +### Using Git +``` +cd resources +git clone https://github.com/ESX-Org/esx_menu_dialog [esx]/esx_menu_dialog +``` + +### Manually +- Download https://github.com/ESX-Org/esx_menu_dialog/archive/master.zip +- Put it in the `[esx]` directory + +## Installation +- Add this to your `server.cfg`: + +``` +start esx_menu_dialog +``` + +# Legal +### License +esx_menu_dialog - input dialog for ESX + +Copyright (C) 2015-2020 Jérémie N'gadi + +This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version. + +This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details. + +You should have received a copy Of the GNU General Public License along with this program. If Not, see http://www.gnu.org/licenses/. \ No newline at end of file diff --git a/[esx]/esx_menu_dialog/client/main.lua b/[esx]/esx_menu_dialog/client/main.lua new file mode 100644 index 00000000..447ca4c3 --- /dev/null +++ b/[esx]/esx_menu_dialog/client/main.lua @@ -0,0 +1,110 @@ +Citizen.CreateThread(function() + ESX = nil + local Timeouts, OpenedMenus, MenuType = {}, {}, 'dialog' + + while ESX == nil do + TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + Citizen.Wait(0) + end + + local openMenu = function(namespace, name, data) + for i=1, #Timeouts, 1 do + ESX.ClearTimeout(Timeouts[i]) + end + + OpenedMenus[namespace .. '_' .. name] = true + + SendNUIMessage({ + action = 'openMenu', + namespace = namespace, + name = name, + data = data + }) + + local timeoutId = ESX.SetTimeout(200, function() + SetNuiFocus(true, true) + end) + + table.insert(Timeouts, timeoutId) + end + + local closeMenu = function(namespace, name) + OpenedMenus[namespace .. '_' .. name] = nil + + SendNUIMessage({ + action = 'closeMenu', + namespace = namespace, + name = name, + data = data + }) + + if ESX.Table.SizeOf(OpenedMenus) == 0 then + SetNuiFocus(false) + end + + end + + ESX.UI.Menu.RegisterType(MenuType, openMenu, closeMenu) + + AddEventHandler('esx_menu_dialog:message:menu_submit', function(data) + local menu = ESX.UI.Menu.GetOpened(MenuType, data._namespace, data._name) + local cancel = false + + if menu.submit then + -- is the submitted data a number? + if tonumber(data.value) then + data.value = ESX.Math.Round(tonumber(data.value)) + + -- check for negative value + if tonumber(data.value) <= 0 then + cancel = true + end + end + + data.value = ESX.Math.Trim(data.value) + + -- don't submit if the value is negative or if it's 0 + if cancel then + ESX.ShowNotification('That input is not allowed!') + else + menu.submit(data, menu) + end + end + end) + + AddEventHandler('esx_menu_dialog:message:menu_cancel', function(data) + local menu = ESX.UI.Menu.GetOpened(MenuType, data._namespace, data._name) + + if menu.cancel ~= nil then + menu.cancel(data, menu) + end + end) + + AddEventHandler('esx_menu_dialog:message:menu_change', function(data) + local menu = ESX.UI.Menu.GetOpened(MenuType, data._namespace, data._name) + + if menu.change ~= nil then + menu.change(data, menu) + end + end) + + Citizen.CreateThread(function() + while true do + Citizen.Wait(10) + + if ESX.Table.SizeOf(OpenedMenus) > 0 then + DisableControlAction(0, 1, true) -- LookLeftRight + DisableControlAction(0, 2, true) -- LookUpDown + DisableControlAction(0, 142, true) -- MeleeAttackAlternate + DisableControlAction(0, 106, true) -- VehicleMouseControlOverride + DisableControlAction(0, 12, true) -- WeaponWheelUpDown + DisableControlAction(0, 14, true) -- WeaponWheelNext + DisableControlAction(0, 15, true) -- WeaponWheelPrev + DisableControlAction(0, 16, true) -- SelectNextWeapon + DisableControlAction(0, 17, true) -- SelectPrevWeapon + else + Citizen.Wait(500) + end + end + end) +end) \ No newline at end of file diff --git a/[esx]/esx_menu_dialog/fxmanifest.lua b/[esx]/esx_menu_dialog/fxmanifest.lua new file mode 100644 index 00000000..f5dc6573 --- /dev/null +++ b/[esx]/esx_menu_dialog/fxmanifest.lua @@ -0,0 +1,28 @@ +fx_version 'adamant' + +game 'gta5' + +description 'ESX Menu Dialog' + +version '1.1.0' + +client_scripts { + '@es_extended/client/wrapper.lua', + 'client/main.lua' +} + +ui_page 'html/ui.html' + +files { + 'html/ui.html', + + 'html/css/app.css', + + 'html/js/mustache.min.js', + 'html/js/app.js', + + 'html/fonts/pdown.ttf', + 'html/fonts/bankgothic.ttf' +} + +dependency 'es_extended' diff --git a/[esx]/esx_menu_dialog/html/css/app.css b/[esx]/esx_menu_dialog/html/css/app.css new file mode 100644 index 00000000..accb9864 --- /dev/null +++ b/[esx]/esx_menu_dialog/html/css/app.css @@ -0,0 +1,91 @@ +@font-face { + font-family: bankgothic; + src: url('../fonts/bankgothic.ttf'); +} + +@font-face { + font-family: pcdown; + src: url('../fonts/pdown.ttf'); +} + +#controls { + font-family: 'IBM Plex Sans', sans-serif; + font-size: 5em; + color: #FFF; + position: absolute; + bottom: 40; + right: 40; +} + +.controls { + display: none; +} + +.dialog { + font-family: 'PT Sans Narrow', sans-serif; + background-color: rgba(40, 40, 40, 1); + color: #fff; + position: absolute; + overflow: hidden; + top: 50%; + left: 50%; + width: 640px; + height: 124px; + transform: translate(-50%, -50%); +} + +.dialog.big { + height: 200px; +} + +.dialog .head { + background-color: #4682B4; + text-align: center; + height: 40px; + font-size: 22px; +} + +.dialog .head span:before { + content: ""; + display: inline-block; + height: 100%; + vertical-align: middle; +} + +.dialog input[type="text"] { + width: 100%; + height: 42px; + color: #fff; + font-size: 20px; + background-color: rgba(20, 20, 20, 1); + border-bottom: 2px solid #e76767; +} + +.dialog textarea { + width: 100%; + height: 138px; + color: #fff; + font-size: 20px; + background-color: rgba(20, 20, 20, 1); + border-bottom: 2px solid #e76767; +} + +.dialog button[name="submit"] { + width: 75%; + color: #fff; + height: 42px; + font-size: 22px; + border: 0px solid #e76767; + border-right: 1px solid #e76767; + background-color: rgba(40, 40, 40, 1) +} + +.dialog button[name="cancel"] { + width: 25%; + color: rgb(236, 75, 75); + height: 42px; + font-size: 20px; + border: 0px solid #e76767; + border-left: 1px solid #e76767; + background-color: rgba(40, 40, 40, 1) +} diff --git a/[esx]/esx_menu_dialog/html/fonts/bankgothic.ttf b/[esx]/esx_menu_dialog/html/fonts/bankgothic.ttf new file mode 100644 index 00000000..f3d8049b Binary files /dev/null and b/[esx]/esx_menu_dialog/html/fonts/bankgothic.ttf differ diff --git a/[esx]/esx_menu_dialog/html/fonts/pdown.ttf b/[esx]/esx_menu_dialog/html/fonts/pdown.ttf new file mode 100644 index 00000000..69c76cf3 Binary files /dev/null and b/[esx]/esx_menu_dialog/html/fonts/pdown.ttf differ diff --git a/[esx]/esx_menu_dialog/html/js/app.js b/[esx]/esx_menu_dialog/html/js/app.js new file mode 100644 index 00000000..85a172b6 --- /dev/null +++ b/[esx]/esx_menu_dialog/html/js/app.js @@ -0,0 +1,170 @@ +(function () { + let MenuTpl = + ' + + + +
+
Ajouter + un contact
+
+
+ + + + +
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/[esx_addons]/esx_phone/html/ui_br.html b/[esx_addons]/esx_phone/html/ui_br.html new file mode 100644 index 00000000..b0e2c9e3 --- /dev/null +++ b/[esx_addons]/esx_phone/html/ui_br.html @@ -0,0 +1,90 @@ + + + + + + + + + + +
+ +
+ +
+ + unknown +
+ + + +
+
+ Agenda + +
+
+
+
+

Nenhum contato

+
+
+
+
+ +
+
Mensagens + +
+
+
+
+

Nenhuma mensagem

+
+
+
+
+ +
+
+
+
+ + + + + +
+
+
+ +
+
Adicionar contato
+
+
+ + + + +
+
+
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/[esx_addons]/esx_phone/html/ui_de.html b/[esx_addons]/esx_phone/html/ui_de.html new file mode 100644 index 00000000..e8171754 --- /dev/null +++ b/[esx_addons]/esx_phone/html/ui_de.html @@ -0,0 +1,90 @@ + + + + + + + + + + +
+ +
+ +
+ + unknown +
+ + + +
+
+ Kontakte + +
+
+
+
+

Keine Kontakte

+
+
+
+
+ +
+
Nachrichten + +
+
+
+
+

Keine Nachrichten

+
+
+
+
+ +
+
+
+
+ + + + + +
+
+
+ +
+
Kontakt + hinzufügen
+
+
+ + + + +
+
+
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/[esx_addons]/esx_phone/html/ui_en.html b/[esx_addons]/esx_phone/html/ui_en.html new file mode 100644 index 00000000..18375822 --- /dev/null +++ b/[esx_addons]/esx_phone/html/ui_en.html @@ -0,0 +1,90 @@ + + + + + + + + + + +
+ +
+ +
+ + unknown +
+ + + +
+
+ Contacts + +
+
+
+
+

No contacts

+
+
+
+
+ +
+
Messages + +
+
+
+
+

No messages

+
+
+
+
+ +
+
+
+
+ + + + + +
+
+
+ +
+
Add a + contact
+
+
+ + + + +
+
+
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/[esx_addons]/esx_phone/html/ui_pl.html b/[esx_addons]/esx_phone/html/ui_pl.html new file mode 100644 index 00000000..92448574 --- /dev/null +++ b/[esx_addons]/esx_phone/html/ui_pl.html @@ -0,0 +1,91 @@ + + + + + + + + + + +
+ +
+ +
+ + #123456 +
+ + + +
+
+ Kontakty + +
+
+
+
+

Brak kontaktów

+
+
+
+
+ +
+
Wiadomości + +
+
+
+
+

Brak wiadomości

+
+
+
+
+ +
+
+
+
+ + + + + +
+
+
+ +
+
Dodaj + kontakt
+
+
+ + + + +
+
+
+ +
+
+ + + + + + + + + \ No newline at end of file diff --git a/[esx_addons]/esx_phone/locales/br.lua b/[esx_addons]/esx_phone/locales/br.lua new file mode 100644 index 00000000..1b1b3ac4 --- /dev/null +++ b/[esx_addons]/esx_phone/locales/br.lua @@ -0,0 +1,13 @@ +Locales['br'] = { + ['new_message'] = '~b~Nova mensagem :~s~ %s', + ['press_take_call'] = '%s - Pressione ~INPUT_CONTEXT~ para aceitar a chamada', + ['taken_call'] = '~y~%s~s~ recebeu uma chamada', + ['gps_position'] = 'destino inserido no GPS', + ['message_sent'] = 'mensagem enviada', + ['cannot_add_self'] = 'você não pode se adicionar', + ['number_in_contacts'] = 'este número já está na sua lista de contatos', + ['contact_added'] = 'contato adicionado', + ['contact_removed'] = 'the contact has been removed!', + ['number_not_assigned'] = 'este número não foi atribuído...', + ['invalid_number'] = 'that\'s not an valid number!', +} diff --git a/[esx_addons]/esx_phone/locales/de.lua b/[esx_addons]/esx_phone/locales/de.lua new file mode 100644 index 00000000..7333c33b --- /dev/null +++ b/[esx_addons]/esx_phone/locales/de.lua @@ -0,0 +1,13 @@ +Locales['de'] = { + ['new_message'] = '~b~Neue Nachricht', + ['press_take_call'] = '%s - Drücke ~INPUT_CONTEXT~ um den Anruf anzunehmen', + ['taken_call'] = '~y~%s~s~ hat den Anruf angenommen', + ['gps_position'] = 'ziel in GPS eingegeben', + ['message_sent'] = 'nachricht gesendet', + ['cannot_add_self'] = 'du kannst dich nicht selbst hinzufügen', + ['number_in_contacts'] = 'diese Nummer ist bereits in deinen Kontakten', + ['contact_added'] = 'kontakt hinzugefügt', + ['contact_removed'] = 'the contact has been removed!', + ['number_not_assigned'] = 'diese Nummer ist nicht vergeben...', + ['invalid_number'] = 'that\'s not an valid number!', +} diff --git a/[esx_addons]/esx_phone/locales/en.lua b/[esx_addons]/esx_phone/locales/en.lua new file mode 100644 index 00000000..0735fe34 --- /dev/null +++ b/[esx_addons]/esx_phone/locales/en.lua @@ -0,0 +1,13 @@ +Locales['en'] = { + ['new_message'] = '~b~You have received a message:~s~ %s', + ['press_take_call'] = '%s - Press ~INPUT_CONTEXT~ to take the call', + ['taken_call'] = '~y~%s~s~ has taken the call', + ['gps_position'] = 'the destination has been added to your GPS', + ['message_sent'] = 'the message has been sent', + ['cannot_add_self'] = 'you can not add yourself!', + ['number_in_contacts'] = 'this number is already in your contact list', + ['contact_added'] = 'the contact has been added!', + ['contact_removed'] = 'the contact has been removed!', + ['number_not_assigned'] = 'the number has not been assigned!', + ['invalid_number'] = 'that\'s not an valid number!', +} diff --git a/[esx_addons]/esx_phone/locales/es.lua b/[esx_addons]/esx_phone/locales/es.lua new file mode 100644 index 00000000..d8ecca20 --- /dev/null +++ b/[esx_addons]/esx_phone/locales/es.lua @@ -0,0 +1,14 @@ +Locales['es'] = { + ['new_message'] = '~b~Nuevo mensaje :~s~ %s', + ['press_take_call'] = '%s - Pulsar ~INPUT_CONTEXT~ para coger la llamada', + ['taken_call'] = '~y~%s~s~ ha contestado la llamada', + ['gps_position'] = 'destino añadido al GPS', + ['message_sent'] = 'mensaje enviado', + ['cannot_add_self'] = 'no puedes agregarte a ti mismo!', + ['number_in_contacts'] = 'este número ya está en tu lista de contactos', + ['contact_added'] = 'contacto añadido!', + ['contact_removed'] = 'el contacto ha sido eliminado!', + ['number_not_assigned'] = 'el número no ha sido añadido!', + ['invalid_number'] = 'el número no es válido!', +} + diff --git a/[esx_addons]/esx_phone/locales/fr.lua b/[esx_addons]/esx_phone/locales/fr.lua new file mode 100644 index 00000000..9b47eb4d --- /dev/null +++ b/[esx_addons]/esx_phone/locales/fr.lua @@ -0,0 +1,13 @@ +Locales['fr'] = { + ['new_message'] = '~b~Nouveau message :~s~ %s', + ['press_take_call'] = '%s - Appuyez sur ~INPUT_CONTEXT~ pour prendre l\'appel', + ['taken_call'] = '~y~%s~s~ a pris l\'appel', + ['gps_position'] = 'position entrée dans le GPS', + ['message_sent'] = 'message envoyé', + ['cannot_add_self'] = 'vous ne pouvez pas vous ajouter vous-même', + ['number_in_contacts'] = 'ce numéro est déja dans votre liste de contacts', + ['contact_added'] = 'contact ajouté', + ['contact_removed'] = 'contact supprimé', + ['number_not_assigned'] = 'ce numéro n\'est pas attribué...', + ['invalid_number'] = 'that\'s not an valid number!', +} diff --git a/[esx_addons]/esx_phone/locales/pl.lua b/[esx_addons]/esx_phone/locales/pl.lua new file mode 100644 index 00000000..85b5eee5 --- /dev/null +++ b/[esx_addons]/esx_phone/locales/pl.lua @@ -0,0 +1,13 @@ +Locales['pl'] = { + ['new_message'] = '~b~Masz nową wiadomość:~s~ %s', + ['press_take_call'] = '%s - wciśnij ~INPUT_CONTEXT~ aby odebrać telefon', + ['taken_call'] = '~y~%s~s~ odebrał telefon', + ['gps_position'] = 'cel podróży został dodany do GPS\'a', + ['message_sent'] = 'wiadomość wysłana', + ['cannot_add_self'] = 'nie możesz dodać samego siebie!', + ['number_in_contacts'] = 'ten numer jest już na twojej liście kontaktów', + ['contact_added'] = 'kontakt dodany!', + ['contact_removed'] = 'kontakt usunięty!', + ['number_not_assigned'] = 'numer nie jest przypisany!', + ['invalid_number'] = 'to nie jest prawidłowy numer telefonu!', +} diff --git a/[esx_addons]/esx_phone/locales/sv.lua b/[esx_addons]/esx_phone/locales/sv.lua new file mode 100644 index 00000000..334facfc --- /dev/null +++ b/[esx_addons]/esx_phone/locales/sv.lua @@ -0,0 +1,13 @@ +Locales['sv'] = { + ['new_message'] = '~b~Nytt meddelande:~s~ %s', + ['press_take_call'] = '%s - tryck ~INPUT_CONTEXT~ för att svara', + ['taken_call'] = '~y~%s~s~ har tagit emot ditt meddelande', + ['gps_position'] = 'destinationen är markerad på din GPS!', + ['message_sent'] = 'meddelandet har skickats!', + ['cannot_add_self'] = 'du kan inte lägga till dig själv!', + ['number_in_contacts'] = 'det här nummret finns redan bland dina kontakter!', + ['contact_added'] = 'kontakten har lags till!', + ['contact_removed'] = 'kontakten har tagits bort!', + ['number_not_assigned'] = 'det här nummret finns inte!', + ['invalid_number'] = 'det är inte ett giltigt nummer!', +} diff --git a/[esx_addons]/esx_phone/server/main.lua b/[esx_addons]/esx_phone/server/main.lua new file mode 100644 index 00000000..ee6b4e37 --- /dev/null +++ b/[esx_addons]/esx_phone/server/main.lua @@ -0,0 +1,294 @@ +ESX = nil +local DisptachRequestId, PhoneNumbers = 0, {} + +TriggerEvent('esx:getSharedObject', function(obj) + ESX = obj + + local xPlayers = ESX.GetPlayers() + + for i=1, #xPlayers, 1 do + LoadPlayer(xPlayers[i]) + end +end) + +function LoadPlayer(source) + local xPlayer = ESX.GetPlayerFromId(source) + + for num,v in pairs(PhoneNumbers) do + if tonumber(num) == num then -- if phonenumber is a player phone number + for src,_ in pairs(v.sources) do + TriggerClientEvent('esx_phone:setPhoneNumberSource', source, num, tonumber(src)) + end + end + end + + MySQL.Async.fetchAll('SELECT phone_number FROM users WHERE identifier = @identifier', { + ['@identifier'] = xPlayer.identifier + }, function(result) + local phoneNumber = result[1].phone_number + + if phoneNumber == nil then + phoneNumber = GenerateUniquePhoneNumber() + + MySQL.Async.execute('UPDATE users SET phone_number = @phone_number WHERE identifier = @identifier', { + ['@identifier'] = xPlayer.identifier, + ['@phone_number'] = phoneNumber + }) + end + + TriggerClientEvent('esx_phone:setPhoneNumberSource', -1, phoneNumber, source) + + PhoneNumbers[phoneNumber] = { + type = 'player', + hashDispatch = false, + sharePos = false, + hideNumber = false, + hidePosIfAnon = false, + sources = {[source] = true} + } + + xPlayer.set('phoneNumber', phoneNumber) + local contacts = {} + + if PhoneNumbers[xPlayer.job.name] then + TriggerEvent('esx_phone:addSource', xPlayer.job.name, source) + end + + MySQL.Async.fetchAll('SELECT * FROM user_contacts WHERE identifier = @identifier ORDER BY name ASC', { + ['@identifier'] = xPlayer.identifier + }, function(result2) + for i=1, #result2, 1 do + table.insert(contacts, { + name = result2[i].name, + number = result2[i].number, + }) + end + + xPlayer.set('contacts', contacts) + TriggerClientEvent('esx_phone:loaded', source, phoneNumber, contacts) + end) + end) +end + +function GenerateUniquePhoneNumber() + local foundNumber, phoneNumber = false, nil + + while not foundNumber do + Citizen.Wait(100) + + math.randomseed(GetGameTimer()) + phoneNumber = math.random(10000, 99999) + + local result = MySQL.Sync.fetchAll('SELECT COUNT(*) as count FROM users WHERE phone_number = @phoneNumber', { + ['@phoneNumber'] = phoneNumber + }) + + if tonumber(result[1].count) == 0 then + foundNumber = true + end + end + + return phoneNumber +end + +function GetDistpatchRequestId() + local requestId = DisptachRequestId + + if DisptachRequestId < 65535 then + DisptachRequestId = DisptachRequestId + 1 + else + DisptachRequestId = 0 + end + + return requestId +end + +AddEventHandler('esx_phone:getDistpatchRequestId', function(cb) + cb(GetDistpatchRequestId()) +end) + +AddEventHandler('esx:playerLoaded', function(playerId) + LoadPlayer(playerId) +end) + +AddEventHandler('esx:playerDropped', function(source) + local xPlayer = ESX.GetPlayerFromId(source) + local phoneNumber = xPlayer.get('phoneNumber') + + TriggerClientEvent('esx_phone:setPhoneNumberSource', -1, phoneNumber, -1) + PhoneNumbers[phoneNumber] = nil + + if PhoneNumbers[xPlayer.job.name] then + TriggerEvent('esx_phone:removeSource', xPlayer.job.name, source) + end +end) + +AddEventHandler('esx:setJob', function(source, job, lastJob) + if PhoneNumbers[lastJob.name] then + TriggerEvent('esx_phone:removeSource', lastJob.name, source) + end + + if PhoneNumbers[job.name] then + TriggerEvent('esx_phone:addSource', job.name, source) + end +end) + +RegisterServerEvent('esx_phone:reload') +AddEventHandler('esx_phone:reload', function(phoneNumber) + local playerId = source + local xPlayer = ESX.GetPlayerFromId(playerId) + local contacts = xPlayer.get('contacts') + + TriggerClientEvent('esx_phone:loaded', playerId, phoneNumber, contacts) +end) + +RegisterServerEvent('esx_phone:send') +AddEventHandler('esx_phone:send', function(phoneNumber, message, anon, position) + local xPlayer = ESX.GetPlayerFromId(source) + print(('esx_phone: MESSAGE => %s@%s: %s'):format(xPlayer.name, phoneNumber, message)) + + if PhoneNumbers[phoneNumber] then + for k,v in pairs(PhoneNumbers[phoneNumber].sources) do + local numType = PhoneNumbers[phoneNumber].type + local numHasDispatch = PhoneNumbers[phoneNumber].hasDispatch + local numHide = PhoneNumbers[phoneNumber].hideNumber + local numHidePosIfAnon = PhoneNumbers[phoneNumber].hidePosIfAnon + local numPosition = (PhoneNumbers[phoneNumber].sharePos and position or false) + local numSource = tonumber(k) + + if numHidePosIfAnon and anon then + numPosition = false + end + + if numHasDispatch then + TriggerClientEvent('esx_phone:onMessage', numSource, xPlayer.get('phoneNumber'), message, numPosition, (numHide and true or anon), numType, GetDistpatchRequestId(), phoneNumber) + else + TriggerClientEvent('esx_phone:onMessage', numSource, xPlayer.get('phoneNumber'), message, numPosition, (numHide and true or anon), numType, false) + end + end + end +end) + +AddEventHandler('esx_phone:registerNumber', function(number, type, sharePos, hasDispatch, hideNumber, hidePosIfAnon) + local hideNumber = hideNumber or false + local hidePosIfAnon = hidePosIfAnon or false + + PhoneNumbers[number] = { + type = type, + sharePos = sharePos, + hasDispatch = (hasDispatch or false), + hideNumber = hideNumber, + hidePosIfAnon = hidePosIfAnon, + sources = {} + } +end) + +AddEventHandler('esx_phone:removeNumber', function(number) + PhoneNumbers[number] = nil +end) + +AddEventHandler('esx_phone:addSource', function(number, source) + PhoneNumbers[number].sources[tostring(source)] = true +end) + +AddEventHandler('esx_phone:removeSource', function(number, source) + PhoneNumbers[number].sources[tostring(source)] = nil +end) + +RegisterServerEvent('esx_phone:addPlayerContact') +AddEventHandler('esx_phone:addPlayerContact', function(phoneNumber, contactName) + local playerId = source + local xPlayer = ESX.GetPlayerFromId(playerId) + phoneNumber = tonumber(phoneNumber) + local playerOnline = false + + if phoneNumber == nil then + print(('esx_phone: %s parsed invalid player contact number!'):format(xPlayer.identifier)) + return + end + + MySQL.Async.fetchAll('SELECT phone_number, identifier FROM users WHERE phone_number = @number', { + ['@number'] = phoneNumber + }, function(result) + if result[1] then + if phoneNumber == xPlayer.get('phoneNumber') then + TriggerClientEvent('esx:showNotification', playerId, _U('cannot_add_self')) + else + local contacts = xPlayer.get('contacts') + + -- already added player? + for i=1, #contacts, 1 do + if contacts[i].number == phoneNumber then + TriggerClientEvent('esx:showNotification', playerId, _U('number_in_contacts')) + return + end + end + + table.insert(contacts, { + name = contactName, + number = phoneNumber + }) + + xPlayer.set('contacts', contacts) + + -- is the player currently online? + local xTarget = ESX.GetPlayerFromIdentifier(result[1].identifier) + playerOnline = xTarget ~= nil + + MySQL.Async.execute('INSERT INTO user_contacts (identifier, name, number) VALUES (@identifier, @name, @number)', { + ['@identifier'] = xPlayer.identifier, + ['@name'] = contactName, + ['@number'] = phoneNumber + }, function(rowsChanged) + TriggerClientEvent('esx:showNotification', playerId, _U('contact_added')) + TriggerClientEvent('esx_phone:addContact', playerId, contactName, phoneNumber, playerOnline) + end) + end + else + TriggerClientEvent('esx:showNotification', playerId, _U('number_not_assigned')) + end + end) +end) + +RegisterServerEvent('esx_phone:removePlayerContact') +AddEventHandler('esx_phone:removePlayerContact', function(phoneNumber, contactName) + local playerId = source + local xPlayer = ESX.GetPlayerFromId(playerId) + local foundNumber = false + + MySQL.Async.fetchAll('SELECT phone_number FROM users WHERE phone_number = @number', { + ['@number'] = phoneNumber + }, function(result) + if result[1] then + foundNumber = true + end + + if foundNumber then + local contacts = xPlayer.get('contacts') + + for key, value in pairs(contacts) do + if value.name == contactName and value.number == phoneNumber then + table.remove(contacts, key) + end + end + + xPlayer.set('contacts', contacts) + + MySQL.Async.execute('DELETE FROM user_contacts WHERE identifier = @identifier AND name = @name AND number = @number', { + ['@identifier'] = xPlayer.identifier, + ['@name'] = contactName, + ['@number'] = phoneNumber + }, function(rowsChanged) + TriggerClientEvent('esx:showNotification', playerId, _U('contact_removed')) + TriggerClientEvent('esx_phone:removeContact', playerId, contactName, phoneNumber) + end) + else + TriggerClientEvent('esx:showNotification', playerId, _U('number_not_assigned')) + end + end) +end) + +RegisterServerEvent('esx_phone:stopDispatch') +AddEventHandler('esx_phone:stopDispatch', function(dispatchRequestId) + TriggerClientEvent('esx_phone:stopDispatch', -1, dispatchRequestId, GetPlayerName(source)) +end) \ No newline at end of file diff --git a/[esx_addons]/esx_phone/ui_es.html b/[esx_addons]/esx_phone/ui_es.html new file mode 100644 index 00000000..9b730801 --- /dev/null +++ b/[esx_addons]/esx_phone/ui_es.html @@ -0,0 +1,87 @@ + + + + + + + + + + +
+ +
+ +
+ + unknown +
+ + + +
+ +
Contactos
+
+
+
+

No hay contactos

+
+
+
+
+ +
+
Mensajes + +
+
+
+
+

No hay mensajes

+
+
+
+
+ +
+
+
+
+ + + + + +
+
+
+ +
+
Añadir contacto
+
+
+ + + + +
+
+
+ +
+
+ + + + + + + + diff --git a/[esx_addons]/esx_policejob/.editorconfig b/[esx_addons]/esx_policejob/.editorconfig new file mode 100644 index 00000000..9b425256 --- /dev/null +++ b/[esx_addons]/esx_policejob/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_size = 4 +indent_style = tab +end_of_line = crlf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/[esx_addons]/esx_policejob/LICENSE b/[esx_addons]/esx_policejob/LICENSE new file mode 100644 index 00000000..49c66f5e --- /dev/null +++ b/[esx_addons]/esx_policejob/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + fxserver-esx_policejob + Copyright (C) 2015 Jérémie N'gadi + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + fxserver-esx_policejob Copyright (C) 2015 Jérémie N'gadi + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. \ No newline at end of file diff --git a/[esx_addons]/esx_policejob/README.md b/[esx_addons]/esx_policejob/README.md new file mode 100644 index 00000000..16504542 --- /dev/null +++ b/[esx_addons]/esx_policejob/README.md @@ -0,0 +1,68 @@ +# esx_policejob + +This resource for ESX adds police armories, vehicle garages and ability for cops to search, handcuff people and much more. + +### Requirements +* Auto mode + * [esx_billing](https://github.com/ESX-Org/esx_billing) + * [esx_vehicleshop](https://github.com/ESX-Org/esx_vehicleshop) + +* Player management (boss actions and armory with buyable weapons) + * [esx_addoninventory](https://github.com/ESX-Org/esx_addoninventory) + * [esx_datastore](https://github.com/ESX-Org/esx_datastore) + * [esx_society](https://github.com/ESX-Org/esx_society) + +* ESX Identity Support + * [esx_identity](https://github.com/ESX-Org/esx_identity) + +* ESX License Support + * [esx_license](https://github.com/ESX-Org/esx_license) + +* ESX Service Support + * [esx_service](https://github.com/ESX-Org/esx_service) + +* ESX Status Support + * [esx_status](https://github.com/ESX-Org/esx_status) + +## Download & Installation + +### Using [fvm](https://github.com/qlaffont/fvm-installer) +``` +fvm install --save --folder=esx esx-org/esx_policejob +``` + +### Using Git +``` +cd resources +git clone https://github.com/ESX-Org/esx_policejob [esx]/esx_policejob +``` + +### Manually +- Download https://github.com/ESX-Org/esx_policejob/archive/master.zip +- Put it in the `[esx]` directory + + +## Installation +- Import `esx_policejob.sql` in your database +- Add this to your server.cfg: + +``` +start esx_policejob +``` + +- * If you want player management you have to set `Config.EnablePlayerManagement` to `true` in `config.lua` + * If you want armory management you have to set `Config.EnableArmoryManagement` to `true` in `config.lua` + * If you want license management you have to set `Config.EnableLicenses` to `true` in `config.lua` + * If you want service management you have to set `Config.MaxInService` to a higher value than `-1` in `config.lua` + +# Legal +### License +esx_policejob - police script for ESX + +Copyright (C) 2015-2020 Jérémie N'gadi + +This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version. + +This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details. + +You should have received a copy Of the GNU General Public License along with this program. If Not, see http://www.gnu.org/licenses/. diff --git a/[esx_addons]/esx_policejob/client/main.lua b/[esx_addons]/esx_policejob/client/main.lua new file mode 100644 index 00000000..4ae3bf3a --- /dev/null +++ b/[esx_addons]/esx_policejob/client/main.lua @@ -0,0 +1,1576 @@ +local CurrentActionData, handcuffTimer, dragStatus, blipsCops, currentTask = {}, {}, {}, {}, {} +local HasAlreadyEnteredMarker, isDead, isHandcuffed, hasAlreadyJoined, playerInService = false, false, false, false, false +local LastStation, LastPart, LastPartNum, LastEntity, CurrentAction, CurrentActionMsg +dragStatus.isDragged, isInShopMenu = false, false +ESX = nil + +Citizen.CreateThread(function() + while ESX == nil do + TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + Citizen.Wait(0) + end + + while ESX.GetPlayerData().job == nil do + Citizen.Wait(10) + end + + ESX.PlayerData = ESX.GetPlayerData() +end) + +function cleanPlayer(playerPed) + SetPedArmour(playerPed, 0) + ClearPedBloodDamage(playerPed) + ResetPedVisibleDamage(playerPed) + ClearPedLastWeaponDamage(playerPed) + ResetPedMovementClipset(playerPed, 0) +end + +function setUniform(uniform, playerPed) + TriggerEvent('skinchanger:getSkin', function(skin) + local uniformObject + + if skin.sex == 0 then + uniformObject = Config.Uniforms[uniform].male + else + uniformObject = Config.Uniforms[uniform].female + end + + if uniformObject then + TriggerEvent('skinchanger:loadClothes', skin, uniformObject) + + if uniform == 'bullet_wear' then + SetPedArmour(playerPed, 100) + end + else + ESX.ShowNotification(_U('no_outfit')) + end + end) +end + +function OpenCloakroomMenu() + local playerPed = PlayerPedId() + local grade = ESX.PlayerData.job.grade_name + + local elements = { + {label = _U('citizen_wear'), value = 'citizen_wear'}, + {label = _U('bullet_wear'), uniform = 'bullet_wear'}, + {label = _U('gilet_wear'), uniform = 'gilet_wear'}, + {label = _U('police_wear'), uniform = grade} + } + + if Config.EnableCustomPeds then + for k,v in ipairs(Config.CustomPeds.shared) do + table.insert(elements, {label = v.label, value = 'freemode_ped', maleModel = v.maleModel, femaleModel = v.femaleModel}) + end + + for k,v in ipairs(Config.CustomPeds[grade]) do + table.insert(elements, {label = v.label, value = 'freemode_ped', maleModel = v.maleModel, femaleModel = v.femaleModel}) + end + end + + ESX.UI.Menu.CloseAll() + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'cloakroom', { + title = _U('cloakroom'), + align = 'top-left', + elements = elements + }, function(data, menu) + cleanPlayer(playerPed) + + if data.current.value == 'citizen_wear' then + if Config.EnableCustomPeds then + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) + local isMale = skin.sex == 0 + + TriggerEvent('skinchanger:loadDefaultModel', isMale, function() + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin) + TriggerEvent('skinchanger:loadSkin', skin) + TriggerEvent('esx:restoreLoadout') + end) + end) + + end) + else + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin) + TriggerEvent('skinchanger:loadSkin', skin) + end) + end + + if Config.EnableESXService then + ESX.TriggerServerCallback('esx_service:isInService', function(isInService) + if isInService then + playerInService = false + + local notification = { + title = _U('service_anonunce'), + subject = '', + msg = _U('service_out_announce', GetPlayerName(PlayerId())), + iconType = 1 + } + + TriggerServerEvent('esx_service:notifyAllInService', notification, 'police') + + TriggerServerEvent('esx_service:disableService', 'police') + TriggerEvent('esx_policejob:updateBlip') + ESX.ShowNotification(_U('service_out')) + end + end, 'police') + end + end + + if Config.EnableESXService and data.current.value ~= 'citizen_wear' then + local awaitService + + ESX.TriggerServerCallback('esx_service:isInService', function(isInService) + if not isInService then + + if Config.MaxInService == -1 then + ESX.TriggerServerCallback('esx_service:enableService', function(canTakeService, maxInService, inServiceCount) + if not canTakeService then + ESX.ShowNotification(_U('service_max', inServiceCount, maxInService)) + else + awaitService = true + playerInService = true + + local notification = { + title = _U('service_anonunce'), + subject = '', + msg = _U('service_in_announce', GetPlayerName(PlayerId())), + iconType = 1 + } + + TriggerServerEvent('esx_service:notifyAllInService', notification, 'police') + TriggerEvent('esx_policejob:updateBlip') + ESX.ShowNotification(_U('service_in')) + end + end, 'police') + else + awaitService = true + playerInService = true + + local notification = { + title = _U('service_anonunce'), + subject = '', + msg = _U('service_in_announce', GetPlayerName(PlayerId())), + iconType = 1 + } + + TriggerServerEvent('esx_service:notifyAllInService', notification, 'police') + TriggerEvent('esx_policejob:updateBlip') + ESX.ShowNotification(_U('service_in')) + end + + else + awaitService = true + end + end, 'police') + + while awaitService == nil do + Citizen.Wait(5) + end + + -- if we couldn't enter service don't let the player get changed + if not awaitService then + return + end + end + + if data.current.uniform then + setUniform(data.current.uniform, playerPed) + elseif data.current.value == 'freemode_ped' then + local modelHash + + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) + if skin.sex == 0 then + modelHash = GetHashKey(data.current.maleModel) + else + modelHash = GetHashKey(data.current.femaleModel) + end + + ESX.Streaming.RequestModel(modelHash, function() + SetPlayerModel(PlayerId(), modelHash) + SetModelAsNoLongerNeeded(modelHash) + SetPedDefaultComponentVariation(PlayerPedId()) + + TriggerEvent('esx:restoreLoadout') + end) + end) + end + end, function(data, menu) + menu.close() + + CurrentAction = 'menu_cloakroom' + CurrentActionMsg = _U('open_cloackroom') + CurrentActionData = {} + end) +end + +function OpenArmoryMenu(station) + local elements = { + {label = _U('buy_weapons'), value = 'buy_weapons'} + } + + if Config.EnableArmoryManagement then + table.insert(elements, {label = _U('get_weapon'), value = 'get_weapon'}) + table.insert(elements, {label = _U('put_weapon'), value = 'put_weapon'}) + table.insert(elements, {label = _U('remove_object'), value = 'get_stock'}) + table.insert(elements, {label = _U('deposit_object'), value = 'put_stock'}) + end + + ESX.UI.Menu.CloseAll() + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'armory', { + title = _U('armory'), + align = 'top-left', + elements = elements + }, function(data, menu) + + if data.current.value == 'get_weapon' then + OpenGetWeaponMenu() + elseif data.current.value == 'put_weapon' then + OpenPutWeaponMenu() + elseif data.current.value == 'buy_weapons' then + OpenBuyWeaponsMenu() + elseif data.current.value == 'put_stock' then + OpenPutStocksMenu() + elseif data.current.value == 'get_stock' then + OpenGetStocksMenu() + end + + end, function(data, menu) + menu.close() + + CurrentAction = 'menu_armory' + CurrentActionMsg = _U('open_armory') + CurrentActionData = {station = station} + end) +end + +function OpenPoliceActionsMenu() + ESX.UI.Menu.CloseAll() + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'police_actions', { + title = 'Police', + align = 'top-left', + elements = { + {label = _U('citizen_interaction'), value = 'citizen_interaction'}, + {label = _U('vehicle_interaction'), value = 'vehicle_interaction'}, + {label = _U('object_spawner'), value = 'object_spawner'} + }}, function(data, menu) + if data.current.value == 'citizen_interaction' then + local elements = { + {label = _U('id_card'), value = 'identity_card'}, + {label = _U('search'), value = 'search'}, + {label = _U('handcuff'), value = 'handcuff'}, + {label = _U('drag'), value = 'drag'}, + {label = _U('put_in_vehicle'), value = 'put_in_vehicle'}, + {label = _U('out_the_vehicle'), value = 'out_the_vehicle'}, + {label = _U('fine'), value = 'fine'}, + {label = _U('unpaid_bills'), value = 'unpaid_bills'} + } + + if Config.EnableLicenses then + table.insert(elements, {label = _U('license_check'), value = 'license'}) + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'citizen_interaction', { + title = _U('citizen_interaction'), + align = 'top-left', + elements = elements + }, function(data2, menu2) + local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() + if closestPlayer ~= -1 and closestDistance <= 3.0 then + local action = data2.current.value + + if action == 'identity_card' then + OpenIdentityCardMenu(closestPlayer) + elseif action == 'search' then + OpenBodySearchMenu(closestPlayer) + elseif action == 'handcuff' then + TriggerServerEvent('esx_policejob:handcuff', GetPlayerServerId(closestPlayer)) + elseif action == 'drag' then + TriggerServerEvent('esx_policejob:drag', GetPlayerServerId(closestPlayer)) + elseif action == 'put_in_vehicle' then + TriggerServerEvent('esx_policejob:putInVehicle', GetPlayerServerId(closestPlayer)) + elseif action == 'out_the_vehicle' then + TriggerServerEvent('esx_policejob:OutVehicle', GetPlayerServerId(closestPlayer)) + elseif action == 'fine' then + OpenFineMenu(closestPlayer) + elseif action == 'license' then + ShowPlayerLicense(closestPlayer) + elseif action == 'unpaid_bills' then + OpenUnpaidBillsMenu(closestPlayer) + end + else + ESX.ShowNotification(_U('no_players_nearby')) + end + end, function(data2, menu2) + menu2.close() + end) + elseif data.current.value == 'vehicle_interaction' then + local elements = {} + local playerPed = PlayerPedId() + local vehicle = ESX.Game.GetVehicleInDirection() + + if DoesEntityExist(vehicle) then + table.insert(elements, {label = _U('vehicle_info'), value = 'vehicle_infos'}) + table.insert(elements, {label = _U('pick_lock'), value = 'hijack_vehicle'}) + table.insert(elements, {label = _U('impound'), value = 'impound'}) + end + + table.insert(elements, {label = _U('search_database'), value = 'search_database'}) + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_interaction', { + title = _U('vehicle_interaction'), + align = 'top-left', + elements = elements + }, function(data2, menu2) + local coords = GetEntityCoords(playerPed) + vehicle = ESX.Game.GetVehicleInDirection() + action = data2.current.value + + if action == 'search_database' then + LookupVehicle() + elseif DoesEntityExist(vehicle) then + if action == 'vehicle_infos' then + local vehicleData = ESX.Game.GetVehicleProperties(vehicle) + OpenVehicleInfosMenu(vehicleData) + elseif action == 'hijack_vehicle' then + if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 3.0) then + TaskStartScenarioInPlace(playerPed, 'WORLD_HUMAN_WELDING', 0, true) + Citizen.Wait(20000) + ClearPedTasksImmediately(playerPed) + + SetVehicleDoorsLocked(vehicle, 1) + SetVehicleDoorsLockedForAllPlayers(vehicle, false) + ESX.ShowNotification(_U('vehicle_unlocked')) + end + elseif action == 'impound' then + -- is the script busy? + if currentTask.busy then + return + end + + ESX.ShowHelpNotification(_U('impound_prompt')) + TaskStartScenarioInPlace(playerPed, 'CODE_HUMAN_MEDIC_TEND_TO_DEAD', 0, true) + + currentTask.busy = true + currentTask.task = ESX.SetTimeout(10000, function() + ClearPedTasks(playerPed) + ImpoundVehicle(vehicle) + Citizen.Wait(100) -- sleep the entire script to let stuff sink back to reality + end) + + -- keep track of that vehicle! + Citizen.CreateThread(function() + while currentTask.busy do + Citizen.Wait(1000) + + vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 3.0, 0, 71) + if not DoesEntityExist(vehicle) and currentTask.busy then + ESX.ShowNotification(_U('impound_canceled_moved')) + ESX.ClearTimeout(currentTask.task) + ClearPedTasks(playerPed) + currentTask.busy = false + break + end + end + end) + end + else + ESX.ShowNotification(_U('no_vehicles_nearby')) + end + + end, function(data2, menu2) + menu2.close() + end) + elseif data.current.value == 'object_spawner' then + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'citizen_interaction', { + title = _U('traffic_interaction'), + align = 'top-left', + elements = { + {label = _U('cone'), model = 'prop_roadcone02a'}, + {label = _U('barrier'), model = 'prop_barrier_work05'}, + {label = _U('spikestrips'), model = 'p_ld_stinger_s'}, + {label = _U('box'), model = 'prop_boxpile_07d'}, + {label = _U('cash'), model = 'hei_prop_cash_crate_half_full'} + }}, function(data2, menu2) + local playerPed = PlayerPedId() + local coords, forward = GetEntityCoords(playerPed), GetEntityForwardVector(playerPed) + local objectCoords = (coords + forward * 1.0) + + ESX.Game.SpawnObject(data2.current.model, objectCoords, function(obj) + SetEntityHeading(obj, GetEntityHeading(playerPed)) + PlaceObjectOnGroundProperly(obj) + end) + end, function(data2, menu2) + menu2.close() + end) + end + end, function(data, menu) + menu.close() + end) +end + +function OpenIdentityCardMenu(player) + ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) + local elements = { + {label = _U('name', data.name)}, + {label = _U('job', ('%s - %s'):format(data.job, data.grade))} + } + + if Config.EnableESXIdentity then + table.insert(elements, {label = _U('sex', _U(data.sex))}) + table.insert(elements, {label = _U('dob', data.dob)}) + table.insert(elements, {label = _U('height', data.height)}) + end + + if data.drunk then + table.insert(elements, {label = _U('bac', data.drunk)}) + end + + if data.licenses then + table.insert(elements, {label = _U('license_label')}) + + for i=1, #data.licenses, 1 do + table.insert(elements, {label = data.licenses[i].label}) + end + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'citizen_interaction', { + title = _U('citizen_interaction'), + align = 'top-left', + elements = elements + }, nil, function(data, menu) + menu.close() + end) + end, GetPlayerServerId(player)) +end + +function OpenBodySearchMenu(player) + ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) + local elements = {} + + for i=1, #data.accounts, 1 do + if data.accounts[i].name == 'black_money' and data.accounts[i].money > 0 then + table.insert(elements, { + label = _U('confiscate_dirty', ESX.Math.Round(data.accounts[i].money)), + value = 'black_money', + itemType = 'item_account', + amount = data.accounts[i].money + }) + + break + end + end + + table.insert(elements, {label = _U('guns_label')}) + + for i=1, #data.weapons, 1 do + table.insert(elements, { + label = _U('confiscate_weapon', ESX.GetWeaponLabel(data.weapons[i].name), data.weapons[i].ammo), + value = data.weapons[i].name, + itemType = 'item_weapon', + amount = data.weapons[i].ammo + }) + end + + table.insert(elements, {label = _U('inventory_label')}) + + for i=1, #data.inventory, 1 do + if data.inventory[i].count > 0 then + table.insert(elements, { + label = _U('confiscate_inv', data.inventory[i].count, data.inventory[i].label), + value = data.inventory[i].name, + itemType = 'item_standard', + amount = data.inventory[i].count + }) + end + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'body_search', { + title = _U('search'), + align = 'top-left', + elements = elements + }, function(data, menu) + if data.current.value then + TriggerServerEvent('esx_policejob:confiscatePlayerItem', GetPlayerServerId(player), data.current.itemType, data.current.value, data.current.amount) + OpenBodySearchMenu(player) + end + end, function(data, menu) + menu.close() + end) + end, GetPlayerServerId(player)) +end + +function OpenFineMenu(player) + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'fine', { + title = _U('fine'), + align = 'top-left', + elements = { + {label = _U('traffic_offense'), value = 0}, + {label = _U('minor_offense'), value = 1}, + {label = _U('average_offense'), value = 2}, + {label = _U('major_offense'), value = 3} + }}, function(data, menu) + OpenFineCategoryMenu(player, data.current.value) + end, function(data, menu) + menu.close() + end) +end + +function OpenFineCategoryMenu(player, category) + ESX.TriggerServerCallback('esx_policejob:getFineList', function(fines) + local elements = {} + + for k,fine in ipairs(fines) do + table.insert(elements, { + label = ('%s %s'):format(fine.label, _U('armory_item', ESX.Math.GroupDigits(fine.amount))), + value = fine.id, + amount = fine.amount, + fineLabel = fine.label + }) + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'fine_category', { + title = _U('fine'), + align = 'top-left', + elements = elements + }, function(data, menu) + menu.close() + + if Config.EnablePlayerManagement then + TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(player), 'society_police', _U('fine_total', data.current.fineLabel), data.current.amount) + else + TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(player), '', _U('fine_total', data.current.fineLabel), data.current.amount) + end + + ESX.SetTimeout(300, function() + OpenFineCategoryMenu(player, category) + end) + end, function(data, menu) + menu.close() + end) + end, category) +end + +function LookupVehicle() + ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'lookup_vehicle', { + title = _U('search_database_title'), + }, function(data, menu) + local length = string.len(data.value) + if not data.value or length < 2 or length > 8 then + ESX.ShowNotification(_U('search_database_error_invalid')) + else + ESX.TriggerServerCallback('esx_policejob:getVehicleInfos', function(retrivedInfo) + local elements = {{label = _U('plate', retrivedInfo.plate)}} + menu.close() + + if not retrivedInfo.owner then + table.insert(elements, {label = _U('owner_unknown')}) + else + table.insert(elements, {label = _U('owner', retrivedInfo.owner)}) + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_infos', { + title = _U('vehicle_info'), + align = 'top-left', + elements = elements + }, nil, function(data2, menu2) + menu2.close() + end) + end, data.value) + + end + end, function(data, menu) + menu.close() + end) +end + +function ShowPlayerLicense(player) + local elements = {} + + ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(playerData) + if playerData.licenses then + for i=1, #playerData.licenses, 1 do + if playerData.licenses[i].label and playerData.licenses[i].type then + table.insert(elements, { + label = playerData.licenses[i].label, + type = playerData.licenses[i].type + }) + end + end + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'manage_license', { + title = _U('license_revoke'), + align = 'top-left', + elements = elements, + }, function(data, menu) + ESX.ShowNotification(_U('licence_you_revoked', data.current.label, playerData.name)) + TriggerServerEvent('esx_policejob:message', GetPlayerServerId(player), _U('license_revoked', data.current.label)) + + TriggerServerEvent('esx_license:removeLicense', GetPlayerServerId(player), data.current.type) + + ESX.SetTimeout(300, function() + ShowPlayerLicense(player) + end) + end, function(data, menu) + menu.close() + end) + + end, GetPlayerServerId(player)) +end + +function OpenUnpaidBillsMenu(player) + local elements = {} + + ESX.TriggerServerCallback('esx_billing:getTargetBills', function(bills) + for k,bill in ipairs(bills) do + table.insert(elements, { + label = ('%s - %s'):format(bill.label, _U('armory_item', ESX.Math.GroupDigits(bill.amount))), + billId = bill.id + }) + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'billing', { + title = _U('unpaid_bills'), + align = 'top-left', + elements = elements + }, nil, function(data, menu) + menu.close() + end) + end, GetPlayerServerId(player)) +end + +function OpenVehicleInfosMenu(vehicleData) + ESX.TriggerServerCallback('esx_policejob:getVehicleInfos', function(retrivedInfo) + local elements = {{label = _U('plate', retrivedInfo.plate)}} + + if not retrivedInfo.owner then + table.insert(elements, {label = _U('owner_unknown')}) + else + table.insert(elements, {label = _U('owner', retrivedInfo.owner)}) + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_infos', { + title = _U('vehicle_info'), + align = 'top-left', + elements = elements + }, nil, function(data, menu) + menu.close() + end) + end, vehicleData.plate) +end + +function OpenGetWeaponMenu() + ESX.TriggerServerCallback('esx_policejob:getArmoryWeapons', function(weapons) + local elements = {} + + for i=1, #weapons, 1 do + if weapons[i].count > 0 then + table.insert(elements, { + label = 'x' .. weapons[i].count .. ' ' .. ESX.GetWeaponLabel(weapons[i].name), + value = weapons[i].name + }) + end + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'armory_get_weapon', { + title = _U('get_weapon_menu'), + align = 'top-left', + elements = elements + }, function(data, menu) + menu.close() + + ESX.TriggerServerCallback('esx_policejob:removeArmoryWeapon', function() + OpenGetWeaponMenu() + end, data.current.value) + end, function(data, menu) + menu.close() + end) + end) +end + +function OpenPutWeaponMenu() + local elements = {} + local playerPed = PlayerPedId() + local weaponList = ESX.GetWeaponList() + + for i=1, #weaponList, 1 do + local weaponHash = GetHashKey(weaponList[i].name) + + if HasPedGotWeapon(playerPed, weaponHash, false) and weaponList[i].name ~= 'WEAPON_UNARMED' then + table.insert(elements, { + label = weaponList[i].label, + value = weaponList[i].name + }) + end + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'armory_put_weapon', { + title = _U('put_weapon_menu'), + align = 'top-left', + elements = elements + }, function(data, menu) + menu.close() + + ESX.TriggerServerCallback('esx_policejob:addArmoryWeapon', function() + OpenPutWeaponMenu() + end, data.current.value, true) + end, function(data, menu) + menu.close() + end) +end + +function OpenBuyWeaponsMenu() + local elements = {} + local playerPed = PlayerPedId() + + for k,v in ipairs(Config.AuthorizedWeapons[ESX.PlayerData.job.grade_name]) do + local weaponNum, weapon = ESX.GetWeapon(v.weapon) + local components, label = {} + local hasWeapon = HasPedGotWeapon(playerPed, GetHashKey(v.weapon), false) + + if v.components then + for i=1, #v.components do + if v.components[i] then + local component = weapon.components[i] + local hasComponent = HasPedGotWeaponComponent(playerPed, GetHashKey(v.weapon), component.hash) + + if hasComponent then + label = ('%s: %s'):format(component.label, _U('armory_owned')) + else + if v.components[i] > 0 then + label = ('%s: %s'):format(component.label, _U('armory_item', ESX.Math.GroupDigits(v.components[i]))) + else + label = ('%s: %s'):format(component.label, _U('armory_free')) + end + end + + table.insert(components, { + label = label, + componentLabel = component.label, + hash = component.hash, + name = component.name, + price = v.components[i], + hasComponent = hasComponent, + componentNum = i + }) + end + end + end + + if hasWeapon and v.components then + label = ('%s: >'):format(weapon.label) + elseif hasWeapon and not v.components then + label = ('%s: %s'):format(weapon.label, _U('armory_owned')) + else + if v.price > 0 then + label = ('%s: %s'):format(weapon.label, _U('armory_item', ESX.Math.GroupDigits(v.price))) + else + label = ('%s: %s'):format(weapon.label, _U('armory_free')) + end + end + + table.insert(elements, { + label = label, + weaponLabel = weapon.label, + name = weapon.name, + components = components, + price = v.price, + hasWeapon = hasWeapon + }) + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'armory_buy_weapons', { + title = _U('armory_weapontitle'), + align = 'top-left', + elements = elements + }, function(data, menu) + if data.current.hasWeapon then + if #data.current.components > 0 then + OpenWeaponComponentShop(data.current.components, data.current.name, menu) + end + else + ESX.TriggerServerCallback('esx_policejob:buyWeapon', function(bought) + if bought then + if data.current.price > 0 then + ESX.ShowNotification(_U('armory_bought', data.current.weaponLabel, ESX.Math.GroupDigits(data.current.price))) + end + + menu.close() + OpenBuyWeaponsMenu() + else + ESX.ShowNotification(_U('armory_money')) + end + end, data.current.name, 1) + end + end, function(data, menu) + menu.close() + end) +end + +function OpenWeaponComponentShop(components, weaponName, parentShop) + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'armory_buy_weapons_components', { + title = _U('armory_componenttitle'), + align = 'top-left', + elements = components + }, function(data, menu) + if data.current.hasComponent then + ESX.ShowNotification(_U('armory_hascomponent')) + else + ESX.TriggerServerCallback('esx_policejob:buyWeapon', function(bought) + if bought then + if data.current.price > 0 then + ESX.ShowNotification(_U('armory_bought', data.current.componentLabel, ESX.Math.GroupDigits(data.current.price))) + end + + menu.close() + parentShop.close() + OpenBuyWeaponsMenu() + else + ESX.ShowNotification(_U('armory_money')) + end + end, weaponName, 2, data.current.componentNum) + end + end, function(data, menu) + menu.close() + end) +end + +function OpenGetStocksMenu() + ESX.TriggerServerCallback('esx_policejob:getStockItems', function(items) + local elements = {} + + for i=1, #items, 1 do + table.insert(elements, { + label = 'x' .. items[i].count .. ' ' .. items[i].label, + value = items[i].name + }) + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'stocks_menu', { + title = _U('police_stock'), + align = 'top-left', + elements = elements + }, function(data, menu) + local itemName = data.current.value + + ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'stocks_menu_get_item_count', { + title = _U('quantity') + }, function(data2, menu2) + local count = tonumber(data2.value) + + if not count then + ESX.ShowNotification(_U('quantity_invalid')) + else + menu2.close() + menu.close() + TriggerServerEvent('esx_policejob:getStockItem', itemName, count) + + Citizen.Wait(300) + OpenGetStocksMenu() + end + end, function(data2, menu2) + menu2.close() + end) + end, function(data, menu) + menu.close() + end) + end) +end + +function OpenPutStocksMenu() + ESX.TriggerServerCallback('esx_policejob:getPlayerInventory', function(inventory) + local elements = {} + + for i=1, #inventory.items, 1 do + local item = inventory.items[i] + + if item.count > 0 then + table.insert(elements, { + label = item.label .. ' x' .. item.count, + type = 'item_standard', + value = item.name + }) + end + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'stocks_menu', { + title = _U('inventory'), + align = 'top-left', + elements = elements + }, function(data, menu) + local itemName = data.current.value + + ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'stocks_menu_put_item_count', { + title = _U('quantity') + }, function(data2, menu2) + local count = tonumber(data2.value) + + if not count then + ESX.ShowNotification(_U('quantity_invalid')) + else + menu2.close() + menu.close() + TriggerServerEvent('esx_policejob:putStockItems', itemName, count) + + Citizen.Wait(300) + OpenPutStocksMenu() + end + end, function(data2, menu2) + menu2.close() + end) + end, function(data, menu) + menu.close() + end) + end) +end + +RegisterNetEvent('esx:setJob') +AddEventHandler('esx:setJob', function(job) + ESX.PlayerData.job = job + + Citizen.Wait(5000) + TriggerServerEvent('esx_policejob:forceBlip') +end) + +RegisterNetEvent('esx_phone:loaded') +AddEventHandler('esx_phone:loaded', function(phoneNumber, contacts) + local specialContact = { + name = _U('phone_police'), + number = 'police', + base64Icon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NDFGQTJDRkI0QUJCMTFFN0JBNkQ5OENBMUI4QUEzM0YiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NDFGQTJDRkM0QUJCMTFFN0JBNkQ5OENBMUI4QUEzM0YiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0MUZBMkNGOTRBQkIxMUU3QkE2RDk4Q0ExQjhBQTMzRiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0MUZBMkNGQTRBQkIxMUU3QkE2RDk4Q0ExQjhBQTMzRiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PoW66EYAAAjGSURBVHjapJcLcFTVGcd/u3cfSXaTLEk2j80TCI8ECI9ABCyoiBqhBVQqVG2ppVKBQqUVgUl5OU7HKqNOHUHU0oHamZZWoGkVS6cWAR2JPJuAQBPy2ISEvLN57+v2u2E33e4k6Ngz85+9d++95/zP9/h/39GpqsqiRYsIGz8QZAq28/8PRfC+4HT4fMXFxeiH+GC54NeCbYLLATLpYe/ECx4VnBTsF0wWhM6lXY8VbBE0Ch4IzLcpfDFD2P1TgrdC7nMCZLRxQ9AkiAkQCn77DcH3BC2COoFRkCSIG2JzLwqiQi0RSmCD4JXbmNKh0+kc/X19tLtc9Ll9sk9ZS1yoU71YIk3xsbEx8QaDEc2ttxmaJSKC1ggSKBK8MKwTFQVXRzs3WzpJGjmZgvxcMpMtWIwqsjztvSrlzjYul56jp+46qSmJmMwR+P3+4aZ8TtCprRkk0DvUW7JjmV6lsqoKW/pU1q9YQOE4Nxkx4ladE7zd8ivuVmJQfXZKW5dx5EwPRw4fxNx2g5SUVLw+33AkzoRaQDP9SkFu6OKqz0uF8yaz7vsOL6ycQVLkcSg/BlWNsjuFoKE1knqDSl5aNnmPLmThrE0UvXqQqvJPyMrMGorEHwQfEha57/3P7mXS684GFjy8kreLppPUuBXfyd/ibeoS2kb0mWPANhJdYjb61AxUvx5PdT3+4y+Tb3mTd19ZSebE+VTXVGNQlHAC7w4VhH8TbA36vKq6ilnzlvPSunHw6Trc7XpZ14AyfgYeyz18crGN1Alz6e3qwNNQSv4dZox1h/BW9+O7eIaEsVv41Y4XeHJDG83Nl4mLTwzGhJYtx0PzNTjOB9KMTlc7Nkcem39YAGU7cbeBKVLMPGMVf296nMd2VbBq1wmizHoqqm/wrS1/Zf0+N19YN2PIu1fcIda4Vk66Zx/rVi+jo9eIX9wZGGcFXUMR6BHUa76/2ezioYcXMtpyAl91DSaTfDxlJbtLprHm2ecpObqPuTPzSNV9yKz4a4zJSuLo71/j8Q17ON69EmXiPIlNMe6FoyzOqWPW/MU03Lw5EFcyKghTrNDh7+/vw545mcJcWbTiGKpRdGPMXbx90sGmDaux6sXk+kimjU+BjnMkx3kYP34cXrFuZ+3nrHi6iDMt92JITcPjk3R3naRwZhpuNSqoD93DKaFVU7j2dhcF8+YzNlpErbIBTVh8toVccbaysPB+4pMcuPw25kwSsau7BIlmHpy3guaOPtISYyi/UkaJM5Lpc5agq5Xkcl6gIHkmqaMn0dtylcjIyPThCNyhaXyfR2W0I1our0v6qBii07ih5rDtGSOxNVdk1y4R2SR8jR/g7hQD9l1jUeY/WLJB5m39AlZN4GZyIQ1fFJNsEgt0duBIc5GRkcZF53mNwIzhXPDgQPoZIkiMkbTxtstDMVnmFA4cOsbz2/aKjSQjev4Mp9ZAg+hIpFhB3EH5Yal16+X+Kq3dGfxkzRY+KauBjBzREvGN0kNCTARu94AejBLMHorAQ7cEQMGs2cXvkWshYLDi6e9l728O8P1XW6hKeB2yv42q18tjj+iFTGoSi+X9jJM9RTxS9E+OHT0krhNiZqlbqraoT7RAU5bBGrEknEBhgJks7KXbLS8qERI0ErVqF/Y4K6NHZfLZB+/wzJvncacvFd91oXO3o/O40MfZKJOKu/rne+mRQByXM4lYreb1tUnkizVVA/0SpfpbWaCNBeEE5gb/UH19NLqEgDF+oNDQWcn41Cj0EXFEWqzkOIyYekslFkThsvMxpIyE2hIc6lXGZ6cPyK7Nnk5OipixRdxgUESAYmhq68VsGgy5CYKCUAJTg0+izApXne3CJFmUTwg4L3FProFxU+6krqmXu3MskkhSD2av41jLdzlnfFrSdCZxyqfMnppN6ZUa7pwt0h3fiK9DCt4IO9e7YqisvI7VYgmNv7mhBKKD/9psNi5dOMv5ZjukjsLdr0ffWsyTi6eSlfcA+dmiVyOXs+/sHNZu3M6PdxzgVO9GmDSHsSNqmTz/R6y6Xxqma4fwaS5Mn85n1ZE0Vl3CHBER3lUNEhiURpPJRFdTOcVnpUJnPIhR7cZXfoH5UYc5+E4RzRH3sfSnl9m2dSMjE+Tz9msse+o5dr7UwcQ5T3HwlWUkNuzG3dKFSTbsNs7m/Y8vExOlC29UWkMJlAxKoRQMR3IC7x85zOn6fHS50+U/2Untx2R1voinu5no+DQmz7yPXmMKZnsu0wrm0Oe3YhOVHdm8A09dBQYhTv4T7C+xUPrZh8Qn2MMr4qcDSRfoirWgKAvtgOpv1JI8Zi77X15G7L+fxeOUOiUFxZiULD5fSlNzNM62W+k1yq5gjajGX/ZHvOIyxd+Fkj+P092rWP/si0Qr7VisMaEWuCiYonXFwbAUTWWPYLV245NITnGkUXnpI9butLJn2y6iba+hlp7C09qBcvoN7FYL9mhxo1/y/LoEXK8Pv6qIC8WbBY/xr9YlPLf9dZT+OqKTUwfmDBm/GOw7ws4FWpuUP2gJEZvKqmocuXPZuWYJMzKuSsH+SNwh3bo0p6hao6HeEqwYEZ2M6aKWd3PwTCy7du/D0F1DsmzE6/WGLr5LsDF4LggnYBacCOboQLHQ3FFfR58SR+HCR1iQH8ukhA5s5o5AYZMwUqOp74nl8xvRHDlRTsnxYpJsUjtsceHt2C8Fm0MPJrphTkZvBc4It9RKLOFx91Pf0Igu0k7W2MmkOewS2QYJUJVWVz9VNbXUVVwkyuAmKTFJayrDo/4Jwe/CT0aGYTrWVYEeUfsgXssMRcpyenraQJa0VX9O3ZU+Ma1fax4xGxUsUVFkOUbcama1hf+7+LmA9juHWshwmwOE1iMmCFYEzg1jtIm1BaxW6wCGGoFdewPfvyE4ertTiv4rHC73B855dwp2a23bbd4tC1hvhOCbX7b4VyUQKhxrtSOaYKngasizvwi0RmOS4O1QZf2yYfiaR+73AvhTQEVf+rpn9/8IMAChKDrDzfsdIQAAAABJRU5ErkJggg==' + } + + TriggerEvent('esx_phone:addSpecialContact', specialContact.name, specialContact.number, specialContact.base64Icon) +end) + +-- don't show dispatches if the player isn't in service +AddEventHandler('esx_phone:cancelMessage', function(dispatchNumber) + if ESX.PlayerData.job and ESX.PlayerData.job.name == 'police' and ESX.PlayerData.job.name == dispatchNumber then + -- if esx_service is enabled + if Config.EnableESXService and not playerInService then + CancelEvent() + end + end +end) + +AddEventHandler('esx_policejob:hasEnteredMarker', function(station, part, partNum) + if part == 'Cloakroom' then + CurrentAction = 'menu_cloakroom' + CurrentActionMsg = _U('open_cloackroom') + CurrentActionData = {} + elseif part == 'Armory' then + CurrentAction = 'menu_armory' + CurrentActionMsg = _U('open_armory') + CurrentActionData = {station = station} + elseif part == 'Vehicles' then + CurrentAction = 'menu_vehicle_spawner' + CurrentActionMsg = _U('garage_prompt') + CurrentActionData = {station = station, part = part, partNum = partNum} + elseif part == 'Helicopters' then + CurrentAction = 'Helicopters' + CurrentActionMsg = _U('helicopter_prompt') + CurrentActionData = {station = station, part = part, partNum = partNum} + elseif part == 'BossActions' then + CurrentAction = 'menu_boss_actions' + CurrentActionMsg = _U('open_bossmenu') + CurrentActionData = {} + end +end) + +AddEventHandler('esx_policejob:hasExitedMarker', function(station, part, partNum) + if not isInShopMenu then + ESX.UI.Menu.CloseAll() + end + + CurrentAction = nil +end) + +AddEventHandler('esx_policejob:hasEnteredEntityZone', function(entity) + local playerPed = PlayerPedId() + + if ESX.PlayerData.job and ESX.PlayerData.job.name == 'police' and IsPedOnFoot(playerPed) then + CurrentAction = 'remove_entity' + CurrentActionMsg = _U('remove_prop') + CurrentActionData = {entity = entity} + end + + if GetEntityModel(entity) == GetHashKey('p_ld_stinger_s') then + local playerPed = PlayerPedId() + local coords = GetEntityCoords(playerPed) + + if IsPedInAnyVehicle(playerPed, false) then + local vehicle = GetVehiclePedIsIn(playerPed) + + for i=0, 7, 1 do + SetVehicleTyreBurst(vehicle, i, true, 1000) + end + end + end +end) + +AddEventHandler('esx_policejob:hasExitedEntityZone', function(entity) + if CurrentAction == 'remove_entity' then + CurrentAction = nil + end +end) + +RegisterNetEvent('esx_policejob:handcuff') +AddEventHandler('esx_policejob:handcuff', function() + isHandcuffed = not isHandcuffed + local playerPed = PlayerPedId() + + if isHandcuffed then + RequestAnimDict('mp_arresting') + while not HasAnimDictLoaded('mp_arresting') do + Citizen.Wait(100) + end + + TaskPlayAnim(playerPed, 'mp_arresting', 'idle', 8.0, -8, -1, 49, 0, 0, 0, 0) + + SetEnableHandcuffs(playerPed, true) + DisablePlayerFiring(playerPed, true) + SetCurrentPedWeapon(playerPed, GetHashKey('WEAPON_UNARMED'), true) -- unarm player + SetPedCanPlayGestureAnims(playerPed, false) + FreezeEntityPosition(playerPed, true) + DisplayRadar(false) + + if Config.EnableHandcuffTimer then + if handcuffTimer.active then + ESX.ClearTimeout(handcuffTimer.task) + end + + StartHandcuffTimer() + end + else + if Config.EnableHandcuffTimer and handcuffTimer.active then + ESX.ClearTimeout(handcuffTimer.task) + end + + ClearPedSecondaryTask(playerPed) + SetEnableHandcuffs(playerPed, false) + DisablePlayerFiring(playerPed, false) + SetPedCanPlayGestureAnims(playerPed, true) + FreezeEntityPosition(playerPed, false) + DisplayRadar(true) + end +end) + +RegisterNetEvent('esx_policejob:unrestrain') +AddEventHandler('esx_policejob:unrestrain', function() + if isHandcuffed then + local playerPed = PlayerPedId() + isHandcuffed = false + + ClearPedSecondaryTask(playerPed) + SetEnableHandcuffs(playerPed, false) + DisablePlayerFiring(playerPed, false) + SetPedCanPlayGestureAnims(playerPed, true) + FreezeEntityPosition(playerPed, false) + DisplayRadar(true) + + -- end timer + if Config.EnableHandcuffTimer and handcuffTimer.active then + ESX.ClearTimeout(handcuffTimer.task) + end + end +end) + +RegisterNetEvent('esx_policejob:drag') +AddEventHandler('esx_policejob:drag', function(copId) + if isHandcuffed then + dragStatus.isDragged = not dragStatus.isDragged + dragStatus.CopId = copId + end +end) + +Citizen.CreateThread(function() + local wasDragged + + while true do + Citizen.Wait(0) + local playerPed = PlayerPedId() + + if isHandcuffed and dragStatus.isDragged then + local targetPed = GetPlayerPed(GetPlayerFromServerId(dragStatus.CopId)) + + if DoesEntityExist(targetPed) and IsPedOnFoot(targetPed) and not IsPedDeadOrDying(targetPed, true) then + if not wasDragged then + AttachEntityToEntity(playerPed, targetPed, 11816, 0.54, 0.54, 0.0, 0.0, 0.0, 0.0, false, false, false, false, 2, true) + wasDragged = true + else + Citizen.Wait(1000) + end + else + wasDragged = false + dragStatus.isDragged = false + DetachEntity(playerPed, true, false) + end + elseif wasDragged then + wasDragged = false + DetachEntity(playerPed, true, false) + else + Citizen.Wait(500) + end + end +end) + +RegisterNetEvent('esx_policejob:putInVehicle') +AddEventHandler('esx_policejob:putInVehicle', function() + if isHandcuffed then + local playerPed = PlayerPedId() + local coords = GetEntityCoords(playerPed) + + if IsAnyVehicleNearPoint(coords, 5.0) then + local vehicle = GetClosestVehicle(coords, 5.0, 0, 71) + + if DoesEntityExist(vehicle) then + local maxSeats, freeSeat = GetVehicleMaxNumberOfPassengers(vehicle) + + for i=maxSeats - 1, 0, -1 do + if IsVehicleSeatFree(vehicle, i) then + freeSeat = i + break + end + end + + if freeSeat then + TaskWarpPedIntoVehicle(playerPed, vehicle, freeSeat) + dragStatus.isDragged = false + end + end + end + end +end) + +RegisterNetEvent('esx_policejob:OutVehicle') +AddEventHandler('esx_policejob:OutVehicle', function() + local playerPed = PlayerPedId() + + if IsPedSittingInAnyVehicle(playerPed) then + local vehicle = GetVehiclePedIsIn(playerPed, false) + TaskLeaveVehicle(playerPed, vehicle, 64) + end +end) + +-- Handcuff +Citizen.CreateThread(function() + while true do + Citizen.Wait(0) + local playerPed = PlayerPedId() + + if isHandcuffed then + DisableControlAction(0, 1, true) -- Disable pan + DisableControlAction(0, 2, true) -- Disable tilt + DisableControlAction(0, 24, true) -- Attack + DisableControlAction(0, 257, true) -- Attack 2 + DisableControlAction(0, 25, true) -- Aim + DisableControlAction(0, 263, true) -- Melee Attack 1 + DisableControlAction(0, 32, true) -- W + DisableControlAction(0, 34, true) -- A + DisableControlAction(0, 31, true) -- S + DisableControlAction(0, 30, true) -- D + + DisableControlAction(0, 45, true) -- Reload + DisableControlAction(0, 22, true) -- Jump + DisableControlAction(0, 44, true) -- Cover + DisableControlAction(0, 37, true) -- Select Weapon + DisableControlAction(0, 23, true) -- Also 'enter'? + + DisableControlAction(0, 288, true) -- Disable phone + DisableControlAction(0, 289, true) -- Inventory + DisableControlAction(0, 170, true) -- Animations + DisableControlAction(0, 167, true) -- Job + + DisableControlAction(0, 0, true) -- Disable changing view + DisableControlAction(0, 26, true) -- Disable looking behind + DisableControlAction(0, 73, true) -- Disable clearing animation + DisableControlAction(2, 199, true) -- Disable pause screen + + DisableControlAction(0, 59, true) -- Disable steering in vehicle + DisableControlAction(0, 71, true) -- Disable driving forward in vehicle + DisableControlAction(0, 72, true) -- Disable reversing in vehicle + + DisableControlAction(2, 36, true) -- Disable going stealth + + DisableControlAction(0, 47, true) -- Disable weapon + DisableControlAction(0, 264, true) -- Disable melee + DisableControlAction(0, 257, true) -- Disable melee + DisableControlAction(0, 140, true) -- Disable melee + DisableControlAction(0, 141, true) -- Disable melee + DisableControlAction(0, 142, true) -- Disable melee + DisableControlAction(0, 143, true) -- Disable melee + DisableControlAction(0, 75, true) -- Disable exit vehicle + DisableControlAction(27, 75, true) -- Disable exit vehicle + + if IsEntityPlayingAnim(playerPed, 'mp_arresting', 'idle', 3) ~= 1 then + ESX.Streaming.RequestAnimDict('mp_arresting', function() + TaskPlayAnim(playerPed, 'mp_arresting', 'idle', 8.0, -8, -1, 49, 0.0, false, false, false) + end) + end + else + Citizen.Wait(500) + end + end +end) + +-- Create blips +Citizen.CreateThread(function() + for k,v in pairs(Config.PoliceStations) do + local blip = AddBlipForCoord(v.Blip.Coords) + + SetBlipSprite (blip, v.Blip.Sprite) + SetBlipDisplay(blip, v.Blip.Display) + SetBlipScale (blip, v.Blip.Scale) + SetBlipColour (blip, v.Blip.Colour) + SetBlipAsShortRange(blip, true) + + BeginTextCommandSetBlipName('STRING') + AddTextComponentSubstringPlayerName(_U('map_blip')) + EndTextCommandSetBlipName(blip) + end +end) + +-- Draw markers and more +Citizen.CreateThread(function() + while true do + Citizen.Wait(0) + + if ESX.PlayerData.job and ESX.PlayerData.job.name == 'police' then + local playerPed = PlayerPedId() + local playerCoords = GetEntityCoords(playerPed) + local isInMarker, hasExited, letSleep = false, false, true + local currentStation, currentPart, currentPartNum + + for k,v in pairs(Config.PoliceStations) do + for i=1, #v.Cloakrooms, 1 do + local distance = #(playerCoords - v.Cloakrooms[i]) + + if distance < Config.DrawDistance then + DrawMarker(Config.MarkerType.Cloakrooms, v.Cloakrooms[i], 0.0, 0.0, 0.0, 0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) + letSleep = false + + if distance < Config.MarkerSize.x then + isInMarker, currentStation, currentPart, currentPartNum = true, k, 'Cloakroom', i + end + end + end + + for i=1, #v.Armories, 1 do + local distance = #(playerCoords - v.Armories[i]) + + if distance < Config.DrawDistance then + DrawMarker(Config.MarkerType.Armories, v.Armories[i], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.5, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) + letSleep = false + + if distance < Config.MarkerSize.x then + isInMarker, currentStation, currentPart, currentPartNum = true, k, 'Armory', i + end + end + end + + for i=1, #v.Vehicles, 1 do + local distance = #(playerCoords - v.Vehicles[i].Spawner) + + if distance < Config.DrawDistance then + DrawMarker(Config.MarkerType.Vehicles, v.Vehicles[i].Spawner, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) + letSleep = false + + if distance < Config.MarkerSize.x then + isInMarker, currentStation, currentPart, currentPartNum = true, k, 'Vehicles', i + end + end + end + + for i=1, #v.Helicopters, 1 do + local distance = #(playerCoords - v.Helicopters[i].Spawner) + + if distance < Config.DrawDistance then + DrawMarker(Config.MarkerType.Helicopters, v.Helicopters[i].Spawner, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) + letSleep = false + + if distance < Config.MarkerSize.x then + isInMarker, currentStation, currentPart, currentPartNum = true, k, 'Helicopters', i + end + end + end + + if Config.EnablePlayerManagement and ESX.PlayerData.job.grade_name == 'boss' then + for i=1, #v.BossActions, 1 do + local distance = #(playerCoords - v.BossActions[i]) + + if distance < Config.DrawDistance then + DrawMarker(Config.MarkerType.BossActions, v.BossActions[i], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) + letSleep = false + + if distance < Config.MarkerSize.x then + isInMarker, currentStation, currentPart, currentPartNum = true, k, 'BossActions', i + end + end + end + end + end + + if isInMarker and not HasAlreadyEnteredMarker or (isInMarker and (LastStation ~= currentStation or LastPart ~= currentPart or LastPartNum ~= currentPartNum)) then + if + (LastStation and LastPart and LastPartNum) and + (LastStation ~= currentStation or LastPart ~= currentPart or LastPartNum ~= currentPartNum) + then + TriggerEvent('esx_policejob:hasExitedMarker', LastStation, LastPart, LastPartNum) + hasExited = true + end + + HasAlreadyEnteredMarker = true + LastStation = currentStation + LastPart = currentPart + LastPartNum = currentPartNum + + TriggerEvent('esx_policejob:hasEnteredMarker', currentStation, currentPart, currentPartNum) + end + + if not hasExited and not isInMarker and HasAlreadyEnteredMarker then + HasAlreadyEnteredMarker = false + TriggerEvent('esx_policejob:hasExitedMarker', LastStation, LastPart, LastPartNum) + end + + if letSleep then + Citizen.Wait(500) + end + else + Citizen.Wait(500) + end + end +end) + +-- Enter / Exit entity zone events +Citizen.CreateThread(function() + local trackedEntities = { + 'prop_roadcone02a', + 'prop_barrier_work05', + 'p_ld_stinger_s', + 'prop_boxpile_07d', + 'hei_prop_cash_crate_half_full' + } + + while true do + Citizen.Wait(500) + + local playerPed = PlayerPedId() + local playerCoords = GetEntityCoords(playerPed) + + local closestDistance = -1 + local closestEntity = nil + + for i=1, #trackedEntities, 1 do + local object = GetClosestObjectOfType(playerCoords, 3.0, GetHashKey(trackedEntities[i]), false, false, false) + + if DoesEntityExist(object) then + local objCoords = GetEntityCoords(object) + local distance = #(playerCoords - objCoords) + + if closestDistance == -1 or closestDistance > distance then + closestDistance = distance + closestEntity = object + end + end + end + + if closestDistance ~= -1 and closestDistance <= 3.0 then + if LastEntity ~= closestEntity then + TriggerEvent('esx_policejob:hasEnteredEntityZone', closestEntity) + LastEntity = closestEntity + end + else + if LastEntity then + TriggerEvent('esx_policejob:hasExitedEntityZone', LastEntity) + LastEntity = nil + end + end + end +end) + +-- Key Controls +Citizen.CreateThread(function() + while true do + Citizen.Wait(0) + + if CurrentAction then + ESX.ShowHelpNotification(CurrentActionMsg) + + if IsControlJustReleased(0, 38) and ESX.PlayerData.job and ESX.PlayerData.job.name == 'police' then + + if CurrentAction == 'menu_cloakroom' then + OpenCloakroomMenu() + elseif CurrentAction == 'menu_armory' then + if not Config.EnableESXService then + OpenArmoryMenu(CurrentActionData.station) + elseif playerInService then + OpenArmoryMenu(CurrentActionData.station) + else + ESX.ShowNotification(_U('service_not')) + end + elseif CurrentAction == 'menu_vehicle_spawner' then + if not Config.EnableESXService then + OpenVehicleSpawnerMenu('car', CurrentActionData.station, CurrentActionData.part, CurrentActionData.partNum) + elseif playerInService then + OpenVehicleSpawnerMenu('car', CurrentActionData.station, CurrentActionData.part, CurrentActionData.partNum) + else + ESX.ShowNotification(_U('service_not')) + end + elseif CurrentAction == 'Helicopters' then + if not Config.EnableESXService then + OpenVehicleSpawnerMenu('helicopter', CurrentActionData.station, CurrentActionData.part, CurrentActionData.partNum) + elseif playerInService then + OpenVehicleSpawnerMenu('helicopter', CurrentActionData.station, CurrentActionData.part, CurrentActionData.partNum) + else + ESX.ShowNotification(_U('service_not')) + end + elseif CurrentAction == 'delete_vehicle' then + ESX.Game.DeleteVehicle(CurrentActionData.vehicle) + elseif CurrentAction == 'menu_boss_actions' then + ESX.UI.Menu.CloseAll() + TriggerEvent('esx_society:openBossMenu', 'police', function(data, menu) + menu.close() + + CurrentAction = 'menu_boss_actions' + CurrentActionMsg = _U('open_bossmenu') + CurrentActionData = {} + end, { wash = false }) -- disable washing money + elseif CurrentAction == 'remove_entity' then + DeleteEntity(CurrentActionData.entity) + end + + CurrentAction = nil + end + end -- CurrentAction end + + if IsControlJustReleased(0, 167) and not isDead and ESX.PlayerData.job and ESX.PlayerData.job.name == 'police' and not ESX.UI.Menu.IsOpen('default', GetCurrentResourceName(), 'police_actions') then + if not Config.EnableESXService then + OpenPoliceActionsMenu() + elseif playerInService then + OpenPoliceActionsMenu() + else + ESX.ShowNotification(_U('service_not')) + end + end + + if IsControlJustReleased(0, 38) and currentTask.busy then + ESX.ShowNotification(_U('impound_canceled')) + ESX.ClearTimeout(currentTask.task) + ClearPedTasks(PlayerPedId()) + + currentTask.busy = false + end + end +end) + +-- Create blip for colleagues +function createBlip(id) + local ped = GetPlayerPed(id) + local blip = GetBlipFromEntity(ped) + + if not DoesBlipExist(blip) then -- Add blip and create head display on player + blip = AddBlipForEntity(ped) + SetBlipSprite(blip, 1) + ShowHeadingIndicatorOnBlip(blip, true) -- Player Blip indicator + SetBlipRotation(blip, math.ceil(GetEntityHeading(ped))) -- update rotation + SetBlipNameToPlayerName(blip, id) -- update blip name + SetBlipScale(blip, 0.85) -- set scale + SetBlipAsShortRange(blip, true) + + table.insert(blipsCops, blip) -- add blip to array so we can remove it later + end +end + +RegisterNetEvent('esx_policejob:updateBlip') +AddEventHandler('esx_policejob:updateBlip', function() + + -- Refresh all blips + for k, existingBlip in pairs(blipsCops) do + RemoveBlip(existingBlip) + end + + -- Clean the blip table + blipsCops = {} + + -- Enable blip? + if Config.EnableESXService and not playerInService then + return + end + + if not Config.EnableJobBlip then + return + end + + -- Is the player a cop? In that case show all the blips for other cops + if ESX.PlayerData.job and ESX.PlayerData.job.name == 'police' then + ESX.TriggerServerCallback('esx_society:getOnlinePlayers', function(players) + for i=1, #players, 1 do + if players[i].job.name == 'police' then + local id = GetPlayerFromServerId(players[i].source) + if NetworkIsPlayerActive(id) and GetPlayerPed(id) ~= PlayerPedId() then + createBlip(id) + end + end + end + end) + end + +end) + +AddEventHandler('playerSpawned', function(spawn) + isDead = false + TriggerEvent('esx_policejob:unrestrain') + + if not hasAlreadyJoined then + TriggerServerEvent('esx_policejob:spawned') + end + hasAlreadyJoined = true +end) + +AddEventHandler('esx:onPlayerDeath', function(data) + isDead = true +end) + +AddEventHandler('onResourceStop', function(resource) + if resource == GetCurrentResourceName() then + TriggerEvent('esx_policejob:unrestrain') + TriggerEvent('esx_phone:removeSpecialContact', 'police') + + if Config.EnableESXService then + TriggerServerEvent('esx_service:disableService', 'police') + end + + if Config.EnableHandcuffTimer and handcuffTimer.active then + ESX.ClearTimeout(handcuffTimer.task) + end + end +end) + +-- handcuff timer, unrestrain the player after an certain amount of time +function StartHandcuffTimer() + if Config.EnableHandcuffTimer and handcuffTimer.active then + ESX.ClearTimeout(handcuffTimer.task) + end + + handcuffTimer.active = true + + handcuffTimer.task = ESX.SetTimeout(Config.HandcuffTimer, function() + ESX.ShowNotification(_U('unrestrained_timer')) + TriggerEvent('esx_policejob:unrestrain') + handcuffTimer.active = false + end) +end + +-- TODO +-- - return to garage if owned +-- - message owner that his vehicle has been impounded +function ImpoundVehicle(vehicle) + --local vehicleName = GetLabelText(GetDisplayNameFromVehicleModel(GetEntityModel(vehicle))) + ESX.Game.DeleteVehicle(vehicle) + ESX.ShowNotification(_U('impound_successful')) + currentTask.busy = false +end diff --git a/[esx_addons]/esx_policejob/client/vehicle.lua b/[esx_addons]/esx_policejob/client/vehicle.lua new file mode 100644 index 00000000..2a0d04b4 --- /dev/null +++ b/[esx_addons]/esx_policejob/client/vehicle.lua @@ -0,0 +1,326 @@ + +local spawnedVehicles = {} + +function OpenVehicleSpawnerMenu(type, station, part, partNum) + local playerCoords = GetEntityCoords(PlayerPedId()) + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle', { + title = _U('garage_title'), + align = 'top-left', + elements = { + {label = _U('garage_storeditem'), action = 'garage'}, + {label = _U('garage_storeitem'), action = 'store_garage'}, + {label = _U('garage_buyitem'), action = 'buy_vehicle'} + }}, function(data, menu) + if data.current.action == 'buy_vehicle' then + local shopElements = {} + local shopCoords = Config.PoliceStations[station][part][partNum].InsideShop + local authorizedVehicles = Config.AuthorizedVehicles[type][ESX.PlayerData.job.grade_name] + + if authorizedVehicles then + if #authorizedVehicles > 0 then + for k,vehicle in ipairs(authorizedVehicles) do + if IsModelInCdimage(vehicle.model) then + local vehicleLabel = GetLabelText(GetDisplayNameFromVehicleModel(vehicle.model)) + + table.insert(shopElements, { + label = ('%s - %s'):format(vehicleLabel, _U('shop_item', ESX.Math.GroupDigits(vehicle.price))), + name = vehicleLabel, + model = vehicle.model, + price = vehicle.price, + props = vehicle.props, + type = type + }) + end + end + + if #shopElements > 0 then + OpenShopMenu(shopElements, playerCoords, shopCoords) + else + ESX.ShowNotification(_U('garage_notauthorized')) + end + else + ESX.ShowNotification(_U('garage_notauthorized')) + end + else + ESX.ShowNotification(_U('garage_notauthorized')) + end + elseif data.current.action == 'garage' then + local garage = {} + + ESX.TriggerServerCallback('esx_vehicleshop:retrieveJobVehicles', function(jobVehicles) + if #jobVehicles > 0 then + local allVehicleProps = {} + + for k,v in ipairs(jobVehicles) do + local props = json.decode(v.vehicle) + + if IsModelInCdimage(props.model) then + local vehicleName = GetLabelText(GetDisplayNameFromVehicleModel(props.model)) + local label = ('%s - %s: '):format(vehicleName, props.plate) + + if v.stored then + label = label .. ('%s'):format(_U('garage_stored')) + else + label = label .. ('%s'):format(_U('garage_notstored')) + end + + table.insert(garage, { + label = label, + stored = v.stored, + model = props.model, + plate = props.plate + }) + + allVehicleProps[props.plate] = props + end + end + + if #garage > 0 then + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_garage', { + title = _U('garage_title'), + align = 'top-left', + elements = garage + }, function(data2, menu2) + if data2.current.stored then + local foundSpawn, spawnPoint = GetAvailableVehicleSpawnPoint(station, part, partNum) + + if foundSpawn then + menu2.close() + + ESX.Game.SpawnVehicle(data2.current.model, spawnPoint.coords, spawnPoint.heading, function(vehicle) + local vehicleProps = allVehicleProps[data2.current.plate] + ESX.Game.SetVehicleProperties(vehicle, vehicleProps) + + TriggerServerEvent('esx_vehicleshop:setJobVehicleState', data2.current.plate, false) + ESX.ShowNotification(_U('garage_released')) + end) + end + else + ESX.ShowNotification(_U('garage_notavailable')) + end + end, function(data2, menu2) + menu2.close() + end) + else + ESX.ShowNotification(_U('garage_empty')) + end + else + ESX.ShowNotification(_U('garage_empty')) + end + end, type) + elseif data.current.action == 'store_garage' then + StoreNearbyVehicle(playerCoords) + end + end, function(data, menu) + menu.close() + end) +end + +function StoreNearbyVehicle(playerCoords) + local vehicles, vehiclePlates = ESX.Game.GetVehiclesInArea(playerCoords, 30.0), {} + + if #vehicles > 0 then + for k,v in ipairs(vehicles) do + + -- Make sure the vehicle we're saving is empty, or else it wont be deleted + if GetVehicleNumberOfPassengers(v) == 0 and IsVehicleSeatFree(v, -1) then + table.insert(vehiclePlates, { + vehicle = v, + plate = ESX.Math.Trim(GetVehicleNumberPlateText(v)) + }) + end + end + else + ESX.ShowNotification(_U('garage_store_nearby')) + return + end + + ESX.TriggerServerCallback('esx_policejob:storeNearbyVehicle', function(storeSuccess, foundNum) + if storeSuccess then + local vehicleId = vehiclePlates[foundNum] + local attempts = 0 + ESX.Game.DeleteVehicle(vehicleId.vehicle) + IsBusy = true + + Citizen.CreateThread(function() + BeginTextCommandBusyspinnerOn('STRING') + AddTextComponentSubstringPlayerName(_U('garage_storing')) + EndTextCommandBusyspinnerOn(4) + + while IsBusy do + Citizen.Wait(100) + end + + BusyspinnerOff() + end) + + -- Workaround for vehicle not deleting when other players are near it. + while DoesEntityExist(vehicleId.vehicle) do + Citizen.Wait(500) + attempts = attempts + 1 + + -- Give up + if attempts > 30 then + break + end + + vehicles = ESX.Game.GetVehiclesInArea(playerCoords, 30.0) + if #vehicles > 0 then + for k,v in ipairs(vehicles) do + if ESX.Math.Trim(GetVehicleNumberPlateText(v)) == vehicleId.plate then + ESX.Game.DeleteVehicle(v) + break + end + end + end + end + + IsBusy = false + ESX.ShowNotification(_U('garage_has_stored')) + else + ESX.ShowNotification(_U('garage_has_notstored')) + end + end, vehiclePlates) +end + +function GetAvailableVehicleSpawnPoint(station, part, partNum) + local spawnPoints = Config.PoliceStations[station][part][partNum].SpawnPoints + local found, foundSpawnPoint = false, nil + + for i=1, #spawnPoints, 1 do + if ESX.Game.IsSpawnPointClear(spawnPoints[i].coords, spawnPoints[i].radius) then + found, foundSpawnPoint = true, spawnPoints[i] + break + end + end + + if found then + return true, foundSpawnPoint + else + ESX.ShowNotification(_U('vehicle_blocked')) + return false + end +end + +function OpenShopMenu(elements, restoreCoords, shopCoords) + local playerPed = PlayerPedId() + isInShopMenu = true + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_shop', { + title = _U('vehicleshop_title'), + align = 'top-left', + elements = elements + }, function(data, menu) + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_shop_confirm', { + title = _U('vehicleshop_confirm', data.current.name, data.current.price), + align = 'top-left', + elements = { + {label = _U('confirm_no'), value = 'no'}, + {label = _U('confirm_yes'), value = 'yes'} + }}, function(data2, menu2) + if data2.current.value == 'yes' then + local newPlate = exports['esx_vehicleshop']:GeneratePlate() + local vehicle = GetVehiclePedIsIn(playerPed, false) + local props = ESX.Game.GetVehicleProperties(vehicle) + props.plate = newPlate + + ESX.TriggerServerCallback('esx_policejob:buyJobVehicle', function (bought) + if bought then + ESX.ShowNotification(_U('vehicleshop_bought', data.current.name, ESX.Math.GroupDigits(data.current.price))) + + isInShopMenu = false + ESX.UI.Menu.CloseAll() + DeleteSpawnedVehicles() + FreezeEntityPosition(playerPed, false) + SetEntityVisible(playerPed, true) + + ESX.Game.Teleport(playerPed, restoreCoords) + else + ESX.ShowNotification(_U('vehicleshop_money')) + menu2.close() + end + end, props, data.current.type) + else + menu2.close() + end + end, function(data2, menu2) + menu2.close() + end) + end, function(data, menu) + isInShopMenu = false + ESX.UI.Menu.CloseAll() + + DeleteSpawnedVehicles() + FreezeEntityPosition(playerPed, false) + SetEntityVisible(playerPed, true) + + ESX.Game.Teleport(playerPed, restoreCoords) + end, function(data, menu) + DeleteSpawnedVehicles() + WaitForVehicleToLoad(data.current.model) + + ESX.Game.SpawnLocalVehicle(data.current.model, shopCoords, 0.0, function(vehicle) + table.insert(spawnedVehicles, vehicle) + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + FreezeEntityPosition(vehicle, true) + SetModelAsNoLongerNeeded(data.current.model) + + if data.current.props then + ESX.Game.SetVehicleProperties(vehicle, data.current.props) + end + end) + end) + + WaitForVehicleToLoad(elements[1].model) + ESX.Game.SpawnLocalVehicle(elements[1].model, shopCoords, 0.0, function(vehicle) + table.insert(spawnedVehicles, vehicle) + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + FreezeEntityPosition(vehicle, true) + SetModelAsNoLongerNeeded(elements[1].model) + + if elements[1].props then + ESX.Game.SetVehicleProperties(vehicle, elements[1].props) + end + end) +end + +Citizen.CreateThread(function() + while true do + Citizen.Wait(0) + + if isInShopMenu then + DisableControlAction(0, 75, true) -- Disable exit vehicle + DisableControlAction(27, 75, true) -- Disable exit vehicle + else + Citizen.Wait(500) + end + end +end) + +function DeleteSpawnedVehicles() + while #spawnedVehicles > 0 do + local vehicle = spawnedVehicles[1] + ESX.Game.DeleteVehicle(vehicle) + table.remove(spawnedVehicles, 1) + end +end + +function WaitForVehicleToLoad(modelHash) + modelHash = (type(modelHash) == 'number' and modelHash or GetHashKey(modelHash)) + + if not HasModelLoaded(modelHash) then + RequestModel(modelHash) + + BeginTextCommandBusyspinnerOn('STRING') + AddTextComponentSubstringPlayerName(_U('vehicleshop_awaiting_model')) + EndTextCommandBusyspinnerOn(4) + + while not HasModelLoaded(modelHash) do + Citizen.Wait(0) + DisableAllControlActions(0) + end + + BusyspinnerOff() + end +end diff --git a/[esx_addons]/esx_policejob/config.lua b/[esx_addons]/esx_policejob/config.lua new file mode 100644 index 00000000..7717309c --- /dev/null +++ b/[esx_addons]/esx_policejob/config.lua @@ -0,0 +1,329 @@ +Config = {} + +Config.DrawDistance = 10.0 -- How close do you need to be for the markers to be drawn (in GTA units). +Config.MarkerType = {Cloakrooms = 20, Armories = 21, BossActions = 22, Vehicles = 36, Helicopters = 34} +Config.MarkerSize = {x = 1.5, y = 1.5, z = 0.5} +Config.MarkerColor = {r = 50, g = 50, b = 204} + +Config.EnablePlayerManagement = false -- Enable if you want society managing. +Config.EnableArmoryManagement = false +Config.EnableESXIdentity = false -- Enable if you're using esx_identity. +Config.EnableLicenses = false -- Enable if you're using esx_license. + +Config.EnableHandcuffTimer = true -- Enable handcuff timer? will unrestrain player after the time ends. +Config.HandcuffTimer = 10 * 60000 -- 10 minutes. + +Config.EnableJobBlip = false -- Enable blips for cops on duty, requires esx_society. +Config.EnableCustomPeds = false -- Enable custom peds in cloak room? See Config.CustomPeds below to customize peds. + +Config.EnableESXService = false -- Enable esx service? +Config.MaxInService = -1 -- How much people can be in service at once? + +Config.Locale = 'en' + +Config.PoliceStations = { + + LSPD = { + + Blip = { + Coords = vector3(425.1, -979.5, 30.7), + Sprite = 60, + Display = 4, + Scale = 1.2, + Colour = 29 + }, + + Cloakrooms = { + vector3(452.6, -992.8, 30.6) + }, + + Armories = { + vector3(451.7, -980.1, 30.6) + }, + + Vehicles = { + { + Spawner = vector3(454.6, -1017.4, 28.4), + InsideShop = vector3(228.5, -993.5, -99.5), + SpawnPoints = { + {coords = vector3(438.4, -1018.3, 27.7), heading = 90.0, radius = 6.0}, + {coords = vector3(441.0, -1024.2, 28.3), heading = 90.0, radius = 6.0}, + {coords = vector3(453.5, -1022.2, 28.0), heading = 90.0, radius = 6.0}, + {coords = vector3(450.9, -1016.5, 28.1), heading = 90.0, radius = 6.0} + } + }, + + { + Spawner = vector3(473.3, -1018.8, 28.0), + InsideShop = vector3(228.5, -993.5, -99.0), + SpawnPoints = { + {coords = vector3(475.9, -1021.6, 28.0), heading = 276.1, radius = 6.0}, + {coords = vector3(484.1, -1023.1, 27.5), heading = 302.5, radius = 6.0} + } + } + }, + + Helicopters = { + { + Spawner = vector3(461.1, -981.5, 43.6), + InsideShop = vector3(477.0, -1106.4, 43.0), + SpawnPoints = { + {coords = vector3(449.5, -981.2, 43.6), heading = 92.6, radius = 10.0} + } + } + }, + + BossActions = { + vector3(448.4, -973.2, 30.6) + } + + } + +} + +Config.AuthorizedWeapons = { + recruit = { + {weapon = 'WEAPON_APPISTOL', components = {0, 0, 1000, 4000, nil}, price = 10000}, + {weapon = 'WEAPON_NIGHTSTICK', price = 0}, + {weapon = 'WEAPON_STUNGUN', price = 1500}, + {weapon = 'WEAPON_FLASHLIGHT', price = 80} + }, + + officer = { + {weapon = 'WEAPON_APPISTOL', components = {0, 0, 1000, 4000, nil}, price = 10000}, + {weapon = 'WEAPON_ADVANCEDRIFLE', components = {0, 6000, 1000, 4000, 8000, nil}, price = 50000}, + {weapon = 'WEAPON_NIGHTSTICK', price = 0}, + {weapon = 'WEAPON_STUNGUN', price = 500}, + {weapon = 'WEAPON_FLASHLIGHT', price = 0} + }, + + sergeant = { + {weapon = 'WEAPON_APPISTOL', components = {0, 0, 1000, 4000, nil}, price = 10000}, + {weapon = 'WEAPON_ADVANCEDRIFLE', components = {0, 6000, 1000, 4000, 8000, nil}, price = 50000}, + {weapon = 'WEAPON_PUMPSHOTGUN', components = {2000, 6000, nil}, price = 70000}, + {weapon = 'WEAPON_NIGHTSTICK', price = 0}, + {weapon = 'WEAPON_STUNGUN', price = 500}, + {weapon = 'WEAPON_FLASHLIGHT', price = 0} + }, + + lieutenant = { + {weapon = 'WEAPON_APPISTOL', components = {0, 0, 1000, 4000, nil}, price = 10000}, + {weapon = 'WEAPON_ADVANCEDRIFLE', components = {0, 6000, 1000, 4000, 8000, nil}, price = 50000}, + {weapon = 'WEAPON_PUMPSHOTGUN', components = {2000, 6000, nil}, price = 70000}, + {weapon = 'WEAPON_NIGHTSTICK', price = 0}, + {weapon = 'WEAPON_STUNGUN', price = 500}, + {weapon = 'WEAPON_FLASHLIGHT', price = 0} + }, + + boss = { + {weapon = 'WEAPON_APPISTOL', components = {0, 0, 1000, 4000, nil}, price = 10000}, + {weapon = 'WEAPON_ADVANCEDRIFLE', components = {0, 6000, 1000, 4000, 8000, nil}, price = 50000}, + {weapon = 'WEAPON_PUMPSHOTGUN', components = {2000, 6000, nil}, price = 70000}, + {weapon = 'WEAPON_NIGHTSTICK', price = 0}, + {weapon = 'WEAPON_STUNGUN', price = 500}, + {weapon = 'WEAPON_FLASHLIGHT', price = 0} + } +} + +Config.AuthorizedVehicles = { + car = { + recruit = {}, + + officer = { + {model = 'police3', price = 20000} + }, + + sergeant = { + {model = 'policet', price = 18500}, + {model = 'policeb', price = 30500} + }, + + lieutenant = { + {model = 'riot', price = 70000}, + {model = 'fbi2', price = 60000} + }, + + boss = {} + }, + + helicopter = { + recruit = {}, + + officer = {}, + + sergeant = {}, + + lieutenant = { + {model = 'polmav', props = {modLivery = 0}, price = 200000} + }, + + boss = { + {model = 'polmav', props = {modLivery = 0}, price = 100000} + } + } +} + +Config.CustomPeds = { + shared = { + {label = 'Sheriff Ped', maleModel = 's_m_y_sheriff_01', femaleModel = 's_f_y_sheriff_01'}, + {label = 'Police Ped', maleModel = 's_m_y_cop_01', femaleModel = 's_f_y_cop_01'} + }, + + recruit = {}, + + officer = {}, + + sergeant = {}, + + lieutenant = {}, + + boss = { + {label = 'SWAT Ped', maleModel = 's_m_y_swat_01', femaleModel = 's_m_y_swat_01'} + } +} + +-- CHECK SKINCHANGER CLIENT MAIN.LUA for matching elements +Config.Uniforms = { + recruit = { + male = { + tshirt_1 = 59, tshirt_2 = 1, + torso_1 = 55, torso_2 = 0, + decals_1 = 0, decals_2 = 0, + arms = 41, + pants_1 = 25, pants_2 = 0, + shoes_1 = 25, shoes_2 = 0, + helmet_1 = 46, helmet_2 = 0, + chain_1 = 0, chain_2 = 0, + ears_1 = 2, ears_2 = 0 + }, + female = { + tshirt_1 = 36, tshirt_2 = 1, + torso_1 = 48, torso_2 = 0, + decals_1 = 0, decals_2 = 0, + arms = 44, + pants_1 = 34, pants_2 = 0, + shoes_1 = 27, shoes_2 = 0, + helmet_1 = 45, helmet_2 = 0, + chain_1 = 0, chain_2 = 0, + ears_1 = 2, ears_2 = 0 + } + }, + + officer = { + male = { + tshirt_1 = 58, tshirt_2 = 0, + torso_1 = 55, torso_2 = 0, + decals_1 = 0, decals_2 = 0, + arms = 41, + pants_1 = 25, pants_2 = 0, + shoes_1 = 25, shoes_2 = 0, + helmet_1 = -1, helmet_2 = 0, + chain_1 = 0, chain_2 = 0, + ears_1 = 2, ears_2 = 0 + }, + female = { + tshirt_1 = 35, tshirt_2 = 0, + torso_1 = 48, torso_2 = 0, + decals_1 = 0, decals_2 = 0, + arms = 44, + pants_1 = 34, pants_2 = 0, + shoes_1 = 27, shoes_2 = 0, + helmet_1 = -1, helmet_2 = 0, + chain_1 = 0, chain_2 = 0, + ears_1 = 2, ears_2 = 0 + } + }, + + sergeant = { + male = { + tshirt_1 = 58, tshirt_2 = 0, + torso_1 = 55, torso_2 = 0, + decals_1 = 8, decals_2 = 1, + arms = 41, + pants_1 = 25, pants_2 = 0, + shoes_1 = 25, shoes_2 = 0, + helmet_1 = -1, helmet_2 = 0, + chain_1 = 0, chain_2 = 0, + ears_1 = 2, ears_2 = 0 + }, + female = { + tshirt_1 = 35, tshirt_2 = 0, + torso_1 = 48, torso_2 = 0, + decals_1 = 7, decals_2 = 1, + arms = 44, + pants_1 = 34, pants_2 = 0, + shoes_1 = 27, shoes_2 = 0, + helmet_1 = -1, helmet_2 = 0, + chain_1 = 0, chain_2 = 0, + ears_1 = 2, ears_2 = 0 + } + }, + + lieutenant = { + male = { + tshirt_1 = 58, tshirt_2 = 0, + torso_1 = 55, torso_2 = 0, + decals_1 = 8, decals_2 = 2, + arms = 41, + pants_1 = 25, pants_2 = 0, + shoes_1 = 25, shoes_2 = 0, + helmet_1 = -1, helmet_2 = 0, + chain_1 = 0, chain_2 = 0, + ears_1 = 2, ears_2 = 0 + }, + female = { + tshirt_1 = 35, tshirt_2 = 0, + torso_1 = 48, torso_2 = 0, + decals_1 = 7, decals_2 = 2, + arms = 44, + pants_1 = 34, pants_2 = 0, + shoes_1 = 27, shoes_2 = 0, + helmet_1 = -1, helmet_2 = 0, + chain_1 = 0, chain_2 = 0, + ears_1 = 2, ears_2 = 0 + } + }, + + boss = { + male = { + tshirt_1 = 58, tshirt_2 = 0, + torso_1 = 55, torso_2 = 0, + decals_1 = 8, decals_2 = 3, + arms = 41, + pants_1 = 25, pants_2 = 0, + shoes_1 = 25, shoes_2 = 0, + helmet_1 = -1, helmet_2 = 0, + chain_1 = 0, chain_2 = 0, + ears_1 = 2, ears_2 = 0 + }, + female = { + tshirt_1 = 35, tshirt_2 = 0, + torso_1 = 48, torso_2 = 0, + decals_1 = 7, decals_2 = 3, + arms = 44, + pants_1 = 34, pants_2 = 0, + shoes_1 = 27, shoes_2 = 0, + helmet_1 = -1, helmet_2 = 0, + chain_1 = 0, chain_2 = 0, + ears_1 = 2, ears_2 = 0 + } + }, + + bullet_wear = { + male = { + bproof_1 = 11, bproof_2 = 1 + }, + female = { + bproof_1 = 13, bproof_2 = 1 + } + }, + + gilet_wear = { + male = { + tshirt_1 = 59, tshirt_2 = 1 + }, + female = { + tshirt_1 = 36, tshirt_2 = 1 + } + } +} diff --git a/[esx_addons]/esx_policejob/esx_policejob.sql b/[esx_addons]/esx_policejob/esx_policejob.sql new file mode 100644 index 00000000..9cbbbde7 --- /dev/null +++ b/[esx_addons]/esx_policejob/esx_policejob.sql @@ -0,0 +1,90 @@ +USE `es_extended`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_police', 'Police', 1) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_police', 'Police', 1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_police', 'Police', 1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('police', 'LSPD') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('police',0,'recruit','Recrue',20,'{}','{}'), + ('police',1,'officer','Officier',40,'{}','{}'), + ('police',2,'sergeant','Sergent',60,'{}','{}'), + ('police',3,'lieutenant','Lieutenant',85,'{}','{}'), + ('police',4,'boss','Commandant',100,'{}','{}') +; + +CREATE TABLE `fine_types` ( + `id` int NOT NULL AUTO_INCREMENT, + `label` varchar(255) DEFAULT NULL, + `amount` int DEFAULT NULL, + `category` int DEFAULT NULL, + + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +INSERT INTO `fine_types` (label, amount, category) VALUES + ('Usage abusif du klaxon',30,0), + ('Franchir une ligne continue',40,0), + ('Circulation à contresens',250,0), + ('Demi-tour non autorisé',250,0), + ('Circulation hors-route',170,0), + ('Non-respect des distances de sécurité',30,0), + ('Arrêt dangereux / interdit',150,0), + ('Stationnement gênant / interdit',70,0), + ('Non respect de la priorité à droite',70,0), + ('Non-respect à un véhicule prioritaire',90,0), + ('Non-respect d\'un stop',105,0), + ('Non-respect d\'un feu rouge',130,0), + ('Dépassement dangereux',100,0), + ('Véhicule non en état',100,0), + ('Conduite sans permis',1500,0), + ('Délit de fuite',800,0), + ('Excès de vitesse < 5 kmh',90,0), + ('Excès de vitesse 5-15 kmh',120,0), + ('Excès de vitesse 15-30 kmh',180,0), + ('Excès de vitesse > 30 kmh',300,0), + ('Entrave de la circulation',110,1), + ('Dégradation de la voie publique',90,1), + ('Trouble à l\'ordre publique',90,1), + ('Entrave opération de police',130,1), + ('Insulte envers / entre civils',75,1), + ('Outrage à agent de police',110,1), + ('Menace verbale ou intimidation envers civil',90,1), + ('Menace verbale ou intimidation envers policier',150,1), + ('Manifestation illégale',250,1), + ('Tentative de corruption',1500,1), + ('Arme blanche sortie en ville',120,2), + ('Arme léthale sortie en ville',300,2), + ('Port d\'arme non autorisé (défaut de license)',600,2), + ('Port d\'arme illégal',700,2), + ('Pris en flag lockpick',300,2), + ('Vol de voiture',1800,2), + ('Vente de drogue',1500,2), + ('Fabriquation de drogue',1500,2), + ('Possession de drogue',650,2), + ('Prise d\'ôtage civil',1500,2), + ('Prise d\'ôtage agent de l\'état',2000,2), + ('Braquage particulier',650,2), + ('Braquage magasin',650,2), + ('Braquage de banque',1500,2), + ('Tir sur civil',2000,3), + ('Tir sur agent de l\'état',2500,3), + ('Tentative de meurtre sur civil',3000,3), + ('Tentative de meurtre sur agent de l\'état',5000,3), + ('Meurtre sur civil',10000,3), + ('Meurte sur agent de l\'état',30000,3), + ('Meurtre involontaire',1800,3), + ('Escroquerie à l\'entreprise',2000,2) +; diff --git a/[esx_addons]/esx_policejob/fxmanifest.lua b/[esx_addons]/esx_policejob/fxmanifest.lua new file mode 100644 index 00000000..5f07436d --- /dev/null +++ b/[esx_addons]/esx_policejob/fxmanifest.lua @@ -0,0 +1,51 @@ +fx_version 'adamant' + +game 'gta5' + +description 'ESX Police Job' + +version '1.3.0' + +server_scripts { + '@mysql-async/lib/MySQL.lua', + '@es_extended/locale.lua', + 'locales/br.lua', + 'locales/de.lua', + 'locales/en.lua', + 'locales/pl.lua', + 'locales/fr.lua', + 'locales/fi.lua', + 'locales/es.lua', + 'locales/sv.lua', + 'locales/ko.lua', + 'locales/cs.lua', + 'locales/nl.lua', + 'locales/tr.lua', + 'config.lua', + 'server/main.lua' +} + +client_scripts { + '@es_extended/locale.lua', + 'locales/br.lua', + 'locales/de.lua', + 'locales/en.lua', + 'locales/pl.lua', + 'locales/fr.lua', + 'locales/fi.lua', + 'locales/es.lua', + 'locales/sv.lua', + 'locales/ko.lua', + 'locales/cs.lua', + 'locales/nl.lua', + 'locales/tr.lua', + 'config.lua', + 'client/main.lua', + 'client/vehicle.lua' +} + +dependencies { + 'es_extended', + 'esx_billing', + 'esx_vehicleshop' +} diff --git a/[esx_addons]/esx_policejob/locales/br.lua b/[esx_addons]/esx_policejob/locales/br.lua new file mode 100644 index 00000000..cadc743f --- /dev/null +++ b/[esx_addons]/esx_policejob/locales/br.lua @@ -0,0 +1,151 @@ +Locales['br'] = { + -- Cloackroom + ['cloakroom'] = 'Vestiário', + ['citizen_wear'] = 'Roupa casual', + ['police_wear'] = 'Uniforme da Polícia', + ['gilet_wear'] = 'orange reflective jacket', + ['bullet_wear'] = 'bulletproof vest', + ['no_outfit'] = 'there\'s no uniform that fits you!', + ['open_cloackroom'] = 'Pressione ~INPUT_CONTEXT~ para se trocar', + -- Armory + ['remove_object'] = 'take object', + ['deposit_object'] = 'deposit object', + ['get_weapon'] = 'Pegar arma', + ['put_weapon'] = 'Entregar arma', + ['buy_weapons'] = 'Comprar armas', + ['armory'] = 'Arsenal', + ['open_armory'] = 'Pressione ~INPUT_CONTEXT~ para acessar o arsenal', + ['armory_owned'] = 'owned', + ['armory_free'] = 'free', + ['armory_item'] = '$%s', + ['armory_weapontitle'] = 'armory - Buy weapon', + ['armory_componenttitle'] = 'armory - Weapon attatchments', + ['armory_bought'] = 'you bought an ~y~%s~s~ for ~g~$%s~s~', + ['armory_money'] = 'you cannot afford that weapon', + ['armory_hascomponent'] = 'you have that attatchment equiped!', + ['get_weapon_menu'] = 'armory - Withdraw Weapon', + ['put_weapon_menu'] = 'armory - Store Weapon', + -- Vehicles + ['vehicle_menu'] = 'vehicle', + ['vehicle_blocked'] = 'all available spawn points are currently blocked!', + ['garage_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Vehicle Actions~s~.', + ['garage_title'] = 'vehicle Actions', + ['garage_stored'] = 'stored', + ['garage_notstored'] = 'not in garage', + ['garage_storing'] = 'we\'re attempting to remove the vehicle, make sure no players are around it.', + ['garage_has_stored'] = 'the vehicle has been stored in your garage', + ['garage_has_notstored'] = 'no nearby owned vehicles were found', + ['garage_notavailable'] = 'your vehicle is not stored in the garage.', + ['garage_blocked'] = 'there\'s no available spawn points!', + ['garage_empty'] = 'you dont have any vehicles in your garage.', + ['garage_released'] = 'your vehicle has been released from the garage.', + ['garage_store_nearby'] = 'there is no nearby vehicles.', + ['garage_storeditem'] = 'open garage', + ['garage_storeitem'] = 'store vehicle in garage', + ['garage_buyitem'] = 'vehicle shop', + ['garage_notauthorized'] = 'you\'re not authorized to buy this kind of vehicles.', + ['helicopter_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Helicopter Actions~s~.', + ['shop_item'] = '$%s', + ['vehicleshop_title'] = 'vehicle Shop', + ['vehicleshop_confirm'] = 'do you want to buy this vehicle?', + ['vehicleshop_bought'] = 'you have bought ~y~%s~s~ for ~g~$%s~s~', + ['vehicleshop_money'] = 'you cannot afford that vehicle', + ['vehicleshop_awaiting_model'] = 'the vehicle is currently ~g~DOWNLOADING & LOADING~s~ please wait', + ['confirm_no'] = 'no', + ['confirm_yes'] = 'yes', + -- Service + ['service_max'] = 'you cannot enter service, max officers in service: %s/%s', + ['service_not'] = 'you have not entered service! You\'ll have to get changed first.', + ['service_anonunce'] = 'service information', + ['service_in'] = 'you\'ve entered service, welcome!', + ['service_in_announce'] = 'operator ~y~%s~s~ has entered service!', + ['service_out'] = 'you have left service.', + ['service_out_announce'] = 'operator ~y~%s~s~ has left their service.', + -- Action Menu + ['citizen_interaction'] = 'Interagir com o cidadão', + ['vehicle_interaction'] = 'Interagir com o veículo', + ['object_spawner'] = 'Interagir com as rodovias', + + ['id_card'] = 'Carteira de identidade', + ['search'] = 'Procurar', + ['handcuff'] = 'Algemar / Soltar', + ['drag'] = 'drag', + ['put_in_vehicle'] = 'Colocar no veículo', + ['out_the_vehicle'] = 'take out of vehicle', + ['fine'] = 'Multa', + ['unpaid_bills'] = 'manage unpaid bills', + ['license_check'] = 'manage license', + ['license_revoke'] = 'revoke license', + ['license_revoked'] = 'your ~b~%s~s~ has been ~y~revoked~s~!', + ['licence_you_revoked'] = 'you revoked a ~b~%s~s~ which belonged to ~y~%s~s~', + ['no_players_nearby'] = 'nenhum jogador nas proximidades', + ['being_searched'] = 'you are being ~y~searched~s~ by the ~b~Police~s~', + -- Vehicle interaction + ['vehicle_info'] = 'Informações', + ['pick_lock'] = 'Trancar veículo', + ['vehicle_unlocked'] = 'Veículo ~g~destravado~s~', + ['no_vehicles_nearby'] = 'Nenhum veículo nas proximidades', + ['impound'] = 'apreender carro', + ['impound_prompt'] = 'Pressione ~INPUT_CONTEXT~ para cancelar a ~y~apreender~s~', + ['impound_canceled'] = 'you canceled the impound', + ['impound_canceled_moved'] = 'o apreender foi cancelado porque o veículo mudou', + ['impound_successful'] = 'você apreendeu o veículo', + ['search_database'] = 'informação do veículo', + ['search_database_title'] = 'informações do veículo - pesquisa com número de registro', + ['search_database_error_invalid'] = 'que ~r~não~s~ é um número de registro ~y~válido~s~', + -- Traffic interaction + ['traffic_interaction'] = 'Interagir com as rodovias', + ['cone'] = 'Cones', + ['barrier'] = 'Barreira', + ['spikestrips'] = 'Fita de pregos', + ['box'] = 'Caixa', + ['cash'] = 'Caixa de dinheiro', + -- ID Card Menu + ['name'] = 'name: %s', + ['job'] = 'job: %s', + ['sex'] = 'sex: %s', + ['dob'] = 'DOB: %s', + ['height'] = 'height: %s', + ['bac'] = 'BAC: %s', + ['unknown'] = 'unknown', + ['male'] = 'male', + ['female'] = 'female', + -- Body Search Menu + ['guns_label'] = '--- Armas ---', + ['inventory_label'] = '--- Inventário ---', + ['license_label'] = ' --- Licenses ---', + ['confiscate'] = 'confiscar %s', + ['confiscate_weapon'] = 'confiscate %s with %s bullets', + ['confiscate_inv'] = 'Confiscar %sx %s', + ['confiscate_dirty'] = 'Confiscar dinheiro sujo: $%s', + ['you_confiscated'] = 'you confiscated ~y~%sx~s~ ~b~%s~s~ from ~b~%s~s~', + ['got_confiscated'] = '~y~%sx~s~ ~b~%s~s~ were confiscated by ~y~%s~s~', + ['you_confiscated_account'] = 'you confiscated ~g~$%s~s~ (%s) from ~b~%s~s~', + ['got_confiscated_account'] = '~g~$%s~s~ (%s) was confiscated by ~y~%s~s~', + ['you_confiscated_weapon'] = 'you confiscated ~b~%s~s~ from ~b~%s~s~ with ~o~%s~s~ bullets', + ['got_confiscated_weapon'] = 'your ~b~%s~s~ with ~o~%s~s~ bullets was confiscated by ~y~%s~s~', + ['traffic_offense'] = 'Infrações de transito', + ['minor_offense'] = 'Infração leve', + ['average_offense'] = 'Infração média', + ['major_offense'] = 'Infração grave', + ['fine_total'] = 'multa: %s', + -- Vehicle Info Menu + ['plate'] = 'placa: %s', + ['owner_unknown'] = 'proprietário: Desconhecido', + ['owner'] = 'proprietário: %s', + -- Boss Menu + ['open_bossmenu'] = 'Pressione ~INPUT_CONTEXT~ para abrir o menu', + ['quantity_invalid'] = 'invalid quantity', + ['have_withdrawn'] = 'you have withdrawn ~y~%sx~s~ ~b~%s~s~', + ['have_deposited'] = 'you have deposited ~y~%sx~s~ ~b~%s~s~', + ['quantity'] = 'quantity', + ['inventory'] = 'inventory', + ['police_stock'] = 'police Stock', + -- Misc + ['remove_prop'] = 'Pressione ~INPUT_CONTEXT~ para remover o objeto', + ['map_blip'] = 'Departamento de Polícia', + ['unrestrained_timer'] = 'you feel your handcuffs slowly losing grip and fading away.', + -- Notifications + ['alert_police'] = 'Alerta da Polícia', + ['phone_police'] = 'police', +} diff --git a/[esx_addons]/esx_policejob/locales/cs.lua b/[esx_addons]/esx_policejob/locales/cs.lua new file mode 100644 index 00000000..0c494b2f --- /dev/null +++ b/[esx_addons]/esx_policejob/locales/cs.lua @@ -0,0 +1,151 @@ +Locales['cs'] = { + -- Cloakroom + ['cloakroom'] = 'satna', + ['citizen_wear'] = 'civilní oblek', + ['police_wear'] = 'policejní oblek', + ['gilet_wear'] = 'oranžová reflexní vesta', + ['bullet_wear'] = 'neprůstřelná vesta', + ['no_outfit'] = 'není zde žádná uniforma, která by ti sedla!', + ['open_cloackroom'] = 'stiskni ~INPUT_CONTEXT~ pro změnu ~y~oblečení~s~.', + -- Armory + ['remove_object'] = 'vzít objekt', + ['deposit_object'] = 'odevzdat objekt', + ['get_weapon'] = 'vzít zbraň ze zbrojnice', + ['put_weapon'] = 'uchovat zbraň ve zbrojnici', + ['buy_weapons'] = 'koupit zbraně', + ['armory'] = 'zbrojnice', + ['open_armory'] = 'stiskni ~INPUT_CONTEXT~ pro přístup do ~y~zbrojnice~s~.', + ['armory_owned'] = 'vlastněno', + ['armory_free'] = 'zdarma', + ['armory_item'] = '$%s', + ['armory_weapontitle'] = 'zbrojnice', + ['armory_componenttitle'] = 'zbrojnice - Příslušenství ke zbraním', + ['armory_bought'] = 'zakoupil jsi ~y~%s~s~ za ~g~$%s~s~', + ['armory_money'] = 'nemáš dostatek peněz na tuto zbraň', + ['armory_hascomponent'] = 'toto příslušenství máš již nainstalováno!', + ['get_weapon_menu'] = 'zbrojnice - Vzít zbraň', + ['put_weapon_menu'] = 'zbrojnice - Uchovat zbraň', + -- Vehicles + ['vehicle_menu'] = 'vozidlo', + ['vehicle_blocked'] = 'vsechny dostupne spawn pointy jsou blokovany!', + ['garage_prompt'] = 'stiskni ~INPUT_CONTEXT~ pro otevreni ~y~akce vozidel~s~.', + ['garage_title'] = 'akce vozidel', + ['garage_stored'] = 'uloženo', + ['garage_notstored'] = 'není v garáži', + ['garage_storing'] = 'pokousime se o odstraneni vozidla, ujisti se, ze kolem nej nejsou hraci.', + ['garage_has_stored'] = 'vozidlo bylo ulozeno do garaze', + ['garage_has_notstored'] = 'zadne nejblizsi vlastnene vozidlo nenalezeno', + ['garage_notavailable'] = 'tvoje vozidlo neni ulozeno v garazi.', + ['garage_blocked'] = 'nejsou zde zadne spawn pointy!', + ['garage_empty'] = 'zadne vozidlo nemas v garazi.', + ['garage_released'] = 'tvoje vozidlo bylo vyjmuto z garaze.', + ['garage_store_nearby'] = 'nejsou poblíž zádná vozidla.', + ['garage_storeditem'] = 'otevřít garáž', + ['garage_storeitem'] = 'uchovat vozidlo v garáži', + ['garage_buyitem'] = 'prodej vozidel', + ['garage_notauthorized'] = 'nemas opravneni ke koupi tohoto vozidla.', + ['helicopter_prompt'] = 'stiskni ~INPUT_CONTEXT~ pro pristup k ~y~akcim Helikopter~s~.', + ['shop_item'] = '$%s', + ['vehicleshop_title'] = 'prodejce vozidel', + ['vehicleshop_confirm'] = 'opravdu chces koupit toto vozidlo?', + ['vehicleshop_bought'] = 'koupil jsi ~y~%s~s~ za ~r~$%s~s~', + ['vehicleshop_money'] = 'toto vozidlo si nemuzete dovolit', + ['vehicleshop_awaiting_model'] = 'vozidlo se prave ~g~stahuje a nacita~s~ prosim pockej', + ['confirm_no'] = 'ne', + ['confirm_yes'] = 'ano', + -- Service + ['service_max'] = 'nemuzete vstoupit do sluzby, max dustojníci v provozu: %s/%s', + ['service_not'] = 'nezadali jste sluzbu! Nejprve se musíte zmenit.', + ['service_anonunce'] = 'informace o sluzbe', + ['service_in'] = 'vstoupil jsi do sluzby, vitej!', + ['service_in_announce'] = 'operator ~y~%s~s~ se pripojil do sluzby!', + ['service_out'] = 'opustil jsi sluzbu.', + ['service_out_announce'] = 'operator ~y~%s~s~ opustil jejich sluzbu.', + -- Action Menu + ['citizen_interaction'] = 'Interakce s občanem', + ['vehicle_interaction'] = 'Interakce vozidla', + ['object_spawner'] = 'Objekty', + + ['id_card'] = 'Občanský průkaz', + ['search'] = 'prohledat', + ['handcuff'] = 'poutat / odpoutat', + ['drag'] = 'prenést', + ['put_in_vehicle'] = 'vlozit do vozidla', + ['out_the_vehicle'] = 'vytahnout z vozidla', + ['fine'] = 'pokuta', + ['unpaid_bills'] = 'spravovat nezaplacené pokuty', + ['license_check'] = 'spravovat průkazy', + ['license_revoke'] = 'zneplatnit průkaz', + ['license_revoked'] = 'vase ~b~%s~s~ bylo ~y~zruseno~s~!', + ['licence_you_revoked'] = 'zrusil jsi ~b~%s~s~ ktery patril ~y~%s~s~', + ['no_players_nearby'] = 'zadny hrac pobliz!', + ['being_searched'] = 'prave jsi ~y~prohledavan~s~ ~b~policii~s~', + -- Vehicle interaction + ['vehicle_info'] = 'informace o vozidle', + ['pick_lock'] = 'vypáčit vozidlo', + ['vehicle_unlocked'] = 'vozidlo je ~g~Odemčeno~s~', + ['no_vehicles_nearby'] = 'there is no vehicles nearby', + ['impound'] = 'odtahnout vozidlo', + ['impound_prompt'] = 'zmackni ~INPUT_CONTEXT~ pro zruseni ~y~odtahnuti~s~', + ['impound_canceled'] = 'zrusil jsi odtah', + ['impound_canceled_moved'] = 'odtah byl zrusen,protoze se vozidlo pohlo!', + ['impound_successful'] = 'uspesne jsi odtahl vozidlo', + ['search_database'] = 'informace o vozidle', + ['search_database_title'] = 'informace o vozidle - pomocí registracnich cisel', + ['search_database_error_invalid'] = 'tohle ~r~neni~s~ ~y~spravne~s~ registracni cislo', + -- Traffic interaction + ['traffic_interaction'] = 'interakce provozu', + ['cone'] = 'kuzel', + ['barrier'] = 'bariera', + ['spikestrips'] = 'ostnaty pas', + ['box'] = 'box', + ['cash'] = 'box penez', + -- ID Card Menu + ['name'] = 'jméno: %s', + ['job'] = 'práce: %s', + ['sex'] = 'pohlaví: %s', + ['dob'] = 'DOB: %s', + ['height'] = 'výška: %s', + ['bac'] = 'BAC: %s', + ['unknown'] = 'neznámé', + ['male'] = 'muž', + ['female'] = 'žena', + -- Body Search Menu + ['guns_label'] = '--- Zbraně ---', + ['inventory_label'] = '--- Inventář ---', + ['license_label'] = ' --- Průkazy ---', + ['confiscate'] = 'zabavit %s', + ['confiscate_weapon'] = 'zabavit %s s %s naboji', + ['confiscate_inv'] = 'zabavit %sx %s', + ['confiscate_dirty'] = 'zabavit spinave penize: $%s', + ['you_confiscated'] = 'zabavil jsi ~y~%sx~s~ ~b~%s~s~ od ~b~%s~s~', + ['got_confiscated'] = '~y~%sx~s~ ~b~%s~s~ byly zabaveny od ~y~%s~s~', + ['you_confiscated_account'] = 'zabavil jsi ~g~$%s~s~ (%s) od ~b~%s~s~', + ['got_confiscated_account'] = '~g~$%s~s~ (%s) byly zabaveny ~y~%s~s~', + ['you_confiscated_weapon'] = 'zabavil jsi ~b~%s~s~ od ~b~%s~s~ s ~o~%s~s~ naboji ', + ['got_confiscated_weapon'] = 'tvoje ~b~%s~s~ s ~o~%s~s~ bylo zabaveno od ~y~%s~s~', + ['traffic_offense'] = 'dopravní přestupek', + ['minor_offense'] = 'malý přestupek', + ['average_offense'] = 'přestupek', + ['major_offense'] = 'trestný čin', + ['fine_total'] = 'pokuta: %s', + -- Vehicle Info Menu + ['plate'] = 'SPZ: %s', + ['owner_unknown'] = 'vlastník: Neznámý', + ['owner'] = 'vlastník: %s', + -- Boss Menu + ['open_bossmenu'] = 'stiskni ~INPUT_CONTEXT~ pro otevření menu', + ['quantity_invalid'] = 'neplatné množství', + ['have_withdrawn'] = 'vybral jsi ~y~%sx~s~ ~b~%s~s~', + ['have_deposited'] = 'vložil jsi ~y~%sx~s~ ~b~%s~s~', + ['quantity'] = 'množství', + ['inventory'] = 'inventář', + ['police_stock'] = 'policejní sklad', + -- Misc + ['remove_prop'] = 'stiskni ~INPUT_CONTEXT~ pro odstranění předmětu', + ['map_blip'] = 'policejní stanice', + ['unrestrained_timer'] = 'cítíš, že tvé pouta pomalu ztrácejí přilnavost a padají.', + -- Notifications + ['alert_police'] = 'policejní poplach', + ['phone_police'] = 'policie', +} diff --git a/[esx_addons]/esx_policejob/locales/de.lua b/[esx_addons]/esx_policejob/locales/de.lua new file mode 100644 index 00000000..5ed2776f --- /dev/null +++ b/[esx_addons]/esx_policejob/locales/de.lua @@ -0,0 +1,151 @@ +Locales['de'] = { + -- Cloackroom + ['cloakroom'] = 'Garderobe', + ['citizen_wear'] = 'Zivilkleidung', + ['police_wear'] = 'Arbeitskleidung', + ['gilet_wear'] = 'orange reflective jacket', + ['bullet_wear'] = 'bulletproof vest', + ['no_outfit'] = 'there\'s no uniform that fits you!', + ['open_cloackroom'] = 'Drücke ~INPUT_CONTEXT~ um dich umzuziehen', + -- Armory + ['remove_object'] = 'take object', + ['deposit_object'] = 'deposit object', + ['get_weapon'] = 'Waffen holen', + ['put_weapon'] = 'Waffen bringen', + ['buy_weapons'] = 'Waffen kaufen', + ['armory'] = 'Waffenkammer', + ['open_armory'] = 'Drücke ~INPUT_CONTEXT~ um die Waffenkammer zu öffnen', + ['armory_owned'] = 'owned', + ['armory_free'] = 'free', + ['armory_item'] = '$%s', + ['armory_weapontitle'] = 'armory - Buy weapon', + ['armory_componenttitle'] = 'armory - Weapon attatchments', + ['armory_bought'] = 'you bought an ~y~%s~s~ for ~g~$%s~s~', + ['armory_money'] = 'you cannot afford that weapon', + ['armory_hascomponent'] = 'you have that attatchment equiped!', + ['get_weapon_menu'] = 'armory - Withdraw Weapon', + ['put_weapon_menu'] = 'armory - Store Weapon', + -- Vehicles + ['vehicle_menu'] = 'vehicle', + ['vehicle_blocked'] = 'all available spawn points are currently blocked!', + ['garage_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Vehicle Actions~s~.', + ['garage_title'] = 'vehicle Actions', + ['garage_stored'] = 'stored', + ['garage_notstored'] = 'not in garage', + ['garage_storing'] = 'we\'re attempting to remove the vehicle, make sure no players are around it.', + ['garage_has_stored'] = 'the vehicle has been stored in your garage', + ['garage_has_notstored'] = 'no nearby owned vehicles were found', + ['garage_notavailable'] = 'your vehicle is not stored in the garage.', + ['garage_blocked'] = 'there\'s no available spawn points!', + ['garage_empty'] = 'you dont have any vehicles in your garage.', + ['garage_released'] = 'your vehicle has been released from the garage.', + ['garage_store_nearby'] = 'there is no nearby vehicles.', + ['garage_storeditem'] = 'open garage', + ['garage_storeitem'] = 'store vehicle in garage', + ['garage_buyitem'] = 'vehicle shop', + ['garage_notauthorized'] = 'you\'re not authorized to buy this kind of vehicles.', + ['helicopter_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Helicopter Actions~s~.', + ['shop_item'] = '$%s', + ['vehicleshop_title'] = 'vehicle Shop', + ['vehicleshop_confirm'] = 'do you want to buy this vehicle?', + ['vehicleshop_bought'] = 'you have bought ~y~%s~s~ for ~r~$%s~s~', + ['vehicleshop_money'] = 'you cannot afford that vehicle', + ['vehicleshop_awaiting_model'] = 'the vehicle is currently ~g~DOWNLOADING & LOADING~s~ please wait', + ['confirm_no'] = 'no', + ['confirm_yes'] = 'yes', + -- Service + ['service_max'] = 'you cannot enter service, max officers in service: %s/%s', + ['service_not'] = 'you have not entered service! You\'ll have to get changed first.', + ['service_anonunce'] = 'service information', + ['service_in'] = 'you\'ve entered service, welcome!', + ['service_in_announce'] = 'operator ~y~%s~s~ has entered service!', + ['service_out'] = 'you have left service.', + ['service_out_announce'] = 'operator ~y~%s~s~ has left their service.', + -- Action Menu + ['citizen_interaction'] = 'Zivilistenaktionen', + ['vehicle_interaction'] = 'Fahrzeuginteraktionen', + ['object_spawner'] = 'Objekt Spawner', + + ['id_card'] = 'ID Karte', + ['search'] = 'Suche', + ['handcuff'] = 'Festnehmen / Freilassen', + ['drag'] = 'drag', + ['put_in_vehicle'] = 'In Fahrzeug setzen', + ['out_the_vehicle'] = 'take out of vehicle', + ['fine'] = 'Strafe', + ['unpaid_bills'] = 'manage unpaid bills', + ['license_check'] = 'manage license', + ['license_revoke'] = 'revoke license', + ['license_revoked'] = 'your ~b~%s~s~ has been ~y~revoked~s~!', + ['licence_you_revoked'] = 'you revoked a ~b~%s~s~ which belonged to ~y~%s~s~', + ['no_players_nearby'] = 'keine Spieler in der Nähe', + ['being_searched'] = 'you are being ~y~searched~s~ by the ~b~Police~s~', + -- Vehicle interaction + ['vehicle_info'] = 'Fahrzeug Info', + ['pick_lock'] = 'Fahrzeug öffnen', + ['vehicle_unlocked'] = 'Fahrzeug ~g~offen~s~', + ['no_vehicles_nearby'] = 'Keine Fahrzeuge in der Nähe', + ['impound'] = 'impound vehicle', + ['impound_prompt'] = 'press ~INPUT_CONTEXT~ to cancel the ~y~impound~s~', + ['impound_canceled'] = 'you canceled the impound', + ['impound_canceled_moved'] = 'the impound has been canceled because the vehicle moved', + ['impound_successful'] = 'you have impounded the vehicle', + ['search_database'] = 'vehicle information', + ['search_database_title'] = 'vehicle information - search with registration number', + ['search_database_error_invalid'] = 'that is ~r~not~s~ a ~y~valid~s~ registration number', + -- Traffic interaction + ['traffic_interaction'] = 'Straßeninteraktionen', + ['cone'] = 'Hütchen', + ['barrier'] = 'Barriere', + ['spikestrips'] = 'Nagelband', + ['box'] = 'Box', + ['cash'] = 'Box mit Geld', + -- ID Card Menu + ['name'] = 'name: %s', + ['job'] = 'job: %s', + ['sex'] = 'sex: %s', + ['dob'] = 'DOB: %s', + ['height'] = 'height: %s', + ['bac'] = 'BAC: %s', + ['unknown'] = 'unknown', + ['male'] = 'male', + ['female'] = 'female', + -- Body Search Menu + ['guns_label'] = '--- Waffen ---', + ['inventory_label'] = '--- Inventar ---', + ['license_label'] = ' --- Licenses ---', + ['confiscate'] = 'konfeszieren %s', + ['confiscate_weapon'] = 'confiscate %s with %s bullets', + ['confiscate_inv'] = 'konfeziere %sx %s', + ['confiscate_dirty'] = 'schwarzgeld konfesziert: $%s', + ['you_confiscated'] = 'you confiscated ~y~%sx~s~ ~b~%s~s~ from ~b~%s~s~', + ['got_confiscated'] = '~y~%sx~s~ ~b~%s~s~ were confiscated by ~y~%s~s~', + ['you_confiscated_account'] = 'you confiscated ~g~$%s~s~ (%s) from ~b~%s~s~', + ['got_confiscated_account'] = '~g~$%s~s~ (%s) was confiscated by ~y~%s~s~', + ['you_confiscated_weapon'] = 'you confiscated ~b~%s~s~ from ~b~%s~s~ with ~o~%s~s~ bullets', + ['got_confiscated_weapon'] = 'your ~b~%s~s~ with ~o~%s~s~ bullets was confiscated by ~y~%s~s~', + ['traffic_offense'] = 'Verkehrs vergehen', + ['minor_offense'] = 'Geringes vergehen', + ['average_offense'] = 'Normales vergehen', + ['major_offense'] = 'Hohes vergehen', + ['fine_total'] = 'strafe: %s', + -- Vehicle Info Menu + ['plate'] = 'plate: %s', + ['owner_unknown'] = 'besitzer: Unbekannt', + ['owner'] = 'besitzer: %s', + -- Boss Menu + ['open_bossmenu'] = 'Drücke ~INPUT_CONTEXT~ um das Menü zu öffnen', + ['quantity_invalid'] = 'invalid quantity', + ['have_withdrawn'] = 'you have withdrawn ~y~%sx~s~ ~b~%s~s~', + ['have_deposited'] = 'you have deposited ~y~%sx~s~ ~b~%s~s~', + ['quantity'] = 'quantity', + ['inventory'] = 'inventory', + ['police_stock'] = 'police Stock', + -- Misc + ['remove_prop'] = 'Drücke ~INPUT_CONTEXT~ um das Objekt zu entfernen', + ['map_blip'] = 'Polizeistation', + ['unrestrained_timer'] = 'you feel your handcuffs slowly losing grip and fading away.', + -- Notifications + ['alert_police'] = 'Polizei alamieren', + ['phone_police'] = 'police', +} diff --git a/[esx_addons]/esx_policejob/locales/en.lua b/[esx_addons]/esx_policejob/locales/en.lua new file mode 100644 index 00000000..e7585c78 --- /dev/null +++ b/[esx_addons]/esx_policejob/locales/en.lua @@ -0,0 +1,151 @@ +Locales['en'] = { + -- Cloakroom + ['cloakroom'] = 'locker room', + ['citizen_wear'] = 'civilian Outfit', + ['police_wear'] = 'police Outfit', + ['gilet_wear'] = 'orange reflective jacket', + ['bullet_wear'] = 'bulletproof vest', + ['no_outfit'] = 'there\'s no uniform that fits you!', + ['open_cloackroom'] = 'press ~INPUT_CONTEXT~ to change ~y~clothes~s~.', + -- Armory + ['remove_object'] = 'withdraw object', + ['deposit_object'] = 'deposit object', + ['get_weapon'] = 'withdraw weapon from armory', + ['put_weapon'] = 'store weapon in armory', + ['buy_weapons'] = 'buy weapons', + ['armory'] = 'armory', + ['open_armory'] = 'press ~INPUT_CONTEXT~ to access the ~y~Armory~s~.', + ['armory_owned'] = 'owned', + ['armory_free'] = 'free', + ['armory_item'] = '$%s', + ['armory_weapontitle'] = 'armory - Buy weapon', + ['armory_componenttitle'] = 'armory - Weapon attatchments', + ['armory_bought'] = 'you bought an ~y~%s~s~ for ~g~$%s~s~', + ['armory_money'] = 'you cannot afford that weapon', + ['armory_hascomponent'] = 'you have that attatchment equiped!', + ['get_weapon_menu'] = 'armory - Withdraw Weapon', + ['put_weapon_menu'] = 'armory - Store Weapon', + -- Vehicles + ['vehicle_menu'] = 'vehicle', + ['vehicle_blocked'] = 'all available spawn points are currently blocked!', + ['garage_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Vehicle Actions~s~.', + ['garage_title'] = 'vehicle Actions', + ['garage_stored'] = 'stored', + ['garage_notstored'] = 'not in garage', + ['garage_storing'] = 'we\'re attempting to remove the vehicle, make sure no players are around it.', + ['garage_has_stored'] = 'the vehicle has been stored in your garage', + ['garage_has_notstored'] = 'no nearby owned vehicles were found', + ['garage_notavailable'] = 'your vehicle is not stored in the garage.', + ['garage_blocked'] = 'there\'s no available spawn points!', + ['garage_empty'] = 'you dont have any vehicles in your garage.', + ['garage_released'] = 'your vehicle has been released from the garage.', + ['garage_store_nearby'] = 'there is no nearby vehicles.', + ['garage_storeditem'] = 'open garage', + ['garage_storeitem'] = 'store vehicle in garage', + ['garage_buyitem'] = 'vehicle shop', + ['garage_notauthorized'] = 'you\'re not authorized to buy this kind of vehicles.', + ['helicopter_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Helicopter Actions~s~.', + ['shop_item'] = '$%s', + ['vehicleshop_title'] = 'vehicle Shop', + ['vehicleshop_confirm'] = 'do you want to buy this vehicle?', + ['vehicleshop_bought'] = 'you have bought ~y~%s~s~ for ~r~$%s~s~', + ['vehicleshop_money'] = 'you cannot afford that vehicle', + ['vehicleshop_awaiting_model'] = 'the vehicle is currently ~g~DOWNLOADING & LOADING~s~ please wait', + ['confirm_no'] = 'no', + ['confirm_yes'] = 'yes', + -- Service + ['service_max'] = 'you cannot enter service, max officers in service: %s/%s', + ['service_not'] = 'you have not entered service! You\'ll have to get changed first.', + ['service_anonunce'] = 'service information', + ['service_in'] = 'you\'ve entered service, welcome!', + ['service_in_announce'] = 'operator ~y~%s~s~ has entered service!', + ['service_out'] = 'you have left service.', + ['service_out_announce'] = 'operator ~y~%s~s~ has left their service.', + -- Action Menu + ['citizen_interaction'] = 'citizen Interaction', + ['vehicle_interaction'] = 'vehicle Interaction', + ['object_spawner'] = 'object Spawner', + + ['id_card'] = 'ID Card', + ['search'] = 'search', + ['handcuff'] = 'cuff / Uncuff', + ['drag'] = 'escort', + ['put_in_vehicle'] = 'put in Vehicle', + ['out_the_vehicle'] = 'drag out from vehicle', + ['fine'] = 'fine', + ['unpaid_bills'] = 'manage unpaid bills', + ['license_check'] = 'manage license', + ['license_revoke'] = 'revoke license', + ['license_revoked'] = 'your ~b~%s~s~ has been ~y~revoked~s~!', + ['licence_you_revoked'] = 'you revoked a ~b~%s~s~ which belonged to ~y~%s~s~', + ['no_players_nearby'] = 'there is no player(s) nearby!', + ['being_searched'] = 'you are being ~y~searched~s~ by the ~b~Police~s~', + -- Vehicle interaction + ['vehicle_info'] = 'vehicle Info', + ['pick_lock'] = 'lockpick Vehicle', + ['vehicle_unlocked'] = 'vehicle ~g~Unlocked~s~', + ['no_vehicles_nearby'] = 'there is no vehicles nearby', + ['impound'] = 'impound vehicle', + ['impound_prompt'] = 'press ~INPUT_CONTEXT~ to cancel the ~y~impound~s~', + ['impound_canceled'] = 'you canceled the impound', + ['impound_canceled_moved'] = 'the impound has been canceled because the vehicle moved', + ['impound_successful'] = 'you have impounded the vehicle', + ['search_database'] = 'vehicle information', + ['search_database_title'] = 'vehicle information - search with registration number', + ['search_database_error_invalid'] = 'that is ~r~not~s~ a ~y~valid~s~ registration number', + -- Traffic interaction + ['traffic_interaction'] = 'interaction Traffic', + ['cone'] = 'cone', + ['barrier'] = 'barrier', + ['spikestrips'] = 'spikestrips', + ['box'] = 'box', + ['cash'] = 'box of cash', + -- ID Card Menu + ['name'] = 'name: %s', + ['job'] = 'job: %s', + ['sex'] = 'sex: %s', + ['dob'] = 'DOB: %s', + ['height'] = 'height: %s', + ['bac'] = 'BAC: %s', + ['unknown'] = 'unknown', + ['male'] = 'male', + ['female'] = 'female', + -- Body Search Menu + ['guns_label'] = '--- Guns ---', + ['inventory_label'] = '--- Inventory ---', + ['license_label'] = ' --- Licenses ---', + ['confiscate'] = 'confiscate %s', + ['confiscate_weapon'] = 'confiscate %s with %s bullets', + ['confiscate_inv'] = 'confiscate %sx %s', + ['confiscate_dirty'] = 'confiscate dirty money: $%s', + ['you_confiscated'] = 'you confiscated ~y~%sx~s~ ~b~%s~s~ from ~b~%s~s~', + ['got_confiscated'] = '~y~%sx~s~ ~b~%s~s~ were confiscated by ~y~%s~s~', + ['you_confiscated_account'] = 'you confiscated ~g~$%s~s~ (%s) from ~b~%s~s~', + ['got_confiscated_account'] = '~g~$%s~s~ (%s) was confiscated by ~y~%s~s~', + ['you_confiscated_weapon'] = 'you confiscated ~b~%s~s~ from ~b~%s~s~ with ~o~%s~s~ bullets', + ['got_confiscated_weapon'] = 'your ~b~%s~s~ with ~o~%s~s~ bullets was confiscated by ~y~%s~s~', + ['traffic_offense'] = 'traffic Offense', + ['minor_offense'] = 'minor Offense', + ['average_offense'] = 'average Offense', + ['major_offense'] = 'major Offense', + ['fine_total'] = 'fine: %s', + -- Vehicle Info Menu + ['plate'] = 'plate: %s', + ['owner_unknown'] = 'owner: Unknown', + ['owner'] = 'owner: %s', + -- Boss Menu + ['open_bossmenu'] = 'press ~INPUT_CONTEXT~ to open the menu', + ['quantity_invalid'] = 'invalid quantity', + ['have_withdrawn'] = 'you have withdrawn ~y~%sx~s~ ~b~%s~s~', + ['have_deposited'] = 'you have deposited ~y~%sx~s~ ~b~%s~s~', + ['quantity'] = 'quantity', + ['inventory'] = 'inventory', + ['police_stock'] = 'police Stock', + -- Misc + ['remove_prop'] = 'press ~INPUT_CONTEXT~ to delete the object', + ['map_blip'] = 'police Station', + ['unrestrained_timer'] = 'you feel your handcuffs slowly losing grip and fading away.', + -- Notifications + ['alert_police'] = 'police alert', + ['phone_police'] = 'police', +} diff --git a/[esx_addons]/esx_policejob/locales/es.lua b/[esx_addons]/esx_policejob/locales/es.lua new file mode 100644 index 00000000..6c01770d --- /dev/null +++ b/[esx_addons]/esx_policejob/locales/es.lua @@ -0,0 +1,151 @@ +Locales['es'] = { + -- Cloakroom + ['cloakroom'] = 'Taquilla', + ['citizen_wear'] = 'Ropa de civil', + ['police_wear'] = 'Uniforme', + ['gilet_wear'] = 'Chaqueta reflectante naranja', + ['bullet_wear'] = 'Chaleco antibalas', + ['no_outfit'] = '¡No hay ningún uniforme disponible para ti!', + ['open_cloackroom'] = 'Presionar ~INPUT_CONTEXT~ para abrir su taquilla', + -- Armory + ['remove_object'] = 'Coger objeto', + ['deposit_object'] = 'Depositar objeto', + ['get_weapon'] = 'Coger arma', + ['put_weapon'] = 'Depositar arma', + ['buy_weapons'] = 'Comprar armas', + ['armory'] = 'Armeria', + ['open_armory'] = 'Presionar ~INPUT_CONTEXT~ para acceder a la armeria', + ['armory_owned'] = 'Comprada', + ['armory_free'] = 'Gratis', + ['armory_item'] = '$%s', + ['armory_weapontitle'] = 'Armeria - Comprar arma', + ['armory_componenttitle'] = 'Armeria - Complementos del arma', + ['armory_bought'] = 'compraste una ~y~%s~s~ por ~g~$%s~s~', + ['armory_money'] = 'No dispones de suficiente dinero para comprar esta arma', + ['armory_hascomponent'] = '¡Ya dispones de ese complemento!', + ['get_weapon_menu'] = 'Armeria - Retirar arma', + ['put_weapon_menu'] = 'Armeria - Guardar arma', + -- Vehicles + ['vehicle_menu'] = 'Vehículos', + ['vehicle_blocked'] = '¡Todos los puntos de aparición de vehículos están ocupados!', + ['garage_prompt'] = 'Presione ~INPUT_CONTEXT~ para acceder a ~y~Acciones del Vehículo~s~.', + ['garage_title'] = 'Acciones del vehículo', + ['garage_stored'] = 'Guardado', + ['garage_notstored'] = 'No se encuentra en el garaje', + ['garage_storing'] = 'Estamos intentando borrar el vehículo, asegurate de que no haya jugadores cerca.', + ['garage_has_stored'] = 'El vehículo ha sido guardado en su garaje', + ['garage_has_notstored'] = 'no nearby owned vehicles were found', + ['garage_notavailable'] = 'Su vehículo no está guardado en el garaje.', + ['garage_blocked'] = '¡No hay ningún punto de spawn disponible!', + ['garage_empty'] = 'No dispones de ningún vehículo en su garaje.', + ['garage_released'] = 'your vehicle has been released from the garage.', + ['garage_store_nearby'] = 'No hay vehículos cercanos.', + ['garage_storeditem'] = 'Abrir garaje', + ['garage_storeitem'] = 'Guardar vehículo en el garaje', + ['garage_buyitem'] = 'Tienda de vehículos', + ['garage_notauthorized'] = 'No estás autorizado a comprar este tipo de vehículos.', + ['helicopter_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Helicopter Actions~s~.', + ['shop_item'] = '$%s', + ['vehicleshop_title'] = 'Tienda de vehículos', + ['vehicleshop_confirm'] = '¿Quieres comprar este vehículo?', + ['vehicleshop_bought'] = 'Has comprado un ~y~%s~s~ por ~r~$%s~s~', + ['vehicleshop_money'] = 'No tienes suficiente dinero para comprar este vehículo', + ['vehicleshop_awaiting_model'] = 'El vehículo se está ~g~DESCARGANDO Y CARGANDO~s~ porfavor espere', + ['confirm_no'] = 'no', + ['confirm_yes'] = 'si', + -- Service + ['service_max'] = 'No puedes entrar de servicio porque se ha alcanzado el número máximo: %s/%s', + ['service_not'] = '¡No has entrado de servicio! Debes hacerlo primeramente.', + ['service_anonunce'] = 'Información de servicio', + ['service_in'] = 'Has entrado de servicio. ¡Bienvenido!', + ['service_in_announce'] = '¡El agente ~y~%s~s~ ha entrado de servicio!', + ['service_out'] = 'Has salido de servicio.', + ['service_out_announce'] = 'El agente ~y~%s~s~ se ha salido de servicio.', + -- Action Menu + ['citizen_interaction'] = 'Interacción ciudadana', + ['vehicle_interaction'] = 'Interacción vehículo', + ['object_spawner'] = 'Colocar objetos', + + ['id_card'] = 'Documento de identidad', + ['search'] = 'Buscar', + ['handcuff'] = 'Poner/quitar Esposas', + ['drag'] = 'escoltar', + ['put_in_vehicle'] = 'Meter en el vehículo', + ['out_the_vehicle'] = 'Sacar del vehículo', + ['fine'] = 'Multa', + ['unpaid_bills'] = 'manage unpaid bills', + ['license_check'] = 'Gestionar licencia', + ['license_revoke'] = 'Revocar licencia', + ['license_revoked'] = 'Su ~b~%s~s~ ha sido ~y~revocar~s~!', + ['licence_you_revoked'] = 'you revoked a ~b~%s~s~ which belonged to ~y~%s~s~', + ['no_players_nearby'] = 'no hay jugadores cerca', + ['being_searched'] = 'you are being ~y~searched~s~ by the ~b~Police~s~', + -- Vehicle interaction + ['vehicle_info'] = 'Información del vehículo', + ['pick_lock'] = 'Forzar coche', + ['vehicle_unlocked'] = 'Vehículo desbloqueado~s~', + ['no_vehicles_nearby'] = 'No hay vehículos cerca', + ['impound'] = 'Confiscar vehículo', + ['impound_prompt'] = 'Presione ~INPUT_CONTEXT~ para cancelar ~y~impound~s~', + ['impound_canceled'] = 'you canceled the impound', + ['impound_canceled_moved'] = 'the impound has been canceled because the vehicle moved', + ['impound_successful'] = 'you have impounded the vehicle', + ['search_database'] = 'vehicle information', + ['search_database_title'] = 'vehicle information - search with registration number', + ['search_database_error_invalid'] = 'that is ~r~not~s~ a ~y~valid~s~ registration number', + -- Traffic interaction + ['traffic_interaction'] = 'Rutas de interacción', + ['cone'] = 'Cono', + ['barrier'] = 'Barrera', + ['spikestrips'] = 'Grada', + ['box'] = 'Caja', + ['cash'] = 'Dinero', + -- ID Card Menu + ['name'] = 'Nombre: %s', + ['job'] = 'Trabajo: %s', + ['sex'] = 'Sexo: %s', + ['dob'] = 'DOB: %s', + ['height'] = 'Altura: %s', + ['bac'] = 'BAC: %s', + ['unknown'] = 'Desconocido', + ['male'] = 'Hombre', + ['female'] = 'Mujer', + -- Body Search Menu + ['guns_label'] = '--- Armas ---', + ['inventory_label'] = '--- Inventario ---', + ['license_label'] = ' --- Licenses ---', + ['confiscate'] = 'confiscar %s', + ['confiscate_weapon'] = 'confiscate %s with %s bullets', + ['confiscate_inv'] = 'confiscar %sx %s', + ['confiscate_dirty'] = 'confiscar dinero negro: €%s', + ['you_confiscated'] = 'you confiscated ~y~%sx~s~ ~b~%s~s~ from ~b~%s~s~', + ['got_confiscated'] = '~y~%sx~s~ ~b~%s~s~ were confiscated by ~y~%s~s~', + ['you_confiscated_account'] = 'Has confiscado ~g~€%s~s~ (%s) de ~b~%s~s~', + ['got_confiscated_account'] = '~g~€%s~s~ (%s) ha sido confiscado por ~y~%s~s~', + ['you_confiscated_weapon'] = 'you confiscated ~b~%s~s~ from ~b~%s~s~ with ~o~%s~s~ bullets', + ['got_confiscated_weapon'] = 'your ~b~%s~s~ with ~o~%s~s~ bullets was confiscated by ~y~%s~s~', + ['traffic_offense'] = 'Delito de tráfico', + ['minor_offense'] = 'Delito menor', + ['average_offense'] = 'Delito medio', + ['major_offense'] = 'Delito grave', + ['fine_total'] = 'Multa total: %s', + -- Vehicle Info Menu + ['plate'] = 'n°: %s', + ['owner_unknown'] = 'propietario: Desconocido', + ['owner'] = 'propietario: %s', + -- Boss Menu + ['open_bossmenu'] = 'presionar ~INPUT_CONTEXT~ para abrir el menú', + ['quantity_invalid'] = 'cantidad invalida', + ['have_withdrawn'] = 'you have withdrawn ~y~%sx~s~ ~b~%s~s~', + ['have_deposited'] = 'you have deposited ~y~%sx~s~ ~b~%s~s~', + ['quantity'] = 'cantidad', + ['inventory'] = 'inventario', + ['police_stock'] = 'almacen Policial', + -- Misc + ['remove_prop'] = 'presionar ~INPUT_CONTEXT~ para eliminar el objeto', + ['map_blip'] = 'comisaría de policía', + ['unrestrained_timer'] = 'you feel your handcuffs slowly losing grip and fading away.', + -- Notifications + ['alert_police'] = 'alerta policia', + ['phone_police'] = 'policia', +} diff --git a/[esx_addons]/esx_policejob/locales/fi.lua b/[esx_addons]/esx_policejob/locales/fi.lua new file mode 100644 index 00000000..abf04045 --- /dev/null +++ b/[esx_addons]/esx_policejob/locales/fi.lua @@ -0,0 +1,151 @@ +Locales['fi'] = { + -- Cloakroom + ['cloakroom'] = 'vaatelokero', + ['citizen_wear'] = 'siviiliasu', + ['police_wear'] = 'poliisiasu', + ['gilet_wear'] = 'huomioliivi', + ['bullet_wear'] = 'luotiliivi', + ['no_outfit'] = 'täällä ei ole sinulle sopivaa asua', + ['open_cloackroom'] = 'paina ~INPUT_CONTEXT~ vaihtaaksesi ~y~vaatteita~s~.', + -- Armory + ['remove_object'] = 'ota esine', + ['deposit_object'] = 'talleta esine', + ['get_weapon'] = 'ota ase', + ['put_weapon'] = 'laita ase pois', + ['buy_weapons'] = 'osta aseita', + ['armory'] = 'asevarasto', + ['open_armory'] = 'paina ~INPUT_CONTEXT~ avataksesi asevarasto', + ['armory_owned'] = 'owned', + ['armory_free'] = 'free', + ['armory_item'] = '$%s', + ['armory_weapontitle'] = 'armory - Buy weapon', + ['armory_componenttitle'] = 'armory - Weapon attatchments', + ['armory_bought'] = 'you bought an ~y~%s~s~ for ~g~$%s~s~', + ['armory_money'] = 'you cannot afford that weapon', + ['armory_hascomponent'] = 'you have that attatchment equiped!', + ['get_weapon_menu'] = 'armory - Withdraw Weapon', + ['put_weapon_menu'] = 'armory - Store Weapon', + -- Vehicles + ['vehicle_menu'] = 'vehicle', + ['vehicle_blocked'] = 'all available spawn points are currently blocked!', + ['garage_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Vehicle Actions~s~.', + ['garage_title'] = 'vehicle Actions', + ['garage_stored'] = 'stored', + ['garage_notstored'] = 'not in garage', + ['garage_storing'] = 'we\'re attempting to remove the vehicle, make sure no players are around it.', + ['garage_has_stored'] = 'the vehicle has been stored in your garage', + ['garage_has_notstored'] = 'no nearby owned vehicles were found', + ['garage_notavailable'] = 'your vehicle is not stored in the garage.', + ['garage_blocked'] = 'there\'s no available spawn points!', + ['garage_empty'] = 'you dont have any vehicles in your garage.', + ['garage_released'] = 'your vehicle has been released from the garage.', + ['garage_store_nearby'] = 'there is no nearby vehicles.', + ['garage_storeditem'] = 'open garage', + ['garage_storeitem'] = 'store vehicle in garage', + ['garage_buyitem'] = 'vehicle shop', + ['garage_notauthorized'] = 'you\'re not authorized to buy this kind of vehicles.', + ['helicopter_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Helicopter Actions~s~.', + ['shop_item'] = '$%s', + ['vehicleshop_title'] = 'vehicle Shop', + ['vehicleshop_confirm'] = 'do you want to buy this vehicle?', + ['vehicleshop_bought'] = 'you have bought ~y~%s~s~ for ~r~$%s~s~', + ['vehicleshop_money'] = 'you cannot afford that vehicle', + ['vehicleshop_awaiting_model'] = 'the vehicle is currently ~g~DOWNLOADING & LOADING~s~ please wait', + ['confirm_no'] = 'no', + ['confirm_yes'] = 'yes', + -- Service + ['service_max'] = 'you cannot enter service, max officers in service: %s/%s', + ['service_not'] = 'you have not entered service! You\'ll have to get changed first.', + ['service_anonunce'] = 'service information', + ['service_in'] = 'you\'ve entered service, welcome!', + ['service_in_announce'] = 'operator ~y~%s~s~ has entered service!', + ['service_out'] = 'you have left service.', + ['service_out_announce'] = 'operator ~y~%s~s~ has left their service.', + -- Action Menu + ['citizen_interaction'] = 'siviilin vuorovaikutus', + ['vehicle_interaction'] = 'ajoneuvon vuorovaikutus', + ['object_spawner'] = 'objekti spawneri', + + ['id_card'] = 'henkilöllisyystodistus', + ['search'] = 'tutki', + ['handcuff'] = 'raudat On/Off', + ['drag'] = 'raahaa', + ['put_in_vehicle'] = 'laita ajoneuvoon', + ['out_the_vehicle'] = 'ota ulos ajoneuvosta', + ['fine'] = 'sakko', + ['unpaid_bills'] = 'hallinoi maksamattomia laskuja', + ['license_check'] = 'hallitse lisenssejä', + ['license_revoke'] = 'kumoa lisenssi', + ['license_revoked'] = 'sinun ~b~%s~s~ ~y~kumottiin~s~!', + ['licence_you_revoked'] = 'sinä kumosit ~b~%s~s~ mikä kuului henkilölle ~y~%s~s~', + ['no_players_nearby'] = 'ei pelaajia lähettyvillä', + ['being_searched'] = 'you are being ~y~searched~s~ by the ~b~Police~s~', + -- Vehicle interaction + ['vehicle_info'] = 'ajoneuvon tiedot', + ['pick_lock'] = 'tiirikoi ovet', + ['vehicle_unlocked'] = 'ajoneuvo ~g~Avattu~s~', + ['no_vehicles_nearby'] = 'ei ajoneuvoja lähettyvillä', + ['impound'] = 'takavarikoi ajoneuvo', + ['impound_prompt'] = 'paina ~INPUT_CONTEXT~ peruaksesi ~y~takavarikointi~s~', + ['impound_canceled'] = 'sinä peruit takavarikoinnin', + ['impound_canceled_moved'] = 'takavarikointi peruuntui koska ajoneuvo liikku', + ['impound_successful'] = 'takavarikoit ajoneuvon', + ['search_database'] = 'ajoneuvon tiedot', + ['search_database_title'] = 'ajoneuvon tiedot - etsi rekisterinumerolla', + ['search_database_error_invalid'] = 'tämä ~r~ei ole~s~ ~y~voimassa oleva~s~ rekisterinumero', + -- Traffic interaction + ['traffic_interaction'] = 'liikenteen vuorovaikutus', + ['cone'] = 'kartio', + ['barrier'] = 'este', + ['spikestrips'] = 'piikkimatto', + ['box'] = 'laatikko', + ['cash'] = 'rahalaatikko', + -- ID Card Menu + ['name'] = 'nimi: %s', + ['job'] = 'työ: %s', + ['sex'] = 'sukupuoli: %s', + ['dob'] = 'syntymäaika: %s', + ['height'] = 'pituus: %s', + ['bac'] = 'alkometri: %s', + ['unknown'] = 'tuntematon', + ['male'] = 'mies', + ['female'] = 'nainen', + -- Body Search Menu + ['guns_label'] = '--- Aseet ---', + ['inventory_label'] = '--- Reppu ---', + ['license_label'] = ' --- Lisenssit ---', + ['confiscate'] = 'takavarikoi %s', + ['confiscate_weapon'] = 'confiscate %s with %s bullets', + ['confiscate_inv'] = 'takavarikoi %sx %s', + ['confiscate_dirty'] = 'takavarikoi likainen raha: $%s', + ['you_confiscated'] = 'sinä takavarioit ~y~%sx~s~ ~b~%s~s~ pelaajalta ~b~%s~s~', + ['got_confiscated'] = '~y~%sx~s~ ~b~%s~s~ takavarikoitiin sinulta pelaajan ~y~%s~s~ toimesta', + ['you_confiscated_account'] = 'sinä takavarikoit ~g~$%s~s~ (%s) pelaajalta ~b~%s~s~', + ['got_confiscated_account'] = '~g~$%s~s~ (%s) takavarikoitiin sinulta pelaajan ~y~%s~s~ toimesta', + ['you_confiscated_weapon'] = 'sinä takavarikoit ~b~%s~s~ pelaajalta ~b~%s~s~ jossa oli ~o~%s~s~ panosta', + ['got_confiscated_weapon'] = 'sinun ~b~%s~s~ jossa oli ~o~%s~s~ panosta takavarikoitiin sinulta~y~%s~s~', + ['traffic_offense'] = 'liikenne rikokset', + ['minor_offense'] = 'lievät rikokset', + ['average_offense'] = 'keskisuuret rikokset', + ['major_offense'] = 'vakavat rikokset', + ['fine_total'] = 'sakko: %s', + --Vehicle Info Menu + ['plate'] = 'kilpi: %s', + ['owner_unknown'] = 'omistaja: Tuntematon', + ['owner'] = 'omistaja: %s', + --Boss Menu + ['open_bossmenu'] = 'paina ~INPUT_CONTEXT~ avataksesi valikon', + ['quantity_invalid'] = 'invalid quantity', + ['have_withdrawn'] = 'sinä otit varastosta ~y~%sx~s~ ~b~%s~s~', + ['have_deposited'] = 'sinä talletit varastoon ~y~%sx~s~ ~b~%s~s~', + ['quantity'] = 'määrä', + ['inventory'] = 'varasto', + ['police_stock'] = 'poliisin Varasto', + -- Misc + ['remove_prop'] = 'paina ~INPUT_CONTEXT~ poistaaksesi objektin', + ['map_blip'] = 'poliisilaitos', + ['unrestrained_timer'] = 'tunnet kuinka hitaasti käsiraudat alkavat löystyä ja irtoavat', + -- Notifications + ['alert_police'] = 'hälyytys Poliisi', + ['phone_police'] = 'poliisi', +} \ No newline at end of file diff --git a/[esx_addons]/esx_policejob/locales/fr.lua b/[esx_addons]/esx_policejob/locales/fr.lua new file mode 100644 index 00000000..df9583c2 --- /dev/null +++ b/[esx_addons]/esx_policejob/locales/fr.lua @@ -0,0 +1,151 @@ +Locales['fr'] = { + -- Cloakroom + ['cloakroom'] = 'vestiaire', + ['citizen_wear'] = 'tenue Civil', + ['police_wear'] = 'tenue Policier', + ['gilet_wear'] = 'gilet orange', + ['bullet_wear'] = 'gilet pare-balles', + ['no_outfit'] = 'il n\'y a pas d\'uniforme à votre taille...', + ['open_cloackroom'] = 'appuyez sur ~INPUT_CONTEXT~ pour vous changer', + -- Armory + ['remove_object'] = 'prendre Objet', + ['deposit_object'] = 'déposer objet', + ['get_weapon'] = 'prendre Arme', + ['put_weapon'] = 'déposer Arme', + ['buy_weapons'] = 'acheter Armes', + ['armory'] = 'armurerie', + ['open_armory'] = 'appuyez sur ~INPUT_CONTEXT~ pour accéder à l\'armurerie', + ['armory_owned'] = 'possédé', + ['armory_free'] = 'gratuit', + ['armory_item'] = '$%s', + ['armory_weapontitle'] = 'armurerie - Acheter une arme', + ['armory_componenttitle'] = 'armurerie - Accessoires d\'armes', + ['armory_bought'] = 'vous achetez un ~y~%s~s~ pour ~g~$%s~s~', + ['armory_money'] = 'vous ne pouvez pas acheter cette arme', + ['armory_hascomponent'] = 'vous avez cet accessoire équipé!', + ['get_weapon_menu'] = 'armurerie - Retirer arme', + ['put_weapon_menu'] = 'armurerie - Stocker arme', + -- Vehicles + ['vehicle_menu'] = 'véhicule', + ['vehicle_blocked'] = 'tous les points de spawn sont bloqués!', + ['garage_prompt'] = 'appuyez sur ~INPUT_CONTEXT~ pour accéder aux ~y~Actions Véhicule~s~.', + ['garage_title'] = 'actions Véhicules', + ['garage_stored'] = 'rangé', + ['garage_notstored'] = 'sorti(e)', + ['garage_storing'] = 'tentative de suppression du véhicule, assurez-vous que personne ne soit autour.', + ['garage_has_stored'] = 'le véhicule a bien été rangé dans le garage', + ['garage_has_notstored'] = 'aucun véhicule dans le garage', + ['garage_notavailable'] = 'votre véhicule n\'est pas rangé dans le garage.', + ['garage_blocked'] = 'la sortie du garage est obstruée!', + ['garage_empty'] = 'vous n\'avez aucun véhicule dans le garage.', + ['garage_released'] = 'votre véhicule a été sorti.', + ['garage_store_nearby'] = 'aucun véhicule a proximité.', + ['garage_storeditem'] = 'ouvrir le garage', + ['garage_storeitem'] = 'ranger le véhicule', + ['garage_buyitem'] = 'magasin véhicule', + ['garage_notauthorized'] = 'vous n\'êtes pas autorisé à acheter ce type de véhicules.', + ['helicopter_prompt'] = 'appuyez sur ~INPUT_CONTEXT~ pour accéder aux ~y~Actions de l\'hélicoptère~s~.', + ['shop_item'] = '$%s', + ['vehicleshop_title'] = 'magasin véhicule', + ['vehicleshop_confirm'] = 'voulez-vous acheter ce véhicule?', + ['vehicleshop_bought'] = 'vous avez acheté ~y~%s~s~ pour ~r~$%s~s~', + ['vehicleshop_money'] = 'vous ne pouvez pas acheter ce véhicule', + ['vehicleshop_awaiting_model'] = 'le véhicule est actuellement en ~g~PRÉPARATION~s~ veuillez patienter', + ['confirm_no'] = 'non', + ['confirm_yes'] = 'oui', + -- Service + ['service_max'] = 'vous ne pouvez pas entrer en service, officiers en service: %s/%s', + ['service_not'] = 'vous n\'êtes pas en service! Vous devez d\'abord enfiler votre tenue.', + ['service_anonunce'] = 'prise de service', + ['service_in'] = 'vous êtes en service, bon courage!', + ['service_in_announce'] = 'l\'officier ~y~%s~s~ est entré en service!', + ['service_out'] = 'vous avez terminé votre service.', + ['service_out_announce'] = 'l\'officier ~y~%s~s~ a quitté son service.', + -- Action Menu + ['citizen_interaction'] = 'interaction citoyen', + ['vehicle_interaction'] = 'interaction véhicule', + ['object_spawner'] = 'placer objets', + + ['id_card'] = 'carte d\'identité', + ['search'] = 'fouiller', + ['handcuff'] = 'menotter / Démenotter', + ['drag'] = 'escorter', + ['put_in_vehicle'] = 'mettre dans véhicule', + ['out_the_vehicle'] = 'sortir du véhicule', + ['fine'] = 'Amende', + ['unpaid_bills'] = 'gérer les amendes impayées', + ['license_check'] = 'gérer les licences', + ['license_revoke'] = 'révoquer la licence', + ['license_revoked'] = 'votre ~b~%s~s~ a été ~y~révoqué~s~!', + ['licence_you_revoked'] = 'vous avez révoqué un ~b~%s~s~ qui appartenait à ~y~%s~s~', + ['no_players_nearby'] = 'aucun joueur à proximité', + ['being_searched'] = 'vous êtes ~y~recherché(e)~s~ par la ~b~Police~s~', + -- Vehicle interaction + ['vehicle_info'] = 'infos véhicule', + ['pick_lock'] = 'crocheter véhicule', + ['vehicle_unlocked'] = 'véhicule ~g~déverouillé~s~', + ['no_vehicles_nearby'] = 'aucun véhicule à proximité', + ['impound'] = 'véhicule en fourrière', + ['impound_prompt'] = 'appuyez sur ~INPUT_CONTEXT~ pour annuler la ~y~saisie du véhicule~s~', + ['impound_canceled'] = 'vous avez annulé la saisie', + ['impound_canceled_moved'] = 'la saisie a été annulée parce que le véhicule a déménagé', + ['impound_successful'] = 'vous avez saisi le véhicule', + ['search_database'] = 'vehicle information', + ['search_database_title'] = 'informations sur le véhicule - recherche avec numéro d\'enregistrement', + ['search_database_error_invalid'] = 'Ce n\'est ~r~pas~s~ un ~y~numéro d\'enregistrement valide~s~', + -- Traffic interaction + ['traffic_interaction'] = 'interaction routière', + ['cone'] = 'plot', + ['barrier'] = 'barrière', + ['spikestrips'] = 'herse', + ['box'] = 'caisse', + ['cash'] = 'caisse', + -- ID Card Menu + ['name'] = 'nom: %s', + ['job'] = 'métier: %s', + ['sex'] = 'sexe: %s', + ['dob'] = 'DDN: %s', + ['height'] = 'taille: %s', + ['bac'] = 'BAC: %s', + ['unknown'] = 'inconnu', + ['male'] = 'homme', + ['female'] = 'femme', + -- Body Search Menu + ['guns_label'] = '--- Armes ---', + ['inventory_label'] = '--- Inventaire ---', + ['license_label'] = ' --- Licenses ---', + ['confiscate'] = 'confisquer %s', + ['confiscate_weapon'] = 'confisqué %s avec %s balles', + ['confiscate_inv'] = 'confisquer %sx %s', + ['confiscate_dirty'] = 'confisquer argent sale: €%s', + ['you_confiscated'] = 'vous avez confisqué ~y~%sx~s~ ~b~%s~s~ à ~b~%s~s~', + ['got_confiscated'] = '~y~%sx~s~ ~b~%s~s~ ont été confisqués par ~y~%s~s~', + ['you_confiscated_account'] = 'vous avez confisqué ~g~$%s~s~ (%s) à ~b~%s~s~', + ['got_confiscated_account'] = '~g~$%s~s~ (%s) ont été confisqués par ~y~%s~s~', + ['you_confiscated_weapon'] = 'vous avez confisqué ~b~%s~s~ à ~b~%s~s~ avec ~o~%s~s~ balles', + ['got_confiscated_weapon'] = 'votre ~b~%s~s~ avec ~o~%s~s~ balles a été confisqué par ~y~%s~s~', + ['traffic_offense'] = 'code de la route', + ['minor_offense'] = 'délit mineur', + ['average_offense'] = 'délit moyen', + ['major_offense'] = 'délit grave', + ['fine_total'] = 'amende: %s', + -- Vehicle Info Menu + ['plate'] = 'n°: %s', + ['owner_unknown'] = 'propriétaire: Inconnu', + ['owner'] = 'propriétaire: %s', + -- Boss Menu + ['open_bossmenu'] = 'appuyez sur ~INPUT_CONTEXT~ pour ouvrir le menu', + ['quantity_invalid'] = 'quantité invalide', + ['have_withdrawn'] = 'vous avez retiré ~y~%sx~s~ ~b~%s~s~', + ['have_deposited'] = 'vous avez déposé ~y~%sx~s~ ~b~%s~s~', + ['quantity'] = 'quantité', + ['inventory'] = 'inventaire', + ['police_stock'] = 'coffre de la police', + -- Misc + ['remove_prop'] = 'appuyez sur ~INPUT_CONTEXT~ pour enlever l\'objet', + ['map_blip'] = 'Commissariat', + ['unrestrained_timer'] = 'vous sentez que vos menottes deviennent fragiles.', + -- Notifications + ['alert_police'] = 'alerte police', + ['phone_police'] = 'police', +} diff --git a/[esx_addons]/esx_policejob/locales/ko.lua b/[esx_addons]/esx_policejob/locales/ko.lua new file mode 100644 index 00000000..e85e9998 --- /dev/null +++ b/[esx_addons]/esx_policejob/locales/ko.lua @@ -0,0 +1,151 @@ +Locales['ko'] = { + -- Cloakroom + ['cloakroom'] = '라커룸', + ['citizen_wear'] = '민간인 복장', + ['police_wear'] = '경찰 복장', + ['gilet_wear'] = '오렌지 반사 재킷', + ['bullet_wear'] = '방탄 조끼', + ['no_outfit'] = '당신에게 맞는 유니폼이 없습니다!', + ['open_cloackroom'] = '~y~옷~s~을 변경하려면 ~INPUT_CONTEXT~를 누르십시오.', + -- Armory + ['remove_object'] = '오브젝트를 빼다', + ['deposit_object'] = '오브젝트를 두다', + ['get_weapon'] = '병기고에서 무기를 빼다', + ['put_weapon'] = '병기고에 무기를 넣다', + ['buy_weapons'] = '무기 구매', + ['armory'] = '병기고', + ['open_armory'] = '~INPUT_CONTEXT~를 눌러 ~y~병기고~s~에 접근하십시오.', + ['armory_owned'] = '소유', + ['armory_free'] = '자유', + ['armory_item'] = '$%s', + ['armory_weapontitle'] = '병기고 - 무기 구매', + ['armory_componenttitle'] = '병기고 - 무기 부착물', + ['armory_bought'] = '당신은 ~g~$%s~s~에 ~y~%s~s~를 구매했습니다', + ['armory_money'] = '당신은 이 무기를 살 수 없습니다', + ['armory_hascomponent'] = '이 부착물이 장착되어 있습니다!', + ['get_weapon_menu'] = '병기고 - 무기 빼다', + ['put_weapon_menu'] = '병기고 - 무기 넣다', + -- Vehicles + ['vehicle_menu'] = '차량', + ['vehicle_blocked'] = '모든 스폰 지점이 차단되었습니다!', + ['garage_prompt'] = '~INPUT_CONTEXT~를 눌러 ~y~차량 동작~s~에 액세스하십시오.', + ['garage_title'] = '차량 행동', + ['garage_stored'] = '저장됨', + ['garage_notstored'] = '차고가 아님', + ['garage_storing'] = '차량을 제거하려고 합니다. 주변에 아무도 없는지 확인하십시오.', + ['garage_has_stored'] = '차량이 차고에 보관되었습니다', + ['garage_has_notstored'] = '차고에 차량이 없습니다', + ['garage_notavailable'] = '차량이 차고에 저장되어 있지 않습니다', + ['garage_blocked'] = '차고 출구가 막혔습니다!', + ['garage_empty'] = '차고에 차량이 없습니다.', + ['garage_released'] = '차량이 출시되었습니다', + ['garage_store_nearby'] = '주변에 차량이 없습니다.', + ['garage_storeditem'] = '차고 열기', + ['garage_storeitem'] = '차량 정리', + ['garage_buyitem'] = '차량 상점', + ['garage_notauthorized'] = 'you\'re not authorized to buy this kind of vehicles.', + ['helicopter_prompt'] = '~y~헬리콥터 동작~s~에 액세스하려면 ~INPUT_CONTEXT~를 누릅니다.', + ['shop_item'] = '$%s', + ['vehicleshop_title'] = '차량 판매점', + ['vehicleshop_confirm'] = '이 차량을 사고 싶습니까?', + ['vehicleshop_bought'] = '당신은 ~r~$%s~s~에 ~y~%s~s~를 구매했습니다', + ['vehicleshop_money'] = '이 차량을 살 수 없습니다', + ['vehicleshop_awaiting_model'] = '차량이 현재 ~g~다운로드 및 로딩중입니다~s~. 잠시만 기다려주십시오', + ['confirm_no'] = '아니요', + ['confirm_yes'] = '예', + -- Service + ['service_max'] = '서비스에 진입 할 수 없습니다. 최대 임원 : %s/%s', + ['service_not'] = '당신은 서비스를 입력하지 않았습니다! 먼저 변경해야합니다.', + ['service_anonunce'] = '서비스 정보', + ['service_in'] = '당신은 서비스에 들어갔다, 환영합니다!', + ['service_in_announce'] = '~y~%s~s~가 서비스에 들어 왔습니다!', + ['service_out'] = '당신은 서비스를 떠났습니다.', + ['service_out_announce'] = '~y~%s~s~가 서비스를 떠났습니다.', + -- Action Menu + ['citizen_interaction'] = '시민 상호 작용', + ['vehicle_interaction'] = '차량 상호 작용', + ['object_spawner'] = '오브젝트 Spawner', + + ['id_card'] = '신분증', + ['search'] = '수색', + ['handcuff'] = '수갑을 채우다 / 수갑을 풀어주다', + ['drag'] = '호위', + ['put_in_vehicle'] = '차량에 넣다', + ['out_the_vehicle'] = '차량을 끌다', + ['fine'] = '벌금', + ['unpaid_bills'] = '미지급 벌금 관리', + ['license_check'] = '라이선스 관리', + ['license_revoke'] = '라이선스 취소', + ['license_revoked'] = '~b~%s~s~는 ~y~취소~s~입니다!', + ['licence_you_revoked'] = '~y~%s~s~에 속하는 ~b~%s~s~를 취소했습니다.', + ['no_players_nearby'] = '근처에 플레이어가 없습니다!', + ['being_searched'] = '~b~경찰~s~이 당신을 ~y~수색~s~', + -- Vehicle interaction + ['vehicle_info'] = '차량 정보', + ['pick_lock'] = '차량 락픽', + ['vehicle_unlocked'] = '차량 ~g~잠금 해제~s~', + ['no_vehicles_nearby'] = '근처에 차량이 없습니다', + ['impound'] = '차량을 견인하다', + ['impound_prompt'] = '~y~견인~s~을 취소하려면 ~INPUT_CONTEXT~를 누릅니다', + ['impound_canceled'] = '당신은 견인을 취소했습니다', + ['impound_canceled_moved'] = '차량이 움직였기 때문에 견인이 취소되었습니다', + ['impound_successful'] = '당신은 차량을 견인했습니다', + ['search_database'] = '차량 정보', + ['search_database_title'] = '차량 정보 - 등록번호로 검색', + ['search_database_error_invalid'] = '~y~유효한~s~ 등록 번호가 ~r~아닙니다.~s~', + -- Traffic interaction + ['traffic_interaction'] = '교통 상호 작용', + ['cone'] = '원뿔', + ['barrier'] = '장벽', + ['spikestrips'] = '스파이크 스트립', + ['box'] = '상자', + ['cash'] = '현금 상자', + -- ID Card Menu + ['name'] = '이름: %s', + ['job'] = '직업: %s', + ['sex'] = '성별: %s', + ['dob'] = '생일: %s', + ['height'] = '키: %s', + ['bac'] = '혈중 알코올 농도: %s', + ['unknown'] = '알 수 없는', + ['male'] = '남자', + ['female'] = '여자', + -- Body Search Menu + ['guns_label'] = '--- 총 ---', + ['inventory_label'] = '--- 인벤토리 ---', + ['license_label'] = ' --- 라이선스 ---', + ['confiscate'] = '%s 을 압수', + ['confiscate_weapon'] = '%s 와 %s 총알을 압수', + ['confiscate_inv'] = '%sx %s 을 압수', + ['confiscate_dirty'] = '더러운 돈을 압수: $%s', + ['you_confiscated'] = '당신은 ~y~%sx~s~ ~b~%s~s~을 ~b~%s~s~에게서 압수했습니다', + ['got_confiscated'] = '~y~%sx~s~ ~b~%s~s~이(가) ~y~%s~s~에 압수되었습니다', + ['you_confiscated_account'] = '당신은 ~g~$%s~s~ (%s) 를 ~b~%s~s~ 에게서 압수했습니다.', + ['got_confiscated_account'] = '~g~$%s~s~ (%s) 이(가) ~y~%s~s~에 압수되었습니다', + ['you_confiscated_weapon'] = '당신은 ~b~%s~s~을 ~b~%s~s~에게서 압수하고 ~o~%s~s~ 총알도 압수했습니다.', + ['got_confiscated_weapon'] = '당신의 ~b~%s~s~와 ~o~%s~s~ 총알이 ~y~%s~s~에 의해 압수되었습니다.', + ['traffic_offense'] = '교통 위반', + ['minor_offense'] = '경범죄', + ['average_offense'] = '일반 범죄', + ['major_offense'] = '심각한 범죄', + ['fine_total'] = '벌금: %s', + -- Vehicle Info Menu + ['plate'] = '번호판: %s', + ['owner_unknown'] = '소유자: 알 수 없는', + ['owner'] = '소유자: %s', + -- Boss Menu + ['open_bossmenu'] = '~INPUT_CONTEXT~를 눌러 메뉴를 엽니다.', + ['quantity_invalid'] = '유효하지 않은 수량', + ['have_withdrawn'] = '당신은 ~y~%sx~s~ ~b~%s~s~ 뺐다 ', + ['have_deposited'] = '당신은 ~y~%sx~s~ ~b~%s~s~ 넣었다', + ['quantity'] = '수량', + ['inventory'] = '인벤토리', + ['police_stock'] = '경찰 자리', + -- Misc + ['remove_prop'] = '~INPUT_CONTEXT~를 눌러 오브젝트를 삭제하십시오.', + ['map_blip'] = '경찰서', + ['unrestrained_timer'] = '당신의 수갑이 천천히 풀리는 것을 느낍니다.', + -- Notifications + ['alert_police'] = '경찰 경보', + ['phone_police'] = '경찰', +} diff --git a/[esx_addons]/esx_policejob/locales/nl.lua b/[esx_addons]/esx_policejob/locales/nl.lua new file mode 100644 index 00000000..26dab1aa --- /dev/null +++ b/[esx_addons]/esx_policejob/locales/nl.lua @@ -0,0 +1,151 @@ +Locales['nl'] = { + -- Cloackroom + ['cloakroom'] = 'Kleedkamer', + ['citizen_wear'] = 'Burgerkleding', + ['police_wear'] = 'Politiekleding', + ['gilet_wear'] = 'Oranje reflecterend vest', + ['bullet_wear'] = 'Kogelwerend vest', + ['no_outfit'] = 'Er zijn geen passende uniformen voor jou!', + ['open_cloackroom'] = 'Druk op ~INPUT_CONTEXT~ om je ~y~kleding~s~ aan te passen.', + -- Wapenkamer + ['remove_object'] = 'Haal item uit kluis', + ['deposit_object'] = 'Leg item in kluis', + ['get_weapon'] = 'Haal wapen uit wapenkamer', + ['put_weapon'] = 'Leg wapen in wapenkamer', + ['buy_weapons'] = 'Koop wapens', + ['armory'] = 'Wapenkamer', + ['open_armory'] = 'Druk op ~INPUT_CONTEXT~ om de ~y~Wapenkamer~s~ te openen.', + ['armory_owned'] = 'In Bezit', + ['armory_free'] = 'Gratis', + ['armory_item'] = '€%s', + ['armory_weapontitle'] = 'Wapenkamer - Koop wapen', + ['armory_componenttitle'] = 'Wapenkamer - Weapon attachments', + ['armory_bought'] = 'Je hebt een ~y~%s~s~ gekocht voor ~g~€%s~s~.', + ['armory_money'] = 'Je kan dit wap niet betalen.', + ['armory_hascomponent'] = 'je hebt dit weapon attachment al!', + ['get_weapon_menu'] = 'Wapenkamer - Pak wapen', + ['put_weapon_menu'] = 'Wapenkamer - Leg wapen weg', + -- Vehicles + ['vehicle_menu'] = 'Voertuig', + ['vehicle_blocked'] = 'Alle spawnpunten zijn geblokkeerd!', + ['garage_prompt'] = 'Druk op ~INPUT_CONTEXT~ om de ~y~Garage~s~ te openen.', + ['garage_title'] = 'Garage', + ['garage_stored'] = 'Beschikbaar', + ['garage_notstored'] = 'Niet in garage', + ['garage_storing'] = 'We proberen je voertuig weg te halen, zorg dat er niemand langs staat.', + ['garage_has_stored'] = 'Het voertuig is opgeslagen in de garage.', + ['garage_has_notstored'] = 'Er zijn geen voertuigen in de buurt gevonden.', + ['garage_notavailable'] = 'Je voertuig is niet opgeslagen in de garage.', + ['garage_blocked'] = 'Er zijn geen beschikbare spawnpunten!', + ['garage_empty'] = 'Je hebt geen voertuigen in je garage.', + ['garage_released'] = 'Je voertuig is uit de garage gehaald.', + ['garage_store_nearby'] = 'Er zijn geen voertuigen in de buurt gevonden.', + ['garage_storeditem'] = 'Open garage', + ['garage_storeitem'] = 'Zet voertuig in garage', + ['garage_buyitem'] = 'Voertuigwinkel', + ['garage_notauthorized'] = 'Je bent niet bevoegd dit type voertuigen te halen.', + ['helicopter_prompt'] = 'Druk op ~INPUT_CONTEXT~ om de ~y~Helikopter Garage~s~ te openen.', + ['shop_item'] = '€%s', + ['vehicleshop_title'] = 'Voertuigwinkel', + ['vehicleshop_confirm'] = 'Wil je dit voertuig kopen?', + ['vehicleshop_bought'] = 'Je hebt een ~y~%s~s~ gekocht voor ~r~€%s~s~.', + ['vehicleshop_money'] = 'Je kan dit voertuig niet betalen.', + ['vehicleshop_awaiting_model'] = 'Dit voertuig is momenteel aan het ~g~DOWNLOADEN & LADEN~s~, even geduld asjeblieft', + ['confirm_no'] = 'Nee', + ['confirm_yes'] = 'Ja', + -- Service + ['service_max'] = 'Je kan niet in dienst gaan, maximale aantal agenten in dienst: %s/%s', + ['service_not'] = 'Je bent niet in dienst! Kleed je eerst om.', + ['service_anonunce'] = 'Dienst Informatie', + ['service_in'] = 'Je bent nu in dienst, welkom!', + ['service_in_announce'] = 'Agent ~y~%s~s~ is nu in dienst!', + ['service_out'] = 'Je bent nu uit dienst, fijne dag.', + ['service_out_announce'] = 'Agent ~y~%s~s~ is nu niet meer in dienst.', + -- Action Menu + ['citizen_interaction'] = 'Burger Interacties', + ['vehicle_interaction'] = 'Voertuig Interacties', + ['object_spawner'] = 'Object Interacties', + + ['id_card'] = 'Identiteitsbewijs', + ['search'] = 'Fouilleren', + ['handcuff'] = 'Boeien / Ontboeien', + ['drag'] = 'Meenemen', + ['put_in_vehicle'] = 'Zet in voertuig', + ['out_the_vehicle'] = 'Haal uit voertuig', + ['fine'] = 'Boete opleggen', + ['unpaid_bills'] = 'Openstaande boetes bekijken', + ['license_check'] = 'Rijbewijzen beheren', + ['license_revoke'] = 'Rijbewijs invorderen', + ['license_revoked'] = 'Je ~b~%s~s~ is ~y~ingevorderd~s~!', + ['licence_you_revoked'] = 'Je hebt een ~b~%s~s~ van ~y~%s~s~ ingevorderd.', + ['no_players_nearby'] = 'Geen spelers in de buurt!', + ['being_searched'] = 'Je wordt ~y~gefouilleerd~s~ door de ~b~Politie~s~', + -- Voertuig Interactie + ['vehicle_info'] = 'Voertuig Informatie', + ['pick_lock'] = 'Breek voertuig open', + ['vehicle_unlocked'] = 'Voertuig ~g~ontgrendeld~s~.', + ['no_vehicles_nearby'] = 'Er zijn geen voertuigen in de buurt gevonden.', + ['impound'] = 'Neem voertuig in beslag', + ['impound_prompt'] = 'Druk op ~INPUT_CONTEXT~ om de ~y~inbeslagname~s~ te annuleren.', + ['impound_canceled'] = 'Je hebt de inbeslagname geannuleerd.', + ['impound_canceled_moved'] = 'De inbeslagname is geannuleerd omdat het voertuig is bewogen.', + ['impound_successful'] = 'Het voertuig is in beslag genomen.', + ['search_database'] = 'Kenteken natrekken', + ['search_database_title'] = 'Voertuig informatie - zoek op kenteken', + ['search_database_error_invalid'] = 'Het ingevoerde kenteken is ~r~ongeldig~s~.', + -- Objecten + ['traffic_interaction'] = 'Verkeers Interacties', + ['cone'] = 'Pion', + ['barrier'] = 'Barriere', + ['box'] = 'Box', + ['fence'] = 'PD Hek', + ['cash'] = 'Pallet met geld', + -- ID Menu + ['name'] = 'Naam: %s', + ['job'] = 'Werk: %s', + ['sex'] = 'Geslacht: %s', + ['dob'] = 'Geboortedatum: %s', + ['height'] = 'Lengte: %s', + ['bac'] = 'BAC: %s', + ['unknown'] = 'onbekend', + ['male'] = 'man', + ['female'] = 'vrouw', + -- Fouilleren + ['guns_label'] = '--- Wapens ---', + ['inventory_label'] = '--- Inventaris ---', + ['license_label'] = ' --- Papieren ---', + ['confiscate'] = 'Neem %s in beslag', + ['confiscate_weapon'] = 'Neem een %s met %s kogels in beslag', + ['confiscate_inv'] = 'Neem %sx %s in beslag', + ['confiscate_dirty'] = 'Neem zwartgeld in beslag: €%s', + ['you_confiscated'] = 'Je hebt ~y~%sx~s~ ~b~%s~s~ van ~b~%s~s~ in beslag genomen.', + ['got_confiscated'] = '~y~%sx~s~ ~b~%s~s~ is in beslag genomen door ~y~%s~s~.', + ['you_confiscated_account'] = 'Je hebt ~g~€%s~s~ (%s) van ~b~%s~s~ in beslag genomen.', + ['got_confiscated_account'] = '~g~€%s~s~ (%s) is in beslag genomen door ~y~%s~s~.', + ['you_confiscated_weapon'] = 'Je hebt een ~b~%s~s~ van ~b~%s~s~ met ~o~%s~s~ kogels in beslag genomen.', + ['got_confiscated_weapon'] = 'Je ~b~%s~s~ met ~o~%s~s~ kogels is in beslag genomen door ~y~%s~s~.', + ['traffic_offense'] = 'Verkeersovertreding', + ['minor_offense'] = 'Kleine overtreding', + ['average_offense'] = 'Gemiddelde overtreding', + ['major_offense'] = 'Grote overtreding', + ['fine_total'] = 'Boete: %s', + -- Voertuig Informatie + ['plate'] = 'Kenteken: %s', + ['owner_unknown'] = 'Eigenaar: Onbekend', + ['owner'] = 'Eigenaar: %s', + -- Boss Menu + ['open_bossmenu'] = 'Druk op ~INPUT_CONTEXT~ om het menu te openen.', + ['quantity_invalid'] = 'Ongeldig aantal', + ['have_withdrawn'] = 'Je hebt ~y~%sx~s~ ~b~%s~s~ gepakt.', + ['have_deposited'] = 'Je hebt ~y~%sx~s~ ~b~%s~s~ weg gelegt.', + ['quantity'] = 'Aantal', + ['inventory'] = 'Inventaris', + ['police_stock'] = 'Politie Voorraad', + -- Misc + ['remove_prop'] = 'Druk op ~INPUT_CONTEXT~ om dit object te verwijderen.', + ['map_blip'] = 'Politiebureau', + ['unrestrained_timer'] = 'Je voelt je handboeien langzaam wegglijden.', + -- Notifications + ['alert_police'] = 'politie alert', + ['phone_police'] = 'politie', + } diff --git a/[esx_addons]/esx_policejob/locales/pl.lua b/[esx_addons]/esx_policejob/locales/pl.lua new file mode 100644 index 00000000..2f2a0479 --- /dev/null +++ b/[esx_addons]/esx_policejob/locales/pl.lua @@ -0,0 +1,151 @@ +Locales['pl'] = { + -- Cloakroom + ['cloakroom'] = 'szatnia', + ['citizen_wear'] = 'ubranie Cywilne', + ['police_wear'] = 'mundur', + ['gilet_wear'] = 'kamizelka odblaskowa', + ['bullet_wear'] = 'kamizelka kuloodporna', + ['no_outfit'] = 'brak ubrania', + ['open_cloackroom'] = 'naciśnij ~INPUT_CONTEXT~ aby zmienić ~y~ubranie~s~.', + -- Armory + ['remove_object'] = 'weź przedmiot', + ['deposit_object'] = 'zdeponuj przedmiot', + ['get_weapon'] = 'weź broń', + ['put_weapon'] = 'odłóż broń', + ['buy_weapons'] = 'kup Broń', + ['armory'] = 'zbrojownia', + ['open_armory'] = 'naciśnij ~INPUT_CONTEXT~ żeby uzyskać dostęp do zbrojowni', + ['armory_owned'] = 'owned', + ['armory_free'] = 'free', + ['armory_item'] = '$%s', + ['armory_weapontitle'] = 'armory - Buy weapon', + ['armory_componenttitle'] = 'armory - Weapon attatchments', + ['armory_bought'] = 'you bought an ~y~%s~s~ for ~g~$%s~s~', + ['armory_money'] = 'you cannot afford that weapon', + ['armory_hascomponent'] = 'you have that attatchment equiped!', + ['get_weapon_menu'] = 'armory - Withdraw Weapon', + ['put_weapon_menu'] = 'armory - Store Weapon', + -- Vehicles + ['vehicle_menu'] = 'vehicle', + ['vehicle_blocked'] = 'all available spawn points are currently blocked!', + ['garage_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Vehicle Actions~s~.', + ['garage_title'] = 'vehicle Actions', + ['garage_stored'] = 'stored', + ['garage_notstored'] = 'not in garage', + ['garage_storing'] = 'we\'re attempting to remove the vehicle, make sure no players are around it.', + ['garage_has_stored'] = 'the vehicle has been stored in your garage', + ['garage_has_notstored'] = 'no nearby owned vehicles were found', + ['garage_notavailable'] = 'your vehicle is not stored in the garage.', + ['garage_blocked'] = 'there\'s no available spawn points!', + ['garage_empty'] = 'you dont have any vehicles in your garage.', + ['garage_released'] = 'your vehicle has been released from the garage.', + ['garage_store_nearby'] = 'there is no nearby vehicles.', + ['garage_storeditem'] = 'open garage', + ['garage_storeitem'] = 'store vehicle in garage', + ['garage_buyitem'] = 'vehicle shop', + ['garage_notauthorized'] = 'you\'re not authorized to buy this kind of vehicles.', + ['helicopter_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Helicopter Actions~s~.', + ['shop_item'] = '$%s', + ['vehicleshop_title'] = 'vehicle Shop', + ['vehicleshop_confirm'] = 'do you want to buy this vehicle?', + ['vehicleshop_bought'] = 'you have bought ~y~%s~s~ for ~r~$%s~s~', + ['vehicleshop_money'] = 'you cannot afford that vehicle', + ['vehicleshop_awaiting_model'] = 'the vehicle is currently ~g~DOWNLOADING & LOADING~s~ please wait', + ['confirm_no'] = 'no', + ['confirm_yes'] = 'yes', + -- Service + ['service_max'] = 'nie możesz wejść do służby, maksymalna liczba oficerów w służbie: %s/%s', + ['service_not'] = 'nie rozpoczynasz służby! Najpierw musisz się przebrać.', + ['service_anonunce'] = 'informacje o służbie', + ['service_in'] = 'rozpoczynasz służbe, Witaj!', + ['service_in_announce'] = 'operator ~y~%s~s~ rozpoczyna służbę!', + ['service_out'] = 'opuszczasz służbę.', + ['service_out_announce'] = 'operator ~y~%s~s~ opuszcza służbe.', + -- Action Menu + ['citizen_interaction'] = 'interakcja z cywilami', + ['vehicle_interaction'] = 'interakcja z pojazdami', + ['object_spawner'] = 'przedmioty do postawienia', + + ['id_card'] = 'dowód osobisty', + ['search'] = 'przeszukaj', + ['handcuff'] = 'zakuj/Rozkuj Kajdanki ', + ['drag'] = 'przemieść podejrzanego', + ['put_in_vehicle'] = 'wsadź do pojazdu', + ['out_the_vehicle'] = 'wyciągnij z pojazdu', + ['fine'] = 'mandaty', + ['unpaid_bills'] = 'zarządzaj niezapłaconymi rachunkami', + ['license_check'] = 'zarządzaj licencjami', + ['license_revoke'] = 'unieważnij licencje', + ['license_revoked'] = 'twoja licencja ~b~%s~s~ została ~y~unieważniona~s~!', + ['licence_you_revoked'] = 'unieważniasz ~b~%s~s~ które należały do ~y~%s~s~', + ['no_players_nearby'] = 'brak graczy w pobliżu', + ['being_searched'] = 'you are being ~y~searched~s~ by the ~b~Police~s~', + -- Vehicle interaction + ['vehicle_info'] = 'informacje o pojeździe', + ['pick_lock'] = 'odblokuj pojazd', + ['vehicle_unlocked'] = 'pojazd ~g~Odblokowany~s~', + ['no_vehicles_nearby'] = 'brak pojazdu w pobliżu', + ['impound'] = 'zajmij pojazd', + ['impound_prompt'] = 'naciśnij ~INPUT_CONTEXT~ żeby unieważnić ~y~zajęcie~s~', + ['impound_canceled'] = 'unieważniasz zajęcie', + ['impound_canceled_moved'] = 'zajęcie zostało anulowane, ponieważ pojazd przemieścił się', + ['impound_successful'] = 'zajmujesz pojazd', + ['search_database'] = 'informacje o pojeździe', + ['search_database_title'] = 'informacjeo pojeździe - przeszukaj używając numeru rejestracyjnego', + ['search_database_error_invalid'] = 'to ~r~nie~s~ jest ~y~poprawny~s~ rnumer rejestracyjny', + -- Traffic interaction + ['traffic_interaction'] = 'interakcje dla ruchu drogowego', + ['cone'] = 'pachołek', + ['barrier'] = 'barierka', + ['spikestrips'] = 'kolczatka', + ['box'] = 'pudła', + ['cash'] = 'paleta z pieniędzmi', + -- ID Card Menu + ['name'] = 'name: %s', + ['job'] = 'praca: %s', + ['sex'] = 'płeć: %s', + ['dob'] = 'data urodzenia: %s', + ['height'] = 'wzrost: %s', + ['bac'] = 'BAC: %s', + ['unknown'] = 'nieznany', + ['male'] = 'mężczyzna', + ['female'] = 'kobieta', + -- Body Search Menu + ['guns_label'] = '--- Bronie ---', + ['inventory_label'] = '--- Ekwipunek ---', + ['license_label'] = ' --- Licenses ---', + ['confiscate'] = 'skonfiskuj %s', + ['confiscate_weapon'] = 'skonfiskuj %s z %s kulami', + ['confiscate_inv'] = 'skonfiskuj %s x %s', + ['confiscate_dirty'] = 'skonfiskuj brudne pieniądze: $%s', + ['you_confiscated'] = 'skonfiskowałeś ~y~%sx~s~ ~b~%s~s~ od ~b~%s~s~', + ['got_confiscated'] = '~y~%sx~s~ ~b~%s~s~ zostały skonfiskowane przez ~y~%s~s~', + ['you_confiscated_account'] = 'skonfiskowałeś ~g~%s$~s~ (%s) od ~b~%s~s~', + ['got_confiscated_account'] = '~g~%s$~s~ (%s) zostały skonfiskowane przez ~y~%s~s~', + ['you_confiscated_weapon'] = 'skonfiskowałeś ~b~%s~s~ od ~b~%s~s~ z ~o~%s~s~ pociskami', + ['got_confiscated_weapon'] = 'twój ~b~%s~s~ z ~o~%s~s~ kulami został skonfiskowany przez ~y~%s~s~', + ['traffic_offense'] = 'wykroczenia drogowe', + ['minor_offense'] = 'niewielkie wykroczenia', + ['average_offense'] = 'średnie wykroczenia', + ['major_offense'] = 'duże wykroczenia', + ['fine_total'] = 'mandat: %s', + -- Vehicle Info Menu + ['plate'] = 'tablica rejestracyjna: %s', + ['owner_unknown'] = 'właściciel: Nieznany', + ['owner'] = 'właściciel: %s', + -- Boss Menu + ['open_bossmenu'] = 'naciśnij ~INPUT_CONTEXT~ aby otworzyć menu', + ['quantity_invalid'] = 'nieprawidłowa ilość', + ['have_withdrawn'] = 'wyjmujesz z depozytu ~y~%sx~s~ ~b~%s~s~', + ['have_deposited'] = 'zdeponowano ~y~%sx~s~ ~b~%s~s~', + ['quantity'] = 'ilość', + ['inventory'] = 'ekwipunek', + ['police_stock'] = 'zapasy policji', + -- Misc + ['remove_prop'] = 'naciśnij ~INPUT_CONTEXT~ aby usunąć ten obiekt', + ['map_blip'] = 'komisariat Policji', + ['unrestrained_timer'] = 'czujesz, że twoje kajdanki powoli tracą przyczepność i znikają.', + -- Notifications + ['alert_police'] = 'ostrzeż policję', + ['phone_police'] = 'police', +} diff --git a/[esx_addons]/esx_policejob/locales/sv.lua b/[esx_addons]/esx_policejob/locales/sv.lua new file mode 100644 index 00000000..ba2c2179 --- /dev/null +++ b/[esx_addons]/esx_policejob/locales/sv.lua @@ -0,0 +1,151 @@ +Locales['sv'] = { + -- Cloakroom + ['cloakroom'] = 'omklädningsrum', + ['citizen_wear'] = 'civila kläder', + ['police_wear'] = 'polisuniform', + ['gilet_wear'] = 'reflektiv väst', + ['bullet_wear'] = 'skottsäker väst', + ['no_outfit'] = 'det finns ingen uniform som passar dig!', + ['open_cloackroom'] = 'tryck ~INPUT_CONTEXT~ för att välja ~y~kläder~s~.', + -- Armory + ['remove_object'] = 'ta ut objekt', + ['deposit_object'] = 'lägg in objekt', + ['get_weapon'] = 'ta ut vapen', + ['put_weapon'] = 'lägg in vapen', + ['buy_weapons'] = 'köp vapen', + ['armory'] = 'vapenförråd', + ['open_armory'] = 'tryck ~INPUT_CONTEXT~ för att komma åt ~y~vapenförrådet~s~.', + ['armory_owned'] = 'ägd', + ['armory_free'] = 'gratis', + ['armory_item'] = '%s SEK', + ['armory_weapontitle'] = 'vapenförråd - Köp vapen', + ['armory_componenttitle'] = 'vapenförråd - Vapen tillbehör', + ['armory_bought'] = 'du köpte ~y~%s~s~ för ~g~%s SEK~s~', + ['armory_money'] = 'du har inte råd med det vapnet', + ['armory_hascomponent'] = 'du har redan det tillbehöret!', + ['get_weapon_menu'] = 'vapenförråd - Ta ut vapen', + ['put_weapon_menu'] = 'vapenförråd - Spara vapen', + -- Vehicles + ['vehicle_menu'] = 'fordon', + ['vehicle_blocked'] = 'det finns ingen tillgänglig plats att ställa ut fordonet på!', + ['garage_prompt'] = 'tryck ~INPUT_CONTEXT~ för att komma åt ~y~garaget~s~.', + ['garage_title'] = 'garage', + ['garage_stored'] = 'inställt', + ['garage_notstored'] = 'uttaget', + ['garage_storing'] = 'vi håller på att ställa in ditt fordon, se till att ingen är i närheten.', + ['garage_has_stored'] = 'fordonet har ställts in i garaget', + ['garage_has_notstored'] = 'inget ägt fordon finns i närheten', + ['garage_notavailable'] = 'ditt fordon är inte inställt i ditt garage.', + ['garage_blocked'] = 'det finns ingen tillgänglig plats att ställa ut fordonet på!', + ['garage_empty'] = 'du har inga fordon i ditt garage.', + ['garage_released'] = 'ditt fordon har tagits ut från garaget.', + ['garage_store_nearby'] = 'det finns inget fordon i närheten.', + ['garage_storeditem'] = 'öppna garage', + ['garage_storeitem'] = 'ställ in fordon', + ['garage_buyitem'] = 'fordonshandel', + ['garage_notauthorized'] = 'du har inte tillgång till att köpa dessa fordon.', + ['helicopter_prompt'] = 'tryck ~INPUT_CONTEXT~ för att komma åt ~y~helikoptergaraget~s~.', + ['shop_item'] = '%s SEK', + ['vehicleshop_title'] = 'fordonshandel', + ['vehicleshop_confirm'] = 'vill du köpa detta fordon?', + ['vehicleshop_bought'] = 'du köpte ~y~%s~s~ för ~g~%s SEK~s~', + ['vehicleshop_money'] = 'du har inte råd med detta fordon', + ['vehicleshop_awaiting_model'] = 'fordonet ~g~LADDAS NED OCH LADDAS IN~s~ var god vänta', + ['confirm_no'] = 'nej', + ['confirm_yes'] = 'ja', + -- Service + ['service_max'] = 'du kan inte gå tjänst, poliser i tjänst: %s/%s', + ['service_not'] = 'du är inte i tjänst! Byt om för att gå in i tjänst.', + ['service_anonunce'] = 'tjänsteinformation', + ['service_in'] = 'du deltog i tjänst, välkommen!', + ['service_in_announce'] = 'operatör ~y~%s~s~ har deltagit tjänst!', + ['service_out'] = 'du har lämnat tjänst.', + ['service_out_announce'] = 'operatör ~y~%s~s~ har lämnat deras tjänst.', + -- Action Menu + ['citizen_interaction'] = 'handlingar mot civila', + ['vehicle_interaction'] = 'handlingar på bilar', + ['object_spawner'] = 'ta fram ett objekt', + + ['id_card'] = 'ID-Kort', + ['search'] = 'sök igenom', + ['handcuff'] = 'handbojor', + ['drag'] = 'dra', + ['put_in_vehicle'] = 'sätt in i fordon', + ['out_the_vehicle'] = 'dra ut ur fordon', + ['fine'] = 'Ge böter', + ['unpaid_bills'] = 'se obetalda räkningar', + ['license_check'] = 'se licenser', + ['license_revoke'] = 'återkalla licenser', + ['license_revoked'] = 'ditt ~b~%s~s~ har blivit ~y~återkallat~s~!', + ['licence_you_revoked'] = 'du återkallade ett ~b~%s~s~ som tillhörde ~y~%s~s~', + ['no_players_nearby'] = 'det finns ingen i närheten', + ['being_searched'] = 'du blir ~y~visiterad~s~ av ~b~Polisen~s~', + -- Vehicle interaction + ['vehicle_info'] = 'fordon', + ['pick_lock'] = 'bryt upp fordon', + ['vehicle_unlocked'] = 'fordonet har ~g~låsts upp~s~', + ['no_vehicles_nearby'] = 'inga fordon i närheten', + ['impound'] = 'bärga fordonet', + ['impound_prompt'] = 'tryck ~INPUT_CONTEXT~ för att avbryta ~y~bärgningen~s~', + ['impound_canceled'] = 'du avbröt bärgningen', + ['impound_canceled_moved'] = 'bärgningen avbröts på grund av att fordonet har rört sig', + ['impound_successful'] = 'du har bärgat fordonet', + ['search_database'] = 'fordonsuppgifter', + ['search_database_title'] = 'fordonsuppgifter - sök med registreringsnummer', + ['search_database_error_invalid'] = 'det är ~r~inte~s~ ett ~y~giltigt~s~ registreringsnummer', + -- Traffic interaction + ['traffic_interaction'] = 'trafiksåtgärder', + ['cone'] = 'kon', + ['barrier'] = 'barriär', + ['spikestrips'] = 'spikmatta', + ['box'] = 'låda', + ['cash'] = 'låda med pengar', + -- ID Card Menu + ['name'] = 'namn: %s', + ['job'] = 'jobb: %s', + ['sex'] = 'kön: %s', + ['dob'] = 'födelsedatum: %s', + ['height'] = 'längd: %s', + ['bac'] = 'alkohol i blodet: %s', + ['unknown'] = 'okänt', + ['male'] = 'man', + ['female'] = 'kvinna', + -- Body Search Menu + ['guns_label'] = '--- Vapen ---', + ['inventory_label'] = '--- Inventory ---', + ['license_label'] = ' --- Licenser ---', + ['confiscate'] = 'beslagta %s', + ['confiscate_weapon'] = 'beslagta %s med %s skott', + ['confiscate_inv'] = 'beslagta %sx %s', + ['confiscate_dirty'] = 'beslagta svarta pengar: %s SEK', + ['you_confiscated'] = 'du beslagtog ~y~%sx~s~ ~b~%s~s~ från ~b~%s~s~', + ['got_confiscated'] = '~y~%sx~s~ ~b~%s~s~ beslagtogs av ~y~%s~s~', + ['you_confiscated_account'] = 'du beslagtog ~g~%s SEK~s~ (%s) från ~b~%s~s~', + ['got_confiscated_account'] = '~g~%s SEK~s~ (%s) beslagtogs av ~y~%s~s~', + ['you_confiscated_weapon'] = 'du beslagtog ~b~%s~s~ från ~b~%s~s~ med ~o~%s~s~ skott', + ['got_confiscated_weapon'] = 'din ~b~%s~s~ med ~o~%s~s~ skott beslagtogs av ~y~%s~s~', + ['traffic_offense'] = 'brott mot trafikregler', + ['minor_offense'] = 'mindre lagbrott', + ['average_offense'] = 'medel lagbrott', + ['major_offense'] = 'grovt lagbrott', + ['fine_total'] = 'böter: %s', + -- Vehicle Info Menu + ['plate'] = 'reg nummer: %s', + ['owner_unknown'] = 'ägare: Okänt', + ['owner'] = 'ägare: %s', + -- Boss Menu + ['open_bossmenu'] = 'tryck ~INPUT_CONTEXT~ för att öppna menyn', + ['quantity_invalid'] = 'otillgängligt antal', + ['have_withdrawn'] = 'du har tagit ut ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'du har lagrat ~y~x%s~s~ ~b~%s~s~', + ['quantity'] = 'antal', + ['inventory'] = 'förråd', + ['police_stock'] = 'polisförråd', + -- Misc + ['remove_prop'] = 'tryck ~INPUT_CONTEXT~ för att ta bort objektet', + ['map_blip'] = 'polisstation', + ['unrestrained_timer'] = 'dina handklovar har försvunnit', + -- Notifications + ['alert_police'] = 'meddela polisen', + ['phone_police'] = 'polisen', +} diff --git a/[esx_addons]/esx_policejob/locales/tr.lua b/[esx_addons]/esx_policejob/locales/tr.lua new file mode 100644 index 00000000..21a0e1a6 --- /dev/null +++ b/[esx_addons]/esx_policejob/locales/tr.lua @@ -0,0 +1,151 @@ +Locales['tr'] = { + -- Cloakroom + ['cloakroom'] = 'kıyafet Odası', + ['citizen_wear'] = 'sivil kıyafet', + ['police_wear'] = 'polis kıyafeti', + ['gilet_wear'] = 'turuncu ceket', + ['bullet_wear'] = 'kurşun geçirmez yelek', + ['no_outfit'] = ' üniforma yok!', + ['open_cloackroom'] = '~y~Kıyafetinizi~s~ değiştirmek için ~INPUT_CONTEXT~ tuşuna basın. ', + -- Armory + ['remove_object'] = 'obje Al', + ['deposit_object'] = 'obje Koy', + ['get_weapon'] = 'cephanelikten silah al', + ['put_weapon'] = 'cephaneliğe silah koy', + ['buy_weapons'] = 'silah satın al', + ['armory'] = 'cephanelik', + ['open_armory'] = '~y~Cephaneliğe~s~ erişmek için ~INPUT_CONTEXT~ tuşuna basın.', + ['armory_owned'] = 'sahipsin', + ['armory_free'] = 'bedava', + ['armory_item'] = '%s TL', + ['armory_weapontitle'] = 'cephanelik - Silah al', + ['armory_componenttitle'] = 'cephanelik - Silah eklentileri', + ['armory_bought'] = ' %s Lira Karşılığında %s satın aldın', + ['armory_money'] = 'yeteri kadar paran yok.', + ['armory_hascomponent'] = 'bu eklentiye zaten sahipsin !', + ['get_weapon_menu'] = 'cephanelik - Silah al', + ['put_weapon_menu'] = 'cephanelik - Silah koy', + -- Vehicles + ['vehicle_menu'] = 'araç', + ['vehicle_blocked'] = 'tüm Spawn Noktaları Bloke Edilmiş!', + ['garage_prompt'] = '~y~Araç eylemlerine ulaşmak için ~s~ ~INPUT_CONTEXT~ tuşuna basınız.', + ['garage_title'] = 'araç eylemleri', + ['garage_stored'] = 'garajda', + ['garage_notstored'] = 'garajda değil', + ['garage_storing'] = 'arac garaja koyuluyor ama, etrafınızda oyuncu olmadığına emin olun .', + ['garage_has_stored'] = 'araç garajına koyuldu', + ['garage_has_notstored'] = 'yakında sana ait araç yok', + ['garage_notavailable'] = 'aracınız garajda değil.', + ['garage_blocked'] = 'müsait araç çıkarma noktası yok!', + ['garage_empty'] = 'garajında bir araç yok.', + ['garage_released'] = 'aracını garajdan çıkardın.', + ['garage_store_nearby'] = 'yakında araç yok.', + ['garage_storeditem'] = 'garajı Aç', + ['garage_storeitem'] = 'aracı garaja koy', + ['garage_buyitem'] = 'araç Galerisi', + ['garage_notauthorized'] = 'galeriye erişim iznin yok', + ['helicopter_prompt'] = '~y~Helikopter eylemlerine~s~ erişmek için ~INPUT_CONTEXT~ tuşuna basınız.', + ['shop_item'] = '%s TL', + ['vehicleshop_title'] = 'araç galerisi', + ['vehicleshop_confirm'] = 'bu aracı satın almak istiyor musun?', + ['vehicleshop_bought'] = '%s lira Karşılığında %s Satın aldın ', + ['vehicleshop_money'] = 'bu araca paran yetmiyor', + ['vehicleshop_awaiting_model'] = 'araç ~g~Yükleniyor~s~ lütfen bekleyiniz', + ['confirm_no'] = 'hayır', + ['confirm_yes'] = 'evet', + -- Service + ['service_max'] = 'hizmete Giremezsin,Hizmette yeterli polis var: %s/%s', + ['service_not'] = 'hizmete Giremedin! İlk Önce Kıyafetlerini Değiştirmelisin.', + ['service_anonunce'] = 'hizmet Bilgisi', + ['service_in'] = 'hizmete Giriş Yaptın, Hoşgeldin!', + ['service_in_announce'] = 'operatör %s servise giriş yaptı!', + ['service_out'] = 'hizmetten Çıktın.', + ['service_out_announce'] = 'operatör %s servisten çıkış yaptı.', + -- Action Menu + ['citizen_interaction'] = 'vatandaş Etkileşimi', + ['vehicle_interaction'] = 'araç Etkileşimi', + ['object_spawner'] = 'obje Yerleştirici', + + ['id_card'] = 'kimlik Kartı', + ['search'] = 'ara', + ['handcuff'] = 'kelepçele / Kelepçeyi Çöz', + ['drag'] = 'taşı', + ['put_in_vehicle'] = 'araca Koy', + ['out_the_vehicle'] = 'araçtan Çıkar', + ['fine'] = 'ceza', + ['unpaid_bills'] = 'ödenmemiş Faturaları Kontrol Et', + ['license_check'] = 'lisansları Kontrol Et', + ['license_revoke'] = 'lisansa El Koy', + ['license_revoked'] = '~b~%s~s~ lisansın ~y~iptal edildi~s~!', + ['licence_you_revoked'] = '~b~%s~s~ adlı kullanıcıya ait ~y~%s~s~ adlı lisansına el koydun.', + ['no_players_nearby'] = 'yakında oyuncu yok!', + ['being_searched'] = 'üstün ~y~searched~s~ - ~b~Polis~s~ tarafından aranıyor', + -- Vehicle interaction + ['vehicle_info'] = 'araç Bilgisi', + ['pick_lock'] = 'aracın kilidini aç', + ['vehicle_unlocked'] = 'araç ~g~açıldı~s~', + ['no_vehicles_nearby'] = 'yakınlarda araç yok', + ['impound'] = 'araca el koy', + ['impound_prompt'] = 'el konulan aracı geri bırakmak için ~INPUT_CONTEXT~ tuşuna basın', + ['impound_canceled'] = 'el konulma kaldırıldı', + ['impound_canceled_moved'] = 'araç hareket ettiği için el koyma iptal edildi', + ['impound_successful'] = 'araca el koydun', + ['search_database'] = 'araç bilgileri', + ['search_database_title'] = 'araç bilgileri - araç kayıt numarasından ara', + ['search_database_error_invalid'] = 'bu doğru bir araç kayıt numarası değil', + -- Traffic interaction + ['traffic_interaction'] = 'traik işlemleri', + ['cone'] = 'koni', + ['barrier'] = 'bariyer', + ['spikestrips'] = 'emniyet şeridi', + ['box'] = 'kutu', + ['cash'] = 'para kurusu', + -- ID Card Menu + ['name'] = 'isim: %s', + ['job'] = 'meslek: %s', + ['sex'] = 'cinsiyet: %s', + ['dob'] = 'doğum Tarihi: %s', + ['height'] = 'boy: %s', + ['bac'] = 'BAC: %s', + ['unknown'] = 'bilinmiyor', + ['male'] = 'erkek', + ['female'] = 'kadın', + -- Body Search Menu + ['guns_label'] = '--- Silahlar ---', + ['inventory_label'] = '--- Envanter ---', + ['license_label'] = ' --- Lisanslar ---', + ['confiscate'] = 'el koy %s', + ['confiscate_weapon'] = 'el koyuldu %s ve %s mermi', + ['confiscate_inv'] = 'el koyuldu %sx %s', + ['confiscate_dirty'] = 'kara paraya el koyuldu: %s TL', + ['you_confiscated'] = '~b~%s~s~ adlı kişiden ~y~%sx~s~ ~b~%s~s~ aldın ', + ['got_confiscated'] = '~y~%s~s~ adlı kişi ~y~%sx~s~ ~b~%s~s~ eşyanı aldı', + ['you_confiscated_account'] = '~b~%s~s~ adlı oyuncunun ~g~%s TL~s~ (%s) kara parasına el konuldu', + ['got_confiscated_account'] = '~g~%s TL~s~ (%s) kara parana el konuldu ~y~%s~s~', + ['you_confiscated_weapon'] = '~b~%s~s~ adlı oyuncunun ~b~%s~s~ ve ~o~%s~s~ mermilerine el konuldu', + ['got_confiscated_weapon'] = '~b~%s~s~ ve ~o~%s~s~ mermilerine ~y~%s~s~ tarafından el konuldu', + ['traffic_offense'] = 'trafik cezaları', + ['minor_offense'] = 'küçük suç', + ['average_offense'] = 'ortalama suç', + ['major_offense'] = 'büyük suç', + ['fine_total'] = 'ceza: %s', + -- Vehicle Info Menu + ['plate'] = 'plaka: %s', + ['owner_unknown'] = 'sahibi: Bilinmiyor', + ['owner'] = 'sahibi: %s', + -- Boss Menu + ['open_bossmenu'] = 'menüyü açmak için ~INPUT_CONTEXT~ tuşuna basın', + ['quantity_invalid'] = 'miktar hatalı', + ['have_withdrawn'] = '~y~%sx~s~ ~b~%s~s~ çekildi', + ['have_deposited'] = '~y~%sx~s~ ~b~%s~s~ yatırıldı', + ['quantity'] = 'miktar', + ['inventory'] = 'envanter', + ['police_stock'] = 'polis Stoğu', + -- Misc + ['remove_prop'] = 'objeyi silmek için ~INPUT_CONTEXT~ tuşuna basın', + ['map_blip'] = 'polis Karakolu', + ['unrestrained_timer'] = 'ellerinin yavaşça çözüldüğünü hissediyorsun.', + -- Notifications + ['alert_police'] = 'polis Acil Durum', + ['phone_police'] = 'polis', + } diff --git a/[esx_addons]/esx_policejob/localization/de_esx_policejob.sql b/[esx_addons]/esx_policejob/localization/de_esx_policejob.sql new file mode 100644 index 00000000..92570ce4 --- /dev/null +++ b/[esx_addons]/esx_policejob/localization/de_esx_policejob.sql @@ -0,0 +1,89 @@ +USE `es_extended`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_police','Polizei',1) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_police','Polizei',1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_police', 'Polizei', 1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('police', 'Polizei') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('police',0,'recruit','Rekrut',20,'{}','{}'), + ('police',1,'officer','Officier',40,'{}','{}'), + ('police',2,'sergeant','Sergent',60,'{}','{}'), + ('police',3,'lieutenant','Lieutenant',85,'{}','{}'), + ('police',4,'boss','Commandant',100,'{}','{}') +; + +CREATE TABLE `fine_types` ( + `id` int NOT NULL AUTO_INCREMENT, + `label` varchar(255) DEFAULT NULL, + `amount` int DEFAULT NULL, + `category` int DEFAULT NULL, + + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +INSERT INTO `fine_types` VALUES ('1', 'Missbrauchen der Hupe', '30', '0'); +INSERT INTO `fine_types` VALUES ('2', 'Vorfahrtstraße missachtet', '40', '0'); +INSERT INTO `fine_types` VALUES ('3', 'Gegenverkehr', '250', '0'); +INSERT INTO `fine_types` VALUES ('4', 'Unbefugtes Wenden', '250', '0'); +INSERT INTO `fine_types` VALUES ('5', 'Off-Road fahren', '170', '0'); +INSERT INTO `fine_types` VALUES ('6', 'Sicherheitsrichtlinien missachtet', '30', '0'); +INSERT INTO `fine_types` VALUES ('7', 'Gefährliches halten', '150', '0'); +INSERT INTO `fine_types` VALUES ('8', 'Nicht erlaubtes parken', '70', '0'); +INSERT INTO `fine_types` VALUES ('9', 'Nicht respektieren des Rechtsfahrgebotes', '70', '0'); +INSERT INTO `fine_types` VALUES ('10', 'Nicht einhaltender Priorität eines Rettungsfahrzeuges', '90', '0'); +INSERT INTO `fine_types` VALUES ('11', 'Nicht angehalten nach Aufforderung', '105', '0'); +INSERT INTO `fine_types` VALUES ('12', 'Bei Rot über die Ampel', '130', '0'); +INSERT INTO `fine_types` VALUES ('13', 'gefährliches Überholmanöver', '100', '0'); +INSERT INTO `fine_types` VALUES ('14', 'Fahrzeug nicht Verkehrstauglich', '100', '0'); +INSERT INTO `fine_types` VALUES ('15', 'Fahren ohne Lizenz', '1500', '0'); +INSERT INTO `fine_types` VALUES ('16', 'Hit and Run', '800', '0'); +INSERT INTO `fine_types` VALUES ('17', 'zu schnell < 5 kmh', '90', '0'); +INSERT INTO `fine_types` VALUES ('18', 'zu schnell 5-15 kmh', '120', '0'); +INSERT INTO `fine_types` VALUES ('19', 'zu schnell 15-30 kmh', '180', '0'); +INSERT INTO `fine_types` VALUES ('20', 'zu schnell > 30 kmh', '300', '0'); +INSERT INTO `fine_types` VALUES ('21', 'Verkehrsbehinderung', '110', '1'); +INSERT INTO `fine_types` VALUES ('22', 'Nicht Benutzung öffentlicher Straßen', '90', '1'); +INSERT INTO `fine_types` VALUES ('23', 'Störung der öffentlichen Ordnung', '90', '1'); +INSERT INTO `fine_types` VALUES ('24', 'Polizeieinsatz behindern', '130', '1'); +INSERT INTO `fine_types` VALUES ('25', 'Beildigung an Zivilist', '75', '1'); +INSERT INTO `fine_types` VALUES ('26', 'Polizist geringschätzen', '110', '1'); +INSERT INTO `fine_types` VALUES ('27', 'verbale Bedrohung an Zivilist', '90', '1'); +INSERT INTO `fine_types` VALUES ('28', 'verbale Bedrohung an Polizist', '150', '1'); +INSERT INTO `fine_types` VALUES ('29', 'Illegale Demonstration', '250', '1'); +INSERT INTO `fine_types` VALUES ('30', 'versuchte Bestechung', '1500', '1'); +INSERT INTO `fine_types` VALUES ('31', 'Mit Messer in der Stadt bewaffnet', '120', '2'); +INSERT INTO `fine_types` VALUES ('32', 'Mit tötlicher Waffe bewaffnet', '300', '2'); +INSERT INTO `fine_types` VALUES ('33', 'Unbefugter Besitz einer Waffe (Standard-Lizenz)', '600', '2'); +INSERT INTO `fine_types` VALUES ('34', 'Illegale Waffe', '700', '2'); +INSERT INTO `fine_types` VALUES ('35', 'Einbruch/Aufbruch', '300', '2'); +INSERT INTO `fine_types` VALUES ('36', 'Autodiebstahl', '1800', '2'); +INSERT INTO `fine_types` VALUES ('37', 'Drogenverkauf', '1500', '2'); +INSERT INTO `fine_types` VALUES ('38', 'Drogen herstellen', '1500', '2'); +INSERT INTO `fine_types` VALUES ('39', 'Drogenbesitz', '650', '2'); +INSERT INTO `fine_types` VALUES ('40', 'Zivile Geisel genommen', '1500', '2'); +INSERT INTO `fine_types` VALUES ('41', 'Geiselnahme', '2000', '2'); +INSERT INTO `fine_types` VALUES ('42', 'Waghalsiges Lenken', '650', '2'); +INSERT INTO `fine_types` VALUES ('43', 'Ladenraub', '650', '2'); +INSERT INTO `fine_types` VALUES ('44', 'Bankraub', '1500', '2'); +INSERT INTO `fine_types` VALUES ('45', 'Schießen auf Zivilisten', '2000', '3'); +INSERT INTO `fine_types` VALUES ('46', 'Schießen auf Beamten', '2500', '3'); +INSERT INTO `fine_types` VALUES ('47', 'versuchterMord an Zivilisten', '3000', '3'); +INSERT INTO `fine_types` VALUES ('48', 'versuchter Mord an einem Beamten', '5000', '3'); +INSERT INTO `fine_types` VALUES ('49', 'Mord an Zivilisten', '10000', '3'); +INSERT INTO `fine_types` VALUES ('50', 'Mord an Beamten', '30000', '3'); +INSERT INTO `fine_types` VALUES ('51', 'versehentlicher Mord', '1800', '3'); +INSERT INTO `fine_types` VALUES ('52', 'Firmenbetrug', '2000', '2'); +; diff --git a/[esx_addons]/esx_policejob/localization/en_esx_policejob.sql b/[esx_addons]/esx_policejob/localization/en_esx_policejob.sql new file mode 100644 index 00000000..fbe587c0 --- /dev/null +++ b/[esx_addons]/esx_policejob/localization/en_esx_policejob.sql @@ -0,0 +1,90 @@ +USE `es_extended`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_police', 'Police', 1) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_police', 'Police', 1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_police', 'Police', 1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('police', 'Police') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('police',0,'recruit','Recruit',20,'{}','{}'), + ('police',1,'officer','Officer',40,'{}','{}'), + ('police',2,'sergeant','Sergeant',60,'{}','{}'), + ('police',3,'lieutenant','Lieutenant',85,'{}','{}'), + ('police',4,'boss','Chief',100,'{}','{}') +; + +CREATE TABLE `fine_types` ( + `id` int NOT NULL AUTO_INCREMENT, + `label` varchar(255) DEFAULT NULL, + `amount` int DEFAULT NULL, + `category` int DEFAULT NULL, + + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +INSERT INTO `fine_types` (label, amount, category) VALUES + ('Misuse of a horn', 30, 0), + ('Illegally Crossing a continuous Line', 40, 0), + ('Driving on the wrong side of the road', 250, 0), + ('Illegal U-Turn', 250, 0), + ('Illegally Driving Off-road', 170, 0), + ('Refusing a Lawful Command', 30, 0), + ('Illegally Stopping a Vehicle', 150, 0), + ('Illegal Parking', 70, 0), + ('Failing to Yield to the right', 70, 0), + ('Failure to comply with Vehicle Information', 90, 0), + ('Failing to stop at a Stop Sign ', 105, 0), + ('Failing to stop at a Red Light', 130, 0), + ('Illegal Passing', 100, 0), + ('Driving an illegal Vehicle', 100, 0), + ('Driving without a License', 1500, 0), + ('Hit and Run', 800, 0), + ('Exceeding Speeds Over < 5 mph', 90, 0), + ('Exceeding Speeds Over 5-15 mph', 120, 0), + ('Exceeding Speeds Over 15-30 mph', 180, 0), + ('Exceeding Speeds Over > 30 mph', 300, 0), + ('Impeding traffic flow', 110, 1), + ('Public Intoxication', 90, 1), + ('Disorderly conduct', 90, 1), + ('Obstruction of Justice', 130, 1), + ('Insults towards Civilans', 75, 1), + ('Disrespecting of an LEO', 110, 1), + ('Verbal Threat towards a Civilan', 90, 1), + ('Verbal Threat towards an LEO', 150, 1), + ('Providing False Information', 250, 1), + ('Attempt of Corruption', 1500, 1), + ('Brandishing a weapon in city Limits', 120, 2), + ('Brandishing a Lethal Weapon in city Limits', 300, 2), + ('No Firearms License', 600, 2), + ('Possession of an Illegal Weapon', 700, 2), + ('Possession of Burglary Tools', 300, 2), + ('Grand Theft Auto', 1800, 2), + ('Intent to Sell/Distrube of an illegal Substance', 1500, 2), + ('Frabrication of an Illegal Substance', 1500, 2), + ('Possession of an Illegal Substance ', 650, 2), + ('Kidnapping of a Civilan', 1500, 2), + ('Kidnapping of an LEO', 2000, 2), + ('Robbery', 650, 2), + ('Armed Robbery of a Store', 650, 2), + ('Armed Robbery of a Bank', 1500, 2), + ('Assault on a Civilian', 2000, 3), + ('Assault of an LEO', 2500, 3), + ('Attempt of Murder of a Civilian', 3000, 3), + ('Attempt of Murder of an LEO', 5000, 3), + ('Murder of a Civilian', 10000, 3), + ('Murder of an LEO', 30000, 3), + ('Involuntary manslaughter', 1800, 3), + ('Fraud', 2000, 2); +; diff --git a/[esx_addons]/esx_policejob/localization/es_esx_policejob.sql b/[esx_addons]/esx_policejob/localization/es_esx_policejob.sql new file mode 100644 index 00000000..ce3a5806 --- /dev/null +++ b/[esx_addons]/esx_policejob/localization/es_esx_policejob.sql @@ -0,0 +1,90 @@ +USE `es_extended`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_police', 'Policía', 1) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_police', 'Policía', 1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_police', 'Policía', 1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('police', 'Policía') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('police',0,'recruit','Recluta',20,'{}','{}'), + ('police',1,'officer','Oficial',40,'{}','{}'), + ('police',2,'sergeant','Sargento',60,'{}','{}'), + ('police',3,'lieutenant','Teniente',85,'{}','{}'), + ('police',4,'boss','Jefe',100,'{}','{}') +; + +CREATE TABLE `fine_types` ( + `id` int NOT NULL AUTO_INCREMENT, + `label` varchar(255) DEFAULT NULL, + `amount` int DEFAULT NULL, + `category` int DEFAULT NULL, + + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +INSERT INTO `fine_types` (label, amount, category) VALUES + ('Mal uso del claxon', 30, 0), + ('Cruzar indebidamente la línea continua', 40, 0), + ('Conducir por el lado incorrecto de la carretera', 250, 0), + ('Giro indebido', 250, 0), + ('Conducir indebidamente fuera de la carretera', 170, 0), + ('No hacer caso a una orden de un agente', 30, 0), + ('Detener el vehículo de forma incorrecta', 150, 0), + ('Aparcar en un lugar no habilitado', 70, 0), + ('No ceder al girar a la derecha', 70, 0), + ('No cumplir con los datos de tu vehículo', 90, 0), + ('No pararse en una señal de STOP', 105, 0), + ('No pararse en un semáforo cuando está en rojo', 130, 0), + ('Cruzar indebidamente', 100, 0), + ('Conducir un coche no permitido', 100, 0), + ('Conducir sin carnet de conducción', 1500, 0), + ('Chocar y darse a la fuga', 800, 0), + ('Exceder la velocidad permitida en 5 km/h', 90, 0), + ('Exceder la velocidad permitida entre 5 y 15 km/h', 120, 0), + ('Exceder la velocidad permitida entre 15 y 30 km/h', 180, 0), + ('Exceder la velocidad permitida más de 30 km/h', 300, 0), + ('Generar atasco en una carretera', 110, 1), + ('Intoxicación pública', 90, 1), + ('Conducta alocada', 90, 1), + ('Obstrucción a la justicia', 130, 1), + ('Insultos hacia civiles', 75, 1), + ('Insultos hacia un agente', 110, 1), + ('Amenaza verbar a un civil', 90, 1), + ('Amenaza verbal a un agente', 150, 1), + ('Dar información falsa', 250, 1), + ('Intento de corrupción', 1500, 1), + ('Tendencia de armas en los limites de la ciudad', 120, 2), + ('Tendencia de armas letales en los limites de la ciudad', 300, 2), + ('No tener licencia de armas', 600, 2), + ('Posesión de un arma ilegal', 700, 2), + ('Posesión de herramientas para robos', 300, 2), + ('Desorden público', 1800, 2), + ('Intento de venta o distribución de sustancias ilegales', 1500, 2), + ('Fabricación de sustancias ilegales', 1500, 2), + ('Posesión de sustancias ilegales', 650, 2), + ('Secuestro de un civil', 1500, 2), + ('Secuestro de un agente', 2000, 2), + ('Robo', 650, 2), + ('Robo armado a una tienda', 650, 2), + ('Robo armado a un banco', 1500, 2), + ('Asalto a un civil', 2000, 3), + ('Asalto a un agente', 2500, 3), + ('Intento de asesinato a un civil', 3000, 3), + ('Intento de asesinato a un agente', 5000, 3), + ('Asesinato de un civil', 10000, 3), + ('Asesinato de un policia', 30000, 3), + ('Homicidio involuntario', 1800, 3), + ('Fraude', 2000, 2); +; diff --git a/[esx_addons]/esx_policejob/localization/fi_esx_policejob.sql b/[esx_addons]/esx_policejob/localization/fi_esx_policejob.sql new file mode 100644 index 00000000..1a1be823 --- /dev/null +++ b/[esx_addons]/esx_policejob/localization/fi_esx_policejob.sql @@ -0,0 +1,90 @@ +USE `es_extended`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_police', 'Poliisi', 1) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_police', 'Poliisi', 1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_police', 'Poliisi', 1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('police', 'Poliisi') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('police',0,'recruit','Tulokas',20,'{}','{}'), + ('police',1,'officer','Konstaapeli',40,'{}','{}'), + ('police',2,'sergeant','Ylikonstaapeli',60,'{}','{}'), + ('police',3,'lieutenant','Kersantti',85,'{}','{}'), + ('police',4,'boss','Komentaja',100,'{}','{}') +; + +CREATE TABLE `fine_types` ( + `id` int NOT NULL AUTO_INCREMENT, + `label` varchar(255) DEFAULT NULL, + `amount` int DEFAULT NULL, + `category` int DEFAULT NULL, + + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +INSERT INTO `fine_types` (label, amount, category) VALUES + ('Äänimerkin väärinkäyttö', 30, 0), + ('Laiton jatkuvan linjan ylitys', 40, 0), + ('Ajaminen tien väärällä puolella', 250, 0), + ('Laiton U-käännös', 250, 0), + ('Laiton maastossa ajaminen', 170, 0), + ('Virkavallan käskyn laiminlyönti', 30, 0), + ('Laiton pysähtyminen', 150, 0), + ('Laiton parkkeeraus', 70, 0), + ('Väistöolovelvollisuuden laiminlyönti', 70, 0), + ('Väärän ajoneuvontiedon antaminen', 90, 0), + ('Stop merkin laiminlyönti', 105, 0), + ('Punaisten valojen laiminlyönti', 130, 0), + ('Laiton ohitus', 100, 0), + ('Laittomalla ajoneuvolla ajaminen', 100, 0), + ('Ajokortitta ajo', 1500, 0), + ('Yliajo', 800, 0), + ('Ylinopeus < 5 kmh', 90, 0), + ('Ylinopeus 5-15 kmh', 120, 0), + ('Ylinopeus 15-30 kmh', 180, 0), + ('Ylinopeus > 30 kmh', 300, 0), + ('Liikenteen pysäytys tahallisesti', 110, 1), + ('Julkinen päihtyminen', 90, 1), + ('Sopimaton käytös', 90, 1), + ('Oikeusjärjestelmän estäminen', 130, 1), + ('Siviilin loukkaaminen', 75, 1), + ('Virkavallan halventaminen', 110, 1), + ('Sanallainen uhkaus siviiliä kohtaan', 90, 1), + ('Sanallinen uhkaus virkavaltaa kohtaan', 150, 1), + ('Virheellisen tiedon antaminen', 250, 1), + ('Korruptioyritys', 1500, 1), + ('Aseella heiluminen kaupungin sisällä', 120, 2), + ('Tappavalla aseella heiluminen kaupungin sisällä', 300, 2), + ('Ei aselupaa', 600, 2), + ('Laittoman aseen hallusapito', 700, 2), + ('Murtotyökalujen hallussapito', 300, 2), + ('Autovarkaus', 1800, 2), + ('Tarkoitus myydä/levittää laitonta ainetta', 1500, 2), + ('Laittoman aineen valmistus', 1500, 2), + ('Laittoman aineen hallusapito ', 650, 2), + ('Siviilin kidnappaus', 1500, 2), + ('Virkavallan kidnappaus', 2000, 2), + ('Ryöstö', 650, 2), + ('Aseellinen kaupparyöstö', 650, 2), + ('Aseellinen pankkiryöstö', 1500, 2), + ('Siviiliä kohtaan kohdistunut hyökkäys', 2000, 3), + ('Virkavaltaa kohtaan kohdistunut hyökkäys', 2500, 3), + ('Siviilin murhanyritys', 3000, 3), + ('Virkavallan murhanyirtys', 5000, 3), + ('Siviilin murha', 10000, 3), + ('Virkavallan murha', 30000, 3), + ('Väkivaltainan tappo', 1800, 3), + ('Petos', 2000, 2); +; diff --git a/[esx_addons]/esx_policejob/localization/ko_esx_policejob.sql b/[esx_addons]/esx_policejob/localization/ko_esx_policejob.sql new file mode 100644 index 00000000..6e890e7f --- /dev/null +++ b/[esx_addons]/esx_policejob/localization/ko_esx_policejob.sql @@ -0,0 +1,90 @@ +USE `es_extended`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_police', '경찰', 1) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_police', '경찰', 1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_police', '경찰', 1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('police', '경찰') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('police',0,'recruit','순경',20,'{}','{}'), + ('police',1,'officer','경장',40,'{}','{}'), + ('police',2,'sergeant','경사',60,'{}','{}'), + ('police',3,'lieutenant','경위',85,'{}','{}'), + ('police',4,'boss','경찰국장',100,'{}','{}') +; + +CREATE TABLE `fine_types` ( + `id` int NOT NULL AUTO_INCREMENT, + `label` varchar(255) DEFAULT NULL, + `amount` int DEFAULT NULL, + `category` int DEFAULT NULL, + + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +INSERT INTO `fine_types` (label, amount, category) VALUES + ('경적 남용', 30, 0), + ('연속으로 라인을 넘음', 40, 0), + ('역주행', 250, 0), + ('불법 U턴', 250, 0), + ('불법적인 오프로드 운전', 170, 0), + ('공무원 명령 미준수', 30, 0), + ('불법적으로 차량 정지', 150, 0), + ('불법 주차', 70, 0), + ('오른쪽으로 양보하지 않음', 70, 0), + ('등록되지 않은 차량', 90, 0), + ('정지선 지키지 않음', 105, 0), + ('빨간불에서 멈추지 않음', 130, 0), + ('위험한 추월', 100, 0), + ('불법 차량 운전', 100, 0), + ('무면허 운전', 1500, 0), + ('뺑소니', 800, 0), + ('5 km 이상 과속', 90, 0), + ('5-15 km 과속', 120, 0), + ('15-30 km 과속', 180, 0), + ('30 km 이상 과속', 300, 0), + ('교통방해', 110, 1), + ('공공질서 문제', 90, 1), + ('무질서한 행동', 90, 1), + ('공무집행 방해', 130, 1), + ('민간인에 대한 모욕', 75, 1), + ('공무원에 대한 모욕', 110, 1), + ('민간인에 대한 언어폭력', 90, 1), + ('공무원에 대한 언어폭력', 150, 1), + ('허위 정보 제공', 250, 1), + ('부패 시도', 1500, 1), + ('도시에서 무기 사용', 120, 2), + ('도시에서 위험한 무기 사용', 300, 2), + ('총기 면허 없음', 600, 2), + ('불법 무기 소지', 700, 2), + ('절도 도구 소지', 300, 2), + ('차량 절도', 1800, 2), + ('마약 판매/분배', 1500, 2), + ('마약 제조', 1500, 2), + ('마약 소지 ', 650, 2), + ('민간인 납치', 1500, 2), + ('공무원 납치', 2000, 2), + ('강도', 650, 2), + ('상점의 무장 강도', 650, 2), + ('은행의 무장 강도', 1500, 2), + ('민간인에 대한 폭행', 2000, 3), + ('공무원에 대한 폭행', 2500, 3), + ('민간인 살인 시도', 3000, 3), + ('공무원 살인 시도', 5000, 3), + ('민간인 살인', 10000, 3), + ('공무원 살인', 30000, 3), + ('우발적 살인', 1800, 3), + ('사기', 2000, 2); +; diff --git a/[esx_addons]/esx_policejob/localization/nl_esx_policejob.lua b/[esx_addons]/esx_policejob/localization/nl_esx_policejob.lua new file mode 100644 index 00000000..7862f791 --- /dev/null +++ b/[esx_addons]/esx_policejob/localization/nl_esx_policejob.lua @@ -0,0 +1,64 @@ +USE `es_extended`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_police', 'Politie', 1) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_police', 'Politie', 1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_police', 'Politie', 1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('police', 'Politie') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('police',0,'aspirant','Aspirant',0,'{}','{}'), + ('police',1,'surveillant','Surveillant',0,'{}','{}'), + ('police',2,'agent','Agent',0,'{}','{}'), + ('police',3,'hoofdagent','Hoofdagent',0,'{}','{}'), + ('police',4,'brigadier','Brigadier',0,'{}','{}'), + ('police',5,'inspecteur','Inspecteur',0,'{}','{}'), + ('police',6,'hoofdinspecteur','Hoofdinspecteur',0,'{}','{}'), + ('police',7,'commissaris','Commissaris',0,'{}','{}'), + ('police',8,'hoofdcommissaris','Hoofdcommissaris',0,'{}','{}'), + ('police',9,'boss','Eerste Hoofdcommissaris',0,'{}','{}') +; + +CREATE TABLE `fine_types` ( + `id` int NOT NULL AUTO_INCREMENT, + `label` varchar(255) DEFAULT NULL, + `amount` int DEFAULT NULL, + `category` int DEFAULT NULL, + + PRIMARY KEY (`id`) +); + +INSERT INTO `fine_types` (label, amount, category) VALUES + ('Onnodig claxoneren', 90, 0), + ('Rijden over een doorgetrokken streep', 240, 0), + ('Tegen het verkeer in rijden', 140, 0), + ('Negeren keerverbod (u-turn)', 140, 0), + ('Niet opvolgen aanwijzing van bevoegd ambtenaar', 110, 0), + ('Fout parkeren', 95, 0), + ('Verkeerd voorsorteren', 240, 0), + ('Rijden met een WOK status ', 300, 0), + ('Door rood rijden', 240, 0), + ('Rijden zonder rijbewijs', 340, 0), + ('Snelheid overtreding < 10km', 112, 0), + ('Snelheid overtreding 10 - 20km', 202, 0), + ('Snelheid overtreding 20 - 50km', 670, 0), + ('Snelheid overtreding > 50km', 1000, 0), + ('Openbare dronkenschap', 415, 1), + ('Wanordelijk gedrag', 500, 1), + ('Hulpdiensten hinderen', 700, 1), + ('Belediging ambtenaar in functie', 200, 1), + ('Bedreiging', 980, 1), + ('Illegaal wapen bezit', 2300, 2), + ('Illegaal drugs bezit', 400, 2), + ('Drugshandel', 3000, 3) +; diff --git a/[esx_addons]/esx_policejob/localization/pl_esx_policejob.sql b/[esx_addons]/esx_policejob/localization/pl_esx_policejob.sql new file mode 100644 index 00000000..00bbe0eb --- /dev/null +++ b/[esx_addons]/esx_policejob/localization/pl_esx_policejob.sql @@ -0,0 +1,90 @@ +USE `es_extended`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_police', 'Police', 1) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_police', 'Police', 1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_police', 'Police', 1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('police', 'Police') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('police',0,'recruit','Posterunkowy',20,'{}','{}'), + ('police',1,'officer','Sierżant',40,'{}','{}'), + ('police',2,'sergeant','Aspirant',60,'{}','{}'), + ('police',3,'lieutenant','Komisarz',85,'{}','{}'), + ('police',4,'boss','Generalny Inspektor',100,'{}','{}') +; + +CREATE TABLE `fine_types` ( + `id` int NOT NULL AUTO_INCREMENT, + `label` varchar(255) DEFAULT NULL, + `amount` int DEFAULT NULL, + `category` int DEFAULT NULL, + + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +INSERT INTO `fine_types` (label, amount, category) VALUES + ('Nadużywanie klaksonu', 30, 0), + ('Przekroczenie lini ciągłej', 40, 0), + ('Jechanie po złej stronie drogi', 250, 0), + ('Nieprawidłowe zawracanie', 250, 0), + ('Nielegalna jazda Off-road', 170, 0), + ('Niedostosowanie się do poleceń Policji', 30, 0), + ('Nieprawidłowe zatrzymanie pojazdu', 150, 0), + ('Nieprawidłowe parkownie', 70, 0), + ('Niezastosowanie się do ruchu prawostronnego (jazda lewym pasem)', 70, 0), + ('Brak informacji o pojeździe', 90, 0), + ('Niezastosowanie się do znaku SOTP', 105, 0), + ('Niezatrzymanie się na czerwonym świetle', 130, 0), + ('Przechodzenie w niedozwolonym miejscu', 100, 0), + ('Jazda nielegalnym pojazdem', 100, 0), + ('Brak prawa jazdy', 1500, 0), + ('Ucieczka z miejsca zdarzenia', 800, 0), + ('Przekroczenie prędkości < 5 mph', 90, 0), + ('Przekroczenie prędkości 5-15 mph', 120, 0), + ('Przekroczenie prędkości 15-30 mph', 180, 0), + ('Przekroczenie prędkości > 30 mph', 300, 0), + ('Utrudnianie przemieszczania się', 110, 1), + ('Publiczne zgorszenie', 90, 1), + ('Niepoprawne zachowanie', 90, 1), + ('Utrudnianie postępowania', 130, 1), + ('Obraza cywilów', 75, 1), + ('Obraza graczy', 110, 1), + ('Groźby werbalne', 90, 1), + ('Przeklinanie na graczy', 150, 1), + ('Dostarczanie fałszywych informacji', 250, 1), + ('Próba korupcji', 1500, 1), + ('Wymachiwanie bronią w mieście', 120, 2), + ('Wymachiwanie niebezpieczną bronią w mieście', 300, 2), + ('Brak pozwolenia na broń', 600, 2), + ('Posiadanie nielegalnej broni', 700, 2), + ('Posiadanie narzędzi do włamań', 300, 2), + ('Złodziej - recydywista', 1800, 2), + ('Rozprowadzanie nielegalnych substancji', 1500, 2), + ('Wytwarzanie nielegalnych substancji', 1500, 2), + ('Posiadanie zakazanych substancji', 650, 2), + ('Porwanie cywila', 1500, 2), + ('Porwanie gracza', 2000, 2), + ('Rabunek', 650, 2), + ('Kradzież z bronią w ręku', 650, 2), + ('Napad na Bank', 1500, 2), + ('Atak na cywila', 2000, 3), + ('Atak na gracza', 2500, 3), + ('Próba morderstwa cywila', 3000, 3), + ('Próba morderstwa gracza', 5000, 3), + ('Zabójstwo cywila z premedytacją', 10000, 3), + ('Zabójstwo gracza z premedytacją', 30000, 3), + ('Nieumyślne spowodowanie śmierci', 1800, 3), + ('Oszustwo', 2000, 2); +; diff --git a/[esx_addons]/esx_policejob/localization/sv_esx_policejob.sql b/[esx_addons]/esx_policejob/localization/sv_esx_policejob.sql new file mode 100644 index 00000000..8a22d453 --- /dev/null +++ b/[esx_addons]/esx_policejob/localization/sv_esx_policejob.sql @@ -0,0 +1,90 @@ +USE `es_extended`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_police', 'Polis', 1) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_police', 'Polis', 1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_police', 'Polis', 1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('police', 'Polis') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('police',0,'recruit','Aspirant',20,'{}','{}'), + ('police',1,'officer','Assistent',40,'{}','{}'), + ('police',2,'sergeant','Inspektör',60,'{}','{}'), + ('police',3,'lieutenant','Kommissarie',85,'{}','{}'), + ('police',4,'boss','Rikspolischef',100,'{}','{}') +; + +CREATE TABLE `fine_types` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `label` varchar(255) DEFAULT NULL, + `amount` int(11) DEFAULT NULL, + `category` int(11) DEFAULT NULL, + + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +INSERT INTO `fine_types` (label, amount, category) VALUES + ('Missbruk av tuta',30,0), + ('Köra över heldragen linje',40,0), + ('Kört i motsatt riktning i rondell',250,0), + ('Olaglig u-sväng',250,0), + ('Olovlig körning i terräng',170,0), + ('Kört för nära bil framför',30,0), + ('Trafikfarlig stopp',150,0), + ('Olaglig parkering',70,0), + ('Använder inte högerregeln',70,0), + ('Aktar sig inte för tjänstefordon i utryckning',90,0), + ('Kört förbi stoppskylt',105,0), + ('Kört mot rött',130,0), + ('Farlig omkörning',100,0), + ('Fordon i dåligt skick',100,0), + ('Kört utan körkort',1500,0), + ('Smitning från olycka',800,0), + ('Kört för fort < 5 kmh',90,0), + ('Kört för fort 5-15 kmh',120,0), + ('Kört för fort 15-30 kmh',180,0), + ('Kört för fort > 30 kmh',300,0), + ('Blockerar trafiken',110,1), + ('Förstört allmän egendom',90,1), + ('Olaga diskriminering',90,1), + ('förhindrar polisens verksamhet',130,1), + ('Hets mot folkgrupp',75,1), + ('Dåligt beteende mot tjänsteman',110,1), + ('Verbalt hot mot annan person',90,1), + ('Verbalt hot mot en tjänsteman',150,1), + ('Olaglig protest',250,1), + ('Försök till mutning',1500,1), + ('Icke livshotande vapen på allmän plats ex. Hammare',120,2), + ('Dödligt vapen på allmän plats',300,2), + ('Vapen på allmän plats med licens (Licens Fel)',600,2), + ('Innehaft olaga vapen',700,2), + ('Försökt bryta sig in',300,2), + ('Bilstöld',1800,2), + ('Försäljning av droger',1500,2), + ('Tillverkning av droger',1500,2), + ('Innehav av droger',650,2), + ('Hålla gisslan/Hålla person mot dess vilja',1500,2), + ('Kidnappa en tjänsteman',2000,2), + ('Rån',650,2), + ('Butiksrån',650,2), + ('Bankrån',1500,2), + ('Skjutit en person',2000,3), + ('Skjutit en tjänsteman',2500,3), + ('Mordförsök',3000,3), + ('Mordförsök på tjänsteman',6000,3), + ('Mord',10000,3), + ('Mord på tjänsteman',30000,3), + ('Dråp',1800,3), + ('Olagliga aktiviteter inom ett företag',2000,2) +; diff --git a/[esx_addons]/esx_policejob/server/main.lua b/[esx_addons]/esx_policejob/server/main.lua new file mode 100644 index 00000000..509fb366 --- /dev/null +++ b/[esx_addons]/esx_policejob/server/main.lua @@ -0,0 +1,496 @@ +ESX = nil + +TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + +if Config.EnableESXService then + if Config.MaxInService ~= -1 then + TriggerEvent('esx_service:activateService', 'police', Config.MaxInService) + end +end + +TriggerEvent('esx_phone:registerNumber', 'police', _U('alert_police'), true, true) +TriggerEvent('esx_society:registerSociety', 'police', 'Police', 'society_police', 'society_police', 'society_police', {type = 'public'}) + +RegisterNetEvent('esx_policejob:confiscatePlayerItem') +AddEventHandler('esx_policejob:confiscatePlayerItem', function(target, itemType, itemName, amount) + local _source = source + local sourceXPlayer = ESX.GetPlayerFromId(_source) + local targetXPlayer = ESX.GetPlayerFromId(target) + + if sourceXPlayer.job.name ~= 'police' then + print(('esx_policejob: %s attempted to confiscate!'):format(sourceXPlayer.identifier)) + return + end + + if itemType == 'item_standard' then + local targetItem = targetXPlayer.getInventoryItem(itemName) + local sourceItem = sourceXPlayer.getInventoryItem(itemName) + + -- does the target player have enough in their inventory? + if targetItem.count > 0 and targetItem.count <= amount then + + -- can the player carry the said amount of x item? + if sourceXPlayer.canCarryItem(itemName, sourceItem.count) then + targetXPlayer.removeInventoryItem(itemName, amount) + sourceXPlayer.addInventoryItem (itemName, amount) + sourceXPlayer.showNotification(_U('you_confiscated', amount, sourceItem.label, targetXPlayer.name)) + targetXPlayer.showNotification(_U('got_confiscated', amount, sourceItem.label, sourceXPlayer.name)) + else + sourceXPlayer.showNotification(_U('quantity_invalid')) + end + else + sourceXPlayer.showNotification(_U('quantity_invalid')) + end + + elseif itemType == 'item_account' then + local targetAccount = targetXPlayer.getAccount(itemName) + + -- does the target player have enough money? + if targetAccount.money >= amount then + targetXPlayer.removeAccountMoney(itemName, amount) + sourceXPlayer.addAccountMoney (itemName, amount) + + sourceXPlayer.showNotification(_U('you_confiscated_account', amount, itemName, targetXPlayer.name)) + targetXPlayer.showNotification(_U('got_confiscated_account', amount, itemName, sourceXPlayer.name)) + else + sourceXPlayer.showNotification(_U('quantity_invalid')) + end + + elseif itemType == 'item_weapon' then + if amount == nil then amount = 0 end + + -- does the target player have weapon? + if targetXPlayer.hasWeapon(itemName) then + targetXPlayer.removeWeapon(itemName, amount) + sourceXPlayer.addWeapon (itemName, amount) + + sourceXPlayer.showNotification(_U('you_confiscated_weapon', ESX.GetWeaponLabel(itemName), targetXPlayer.name, amount)) + targetXPlayer.showNotification(_U('got_confiscated_weapon', ESX.GetWeaponLabel(itemName), amount, sourceXPlayer.name)) + else + sourceXPlayer.showNotification(_U('quantity_invalid')) + end + end +end) + +RegisterNetEvent('esx_policejob:handcuff') +AddEventHandler('esx_policejob:handcuff', function(target) + local xPlayer = ESX.GetPlayerFromId(source) + + if xPlayer.job.name == 'police' then + TriggerClientEvent('esx_policejob:handcuff', target) + else + print(('esx_policejob: %s attempted to handcuff a player (not cop)!'):format(xPlayer.identifier)) + end +end) + +RegisterNetEvent('esx_policejob:drag') +AddEventHandler('esx_policejob:drag', function(target) + local xPlayer = ESX.GetPlayerFromId(source) + + if xPlayer.job.name == 'police' then + TriggerClientEvent('esx_policejob:drag', target, source) + else + print(('esx_policejob: %s attempted to drag (not cop)!'):format(xPlayer.identifier)) + end +end) + +RegisterNetEvent('esx_policejob:putInVehicle') +AddEventHandler('esx_policejob:putInVehicle', function(target) + local xPlayer = ESX.GetPlayerFromId(source) + + if xPlayer.job.name == 'police' then + TriggerClientEvent('esx_policejob:putInVehicle', target) + else + print(('esx_policejob: %s attempted to put in vehicle (not cop)!'):format(xPlayer.identifier)) + end +end) + +RegisterNetEvent('esx_policejob:OutVehicle') +AddEventHandler('esx_policejob:OutVehicle', function(target) + local xPlayer = ESX.GetPlayerFromId(source) + + if xPlayer.job.name == 'police' then + TriggerClientEvent('esx_policejob:OutVehicle', target) + else + print(('esx_policejob: %s attempted to drag out from vehicle (not cop)!'):format(xPlayer.identifier)) + end +end) + +RegisterNetEvent('esx_policejob:getStockItem') +AddEventHandler('esx_policejob:getStockItem', function(itemName, count) + local _source = source + local xPlayer = ESX.GetPlayerFromId(_source) + + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_police', function(inventory) + local inventoryItem = inventory.getItem(itemName) + + -- is there enough in the society? + if count > 0 and inventoryItem.count >= count then + + -- can the player carry the said amount of x item? + if xPlayer.canCarryItem(itemName, count) then + inventory.removeItem(itemName, count) + xPlayer.addInventoryItem(itemName, count) + xPlayer.showNotification(_U('have_withdrawn', count, inventoryItem.name)) + else + xPlayer.showNotification(_U('quantity_invalid')) + end + else + xPlayer.showNotification(_U('quantity_invalid')) + end + end) +end) + +RegisterNetEvent('esx_policejob:putStockItems') +AddEventHandler('esx_policejob:putStockItems', function(itemName, count) + local xPlayer = ESX.GetPlayerFromId(source) + local sourceItem = xPlayer.getInventoryItem(itemName) + + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_police', function(inventory) + local inventoryItem = inventory.getItem(itemName) + + -- does the player have enough of the item? + if sourceItem.count >= count and count > 0 then + xPlayer.removeInventoryItem(itemName, count) + inventory.addItem(itemName, count) + xPlayer.showNotification(_U('have_deposited', count, inventoryItem.name)) + else + xPlayer.showNotification(_U('quantity_invalid')) + end + end) +end) + +ESX.RegisterServerCallback('esx_policejob:getOtherPlayerData', function(source, cb, target, notify) + local xPlayer = ESX.GetPlayerFromId(target) + + if notify then + xPlayer.showNotification(_U('being_searched')) + end + + if xPlayer then + local data = { + name = xPlayer.getName(), + job = xPlayer.job.label, + grade = xPlayer.job.grade_label, + inventory = xPlayer.getInventory(), + accounts = xPlayer.getAccounts(), + weapons = xPlayer.getLoadout() + } + + if Config.EnableESXIdentity then + data.dob = xPlayer.get('dateofbirth') + data.height = xPlayer.get('height') + + if xPlayer.get('sex') == 'm' then data.sex = 'male' else data.sex = 'female' end + end + + TriggerEvent('esx_status:getStatus', target, 'drunk', function(status) + if status then + data.drunk = ESX.Math.Round(status.percent) + end + end) + + if Config.EnableLicenses then + TriggerEvent('esx_license:getLicenses', target, function(licenses) + data.licenses = licenses + cb(data) + end) + else + cb(data) + end + end +end) + +ESX.RegisterServerCallback('esx_policejob:getFineList', function(source, cb, category) + MySQL.Async.fetchAll('SELECT * FROM fine_types WHERE category = @category', { + ['@category'] = category + }, function(fines) + cb(fines) + end) +end) + +ESX.RegisterServerCallback('esx_policejob:getVehicleInfos', function(source, cb, plate) + MySQL.Async.fetchAll('SELECT owner FROM owned_vehicles WHERE plate = @plate', { + ['@plate'] = plate + }, function(result) + local retrivedInfo = {plate = plate} + + if result[1] then + local xPlayer = ESX.GetPlayerFromIdentifier(result[1].owner) + + -- is the owner online? + if xPlayer then + retrivedInfo.owner = xPlayer.getName() + cb(retrivedInfo) + elseif Config.EnableESXIdentity then + MySQL.Async.fetchAll('SELECT firstname, lastname FROM users WHERE identifier = @identifier', { + ['@identifier'] = result[1].owner + }, function(result2) + if result2[1] then + retrivedInfo.owner = ('%s %s'):format(result2[1].firstname, result2[1].lastname) + cb(retrivedInfo) + else + cb(retrivedInfo) + end + end) + else + cb(retrivedInfo) + end + else + cb(retrivedInfo) + end + end) +end) + +ESX.RegisterServerCallback('esx_policejob:getArmoryWeapons', function(source, cb) + TriggerEvent('esx_datastore:getSharedDataStore', 'society_police', function(store) + local weapons = store.get('weapons') + + if weapons == nil then + weapons = {} + end + + cb(weapons) + end) +end) + +ESX.RegisterServerCallback('esx_policejob:addArmoryWeapon', function(source, cb, weaponName, removeWeapon) + local xPlayer = ESX.GetPlayerFromId(source) + + if removeWeapon then + xPlayer.removeWeapon(weaponName) + end + + TriggerEvent('esx_datastore:getSharedDataStore', 'society_police', function(store) + local weapons = store.get('weapons') or {} + local foundWeapon = false + + for i=1, #weapons, 1 do + if weapons[i].name == weaponName then + weapons[i].count = weapons[i].count + 1 + foundWeapon = true + break + end + end + + if not foundWeapon then + table.insert(weapons, { + name = weaponName, + count = 1 + }) + end + + store.set('weapons', weapons) + cb() + end) +end) + +ESX.RegisterServerCallback('esx_policejob:removeArmoryWeapon', function(source, cb, weaponName) + local xPlayer = ESX.GetPlayerFromId(source) + xPlayer.addWeapon(weaponName, 500) + + TriggerEvent('esx_datastore:getSharedDataStore', 'society_police', function(store) + local weapons = store.get('weapons') or {} + + local foundWeapon = false + + for i=1, #weapons, 1 do + if weapons[i].name == weaponName then + weapons[i].count = (weapons[i].count > 0 and weapons[i].count - 1 or 0) + foundWeapon = true + break + end + end + + if not foundWeapon then + table.insert(weapons, { + name = weaponName, + count = 0 + }) + end + + store.set('weapons', weapons) + cb() + end) +end) + +ESX.RegisterServerCallback('esx_policejob:buyWeapon', function(source, cb, weaponName, type, componentNum) + local xPlayer = ESX.GetPlayerFromId(source) + local authorizedWeapons, selectedWeapon = Config.AuthorizedWeapons[xPlayer.job.grade_name] + + for k,v in ipairs(authorizedWeapons) do + if v.weapon == weaponName then + selectedWeapon = v + break + end + end + + if not selectedWeapon then + print(('esx_policejob: %s attempted to buy an invalid weapon.'):format(xPlayer.identifier)) + cb(false) + else + -- Weapon + if type == 1 then + if xPlayer.getMoney() >= selectedWeapon.price then + xPlayer.removeMoney(selectedWeapon.price) + xPlayer.addWeapon(weaponName, 100) + + cb(true) + else + cb(false) + end + + -- Weapon Component + elseif type == 2 then + local price = selectedWeapon.components[componentNum] + local weaponNum, weapon = ESX.GetWeapon(weaponName) + local component = weapon.components[componentNum] + + if component then + if xPlayer.getMoney() >= price then + xPlayer.removeMoney(price) + xPlayer.addWeaponComponent(weaponName, component.name) + + cb(true) + else + cb(false) + end + else + print(('esx_policejob: %s attempted to buy an invalid weapon component.'):format(xPlayer.identifier)) + cb(false) + end + end + end +end) + +ESX.RegisterServerCallback('esx_policejob:buyJobVehicle', function(source, cb, vehicleProps, type) + local xPlayer = ESX.GetPlayerFromId(source) + local price = getPriceFromHash(vehicleProps.model, xPlayer.job.grade_name, type) + + -- vehicle model not found + if price == 0 then + print(('esx_policejob: %s attempted to exploit the shop! (invalid vehicle model)'):format(xPlayer.identifier)) + cb(false) + else + if xPlayer.getMoney() >= price then + xPlayer.removeMoney(price) + + MySQL.Async.execute('INSERT INTO owned_vehicles (owner, vehicle, plate, type, job, `stored`) VALUES (@owner, @vehicle, @plate, @type, @job, @stored)', { + ['@owner'] = xPlayer.identifier, + ['@vehicle'] = json.encode(vehicleProps), + ['@plate'] = vehicleProps.plate, + ['@type'] = type, + ['@job'] = xPlayer.job.name, + ['@stored'] = true + }, function (rowsChanged) + cb(true) + end) + else + cb(false) + end + end +end) + +ESX.RegisterServerCallback('esx_policejob:storeNearbyVehicle', function(source, cb, nearbyVehicles) + local xPlayer = ESX.GetPlayerFromId(source) + local foundPlate, foundNum + + for k,v in ipairs(nearbyVehicles) do + local result = MySQL.Sync.fetchAll('SELECT plate FROM owned_vehicles WHERE owner = @owner AND plate = @plate AND job = @job', { + ['@owner'] = xPlayer.identifier, + ['@plate'] = v.plate, + ['@job'] = xPlayer.job.name + }) + + if result[1] then + foundPlate, foundNum = result[1].plate, k + break + end + end + + if not foundPlate then + cb(false) + else + MySQL.Async.execute('UPDATE owned_vehicles SET `stored` = true WHERE owner = @owner AND plate = @plate AND job = @job', { + ['@owner'] = xPlayer.identifier, + ['@plate'] = foundPlate, + ['@job'] = xPlayer.job.name + }, function (rowsChanged) + if rowsChanged == 0 then + print(('esx_policejob: %s has exploited the garage!'):format(xPlayer.identifier)) + cb(false) + else + cb(true, foundNum) + end + end) + end +end) + +function getPriceFromHash(vehicleHash, jobGrade, type) + local vehicles = Config.AuthorizedVehicles[type][jobGrade] + + for k,v in ipairs(vehicles) do + if GetHashKey(v.model) == vehicleHash then + return v.price + end + end + + return 0 +end + +ESX.RegisterServerCallback('esx_policejob:getStockItems', function(source, cb) + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_police', function(inventory) + cb(inventory.items) + end) +end) + +ESX.RegisterServerCallback('esx_policejob:getPlayerInventory', function(source, cb) + local xPlayer = ESX.GetPlayerFromId(source) + local items = xPlayer.inventory + + cb({items = items}) +end) + +AddEventHandler('playerDropped', function() + -- Save the source in case we lose it (which happens a lot) + local playerId = source + + -- Did the player ever join? + if playerId then + local xPlayer = ESX.GetPlayerFromId(playerId) + + -- Is it worth telling all clients to refresh? + if xPlayer and xPlayer.job.name == 'police' then + Citizen.Wait(5000) + TriggerClientEvent('esx_policejob:updateBlip', -1) + end + end +end) + +RegisterNetEvent('esx_policejob:spawned') +AddEventHandler('esx_policejob:spawned', function() + local xPlayer = ESX.GetPlayerFromId(playerId) + + if xPlayer and xPlayer.job.name == 'police' then + Citizen.Wait(5000) + TriggerClientEvent('esx_policejob:updateBlip', -1) + end +end) + +RegisterNetEvent('esx_policejob:forceBlip') +AddEventHandler('esx_policejob:forceBlip', function() + TriggerClientEvent('esx_policejob:updateBlip', -1) +end) + +AddEventHandler('onResourceStart', function(resource) + if resource == GetCurrentResourceName() then + Citizen.Wait(5000) + TriggerClientEvent('esx_policejob:updateBlip', -1) + end +end) + +AddEventHandler('onResourceStop', function(resource) + if resource == GetCurrentResourceName() then + TriggerEvent('esx_phone:removeNumber', 'police') + end +end) diff --git a/[esx_addons]/esx_property/.editorconfig b/[esx_addons]/esx_property/.editorconfig new file mode 100644 index 00000000..9b425256 --- /dev/null +++ b/[esx_addons]/esx_property/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_size = 4 +indent_style = tab +end_of_line = crlf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/[esx_addons]/esx_property/LICENSE b/[esx_addons]/esx_property/LICENSE new file mode 100644 index 00000000..0bcccde6 --- /dev/null +++ b/[esx_addons]/esx_property/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + fxserver-esx_property + Copyright (C) 2015 Jérémie N'gadi + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + fxserver-esx_property Copyright (C) 2015 Jérémie N'gadi + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. \ No newline at end of file diff --git a/[esx_addons]/esx_property/README.md b/[esx_addons]/esx_property/README.md new file mode 100644 index 00000000..8c230af9 --- /dev/null +++ b/[esx_addons]/esx_property/README.md @@ -0,0 +1,48 @@ +# esx_property + +### Requirements + +- [async](https://github.com/ESX-Org/async) +- [instance](https://github.com/ESX-Org/instance) +- [cron](https://github.com/ESX-Org/cron) +- [esx_addonaccount](https://github.com/ESX-Org/esx_addonaccount) +- [esx_addoninventory](https://github.com/ESX-Org/esx_addoninventory) +- [esx_datastore](https://github.com/ESX-Org/esx_datastore) + +## Download & Installation + +### Using [fvm](https://github.com/qlaffont/fvm-installer) +``` +fvm install --save --folder=esx esx-org/esx_property +``` + +### Using Git +``` +cd resources +git clone https://github.com/ESX-Org/esx_property [esx]/esx_property +``` + +### Manually +- Download https://github.com/ESX-Org/esx_property/archive/master.zip +- Put it in the `[esx]` directory + +## Installation +- Import `esx_property.sql` in your database +- Import `esx_offices.sql` in your database if you want offices (The Arcadius Business Centre is not included because realstateagentjob) +- Add this to your `server.cfg`: + +``` +start esx_property +``` + +# Legal +### License +esx_property - own a property! + +Copyright (C) 2015-2020 Jérémie N'gadi + +This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version. + +This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details. + +You should have received a copy Of the GNU General Public License along with this program. If Not, see http://www.gnu.org/licenses/. \ No newline at end of file diff --git a/[esx_addons]/esx_property/client/main.lua b/[esx_addons]/esx_property/client/main.lua new file mode 100644 index 00000000..04e00eb6 --- /dev/null +++ b/[esx_addons]/esx_property/client/main.lua @@ -0,0 +1,893 @@ +local OwnedProperties, Blips, CurrentActionData = {}, {}, {} +local CurrentProperty, CurrentPropertyOwner, LastProperty, LastPart, CurrentAction, CurrentActionMsg +local firstSpawn, hasChest, hasAlreadyEnteredMarker = true, false, false +ESX = nil + +Citizen.CreateThread(function() + while ESX == nil do + TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + Citizen.Wait(0) + end +end) + +RegisterNetEvent('esx:playerLoaded') +AddEventHandler('esx:playerLoaded', function(xPlayer) + ESX.TriggerServerCallback('esx_property:getProperties', function(properties) + Config.Properties = properties + CreateBlips() + end) + + ESX.TriggerServerCallback('esx_property:getOwnedProperties', function(result) + for k,v in ipairs(result) do + SetPropertyOwned(v.name, true, v.rented) + end + end) +end) + +-- only used when script is restarting mid-session +RegisterNetEvent('esx_property:sendProperties') +AddEventHandler('esx_property:sendProperties', function(properties) + Config.Properties = properties + CreateBlips() + + ESX.TriggerServerCallback('esx_property:getOwnedProperties', function(result) + for k,v in ipairs(result) do + SetPropertyOwned(v.name, true, v.rented) + end + end) +end) + +function DrawSub(text, time) + ClearPrints() + BeginTextCommandPrint('STRING') + AddTextComponentSubstringPlayerName(text) + EndTextCommandPrint(time, 1) +end + +function CreateBlips() + for i=1, #Config.Properties, 1 do + local property = Config.Properties[i] + + if property.entering then + Blips[property.name] = AddBlipForCoord(property.entering.x, property.entering.y, property.entering.z) + + SetBlipSprite (Blips[property.name], 369) + SetBlipDisplay(Blips[property.name], 4) + SetBlipScale (Blips[property.name], 1.0) + SetBlipAsShortRange(Blips[property.name], true) + + BeginTextCommandSetBlipName("STRING") + AddTextComponentSubstringPlayerName(_U('free_prop')) + EndTextCommandSetBlipName(Blips[property.name]) + end + end +end + +function GetProperties() + return Config.Properties +end + +function GetProperty(name) + for i=1, #Config.Properties, 1 do + if Config.Properties[i].name == name then + return Config.Properties[i] + end + end +end + +function GetGateway(property) + for i=1, #Config.Properties, 1 do + local property2 = Config.Properties[i] + + if property2.isGateway and property2.name == property.gateway then + return property2 + end + end +end + +function GetGatewayProperties(property) + local properties = {} + + for i=1, #Config.Properties, 1 do + if Config.Properties[i].gateway == property.name then + table.insert(properties, Config.Properties[i]) + end + end + + return properties +end + +function EnterProperty(name, owner) + local property = GetProperty(name) + local playerPed = PlayerPedId() + CurrentProperty = property + CurrentPropertyOwner = owner + + for i=1, #Config.Properties, 1 do + if Config.Properties[i].name ~= name then + Config.Properties[i].disabled = true + end + end + + TriggerServerEvent('esx_property:saveLastProperty', name) + + Citizen.CreateThread(function() + DoScreenFadeOut(800) + + while not IsScreenFadedOut() do + Citizen.Wait(0) + end + + for i=1, #property.ipls, 1 do + RequestIpl(property.ipls[i]) + + while not IsIplActive(property.ipls[i]) do + Citizen.Wait(0) + end + end + + SetEntityCoords(playerPed, property.inside.x, property.inside.y, property.inside.z) + DoScreenFadeIn(800) + DrawSub(property.label, 5000) + end) + +end + +function ExitProperty(name) + local property = GetProperty(name) + local playerPed = PlayerPedId() + local outside = nil + CurrentProperty = nil + + if property.isSingle then + outside = property.outside + else + outside = GetGateway(property).outside + end + + TriggerServerEvent('esx_property:deleteLastProperty') + + Citizen.CreateThread(function() + DoScreenFadeOut(800) + + while not IsScreenFadedOut() do + Citizen.Wait(0) + end + + SetEntityCoords(playerPed, outside.x, outside.y, outside.z) + + for i=1, #property.ipls, 1 do + RemoveIpl(property.ipls[i]) + end + + for i=1, #Config.Properties, 1 do + Config.Properties[i].disabled = false + end + + DoScreenFadeIn(800) + end) +end + +function SetPropertyOwned(name, owned, rented) + local property = GetProperty(name) + local entering = nil + local enteringName = nil + + if property.isSingle then + entering = property.entering + enteringName = property.name + else + local gateway = GetGateway(property) + entering = gateway.entering + enteringName = gateway.name + end + + if owned then + OwnedProperties[name] = rented + RemoveBlip(Blips[enteringName]) + + Blips[enteringName] = AddBlipForCoord(entering.x, entering.y, entering.z) + SetBlipSprite(Blips[enteringName], 357) + SetBlipAsShortRange(Blips[enteringName], true) + + BeginTextCommandSetBlipName("STRING") + AddTextComponentSubstringPlayerName(_U('property')) + EndTextCommandSetBlipName(Blips[enteringName]) + else + OwnedProperties[name] = nil + local found = false + + for k,v in pairs(OwnedProperties) do + local _property = GetProperty(k) + local _gateway = GetGateway(_property) + + if _gateway then + if _gateway.name == enteringName then + found = true + break + end + end + end + + if not found then + RemoveBlip(Blips[enteringName]) + + Blips[enteringName] = AddBlipForCoord(entering.x, entering.y, entering.z) + SetBlipSprite(Blips[enteringName], 369) + SetBlipAsShortRange(Blips[enteringName], true) + + BeginTextCommandSetBlipName("STRING") + AddTextComponentSubstringPlayerName(_U('free_prop')) + EndTextCommandSetBlipName(Blips[enteringName]) + end + end +end + +function PropertyIsOwned(property) + return OwnedProperties[property.name] ~= nil +end + +function OpenPropertyMenu(property) + local elements = {} + + if PropertyIsOwned(property) then + table.insert(elements, {label = _U('enter'), value = 'enter'}) + + -- add move out + if not Config.EnablePlayerManagement then + local leaveLabel = _U('move_out') + + if not OwnedProperties[property.name] then + leaveLabel = _U('move_out_sold', ESX.Math.GroupDigits(ESX.Math.Round(property.price / Config.SellModifier))) + end + + table.insert(elements, {label = leaveLabel, value = 'leave'}) + end + else + if not Config.EnablePlayerManagement then + table.insert(elements, {label = _U('buy', ESX.Math.GroupDigits(property.price)), value = 'buy'}) + + -- display rent price + local rent = ESX.Math.Round(property.price / Config.RentModifier) + table.insert(elements, {label = _U('rent', ESX.Math.GroupDigits(rent)), value = 'rent'}) + end + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'property', { + title = property.label, + align = 'top-left', + elements = elements + }, function(data, menu) + menu.close() + + if data.current.value == 'enter' then + TriggerEvent('instance:create', 'property', {property = property.name, owner = ESX.GetPlayerData().identifier}) + elseif data.current.value == 'leave' then + TriggerServerEvent('esx_property:removeOwnedProperty', property.name) + elseif data.current.value == 'buy' then + TriggerServerEvent('esx_property:buyProperty', property.name) + elseif data.current.value == 'rent' then + TriggerServerEvent('esx_property:rentProperty', property.name) + end + end, function(data, menu) + menu.close() + + CurrentAction = 'property_menu' + CurrentActionMsg = _U('press_to_menu') + CurrentActionData = {property = property} + end) +end + +function OpenGatewayMenu(property) + if Config.EnablePlayerManagement then + OpenGatewayOwnedPropertiesMenu(gatewayProperties) + else + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'gateway', { + title = property.name, + align = 'top-left', + elements = { + {label = _U('owned_properties'), value = 'owned_properties'}, + {label = _U('available_properties'), value = 'available_properties'} + }}, function(data, menu) + if data.current.value == 'owned_properties' then + OpenGatewayOwnedPropertiesMenu(property) + elseif data.current.value == 'available_properties' then + OpenGatewayAvailablePropertiesMenu(property) + end + end, function(data, menu) + menu.close() + + CurrentAction = 'gateway_menu' + CurrentActionMsg = _U('press_to_menu') + CurrentActionData = {property = property} + end) + end +end + +function OpenGatewayOwnedPropertiesMenu(property) + local gatewayProperties = GetGatewayProperties(property) + local elements = {} + + for i=1, #gatewayProperties, 1 do + if PropertyIsOwned(gatewayProperties[i]) then + table.insert(elements, { + label = gatewayProperties[i].label, + value = gatewayProperties[i].name + }) + end + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'gateway_owned_properties', { + title = property.name .. ' - ' .. _U('owned_properties'), + align = 'top-left', + elements = elements + }, function(data, menu) + menu.close() + local elements = {{label = _U('enter'), value = 'enter'}} + + if not Config.EnablePlayerManagement then + table.insert(elements, {label = _U('leave'), value = 'leave'}) + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'gateway_owned_properties_actions', { + title = data.current.label, + align = 'top-left', + elements = elements + }, function(data2, menu2) + menu2.close() + + if data2.current.value == 'enter' then + TriggerEvent('instance:create', 'property', {property = data.current.value, owner = ESX.GetPlayerData().identifier}) + ESX.UI.Menu.CloseAll() + elseif data2.current.value == 'leave' then + TriggerServerEvent('esx_property:removeOwnedProperty', data.current.value) + end + end, function(data2, menu2) + menu2.close() + end) + end, function(data, menu) + menu.close() + end) +end + +function OpenGatewayAvailablePropertiesMenu(property) + local gatewayProperties = GetGatewayProperties(property) + local elements = {} + + for i=1, #gatewayProperties, 1 do + if not PropertyIsOwned(gatewayProperties[i]) then + table.insert(elements, { + label = gatewayProperties[i].label, + value = gatewayProperties[i].name, + buyPrice = gatewayProperties[i].price, + rentPrice = ESX.Math.Round(gatewayProperties[i].price / Config.RentModifier) + }) + end + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'gateway_available_properties', { + title = property.name .. ' - ' .. _U('available_properties'), + align = 'top-left', + elements = elements + }, function(data, menu) + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'gateway_available_properties_actions', { + title = property.label .. ' - ' .. _U('available_properties'), + align = 'top-left', + elements = { + {label = _U('buy', ESX.Math.GroupDigits(data.current.buyPrice)), value = 'buy'}, + {label = _U('rent', ESX.Math.GroupDigits(data.current.rentPrice)), value = 'rent'} + }}, function(data2, menu2) + menu.close() + menu2.close() + + if data2.current.value == 'buy' then + TriggerServerEvent('esx_property:buyProperty', data.current.value) + elseif data2.current.value == 'rent' then + TriggerServerEvent('esx_property:rentProperty', data.current.value) + end + end, function(data2, menu2) + menu2.close() + end) + end, function(data, menu) + menu.close() + end) +end + +function OpenRoomMenu(property, owner) + local entering = nil + local elements = {{label = _U('invite_player'), value = 'invite_player'}} + + if property.isSingle then + entering = property.entering + else + entering = GetGateway(property).entering + end + + if CurrentPropertyOwner == owner then + table.insert(elements, {label = _U('player_clothes'), value = 'player_dressing'}) + table.insert(elements, {label = _U('remove_cloth'), value = 'remove_cloth'}) + end + + table.insert(elements, {label = _U('remove_object'), value = 'room_inventory'}) + table.insert(elements, {label = _U('deposit_object'), value = 'player_inventory'}) + + ESX.UI.Menu.CloseAll() + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'room', { + title = property.label, + align = 'top-left', + elements = elements + }, function(data, menu) + + if data.current.value == 'invite_player' then + + local playersInArea = ESX.Game.GetPlayersInArea(entering, 10.0) + local elements = {} + + for i=1, #playersInArea, 1 do + if playersInArea[i] ~= PlayerId() then + table.insert(elements, {label = GetPlayerName(playersInArea[i]), value = playersInArea[i]}) + end + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'room_invite', { + title = property.label .. ' - ' .. _U('invite'), + align = 'top-left', + elements = elements, + }, function(data2, menu2) + TriggerEvent('instance:invite', 'property', GetPlayerServerId(data2.current.value), {property = property.name, owner = owner}) + ESX.ShowNotification(_U('you_invited', GetPlayerName(data2.current.value))) + end, function(data2, menu2) + menu2.close() + end) + + elseif data.current.value == 'player_dressing' then + + ESX.TriggerServerCallback('esx_property:getPlayerDressing', function(dressing) + local elements = {} + + for i=1, #dressing, 1 do + table.insert(elements, { + label = dressing[i], + value = i + }) + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'player_dressing', { + title = property.label .. ' - ' .. _U('player_clothes'), + align = 'top-left', + elements = elements + }, function(data2, menu2) + TriggerEvent('skinchanger:getSkin', function(skin) + ESX.TriggerServerCallback('esx_property:getPlayerOutfit', function(clothes) + TriggerEvent('skinchanger:loadClothes', skin, clothes) + TriggerEvent('esx_skin:setLastSkin', skin) + + TriggerEvent('skinchanger:getSkin', function(skin) + TriggerServerEvent('esx_skin:save', skin) + end) + end, data2.current.value) + end) + end, function(data2, menu2) + menu2.close() + end) + end) + + elseif data.current.value == 'remove_cloth' then + + ESX.TriggerServerCallback('esx_property:getPlayerDressing', function(dressing) + local elements = {} + + for i=1, #dressing, 1 do + table.insert(elements, { + label = dressing[i], + value = i + }) + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'remove_cloth', { + title = property.label .. ' - ' .. _U('remove_cloth'), + align = 'top-left', + elements = elements + }, function(data2, menu2) + menu2.close() + TriggerServerEvent('esx_property:removeOutfit', data2.current.value) + ESX.ShowNotification(_U('removed_cloth')) + end, function(data2, menu2) + menu2.close() + end) + end) + + elseif data.current.value == 'room_inventory' then + OpenRoomInventoryMenu(property, owner) + elseif data.current.value == 'player_inventory' then + OpenPlayerInventoryMenu(property, owner) + end + + end, function(data, menu) + menu.close() + + CurrentAction = 'room_menu' + CurrentActionMsg = _U('press_to_menu') + CurrentActionData = {property = property, owner = owner} + end) +end + +function OpenRoomInventoryMenu(property, owner) + ESX.TriggerServerCallback('esx_property:getPropertyInventory', function(inventory) + local elements = {} + + if inventory.blackMoney > 0 then + table.insert(elements, { + label = _U('dirty_money', ESX.Math.GroupDigits(inventory.blackMoney)), + type = 'item_account', + value = 'black_money' + }) + end + + for i=1, #inventory.items, 1 do + local item = inventory.items[i] + + if item.count > 0 then + table.insert(elements, { + label = item.label .. ' x' .. item.count, + type = 'item_standard', + value = item.name + }) + end + end + + for i=1, #inventory.weapons, 1 do + local weapon = inventory.weapons[i] + + table.insert(elements, { + label = ESX.GetWeaponLabel(weapon.name) .. ' [' .. weapon.ammo .. ']', + type = 'item_weapon', + value = weapon.name, + index = i + }) + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'room_inventory', { + title = property.label .. ' - ' .. _U('inventory'), + align = 'top-left', + elements = elements + }, function(data, menu) + + if data.current.type == 'item_weapon' then + menu.close() + + TriggerServerEvent('esx_property:getItem', owner, data.current.type, data.current.value, data.current.index) + ESX.SetTimeout(300, function() + OpenRoomInventoryMenu(property, owner) + end) + else + ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'get_item_count', { + title = _U('amount') + }, function(data2, menu) + + local quantity = tonumber(data2.value) + if quantity == nil then + ESX.ShowNotification(_U('amount_invalid')) + else + menu.close() + + TriggerServerEvent('esx_property:getItem', owner, data.current.type, data.current.value, quantity) + ESX.SetTimeout(300, function() + OpenRoomInventoryMenu(property, owner) + end) + end + end, function(data2,menu) + menu.close() + end) + end + end, function(data, menu) + menu.close() + end) + end, owner) +end + +function OpenPlayerInventoryMenu(property, owner) + ESX.TriggerServerCallback('esx_property:getPlayerInventory', function(inventory) + local elements = {} + + if inventory.blackMoney > 0 then + table.insert(elements, { + label = _U('dirty_money', ESX.Math.GroupDigits(inventory.blackMoney)), + type = 'item_account', + value = 'black_money' + }) + end + + for i=1, #inventory.items, 1 do + local item = inventory.items[i] + + if item.count > 0 then + table.insert(elements, { + label = item.label .. ' x' .. item.count, + type = 'item_standard', + value = item.name + }) + end + end + + for i=1, #inventory.weapons, 1 do + local weapon = inventory.weapons[i] + + table.insert(elements, { + label = weapon.label .. ' [' .. weapon.ammo .. ']', + type = 'item_weapon', + value = weapon.name, + ammo = weapon.ammo + }) + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'player_inventory', { + title = property.label .. ' - ' .. _U('inventory'), + align = 'top-left', + elements = elements + }, function(data, menu) + + if data.current.type == 'item_weapon' then + menu.close() + TriggerServerEvent('esx_property:putItem', owner, data.current.type, data.current.value, data.current.ammo) + + ESX.SetTimeout(300, function() + OpenPlayerInventoryMenu(property, owner) + end) + else + ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'put_item_count', { + title = _U('amount') + }, function(data2, menu2) + local quantity = tonumber(data2.value) + + if quantity == nil then + ESX.ShowNotification(_U('amount_invalid')) + else + menu2.close() + + TriggerServerEvent('esx_property:putItem', owner, data.current.type, data.current.value, tonumber(data2.value)) + ESX.SetTimeout(300, function() + OpenPlayerInventoryMenu(property, owner) + end) + end + end, function(data2, menu2) + menu2.close() + end) + end + end, function(data, menu) + menu.close() + end) + end) +end + +AddEventHandler('instance:loaded', function() + TriggerEvent('instance:registerType', 'property', function(instance) + EnterProperty(instance.data.property, instance.data.owner) + end, function(instance) + ExitProperty(instance.data.property) + end) +end) + +AddEventHandler('esx:onPlayerSpawn', function() + if firstSpawn then + Citizen.CreateThread(function() + while not ESX.IsPlayerLoaded() do + Citizen.Wait(0) + end + + ESX.TriggerServerCallback('esx_property:getLastProperty', function(propertyName) + if propertyName then + if propertyName ~= '' then + local property = GetProperty(propertyName) + + for i=1, #property.ipls, 1 do + RequestIpl(property.ipls[i]) + + while not IsIplActive(property.ipls[i]) do + Citizen.Wait(0) + end + end + + TriggerEvent('instance:create', 'property', {property = propertyName, owner = ESX.GetPlayerData().identifier}) + end + end + end) + end) + + firstSpawn = false + end +end) + +AddEventHandler('esx_property:getProperties', function(cb) + cb(GetProperties()) +end) + +AddEventHandler('esx_property:getProperty', function(name, cb) + cb(GetProperty(name)) +end) + +AddEventHandler('esx_property:getGateway', function(property, cb) + cb(GetGateway(property)) +end) + +RegisterNetEvent('esx_property:setPropertyOwned') +AddEventHandler('esx_property:setPropertyOwned', function(name, owned, rented) + SetPropertyOwned(name, owned, rented) +end) + +RegisterNetEvent('instance:onCreate') +AddEventHandler('instance:onCreate', function(instance) + if instance.type == 'property' then + TriggerEvent('instance:enter', instance) + end +end) + +RegisterNetEvent('instance:onEnter') +AddEventHandler('instance:onEnter', function(instance) + if instance.type == 'property' then + local property = GetProperty(instance.data.property) + local isHost = GetPlayerFromServerId(instance.host) == PlayerId() + local isOwned = false + + if PropertyIsOwned(property) == true then + isOwned = true + end + + if isOwned or not isHost then + hasChest = true + else + hasChest = false + end + end +end) + +RegisterNetEvent('instance:onPlayerLeft') +AddEventHandler('instance:onPlayerLeft', function(instance, player) + if player == instance.host then + TriggerEvent('instance:leave') + end +end) + +AddEventHandler('esx_property:hasEnteredMarker', function(name, part) + local property = GetProperty(name) + + if part == 'entering' then + if property.isSingle then + CurrentAction = 'property_menu' + CurrentActionMsg = _U('press_to_menu') + CurrentActionData = {property = property} + else + CurrentAction = 'gateway_menu' + CurrentActionMsg = _U('press_to_menu') + CurrentActionData = {property = property} + end + elseif part == 'exit' then + CurrentAction = 'room_exit' + CurrentActionMsg = _U('press_to_exit') + CurrentActionData = {propertyName = name} + elseif part == 'roomMenu' then + CurrentAction = 'room_menu' + CurrentActionMsg = _U('press_to_menu') + CurrentActionData = {property = property, owner = CurrentPropertyOwner} + end +end) + +AddEventHandler('esx_property:hasExitedMarker', function(name, part) + ESX.UI.Menu.CloseAll() + CurrentAction = nil +end) + +-- Enter / Exit marker events & Draw markers +Citizen.CreateThread(function() + while true do + Citizen.Wait(0) + + local coords = GetEntityCoords(PlayerPedId()) + local isInMarker, letSleep = false, true + local currentProperty, currentPart + + for i=1, #Config.Properties, 1 do + local property = Config.Properties[i] + + -- Entering + if property.entering and not property.disabled then + local distance = GetDistanceBetweenCoords(coords, property.entering.x, property.entering.y, property.entering.z, true) + + if distance < Config.DrawDistance then + DrawMarker(Config.MarkerType, property.entering.x, property.entering.y, property.entering.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, nil, nil, false) + if Config.MarkerText == true then + ESX.Game.Utils.DrawText3D(property.entering, property.name, 2) + end + letSleep = false + end + + if distance < Config.MarkerSize.x then + isInMarker = true + currentProperty = property.name + currentPart = 'entering' + end + end + + -- Exit + if property.exit and not property.disabled then + local distance = GetDistanceBetweenCoords(coords, property.exit.x, property.exit.y, property.exit.z, true) + + if distance < Config.DrawDistance then + DrawMarker(Config.MarkerType, property.exit.x, property.exit.y, property.exit.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, nil, nil, false) + letSleep = false + end + + if distance < Config.MarkerSize.x then + isInMarker = true + currentProperty = property.name + currentPart = 'exit' + end + end + + -- Room menu + if property.roomMenu and hasChest and not property.disabled then + local distance = GetDistanceBetweenCoords(coords, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, true) + + if distance < Config.DrawDistance then + DrawMarker(Config.MarkerType, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.RoomMenuMarkerColor.r, Config.RoomMenuMarkerColor.g, Config.RoomMenuMarkerColor.b, 100, false, true, 2, false, nil, nil, false) + letSleep = false + end + + if distance < Config.MarkerSize.x then + isInMarker = true + currentProperty = property.name + currentPart = 'roomMenu' + end + end + end + + if isInMarker and not hasAlreadyEnteredMarker or (isInMarker and (LastProperty ~= currentProperty or LastPart ~= currentPart) ) then + hasAlreadyEnteredMarker = true + LastProperty = currentProperty + LastPart = currentPart + + TriggerEvent('esx_property:hasEnteredMarker', currentProperty, currentPart) + end + + if not isInMarker and hasAlreadyEnteredMarker then + hasAlreadyEnteredMarker = false + TriggerEvent('esx_property:hasExitedMarker', LastProperty, LastPart) + end + + if letSleep then + Citizen.Wait(500) + end + end +end) + +-- Key controls +Citizen.CreateThread(function() + while true do + Citizen.Wait(0) + + if CurrentAction then + ESX.ShowHelpNotification(CurrentActionMsg) + + if IsControlJustReleased(0, 38) then + if CurrentAction == 'property_menu' then + OpenPropertyMenu(CurrentActionData.property) + elseif CurrentAction == 'gateway_menu' then + if Config.EnablePlayerManagement then + OpenGatewayOwnedPropertiesMenu(CurrentActionData.property) + else + OpenGatewayMenu(CurrentActionData.property) + end + elseif CurrentAction == 'room_menu' then + OpenRoomMenu(CurrentActionData.property, CurrentActionData.owner) + elseif CurrentAction == 'room_exit' then + TriggerEvent('instance:leave') + end + + CurrentAction = nil + end + else + Citizen.Wait(500) + end + end +end) diff --git a/[esx_addons]/esx_property/config.lua b/[esx_addons]/esx_property/config.lua new file mode 100644 index 00000000..0095b791 --- /dev/null +++ b/[esx_addons]/esx_property/config.lua @@ -0,0 +1,16 @@ +Config = {} + +Config.DrawDistance = 100 +Config.MarkerSize = {x = 1.5, y = 1.5, z = 1.0} +Config.MarkerColor = {r = 102, g = 102, b = 204} +Config.RoomMenuMarkerColor = {r = 102, g = 204, b = 102} +Config.MarkerType = 1 +Config.MarkerText = true + +Config.RentModifier = 200 -- rent price: / (rounded) +Config.SellModifier = 2 -- sell price: / (rounded) + +Config.Properties = {} + +Config.EnablePlayerManagement = false -- If set to true you use esx_realestateagentjob +Config.Locale = 'en' diff --git a/[esx_addons]/esx_property/esx_property.sql b/[esx_addons]/esx_property/esx_property.sql new file mode 100644 index 00000000..b513dd15 --- /dev/null +++ b/[esx_addons]/esx_property/esx_property.sql @@ -0,0 +1,96 @@ +USE `es_extended`; + +ALTER TABLE `users` + ADD COLUMN `last_property` VARCHAR(255) NULL +; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('property_black_money','Argent Sale Propriété',0) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('property','Propriété',0) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('property','Propriété',0) +; + +CREATE TABLE `owned_properties` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `price` double NOT NULL, + `rented` int(11) NOT NULL, + `owner` varchar(60) NOT NULL, + + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `properties` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `entering` varchar(255) DEFAULT NULL, + `exit` varchar(255) DEFAULT NULL, + `inside` varchar(255) DEFAULT NULL, + `outside` varchar(255) DEFAULT NULL, + `ipls` varchar(255) DEFAULT '[]', + `gateway` varchar(255) DEFAULT NULL, + `is_single` int(11) DEFAULT NULL, + `is_room` int(11) DEFAULT NULL, + `is_gateway` int(11) DEFAULT NULL, + `room_menu` varchar(255) DEFAULT NULL, + `price` int(11) NOT NULL, + + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +INSERT INTO `properties` VALUES + (1,'WhispymoundDrive','2677 Whispymound Drive','{\"y\":564.89,\"z\":182.959,\"x\":119.384}','{\"x\":117.347,\"y\":559.506,\"z\":183.304}','{\"y\":557.032,\"z\":183.301,\"x\":118.037}','{\"y\":567.798,\"z\":182.131,\"x\":119.249}','[]',NULL,1,1,0,'{\"x\":118.748,\"y\":566.573,\"z\":175.697}',1500000), + (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"x\":372.796,\"y\":428.327,\"z\":144.685}','{\"x\":373.548,\"y\":422.982,\"z\":144.907}','{\"y\":420.075,\"z\":145.904,\"x\":372.161}','{\"x\":372.454,\"y\":432.886,\"z\":143.443}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), + (3,'RichardMajesticApt2','Richard Majestic, Apt 2','{\"y\":-379.165,\"z\":37.961,\"x\":-936.363}','{\"y\":-365.476,\"z\":113.274,\"x\":-913.097}','{\"y\":-367.637,\"z\":113.274,\"x\":-918.022}','{\"y\":-382.023,\"z\":37.961,\"x\":-943.626}','[]',NULL,1,1,0,'{\"x\":-927.554,\"y\":-377.744,\"z\":112.674}',1700000), + (4,'NorthConkerAvenue2044','2044 North Conker Avenue','{\"y\":440.8,\"z\":146.702,\"x\":346.964}','{\"y\":437.456,\"z\":148.394,\"x\":341.683}','{\"y\":435.626,\"z\":148.394,\"x\":339.595}','{\"x\":350.535,\"y\":443.329,\"z\":145.764}','[]',NULL,1,1,0,'{\"x\":337.726,\"y\":436.985,\"z\":140.77}',1500000), + (5,'WildOatsDrive','3655 Wild Oats Drive','{\"y\":502.696,\"z\":136.421,\"x\":-176.003}','{\"y\":497.817,\"z\":136.653,\"x\":-174.349}','{\"y\":495.069,\"z\":136.666,\"x\":-173.331}','{\"y\":506.412,\"z\":135.0664,\"x\":-177.927}','[]',NULL,1,1,0,'{\"x\":-174.725,\"y\":493.095,\"z\":129.043}',1500000), + (6,'HillcrestAvenue2862','2862 Hillcrest Avenue','{\"y\":596.58,\"z\":142.641,\"x\":-686.554}','{\"y\":591.988,\"z\":144.392,\"x\":-681.728}','{\"y\":590.608,\"z\":144.392,\"x\":-680.124}','{\"y\":599.019,\"z\":142.059,\"x\":-689.492}','[]',NULL,1,1,0,'{\"x\":-680.46,\"y\":588.6,\"z\":136.769}',1500000), + (7,'LowEndApartment','Appartement de base','{\"y\":-1078.735,\"z\":28.4031,\"x\":292.528}','{\"y\":-1007.152,\"z\":-102.002,\"x\":265.845}','{\"y\":-1002.802,\"z\":-100.008,\"x\":265.307}','{\"y\":-1078.669,\"z\":28.401,\"x\":296.738}','[]',NULL,1,1,0,'{\"x\":265.916,\"y\":-999.38,\"z\":-100.008}',562500), + (8,'MadWayneThunder','2113 Mad Wayne Thunder','{\"y\":454.955,\"z\":96.462,\"x\":-1294.433}','{"x":-1289.917,"y":449.541,"z":96.902}','{\"y\":446.322,\"z\":96.899,\"x\":-1289.642}','{\"y\":455.453,\"z\":96.517,\"x\":-1298.851}','[]',NULL,1,1,0,'{\"x\":-1287.306,\"y\":455.901,\"z\":89.294}',1500000), + (9,'HillcrestAvenue2874','2874 Hillcrest Avenue','{\"x\":-853.346,\"y\":696.678,\"z\":147.782}','{\"y\":690.875,\"z\":151.86,\"x\":-859.961}','{\"y\":688.361,\"z\":151.857,\"x\":-859.395}','{\"y\":701.628,\"z\":147.773,\"x\":-855.007}','[]',NULL,1,1,0,'{\"x\":-858.543,\"y\":697.514,\"z\":144.253}',1500000), + (10,'HillcrestAvenue2868','2868 Hillcrest Avenue','{\"y\":620.494,\"z\":141.588,\"x\":-752.82}','{\"y\":618.62,\"z\":143.153,\"x\":-759.317}','{\"y\":617.629,\"z\":143.153,\"x\":-760.789}','{\"y\":621.281,\"z\":141.254,\"x\":-750.919}','[]',NULL,1,1,0,'{\"x\":-762.504,\"y\":618.992,\"z\":135.53}',1500000), + (11,'TinselTowersApt12','Tinsel Towers, Apt 42','{\"y\":37.025,\"z\":42.58,\"x\":-618.299}','{\"y\":58.898,\"z\":97.2,\"x\":-603.301}','{\"y\":58.941,\"z\":97.2,\"x\":-608.741}','{\"y\":30.603,\"z\":42.524,\"x\":-620.017}','[]',NULL,1,1,0,'{\"x\":-622.173,\"y\":54.585,\"z\":96.599}',1700000), + (12,'MiltonDrive','Milton Drive','{\"x\":-775.17,\"y\":312.01,\"z\":84.658}',NULL,NULL,'{\"x\":-775.346,\"y\":306.776,\"z\":84.7}','[]',NULL,0,0,1,NULL,0), + (13,'Modern1Apartment','Appartement Moderne 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_01_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.661,\"y\":327.672,\"z\":210.396}',1300000), + (14,'Modern2Apartment','Appartement Moderne 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_01_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.735,\"y\":326.757,\"z\":186.313}',1300000), + (15,'Modern3Apartment','Appartement Moderne 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_01_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.386,\"y\":330.782,\"z\":195.08}',1300000), + (16,'Mody1Apartment','Appartement Mode 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_02_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.615,\"y\":327.878,\"z\":210.396}',1300000), + (17,'Mody2Apartment','Appartement Mode 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_02_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.297,\"y\":327.092,\"z\":186.313}',1300000), + (18,'Mody3Apartment','Appartement Mode 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_02_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.303,\"y\":330.932,\"z\":195.085}',1300000), + (19,'Vibrant1Apartment','Appartement Vibrant 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_03_a\"]','MiltonDrive',0,1,0,'{\"x\":-765.885,\"y\":327.641,\"z\":210.396}',1300000), + (20,'Vibrant2Apartment','Appartement Vibrant 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_03_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.607,\"y\":327.344,\"z\":186.313}',1300000), + (21,'Vibrant3Apartment','Appartement Vibrant 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_03_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.525,\"y\":330.851,\"z\":195.085}',1300000), + (22,'Sharp1Apartment','Appartement Persan 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_04_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.527,\"y\":327.89,\"z\":210.396}',1300000), + (23,'Sharp2Apartment','Appartement Persan 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_04_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.642,\"y\":326.497,\"z\":186.313}',1300000), + (24,'Sharp3Apartment','Appartement Persan 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_04_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.503,\"y\":331.318,\"z\":195.085}',1300000), + (25,'Monochrome1Apartment','Appartement Monochrome 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_05_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.289,\"y\":328.086,\"z\":210.396}',1300000), + (26,'Monochrome2Apartment','Appartement Monochrome 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_05_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.692,\"y\":326.762,\"z\":186.313}',1300000), + (27,'Monochrome3Apartment','Appartement Monochrome 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_05_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.094,\"y\":330.976,\"z\":195.085}',1300000), + (28,'Seductive1Apartment','Appartement Séduisant 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_06_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.263,\"y\":328.104,\"z\":210.396}',1300000), + (29,'Seductive2Apartment','Appartement Séduisant 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_06_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.655,\"y\":326.611,\"z\":186.313}',1300000), + (30,'Seductive3Apartment','Appartement Séduisant 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_06_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.3,\"y\":331.414,\"z\":195.085}',1300000), + (31,'Regal1Apartment','Appartement Régal 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_07_a\"]','MiltonDrive',0,1,0,'{\"x\":-765.956,\"y\":328.257,\"z\":210.396}',1300000), + (32,'Regal2Apartment','Appartement Régal 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_07_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.545,\"y\":326.659,\"z\":186.313}',1300000), + (33,'Regal3Apartment','Appartement Régal 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_07_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.087,\"y\":331.429,\"z\":195.123}',1300000), + (34,'Aqua1Apartment','Appartement Aqua 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_08_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.187,\"y\":328.47,\"z\":210.396}',1300000), + (35,'Aqua2Apartment','Appartement Aqua 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_08_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.658,\"y\":326.563,\"z\":186.313}',1300000), + (36,'Aqua3Apartment','Appartement Aqua 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_08_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.287,\"y\":331.084,\"z\":195.086}',1300000), + (37,'IntegrityWay','4 Integrity Way','{\"x\":-47.804,\"y\":-585.867,\"z\":36.956}',NULL,NULL,'{\"x\":-54.178,\"y\":-583.762,\"z\":35.798}','[]',NULL,0,0,1,NULL,0), + (38,'IntegrityWay28','4 Integrity Way - Apt 28',NULL,'{\"x\":-31.409,\"y\":-594.927,\"z\":79.03}','{\"x\":-26.098,\"y\":-596.909,\"z\":79.03}',NULL,'[]','IntegrityWay',0,1,0,'{\"x\":-11.923,\"y\":-597.083,\"z\":78.43}',1700000), + (39,'IntegrityWay30','4 Integrity Way - Apt 30',NULL,'{\"x\":-17.702,\"y\":-588.524,\"z\":89.114}','{\"x\":-16.21,\"y\":-582.569,\"z\":89.114}',NULL,'[]','IntegrityWay',0,1,0,'{\"x\":-26.327,\"y\":-588.384,\"z\":89.123}',1700000), + (40,'DellPerroHeights','Dell Perro Heights','{\"x\":-1447.06,\"y\":-538.28,\"z\":33.74}',NULL,NULL,'{\"x\":-1440.022,\"y\":-548.696,\"z\":33.74}','[]',NULL,0,0,1,NULL,0), + (41,'DellPerroHeightst4','Dell Perro Heights - Apt 28',NULL,'{\"x\":-1452.125,\"y\":-540.591,\"z\":73.044}','{\"x\":-1455.435,\"y\":-535.79,\"z\":73.044}',NULL,'[]','DellPerroHeights',0,1,0,'{\"x\":-1467.058,\"y\":-527.571,\"z\":72.443}',1700000), + (42,'DellPerroHeightst7','Dell Perro Heights - Apt 30',NULL,'{\"x\":-1451.562,\"y\":-523.535,\"z\":55.928}','{\"x\":-1456.02,\"y\":-519.209,\"z\":55.929}',NULL,'[]','DellPerroHeights',0,1,0,'{\"x\":-1457.026,\"y\":-530.219,\"z\":55.937}',1700000) +; + diff --git a/[esx_addons]/esx_property/fxmanifest.lua b/[esx_addons]/esx_property/fxmanifest.lua new file mode 100644 index 00000000..e97611c2 --- /dev/null +++ b/[esx_addons]/esx_property/fxmanifest.lua @@ -0,0 +1,49 @@ +fx_version 'adamant' + +game 'gta5' + +description 'ESX Property' + +version '1.0.4' + +server_scripts { + '@async/async.lua', + '@mysql-async/lib/MySQL.lua', + '@es_extended/locale.lua', + 'locales/tr.lua', + 'locales/de.lua', + 'locales/br.lua', + 'locales/en.lua', + 'locales/fi.lua', + 'locales/fr.lua', + 'locales/es.lua', + 'locales/sv.lua', + 'locales/pl.lua', + 'config.lua', + 'server/main.lua' +} + +client_scripts { + '@es_extended/locale.lua', + 'locales/tr.lua', + 'locales/de.lua', + 'locales/br.lua', + 'locales/en.lua', + 'locales/fi.lua', + 'locales/fr.lua', + 'locales/es.lua', + 'locales/sv.lua', + 'locales/pl.lua', + 'config.lua', + 'client/main.lua' +} + +dependencies { + 'async', + 'es_extended', + 'instance', + 'cron', + 'esx_addonaccount', + 'esx_addoninventory', + 'esx_datastore' +} diff --git a/[esx_addons]/esx_property/locales/br.lua b/[esx_addons]/esx_property/locales/br.lua new file mode 100644 index 00000000..0ff61d99 --- /dev/null +++ b/[esx_addons]/esx_property/locales/br.lua @@ -0,0 +1,37 @@ +Locales['br'] = { + ['have_withdrawn'] = 'você retirou ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'você depositou ~y~x%s~s~ ~b~%s~s~', + ['free_prop'] = 'Propriedade a Venda', + ['property'] = 'Propriedade', + ['enter'] = 'Entrar', + ['move_out'] = 'move out from property', + ['move_out_sold'] = 'sell property for $%s', + ['moved_out'] = 'you moved out and do no longer rent the property.', + ['moved_out_sold'] = 'you have sold the property for ~g~$%s~s~', + ['buy'] = 'buy property for $%s', + ['buy_for'] = 'você comprou uma propriedade por ~g~$%s~s~', + ['rent'] = 'rent property for $%s / week', + ['rent_for'] = 'você alugou uma propriedade por ~g~$%s~s~', + ['press_to_menu'] = 'Pressione ~INPUT_CONTEXT~ para acessar o menu', + ['owned_properties'] = 'Propriedades adquiridas', + ['available_properties'] = 'Propriedades disponíveis', + ['invite_player'] = 'Convidar um jogador', + ['you_invited'] = 'you invited ~y~%s~s~ to your property', + ['player_clothes'] = 'Roupas', + ['remove_cloth'] = 'tire a roupa', + ['removed_cloth'] = 'a roupa foi removida do seu guarda-roupa!', + ['remove_object'] = 'Remover objeto', + ['deposit_object'] = 'Depositar objeto', + ['invite'] = 'Convidar', + ['dirty_money'] = 'Dinheiro sujo: $%s', + ['inventory'] = 'Inventário', + ['amount'] = 'valor?', + ['amount_invalid'] = 'quantidade inválida', + ['press_to_exit'] = 'Pressione ~INPUT_CONTEXT~ para sair da propriedade', + ['not_enough'] = 'Você não tem dinheiro suficiente', + ['invalid_quantity'] = 'Quantidade inválida', + ['paid_rent'] = 'you paid your rent at ~g~$%s~s~ for ~y~%s~s~', + ['paid_rent_evicted'] = 'you have been ~o~evicted~s~ from ~y~%s~s~ for not affording rent at ~g~$%s~s~', + ['not_enough_in_property'] = 'não há o suficiente de que esse item esteja na propriedade!', + ['player_cannot_hold'] = 'você não tem espaço suficiente em seu inventário!', +} diff --git a/[esx_addons]/esx_property/locales/de.lua b/[esx_addons]/esx_property/locales/de.lua new file mode 100644 index 00000000..c50ebd84 --- /dev/null +++ b/[esx_addons]/esx_property/locales/de.lua @@ -0,0 +1,37 @@ +Locales['de'] = { + ['have_withdrawn'] = 'you have withdrawn ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'you have deposited ~y~x%s~s~ ~b~%s~s~', + ['free_prop'] = 'Kostenlose Immobilie', + ['property'] = 'Immobilie', + ['enter'] = 'Eintreten', + ['move_out'] = 'move out from property', + ['move_out_sold'] = 'sell property for $%s', + ['moved_out'] = 'you moved out and do no longer rent the property.', + ['moved_out_sold'] = 'you have sold the property for ~g~$%s~s~', + ['buy'] = 'buy property for $%s', + ['buy_for'] = 'you purchased a property for ~g~$%s~s~', + ['rent'] = 'rent property for $%s / week', + ['rent_for'] = 'you rented a property for ~g~$%s~s~ / week, payment is automatic', + ['press_to_menu'] = 'Drücke ~INPUT_CONTEXT~ um das Menü zu öffnen', + ['owned_properties'] = 'Gekaufte Immobilien', + ['available_properties'] = 'Verfügbare Immobilien', + ['invite_player'] = 'Spieler einladen', + ['you_invited'] = 'Du hast %s eingeladen', + ['player_clothes'] = 'Kleidung', + ['remove_cloth'] = 'remove clothing', + ['removed_cloth'] = 'the outfit has been removed from your wardrobe!', + ['remove_object'] = 'Objekt nehmen', + ['deposit_object'] = 'Objekt deponieren', + ['invite'] = 'Einladen', + ['dirty_money'] = 'Schwarzgeld: $%s', + ['inventory'] = 'Inventar', + ['amount'] = 'Anzahlt?', + ['amount_invalid'] = 'Ungültiger Wert', + ['press_to_exit'] = 'Drücke ~INPUT_CONTEXT~ um die Immobilie zu verlassen', + ['not_enough'] = 'du hast nicht genug Geld', + ['invalid_quantity'] = 'Ungültiger Betrag', + ['paid_rent'] = 'you paid your rent at ~g~$%s~s~ for ~y~%s~s~', + ['paid_rent_evicted'] = 'you have been ~o~evicted~s~ from ~y~%s~s~ for not affording rent at ~g~$%s~s~', + ['not_enough_in_property'] = 'there\'s not enough of ~r~that item~s~ in the property!', + ['player_cannot_hold'] = 'you do ~r~not~s~ have enough ~y~free space~s~ in your inventory!', +} diff --git a/[esx_addons]/esx_property/locales/en.lua b/[esx_addons]/esx_property/locales/en.lua new file mode 100644 index 00000000..61296a87 --- /dev/null +++ b/[esx_addons]/esx_property/locales/en.lua @@ -0,0 +1,37 @@ +Locales['en'] = { + ['have_withdrawn'] = 'you have withdrawn ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'you have deposited ~y~x%s~s~ ~b~%s~s~', + ['free_prop'] = 'property For Sale', + ['property'] = 'property', + ['enter'] = 'enter', + ['move_out'] = 'move out from property', + ['move_out_sold'] = 'sell property for $%s', + ['moved_out'] = 'you moved out and do no longer rent the property.', + ['moved_out_sold'] = 'you have sold the property for ~g~$%s~s~', + ['buy'] = 'buy property for $%s', + ['buy_for'] = 'you purchased a property for ~g~$%s~s~', + ['rent'] = 'rent property for $%s / week', + ['rent_for'] = 'you rented a property for ~g~$%s~s~ / week, payment is automatic', + ['press_to_menu'] = 'press ~INPUT_CONTEXT~ to access the ~y~Property Menu~s~.', + ['owned_properties'] = 'acquired properties', + ['available_properties'] = 'available properties', + ['invite_player'] = 'invite a player', + ['you_invited'] = 'you invited ~y~%s~s~ to your property', + ['player_clothes'] = 'clothes', + ['remove_cloth'] = 'remove clothing', + ['removed_cloth'] = 'the outfit has been removed from your wardrobe!', + ['remove_object'] = 'remove object', + ['deposit_object'] = 'deposit object', + ['invite'] = 'invite', + ['dirty_money'] = 'dirty money: $%s', + ['inventory'] = 'inventory', + ['amount'] = 'amount?', + ['amount_invalid'] = 'invalid amount', + ['press_to_exit'] = 'press ~INPUT_CONTEXT~ to exit the property', + ['not_enough'] = 'you do not have enough money', + ['invalid_quantity'] = 'invalid quantity', + ['paid_rent'] = 'you paid your rent at ~g~$%s~s~ for ~y~%s~s~', + ['paid_rent_evicted'] = 'you have been ~o~evicted~s~ from ~y~%s~s~ for not affording rent at ~g~$%s~s~', + ['not_enough_in_property'] = 'there\'s not enough of ~r~that item~s~ in the property!', + ['player_cannot_hold'] = 'you do ~r~not~s~ have enough ~y~free space~s~ in your inventory!', +} diff --git a/[esx_addons]/esx_property/locales/es.lua b/[esx_addons]/esx_property/locales/es.lua new file mode 100644 index 00000000..0ff5d49c --- /dev/null +++ b/[esx_addons]/esx_property/locales/es.lua @@ -0,0 +1,37 @@ +Locales['es'] = { + ['have_withdrawn'] = 'Has sacado ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'Has depositado ~y~x%s~s~ ~b~%s~s~', + ['free_prop'] = 'Propiedad libre', + ['property'] = 'Propiedad', + ['enter'] = 'Entrar', + ['move_out'] = 'Mudarse de propiedad', + ['move_out_sold'] = 'Vender propiedad por %s$', + ['moved_out'] = 'Te has mudado y no puedes alquilar esa propiedad', + ['moved_out_sold'] = 'Has vendido la propiedad por ~g~%s$~s~', + ['buy'] = 'Comprar propiedad por %s$', + ['buy_for'] = 'Has comprado una propiedad por ~g~%s$~s~', + ['rent'] = 'Alquilar propiedad por %s$ / semana', + ['rent_for'] = 'Has alquilado una propiedad por ~g~%s$~s~', + ['press_to_menu'] = 'Pulsa ~INPUT_CONTEXT~ para acceder al menú', + ['owned_properties'] = 'Propiedad adquirida', + ['available_properties'] = 'Propiedades disponibles', + ['invite_player'] = 'Invitar a un jugador', + ['you_invited'] = 'Has invitado a %s', + ['player_clothes'] = 'Ropa', + ['remove_cloth'] = 'Eliminar ropa', + ['removed_cloth'] = '¡El conjunto ha sido eliminado del armario!', + ['remove_object'] = 'Retirar objeto', + ['deposit_object'] = 'Depositar objeto', + ['invite'] = 'Invitar', + ['dirty_money'] = 'Dinero sucio: %s$', + ['inventory'] = 'Inventario', + ['amount'] = '¿Cantidad?', + ['amount_invalid'] = 'Cantidad inválida', + ['press_to_exit'] = 'Pulsa ~INPUT_CONTEXT~ para salir de la propiedad', + ['not_enough'] = 'No tienes suficiente dinero', + ['invalid_quantity'] = 'Cantidad inválida', + ['paid_rent'] = 'Pagaste tu alquiler de ~g~%s$~s~ en ~y~%s~s~', + ['paid_rent_evicted'] = 'Has sido ~o~desahuciado~s~ de ~y~%s~s~ por no pagar el alquiler de ~g~%s$~s~', + ['not_enough_in_property'] = '¡No hay suficiente cantidad de ~r~ese objeto~s~ en la propiedad!', + ['player_cannot_hold'] = '¡~r~No tienes~s~ suficiente ~y~espacio libre~s~ en tu inventario!', +} diff --git a/[esx_addons]/esx_property/locales/fi.lua b/[esx_addons]/esx_property/locales/fi.lua new file mode 100644 index 00000000..e52417be --- /dev/null +++ b/[esx_addons]/esx_property/locales/fi.lua @@ -0,0 +1,37 @@ +Locales['fi'] = { + ['have_withdrawn'] = 'sinä nostit ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'sinä talletit ~y~x%s~s~ ~b~%s~s~', + ['free_prop'] = 'vapaa kiinteistö', + ['property'] = 'asunto', + ['enter'] = 'sisään', + ['move_out'] = 'move out from property', + ['move_out_sold'] = 'sell property for $%s', + ['moved_out'] = 'you moved out and do no longer rent the property.', + ['moved_out_sold'] = 'you have sold the property for ~g~$%s~s~', + ['buy'] = 'buy property for $%s', + ['buy_for'] = 'sinä ostit kiinteistön hintaan ~g~$%s~s~', + ['rent'] = 'rent property for $%s / week', + ['rent_for'] = 'sinä vuokrasit kiinteistön hintaan ~g~$%s~s~', + ['press_to_menu'] = 'paina ~INPUT_CONTEXT~ avataksesi talon valikko', + ['owned_properties'] = 'omistuksessa olevat asunnot', + ['available_properties'] = 'vapaat asunnot', + ['invite_player'] = 'kutsu pelaaja', + ['you_invited'] = 'sinä kutsuit henkilön ~y~%s~s~ kiinteistöösi', + ['player_clothes'] = 'asut', + ['remove_cloth'] = 'poista asu', + ['removed_cloth'] = 'asu poistettiin vaatekaapistasi!', + ['remove_object'] = 'poista esine', + ['deposit_object'] = 'talleta esine', + ['invite'] = 'kutsu', + ['dirty_money'] = 'likainen raha: $%s', + ['inventory'] = 'reppu', + ['amount'] = 'määrä?', + ['amount_invalid'] = 'virheellinen määrä', + ['press_to_exit'] = 'paina ~INPUT_CONTEXT~ poistuaksesi kiinteistöstä', + ['not_enough'] = 'sinulla ei ole tarpeeksi rahaa', + ['invalid_quantity'] = 'virheellinen määrä', + ['paid_rent'] = 'you paid your rent at ~g~$%s~s~ for ~y~%s~s~', + ['paid_rent_evicted'] = 'you have been ~o~evicted~s~ from ~y~%s~s~ for not affording rent at ~g~$%s~s~', + ['not_enough_in_property'] = 'täällä ei ole enempää ~r~tätä itemiä~s~ tässä kiinteistössä!', + ['player_cannot_hold'] = 'sinulla ~r~ei ole~s~ tarpeeksi ~y~vapaata tilaa~s~ repussasi!', +} diff --git a/[esx_addons]/esx_property/locales/fr.lua b/[esx_addons]/esx_property/locales/fr.lua new file mode 100644 index 00000000..ed734e23 --- /dev/null +++ b/[esx_addons]/esx_property/locales/fr.lua @@ -0,0 +1,37 @@ +Locales['fr'] = { + ['have_withdrawn'] = 'vous avez pris ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'vous avez déposé ~y~x%s~s~ ~b~%s~s~', + ['free_prop'] = 'propriété libre', + ['property'] = 'propriété', + ['enter'] = 'entrer', + ['move_out'] = 'move out from property', + ['move_out_sold'] = 'sell property for $%s', + ['moved_out'] = 'you moved out and do no longer rent the property.', + ['moved_out_sold'] = 'you have sold the property for ~g~$%s~s~', + ['buy'] = 'buy property for $%s', + ['buy_for'] = 'vous avez acheté une propriété pour ~g~$%s~s~', + ['rent'] = 'rent property for $%s / week', + ['rent_for'] = 'vous avez loué une propriété pour ~g~$%s~s~', + ['press_to_menu'] = 'appuyez sur ~INPUT_CONTEXT~ pour accéder au menu', + ['owned_properties'] = 'propriétés acquises', + ['available_properties'] = 'propriétés disponibles', + ['invite_player'] = 'inviter un joueur', + ['you_invited'] = 'vous avez invité %s', + ['player_clothes'] = 'vêtements', + ['remove_cloth'] = 'supprimer des tenues', + ['removed_cloth'] = 'cette tenue a bien été supprimée de votre garde robe !', + ['remove_object'] = 'retirer objet', + ['deposit_object'] = 'déposer objet', + ['invite'] = 'inviter', + ['dirty_money'] = 'argent sale: $%s', + ['inventory'] = 'inventaire', + ['amount'] = 'quantité ?', + ['amount_invalid'] = 'montant invalide', + ['press_to_exit'] = 'appuyez sur ~INPUT_CONTEXT~ pour sortir de la propriété', + ['not_enough'] = 'vous n\'avez pas assez d\'argent', + ['invalid_quantity'] = 'quantité invalide', + ['paid_rent'] = 'you paid your rent at ~g~$%s~s~ for ~y~%s~s~', + ['paid_rent_evicted'] = 'you have been ~o~evicted~s~ from ~y~%s~s~ for not affording rent at ~g~$%s~s~', + ['not_enough_in_property'] = 'il n\'a pas assez de ~r~cet objet~s~ dans votre coffre!', + ['player_cannot_hold'] = 'vous n\'avez pas assez ~y~de place~s~ dans votre inventaire!', +} diff --git a/[esx_addons]/esx_property/locales/pl.lua b/[esx_addons]/esx_property/locales/pl.lua new file mode 100644 index 00000000..eb9428cb --- /dev/null +++ b/[esx_addons]/esx_property/locales/pl.lua @@ -0,0 +1,37 @@ +Locales['pl'] = { + ['have_withdrawn'] = 'wyciągnąłeś/aś ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'zdeponowałeś/aś ~y~x%s~s~ ~b~%s~s~', + ['free_prop'] = 'wolne mieszkanie', + ['property'] = 'mieszkanie', + ['enter'] = 'wejdz', + ['move_out'] = 'move out from property', + ['move_out_sold'] = 'sell property for $%s', + ['moved_out'] = 'you moved out and do no longer rent the property.', + ['moved_out_sold'] = 'you have sold the property for ~g~$%s~s~', + ['buy'] = 'buy property for $%s', + ['buy_for'] = 'kupiłeś/aś mieszkanie za ~g~$%s~s~', + ['rent'] = 'rent property for $%s / week', + ['rent_for'] = 'wynająłeś/aś mieszkanie za ~g~$%s~s~', + ['press_to_menu'] = 'wciśnij ~INPUT_CONTEXT~ aby otworzyć menu', + ['owned_properties'] = 'twoje mieszkania', + ['available_properties'] = 'dostępne mieszkania', + ['invite_player'] = 'zaproś gracza', + ['you_invited'] = 'zaprosiłeś/aś ~y~%s~s~ do swojego mieszkania', + ['player_clothes'] = 'ubrania', + ['remove_cloth'] = 'usuń ubrania', + ['removed_cloth'] = 'te ubrania zostały usunięte z twojej garderoby!', + ['remove_object'] = 'usuń objekt', + ['deposit_object'] = 'deponuj objekt', + ['invite'] = 'zaproś', + ['dirty_money'] = 'brudne pieniądze: $%s', + ['inventory'] = 'ekwipunek', + ['amount'] = 'suma?', + ['amount_invalid'] = 'nieprawidłowa suma', + ['press_to_exit'] = 'wciśnij ~INPUT_CONTEXT~ aby wyjść z mieszkania', + ['not_enough'] = 'nie posiadasz wystarczająco pieniędzy', + ['invalid_quantity'] = 'nieprawidłowa ilość', + ['paid_rent'] = 'you paid your rent at ~g~$%s~s~ for ~y~%s~s~', + ['paid_rent_evicted'] = 'you have been ~o~evicted~s~ from ~y~%s~s~ for not affording rent at ~g~$%s~s~', + ['not_enough_in_property'] = 'nie ma wystarczająco ~r~tego przedmiotu~s~ w mieszkaniu!', + ['player_cannot_hold'] = '~r~nie masz~s~ wystarczająco ~y~wolnego~s~ miejsca w ekwipunku!', +} diff --git a/[esx_addons]/esx_property/locales/pt.lua b/[esx_addons]/esx_property/locales/pt.lua new file mode 100644 index 00000000..c0eba25a --- /dev/null +++ b/[esx_addons]/esx_property/locales/pt.lua @@ -0,0 +1,37 @@ +Locales['pt'] = { + ['have_withdrawn'] = 'Depositaste ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'Depositaste ~y~x%s~s~ ~b~%s~s~', + ['free_prop'] = 'Propriedade à Venda', + ['property'] = 'Propriedade', + ['enter'] = 'Entrar', + ['move_out'] = 'Sair da Propriedade', + ['move_out_sold'] = 'Vender a Propriedade por %s€', + ['moved_out'] = 'Tu saiste da casa e já não és o arrendatário.', + ['moved_out_sold'] = 'Tu vendeste a propriedade por ~g~%s€~s~', + ['buy'] = 'Comprar a Propriedade por %s€', + ['buy_for'] = 'Compraste uma Propriedade por ~g~%s€~s~', + ['rent'] = 'Arrendar a Propriedade por %s€ / semana', + ['rent_for'] = 'Arrendaste uma Propriedade por ~g~%s€~s~', + ['press_to_menu'] = 'Pressiona ~INPUT_CONTEXT~ para abrir o menu', + ['owned_properties'] = 'Propriedades Adquiridas', + ['available_properties'] = 'Propriedades Disponíveis', + ['invite_player'] = 'Convidar um jogador', + ['you_invited'] = 'Tu convidaste ~y~%s~s~ para a tua Propriedade', + ['player_clothes'] = 'Roupas', + ['remove_cloth'] = 'Tira a roupa do guarda-roupa', + ['removed_cloth'] = 'A roupa foi removida do teu guarda-roupa!', + ['remove_object'] = 'Retirar objeto', + ['deposit_object'] = 'Depositar objeto', + ['invite'] = 'Convidar', + ['dirty_money'] = 'Dinheiro sujo: %s€', + ['inventory'] = 'Inventário', + ['amount'] = 'Valor?', + ['amount_invalid'] = 'Quantidade Inválida', + ['press_to_exit'] = 'Pressiona ~INPUT_CONTEXT~ para sair da propriedade', + ['not_enough'] = 'Não tens dinheiro suficiente', + ['invalid_quantity'] = 'Quantidade inválida', + ['paid_rent'] = 'Tu pagaste a tua renda de ~g~%s€~s~ por ~y~%s~s~', + ['paid_rent_evicted'] = 'Tu foste ~o~despejado~s~ da ~y~%s~s~ por não teres dinheiro para pagar a renda de ~g~%s€~s~', + ['not_enough_in_property'] = 'Não tens itens desses suficientes na Propriedade!', + ['player_cannot_hold'] = 'Não tens espaço suficiente no Inventário!', +} \ No newline at end of file diff --git a/[esx_addons]/esx_property/locales/sv.lua b/[esx_addons]/esx_property/locales/sv.lua new file mode 100644 index 00000000..aa609bb1 --- /dev/null +++ b/[esx_addons]/esx_property/locales/sv.lua @@ -0,0 +1,37 @@ +Locales['sv'] = { + ['have_withdrawn'] = 'du har tagit ut ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'du har lagrat ~y~x%s~s~ ~b~%s~s~', + ['free_prop'] = 'ledig fastighet', + ['property'] = 'fastighet', + ['enter'] = 'gå in', + ['move_out'] = 'flytta ut', + ['move_out_sold'] = 'sälj fastighet för %s SEK', + ['moved_out'] = 'du har flyttat ut och hyr inte fastigheten längre', + ['moved_out_sold'] = 'du har sålt fastigheten för ~g~%s SEK~s~', + ['buy'] = 'köp fastighet för %s SEK', + ['buy_for'] = 'du köpte en fastighet för ~g~%s SEK~s~', + ['rent'] = 'hyr fastighet för %s SEK / vecka', + ['rent_for'] = 'du hyrde en fastighet för ~g~%s SEK~s~ / vecka, betalning sker automatiskt', + ['press_to_menu'] = 'tryck ~INPUT_CONTEXT~ för att komma åt menyn', + ['owned_properties'] = 'ägda fastigheter', + ['available_properties'] = 'fastigheter till salu', + ['invite_player'] = 'bjud in spelare', + ['you_invited'] = 'du bjöd in ~y~%s~s~ till din fastighet', + ['player_clothes'] = 'Kläder', + ['remove_cloth'] = 'ta bort klädstil', + ['removed_cloth'] = 'denna outfit har blivit borttagen från din garderob!', + ['remove_object'] = 'ta ut objekt', + ['deposit_object'] = 'lagra objekt', + ['invite'] = 'bjud in', + ['dirty_money'] = 'smutsiga pengar: %s SEK', + ['inventory'] = 'inventory', + ['amount'] = 'summa?', + ['amount_invalid'] = 'ogiltlig summa', + ['press_to_exit'] = 'tryck ~INPUT_CONTEXT~ för att lämna fastigheten', + ['not_enough'] = 'du har inte tillräckligt med pengar!', + ['invalid_quantity'] = 'ogiltlig mängd', + ['paid_rent'] = 'du betalade din hyra på ~g~%s SEK~s~ för ~y~%s~s~', + ['paid_rent_evicted'] = 'du blev ~o~vräkt~s~ från ~y~%s~s~ för att du inte har råd för att betala hyran på ~g~%s SEK~s~', + ['not_enough_in_property'] = 'det finns ~r~inte~s~ tillräckligt av ~r~det objektet~s~ i fastigheten!', + ['player_cannot_hold'] = 'du har ~r~inte~s~ tillräckligt med ~y~utrymme~s~ för att hålla det!', +} diff --git a/[esx_addons]/esx_property/locales/tr.lua b/[esx_addons]/esx_property/locales/tr.lua new file mode 100644 index 00000000..2651cc9b --- /dev/null +++ b/[esx_addons]/esx_property/locales/tr.lua @@ -0,0 +1,35 @@ +Locales['tr'] = { + ['have_withdrawn'] = 'Depodan çıkarıldı ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'Depoya eklendi ~y~x%s~s~ ~b~%s~s~', + ['free_prop'] = 'Satılık Ev', + ['property'] = 'Ev', + ['enter'] = 'Gir', + ['leave'] = 'Sat', + ['buy'] = 'Satın Al', + ['rent'] = 'Kirala', + ['visit'] = 'Ziyaret Et', + ['press_to_menu'] = '~INPUT_CONTEXT~ tuşuna basarak menüyü açabilirsin.', + ['owned_properties'] = 'Sahip olunan evler', + ['available_properties'] = 'Kullanılabilir evler', + ['invite_player'] = 'Oyuncuyu Davet Et', + ['you_invited'] = '~y~%s~s~ kişisini evine davet ettin.', + ['player_clothes'] = 'Kıyafetler', + ['remove_cloth'] = 'Kıyafetleri Çıkar', + ['removed_cloth'] = 'Kıyafeti çöpe attınız.', + ['remove_object'] = 'Öğeyi çöpe at', + ['deposit_object'] = 'Öğeyi depoya ekle', + ['invite'] = 'Davet', + ['dirty_money'] = 'Kirli Para: $%s', + ['inventory'] = 'Envanter', + ['amount'] = 'adet?', + ['amount_invalid'] = 'Geçersiz adet.', + ['press_to_exit'] = '~INPUT_CONTEXT~ tuşuna basarak evinizden çıkabilirsiniz.', + ['rented_for'] = '~g~$%s~s~ ücret karşılığında evi kiraladın.', + ['purchased_for'] = '~g~$%s~s~ ücret karşılığında evi satın aldın.', + ['made_property'] = 'Sahip olduğun evi sattın.', + ['not_enough'] = 'Yeterli paran yok.', + ['invalid_quantity'] = 'Geçersiz miktar.', + ['paid_rent'] = 'Kira ücreti olarak ~g~$%s~s~ için ~g~paid~s~ ödedin.', + ['not_enough_in_property'] = 'Bu eşyadan evin içerisinde yeteri kadar bulunmuyor.', + ['player_cannot_hold'] = 'Envanterinde yeterli boş alan yok.', +} diff --git a/[esx_addons]/esx_property/localization/de_esx_property.sql b/[esx_addons]/esx_property/localization/de_esx_property.sql new file mode 100644 index 00000000..6026b57e --- /dev/null +++ b/[esx_addons]/esx_property/localization/de_esx_property.sql @@ -0,0 +1,96 @@ +USE `es_extended`; + +ALTER TABLE `users` + ADD COLUMN `last_property` VARCHAR(255) NULL +; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('property_black_money','Schwarzgeld',0) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('property','Immobilien',0) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('property','Immobilien',0) +; + +CREATE TABLE `owned_properties` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `price` double NOT NULL, + `rented` int(11) NOT NULL, + `owner` varchar(60) NOT NULL, + + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `properties` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `entering` varchar(255) DEFAULT NULL, + `exit` varchar(255) DEFAULT NULL, + `inside` varchar(255) DEFAULT NULL, + `outside` varchar(255) DEFAULT NULL, + `ipls` varchar(255) DEFAULT '[]', + `gateway` varchar(255) DEFAULT NULL, + `is_single` int(11) DEFAULT NULL, + `is_room` int(11) DEFAULT NULL, + `is_gateway` int(11) DEFAULT NULL, + `room_menu` varchar(255) DEFAULT NULL, + `price` int(11) NOT NULL, + + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +INSERT INTO `properties` VALUES + (1,'WhispymoundDrive','2677 Whispymound Drive','{\"y\":564.89,\"z\":182.959,\"x\":119.384}','{\"x\":117.347,\"y\":559.506,\"z\":183.304}','{\"y\":557.032,\"z\":183.301,\"x\":118.037}','{\"y\":567.798,\"z\":182.131,\"x\":119.249}','[]',NULL,1,1,0,'{\"x\":118.748,\"y\":566.573,\"z\":175.697}',1500000), + (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"x\":372.796,\"y\":428.327,\"z\":144.685}','{\"x\":373.548,\"y\":422.982,\"z\":144.907}','{\"y\":420.075,\"z\":145.904,\"x\":372.161}','{\"x\":372.454,\"y\":432.886,\"z\":143.443}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), + (3,'RichardMajesticApt2','Richard Majestic, Apt 2','{\"y\":-379.165,\"z\":37.961,\"x\":-936.363}','{\"y\":-365.476,\"z\":113.274,\"x\":-913.097}','{\"y\":-367.637,\"z\":113.274,\"x\":-918.022}','{\"y\":-382.023,\"z\":37.961,\"x\":-943.626}','[]',NULL,1,1,0,'{\"x\":-927.554,\"y\":-377.744,\"z\":112.674}',1700000), + (4,'NorthConkerAvenue2044','2044 North Conker Avenue','{\"y\":440.8,\"z\":146.702,\"x\":346.964}','{\"y\":437.456,\"z\":148.394,\"x\":341.683}','{\"y\":435.626,\"z\":148.394,\"x\":339.595}','{\"x\":350.535,\"y\":443.329,\"z\":145.764}','[]',NULL,1,1,0,'{\"x\":337.726,\"y\":436.985,\"z\":140.77}',1500000), + (5,'WildOatsDrive','3655 Wild Oats Drive','{\"y\":502.696,\"z\":136.421,\"x\":-176.003}','{\"y\":497.817,\"z\":136.653,\"x\":-174.349}','{\"y\":495.069,\"z\":136.666,\"x\":-173.331}','{\"y\":506.412,\"z\":135.0664,\"x\":-177.927}','[]',NULL,1,1,0,'{\"x\":-174.725,\"y\":493.095,\"z\":129.043}',1500000), + (6,'HillcrestAvenue2862','2862 Hillcrest Avenue','{\"y\":596.58,\"z\":142.641,\"x\":-686.554}','{\"y\":591.988,\"z\":144.392,\"x\":-681.728}','{\"y\":590.608,\"z\":144.392,\"x\":-680.124}','{\"y\":599.019,\"z\":142.059,\"x\":-689.492}','[]',NULL,1,1,0,'{\"x\":-680.46,\"y\":588.6,\"z\":136.769}',1500000), + (7,'LowEndApartment','Appartement de base','{\"y\":-1078.735,\"z\":28.4031,\"x\":292.528}','{\"y\":-1007.152,\"z\":-102.002,\"x\":265.845}','{\"y\":-1002.802,\"z\":-100.008,\"x\":265.307}','{\"y\":-1078.669,\"z\":28.401,\"x\":296.738}','[]',NULL,1,1,0,'{\"x\":265.916,\"y\":-999.38,\"z\":-100.008}',562500), + (8,'MadWayneThunder','2113 Mad Wayne Thunder','{\"y\":454.955,\"z\":96.462,\"x\":-1294.433}','{"x":-1289.917,"y":449.541,"z":96.902}','{\"y\":446.322,\"z\":96.899,\"x\":-1289.642}','{\"y\":455.453,\"z\":96.517,\"x\":-1298.851}','[]',NULL,1,1,0,'{\"x\":-1287.306,\"y\":455.901,\"z\":89.294}',1500000), + (9,'HillcrestAvenue2874','2874 Hillcrest Avenue','{\"x\":-853.346,\"y\":696.678,\"z\":147.782}','{\"y\":690.875,\"z\":151.86,\"x\":-859.961}','{\"y\":688.361,\"z\":151.857,\"x\":-859.395}','{\"y\":701.628,\"z\":147.773,\"x\":-855.007}','[]',NULL,1,1,0,'{\"x\":-858.543,\"y\":697.514,\"z\":144.253}',1500000), + (10,'HillcrestAvenue2868','2868 Hillcrest Avenue','{\"y\":620.494,\"z\":141.588,\"x\":-752.82}','{\"y\":618.62,\"z\":143.153,\"x\":-759.317}','{\"y\":617.629,\"z\":143.153,\"x\":-760.789}','{\"y\":621.281,\"z\":141.254,\"x\":-750.919}','[]',NULL,1,1,0,'{\"x\":-762.504,\"y\":618.992,\"z\":135.53}',1500000), + (11,'TinselTowersApt12','Tinsel Towers, Apt 42','{\"y\":37.025,\"z\":42.58,\"x\":-618.299}','{\"y\":58.898,\"z\":97.2,\"x\":-603.301}','{\"y\":58.941,\"z\":97.2,\"x\":-608.741}','{\"y\":30.603,\"z\":42.524,\"x\":-620.017}','[]',NULL,1,1,0,'{\"x\":-622.173,\"y\":54.585,\"z\":96.599}',1700000), + (12,'MiltonDrive','Milton Drive','{\"x\":-775.17,\"y\":312.01,\"z\":84.658}',NULL,NULL,'{\"x\":-775.346,\"y\":306.776,\"z\":84.7}','[]',NULL,0,0,1,NULL,0), + (13,'Modern1Apartment','Appartement Moderne 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_01_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.661,\"y\":327.672,\"z\":210.396}',1300000), + (14,'Modern2Apartment','Appartement Moderne 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_01_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.735,\"y\":326.757,\"z\":186.313}',1300000), + (15,'Modern3Apartment','Appartement Moderne 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_01_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.386,\"y\":330.782,\"z\":195.08}',1300000), + (16,'Mody1Apartment','Appartement Mode 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_02_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.615,\"y\":327.878,\"z\":210.396}',1300000), + (17,'Mody2Apartment','Appartement Mode 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_02_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.297,\"y\":327.092,\"z\":186.313}',1300000), + (18,'Mody3Apartment','Appartement Mode 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_02_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.303,\"y\":330.932,\"z\":195.085}',1300000), + (19,'Vibrant1Apartment','Appartement Vibrant 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_03_a\"]','MiltonDrive',0,1,0,'{\"x\":-765.885,\"y\":327.641,\"z\":210.396}',1300000), + (20,'Vibrant2Apartment','Appartement Vibrant 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_03_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.607,\"y\":327.344,\"z\":186.313}',1300000), + (21,'Vibrant3Apartment','Appartement Vibrant 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_03_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.525,\"y\":330.851,\"z\":195.085}',1300000), + (22,'Sharp1Apartment','Appartement Persan 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_04_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.527,\"y\":327.89,\"z\":210.396}',1300000), + (23,'Sharp2Apartment','Appartement Persan 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_04_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.642,\"y\":326.497,\"z\":186.313}',1300000), + (24,'Sharp3Apartment','Appartement Persan 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_04_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.503,\"y\":331.318,\"z\":195.085}',1300000), + (25,'Monochrome1Apartment','Appartement Monochrome 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_05_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.289,\"y\":328.086,\"z\":210.396}',1300000), + (26,'Monochrome2Apartment','Appartement Monochrome 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_05_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.692,\"y\":326.762,\"z\":186.313}',1300000), + (27,'Monochrome3Apartment','Appartement Monochrome 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_05_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.094,\"y\":330.976,\"z\":195.085}',1300000), + (28,'Seductive1Apartment','Appartement Séduisant 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_06_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.263,\"y\":328.104,\"z\":210.396}',1300000), + (29,'Seductive2Apartment','Appartement Séduisant 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_06_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.655,\"y\":326.611,\"z\":186.313}',1300000), + (30,'Seductive3Apartment','Appartement Séduisant 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_06_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.3,\"y\":331.414,\"z\":195.085}',1300000), + (31,'Regal1Apartment','Appartement Régal 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_07_a\"]','MiltonDrive',0,1,0,'{\"x\":-765.956,\"y\":328.257,\"z\":210.396}',1300000), + (32,'Regal2Apartment','Appartement Régal 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_07_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.545,\"y\":326.659,\"z\":186.313}',1300000), + (33,'Regal3Apartment','Appartement Régal 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_07_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.087,\"y\":331.429,\"z\":195.123}',1300000), + (34,'Aqua1Apartment','Appartement Aqua 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_08_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.187,\"y\":328.47,\"z\":210.396}',1300000), + (35,'Aqua2Apartment','Appartement Aqua 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_08_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.658,\"y\":326.563,\"z\":186.313}',1300000), + (36,'Aqua3Apartment','Appartement Aqua 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_08_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.287,\"y\":331.084,\"z\":195.086}',1300000), + (37,'IntegrityWay','4 Integrity Way','{\"x\":-47.804,\"y\":-585.867,\"z\":36.956}',NULL,NULL,'{\"x\":-54.178,\"y\":-583.762,\"z\":35.798}','[]',NULL,0,0,1,NULL,0), + (38,'IntegrityWay28','4 Integrity Way - Apt 28',NULL,'{\"x\":-31.409,\"y\":-594.927,\"z\":79.03}','{\"x\":-26.098,\"y\":-596.909,\"z\":79.03}',NULL,'[]','IntegrityWay',0,1,0,'{\"x\":-11.923,\"y\":-597.083,\"z\":78.43}',1700000), + (39,'IntegrityWay30','4 Integrity Way - Apt 30',NULL,'{\"x\":-17.702,\"y\":-588.524,\"z\":89.114}','{\"x\":-16.21,\"y\":-582.569,\"z\":89.114}',NULL,'[]','IntegrityWay',0,1,0,'{\"x\":-26.327,\"y\":-588.384,\"z\":89.123}',1700000), + (40,'DellPerroHeights','Dell Perro Heights','{\"x\":-1447.06,\"y\":-538.28,\"z\":33.74}',NULL,NULL,'{\"x\":-1440.022,\"y\":-548.696,\"z\":33.74}','[]',NULL,0,0,1,NULL,0), + (41,'DellPerroHeightst4','Dell Perro Heights - Apt 28',NULL,'{\"x\":-1452.125,\"y\":-540.591,\"z\":73.044}','{\"x\":-1455.435,\"y\":-535.79,\"z\":73.044}',NULL,'[]','DellPerroHeights',0,1,0,'{\"x\":-1467.058,\"y\":-527.571,\"z\":72.443}',1700000), + (42,'DellPerroHeightst7','Dell Perro Heights - Apt 30',NULL,'{\"x\":-1451.562,\"y\":-523.535,\"z\":55.928}','{\"x\":-1456.02,\"y\":-519.209,\"z\":55.929}',NULL,'[]','DellPerroHeights',0,1,0,'{\"x\":-1457.026,\"y\":-530.219,\"z\":55.937}',1700000) +; + diff --git a/[esx_addons]/esx_property/localization/en_esx_property.sql b/[esx_addons]/esx_property/localization/en_esx_property.sql new file mode 100644 index 00000000..f062647f --- /dev/null +++ b/[esx_addons]/esx_property/localization/en_esx_property.sql @@ -0,0 +1,96 @@ +USE `es_extended`; + +ALTER TABLE `users` + ADD COLUMN `last_property` VARCHAR(255) NULL +; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('property_black_money','Money Sale Property',0) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('property','Property',0) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('property','Property',0) +; + +CREATE TABLE `owned_properties` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `price` double NOT NULL, + `rented` int(11) NOT NULL, + `owner` varchar(60) NOT NULL, + + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `properties` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `entering` varchar(255) DEFAULT NULL, + `exit` varchar(255) DEFAULT NULL, + `inside` varchar(255) DEFAULT NULL, + `outside` varchar(255) DEFAULT NULL, + `ipls` varchar(255) DEFAULT '[]', + `gateway` varchar(255) DEFAULT NULL, + `is_single` int(11) DEFAULT NULL, + `is_room` int(11) DEFAULT NULL, + `is_gateway` int(11) DEFAULT NULL, + `room_menu` varchar(255) DEFAULT NULL, + `price` int(11) NOT NULL, + + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +INSERT INTO `properties` VALUES + (1,'WhispymoundDrive','2677 Whispymound Drive','{\"y\":564.89,\"z\":182.959,\"x\":119.384}','{\"x\":117.347,\"y\":559.506,\"z\":183.304}','{\"y\":557.032,\"z\":183.301,\"x\":118.037}','{\"y\":567.798,\"z\":182.131,\"x\":119.249}','[]',NULL,1,1,0,'{\"x\":118.748,\"y\":566.573,\"z\":175.697}',1500000), + (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"x\":372.796,\"y\":428.327,\"z\":144.685}','{\"x\":373.548,\"y\":422.982,\"z\":144.907}','{\"y\":420.075,\"z\":145.904,\"x\":372.161}','{\"x\":372.454,\"y\":432.886,\"z\":143.443}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), + (3,'RichardMajesticApt2','Richard Majestic, Apt 2','{\"y\":-379.165,\"z\":37.961,\"x\":-936.363}','{\"y\":-365.476,\"z\":113.274,\"x\":-913.097}','{\"y\":-367.637,\"z\":113.274,\"x\":-918.022}','{\"y\":-382.023,\"z\":37.961,\"x\":-943.626}','[]',NULL,1,1,0,'{\"x\":-927.554,\"y\":-377.744,\"z\":112.674}',1700000), + (4,'NorthConkerAvenue2044','2044 North Conker Avenue','{\"y\":440.8,\"z\":146.702,\"x\":346.964}','{\"y\":437.456,\"z\":148.394,\"x\":341.683}','{\"y\":435.626,\"z\":148.394,\"x\":339.595}','{\"x\":350.535,\"y\":443.329,\"z\":145.764}','[]',NULL,1,1,0,'{\"x\":337.726,\"y\":436.985,\"z\":140.77}',1500000), + (5,'WildOatsDrive','3655 Wild Oats Drive','{\"y\":502.696,\"z\":136.421,\"x\":-176.003}','{\"y\":497.817,\"z\":136.653,\"x\":-174.349}','{\"y\":495.069,\"z\":136.666,\"x\":-173.331}','{\"y\":506.412,\"z\":135.0664,\"x\":-177.927}','[]',NULL,1,1,0,'{\"x\":-174.725,\"y\":493.095,\"z\":129.043}',1500000), + (6,'HillcrestAvenue2862','2862 Hillcrest Avenue','{\"y\":596.58,\"z\":142.641,\"x\":-686.554}','{\"y\":591.988,\"z\":144.392,\"x\":-681.728}','{\"y\":590.608,\"z\":144.392,\"x\":-680.124}','{\"y\":599.019,\"z\":142.059,\"x\":-689.492}','[]',NULL,1,1,0,'{\"x\":-680.46,\"y\":588.6,\"z\":136.769}',1500000), + (7,'LowEndApartment','Basic apartment','{\"y\":-1078.735,\"z\":28.4031,\"x\":292.528}','{\"y\":-1007.152,\"z\":-102.002,\"x\":265.845}','{\"y\":-1002.802,\"z\":-100.008,\"x\":265.307}','{\"y\":-1078.669,\"z\":28.401,\"x\":296.738}','[]',NULL,1,1,0,'{\"x\":265.916,\"y\":-999.38,\"z\":-100.008}',562500), + (8,'MadWayneThunder','2113 Mad Wayne Thunder','{\"y\":454.955,\"z\":96.462,\"x\":-1294.433}','{"x":-1289.917,"y":449.541,"z":96.902}','{\"y\":446.322,\"z\":96.899,\"x\":-1289.642}','{\"y\":455.453,\"z\":96.517,\"x\":-1298.851}','[]',NULL,1,1,0,'{\"x\":-1287.306,\"y\":455.901,\"z\":89.294}',1500000), + (9,'HillcrestAvenue2874','2874 Hillcrest Avenue','{\"x\":-853.346,\"y\":696.678,\"z\":147.782}','{\"y\":690.875,\"z\":151.86,\"x\":-859.961}','{\"y\":688.361,\"z\":151.857,\"x\":-859.395}','{\"y\":701.628,\"z\":147.773,\"x\":-855.007}','[]',NULL,1,1,0,'{\"x\":-858.543,\"y\":697.514,\"z\":144.253}',1500000), + (10,'HillcrestAvenue2868','2868 Hillcrest Avenue','{\"y\":620.494,\"z\":141.588,\"x\":-752.82}','{\"y\":618.62,\"z\":143.153,\"x\":-759.317}','{\"y\":617.629,\"z\":143.153,\"x\":-760.789}','{\"y\":621.281,\"z\":141.254,\"x\":-750.919}','[]',NULL,1,1,0,'{\"x\":-762.504,\"y\":618.992,\"z\":135.53}',1500000), + (11,'TinselTowersApt12','Tinsel Towers, Apt 42','{\"y\":37.025,\"z\":42.58,\"x\":-618.299}','{\"y\":58.898,\"z\":97.2,\"x\":-603.301}','{\"y\":58.941,\"z\":97.2,\"x\":-608.741}','{\"y\":30.603,\"z\":42.524,\"x\":-620.017}','[]',NULL,1,1,0,'{\"x\":-622.173,\"y\":54.585,\"z\":96.599}',1700000), + (12,'MiltonDrive','Milton Drive','{\"x\":-775.17,\"y\":312.01,\"z\":84.658}',NULL,NULL,'{\"x\":-775.346,\"y\":306.776,\"z\":84.7}','[]',NULL,0,0,1,NULL,0), + (13,'Modern1Apartment','Modern Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_01_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.661,\"y\":327.672,\"z\":210.396}',1300000), + (14,'Modern2Apartment','Modern Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_01_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.735,\"y\":326.757,\"z\":186.313}',1300000), + (15,'Modern3Apartment','Modern Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_01_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.386,\"y\":330.782,\"z\":195.08}',1300000), + (16,'Mody1Apartment','Mody Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_02_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.615,\"y\":327.878,\"z\":210.396}',1300000), + (17,'Mody2Apartment','Mody Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_02_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.297,\"y\":327.092,\"z\":186.313}',1300000), + (18,'Mody3Apartment','Mody Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_02_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.303,\"y\":330.932,\"z\":195.085}',1300000), + (19,'Vibrant1Apartment','Vibrant Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_03_a\"]','MiltonDrive',0,1,0,'{\"x\":-765.885,\"y\":327.641,\"z\":210.396}',1300000), + (20,'Vibrant2Apartment','Vibrant Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_03_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.607,\"y\":327.344,\"z\":186.313}',1300000), + (21,'Vibrant3Apartment','Vibrant Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_03_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.525,\"y\":330.851,\"z\":195.085}',1300000), + (22,'Sharp1Apartment','Sharp Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_04_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.527,\"y\":327.89,\"z\":210.396}',1300000), + (23,'Sharp2Apartment','Sharp Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_04_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.642,\"y\":326.497,\"z\":186.313}',1300000), + (24,'Sharp3Apartment','Sharp Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_04_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.503,\"y\":331.318,\"z\":195.085}',1300000), + (25,'Monochrome1Apartment','Monochrome Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_05_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.289,\"y\":328.086,\"z\":210.396}',1300000), + (26,'Monochrome2Apartment','Monochrome Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_05_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.692,\"y\":326.762,\"z\":186.313}',1300000), + (27,'Monochrome3Apartment','Monochrome Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_05_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.094,\"y\":330.976,\"z\":195.085}',1300000), + (28,'Seductive1Apartment','Seductive Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_06_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.263,\"y\":328.104,\"z\":210.396}',1300000), + (29,'Seductive2Apartment','Seductive Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_06_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.655,\"y\":326.611,\"z\":186.313}',1300000), + (30,'Seductive3Apartment','Seductive Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_06_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.3,\"y\":331.414,\"z\":195.085}',1300000), + (31,'Regal1Apartment','Regal Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_07_a\"]','MiltonDrive',0,1,0,'{\"x\":-765.956,\"y\":328.257,\"z\":210.396}',1300000), + (32,'Regal2Apartment','Regal Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_07_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.545,\"y\":326.659,\"z\":186.313}',1300000), + (33,'Regal3Apartment','Regal Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_07_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.087,\"y\":331.429,\"z\":195.123}',1300000), + (34,'Aqua1Apartment','Aqua Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_08_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.187,\"y\":328.47,\"z\":210.396}',1300000), + (35,'Aqua2Apartment','Aqua Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_08_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.658,\"y\":326.563,\"z\":186.313}',1300000), + (36,'Aqua3Apartment','Aqua Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_08_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.287,\"y\":331.084,\"z\":195.086}',1300000), + (37,'IntegrityWay','4 Integrity Way','{\"x\":-47.804,\"y\":-585.867,\"z\":36.956}',NULL,NULL,'{\"x\":-54.178,\"y\":-583.762,\"z\":35.798}','[]',NULL,0,0,1,NULL,0), + (38,'IntegrityWay28','4 Integrity Way - Apt 28',NULL,'{\"x\":-31.409,\"y\":-594.927,\"z\":79.03}','{\"x\":-26.098,\"y\":-596.909,\"z\":79.03}',NULL,'[]','IntegrityWay',0,1,0,'{\"x\":-11.923,\"y\":-597.083,\"z\":78.43}',1700000), + (39,'IntegrityWay30','4 Integrity Way - Apt 30',NULL,'{\"x\":-17.702,\"y\":-588.524,\"z\":89.114}','{\"x\":-16.21,\"y\":-582.569,\"z\":89.114}',NULL,'[]','IntegrityWay',0,1,0,'{\"x\":-26.327,\"y\":-588.384,\"z\":89.123}',1700000), + (40,'DellPerroHeights','Dell Perro Heights','{\"x\":-1447.06,\"y\":-538.28,\"z\":33.74}',NULL,NULL,'{\"x\":-1440.022,\"y\":-548.696,\"z\":33.74}','[]',NULL,0,0,1,NULL,0), + (41,'DellPerroHeightst4','Dell Perro Heights - Apt 28',NULL,'{\"x\":-1452.125,\"y\":-540.591,\"z\":73.044}','{\"x\":-1455.435,\"y\":-535.79,\"z\":73.044}',NULL,'[]','DellPerroHeights',0,1,0,'{\"x\":-1467.058,\"y\":-527.571,\"z\":72.443}',1700000), + (42,'DellPerroHeightst7','Dell Perro Heights - Apt 30',NULL,'{\"x\":-1451.562,\"y\":-523.535,\"z\":55.928}','{\"x\":-1456.02,\"y\":-519.209,\"z\":55.929}',NULL,'[]','DellPerroHeights',0,1,0,'{\"x\":-1457.026,\"y\":-530.219,\"z\":55.937}',1700000) +; + diff --git a/[esx_addons]/esx_property/localization/es_esx_property.sql b/[esx_addons]/esx_property/localization/es_esx_property.sql new file mode 100644 index 00000000..e3ebfdc5 --- /dev/null +++ b/[esx_addons]/esx_property/localization/es_esx_property.sql @@ -0,0 +1,96 @@ +USE `es_extended`; + +ALTER TABLE `users` + ADD COLUMN `last_property` VARCHAR(255) NULL +; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('property_black_money','Propiedad de venta de dinero',0) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('property','Propiedad',0) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('property','Propiedad',0) +; + +CREATE TABLE `owned_properties` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `price` double NOT NULL, + `rented` int(11) NOT NULL, + `owner` varchar(60) NOT NULL, + + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `properties` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `entering` varchar(255) DEFAULT NULL, + `exit` varchar(255) DEFAULT NULL, + `inside` varchar(255) DEFAULT NULL, + `outside` varchar(255) DEFAULT NULL, + `ipls` varchar(255) DEFAULT '[]', + `gateway` varchar(255) DEFAULT NULL, + `is_single` int(11) DEFAULT NULL, + `is_room` int(11) DEFAULT NULL, + `is_gateway` int(11) DEFAULT NULL, + `room_menu` varchar(255) DEFAULT NULL, + `price` int(11) NOT NULL, + + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +INSERT INTO `properties` VALUES + (1,'WhispymoundDrive','2677 Whispymound Drive','{\"y\":564.89,\"z\":182.959,\"x\":119.384}','{\"x\":117.347,\"y\":559.506,\"z\":183.304}','{\"y\":557.032,\"z\":183.301,\"x\":118.037}','{\"y\":567.798,\"z\":182.131,\"x\":119.249}','[]',NULL,1,1,0,'{\"x\":118.748,\"y\":566.573,\"z\":175.697}',1500000), + (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"x\":372.796,\"y\":428.327,\"z\":144.685}','{\"x\":373.548,\"y\":422.982,\"z\":144.907}','{\"y\":420.075,\"z\":145.904,\"x\":372.161}','{\"x\":372.454,\"y\":432.886,\"z\":143.443}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), + (3,'RichardMajesticApt2','Richard Majestic, Apt 2','{\"y\":-379.165,\"z\":37.961,\"x\":-936.363}','{\"y\":-365.476,\"z\":113.274,\"x\":-913.097}','{\"y\":-367.637,\"z\":113.274,\"x\":-918.022}','{\"y\":-382.023,\"z\":37.961,\"x\":-943.626}','[]',NULL,1,1,0,'{\"x\":-927.554,\"y\":-377.744,\"z\":112.674}',1700000), + (4,'NorthConkerAvenue2044','2044 North Conker Avenue','{\"y\":440.8,\"z\":146.702,\"x\":346.964}','{\"y\":437.456,\"z\":148.394,\"x\":341.683}','{\"y\":435.626,\"z\":148.394,\"x\":339.595}','{\"x\":350.535,\"y\":443.329,\"z\":145.764}','[]',NULL,1,1,0,'{\"x\":337.726,\"y\":436.985,\"z\":140.77}',1500000), + (5,'WildOatsDrive','3655 Wild Oats Drive','{\"y\":502.696,\"z\":136.421,\"x\":-176.003}','{\"y\":497.817,\"z\":136.653,\"x\":-174.349}','{\"y\":495.069,\"z\":136.666,\"x\":-173.331}','{\"y\":506.412,\"z\":135.0664,\"x\":-177.927}','[]',NULL,1,1,0,'{\"x\":-174.725,\"y\":493.095,\"z\":129.043}',1500000), + (6,'HillcrestAvenue2862','2862 Hillcrest Avenue','{\"y\":596.58,\"z\":142.641,\"x\":-686.554}','{\"y\":591.988,\"z\":144.392,\"x\":-681.728}','{\"y\":590.608,\"z\":144.392,\"x\":-680.124}','{\"y\":599.019,\"z\":142.059,\"x\":-689.492}','[]',NULL,1,1,0,'{\"x\":-680.46,\"y\":588.6,\"z\":136.769}',1500000), + (7,'LowEndApartment','Basic apartment','{\"y\":-1078.735,\"z\":28.4031,\"x\":292.528}','{\"y\":-1007.152,\"z\":-102.002,\"x\":265.845}','{\"y\":-1002.802,\"z\":-100.008,\"x\":265.307}','{\"y\":-1078.669,\"z\":28.401,\"x\":296.738}','[]',NULL,1,1,0,'{\"x\":265.916,\"y\":-999.38,\"z\":-100.008}',562500), + (8,'MadWayneThunder','2113 Mad Wayne Thunder','{\"y\":454.955,\"z\":96.462,\"x\":-1294.433}','{"x":-1289.917,"y":449.541,"z":96.902}','{\"y\":446.322,\"z\":96.899,\"x\":-1289.642}','{\"y\":455.453,\"z\":96.517,\"x\":-1298.851}','[]',NULL,1,1,0,'{\"x\":-1287.306,\"y\":455.901,\"z\":89.294}',1500000), + (9,'HillcrestAvenue2874','2874 Hillcrest Avenue','{\"x\":-853.346,\"y\":696.678,\"z\":147.782}','{\"y\":690.875,\"z\":151.86,\"x\":-859.961}','{\"y\":688.361,\"z\":151.857,\"x\":-859.395}','{\"y\":701.628,\"z\":147.773,\"x\":-855.007}','[]',NULL,1,1,0,'{\"x\":-858.543,\"y\":697.514,\"z\":144.253}',1500000), + (10,'HillcrestAvenue2868','2868 Hillcrest Avenue','{\"y\":620.494,\"z\":141.588,\"x\":-752.82}','{\"y\":618.62,\"z\":143.153,\"x\":-759.317}','{\"y\":617.629,\"z\":143.153,\"x\":-760.789}','{\"y\":621.281,\"z\":141.254,\"x\":-750.919}','[]',NULL,1,1,0,'{\"x\":-762.504,\"y\":618.992,\"z\":135.53}',1500000), + (11,'TinselTowersApt12','Tinsel Towers, Apt 42','{\"y\":37.025,\"z\":42.58,\"x\":-618.299}','{\"y\":58.898,\"z\":97.2,\"x\":-603.301}','{\"y\":58.941,\"z\":97.2,\"x\":-608.741}','{\"y\":30.603,\"z\":42.524,\"x\":-620.017}','[]',NULL,1,1,0,'{\"x\":-622.173,\"y\":54.585,\"z\":96.599}',1700000), + (12,'MiltonDrive','Milton Drive','{\"x\":-775.17,\"y\":312.01,\"z\":84.658}',NULL,NULL,'{\"x\":-775.346,\"y\":306.776,\"z\":84.7}','[]',NULL,0,0,1,NULL,0), + (13,'Modern1Apartment','Modern Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_01_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.661,\"y\":327.672,\"z\":210.396}',1300000), + (14,'Modern2Apartment','Modern Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_01_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.735,\"y\":326.757,\"z\":186.313}',1300000), + (15,'Modern3Apartment','Modern Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_01_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.386,\"y\":330.782,\"z\":195.08}',1300000), + (16,'Mody1Apartment','Mody Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_02_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.615,\"y\":327.878,\"z\":210.396}',1300000), + (17,'Mody2Apartment','Mody Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_02_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.297,\"y\":327.092,\"z\":186.313}',1300000), + (18,'Mody3Apartment','Mody Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_02_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.303,\"y\":330.932,\"z\":195.085}',1300000), + (19,'Vibrant1Apartment','Vibrant Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_03_a\"]','MiltonDrive',0,1,0,'{\"x\":-765.885,\"y\":327.641,\"z\":210.396}',1300000), + (20,'Vibrant2Apartment','Vibrant Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_03_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.607,\"y\":327.344,\"z\":186.313}',1300000), + (21,'Vibrant3Apartment','Vibrant Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_03_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.525,\"y\":330.851,\"z\":195.085}',1300000), + (22,'Sharp1Apartment','Sharp Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_04_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.527,\"y\":327.89,\"z\":210.396}',1300000), + (23,'Sharp2Apartment','Sharp Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_04_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.642,\"y\":326.497,\"z\":186.313}',1300000), + (24,'Sharp3Apartment','Sharp Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_04_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.503,\"y\":331.318,\"z\":195.085}',1300000), + (25,'Monochrome1Apartment','Monochrome Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_05_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.289,\"y\":328.086,\"z\":210.396}',1300000), + (26,'Monochrome2Apartment','Monochrome Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_05_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.692,\"y\":326.762,\"z\":186.313}',1300000), + (27,'Monochrome3Apartment','Monochrome Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_05_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.094,\"y\":330.976,\"z\":195.085}',1300000), + (28,'Seductive1Apartment','Seductive Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_06_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.263,\"y\":328.104,\"z\":210.396}',1300000), + (29,'Seductive2Apartment','Seductive Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_06_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.655,\"y\":326.611,\"z\":186.313}',1300000), + (30,'Seductive3Apartment','Seductive Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_06_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.3,\"y\":331.414,\"z\":195.085}',1300000), + (31,'Regal1Apartment','Regal Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_07_a\"]','MiltonDrive',0,1,0,'{\"x\":-765.956,\"y\":328.257,\"z\":210.396}',1300000), + (32,'Regal2Apartment','Regal Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_07_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.545,\"y\":326.659,\"z\":186.313}',1300000), + (33,'Regal3Apartment','Regal Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_07_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.087,\"y\":331.429,\"z\":195.123}',1300000), + (34,'Aqua1Apartment','Aqua Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_08_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.187,\"y\":328.47,\"z\":210.396}',1300000), + (35,'Aqua2Apartment','Aqua Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_08_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.658,\"y\":326.563,\"z\":186.313}',1300000), + (36,'Aqua3Apartment','Aqua Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_08_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.287,\"y\":331.084,\"z\":195.086}',1300000), + (37,'IntegrityWay','4 Integrity Way','{\"x\":-47.804,\"y\":-585.867,\"z\":36.956}',NULL,NULL,'{\"x\":-54.178,\"y\":-583.762,\"z\":35.798}','[]',NULL,0,0,1,NULL,0), + (38,'IntegrityWay28','4 Integrity Way - Apt 28',NULL,'{\"x\":-31.409,\"y\":-594.927,\"z\":79.03}','{\"x\":-26.098,\"y\":-596.909,\"z\":79.03}',NULL,'[]','IntegrityWay',0,1,0,'{\"x\":-11.923,\"y\":-597.083,\"z\":78.43}',1700000), + (39,'IntegrityWay30','4 Integrity Way - Apt 30',NULL,'{\"x\":-17.702,\"y\":-588.524,\"z\":89.114}','{\"x\":-16.21,\"y\":-582.569,\"z\":89.114}',NULL,'[]','IntegrityWay',0,1,0,'{\"x\":-26.327,\"y\":-588.384,\"z\":89.123}',1700000), + (40,'DellPerroHeights','Dell Perro Heights','{\"x\":-1447.06,\"y\":-538.28,\"z\":33.74}',NULL,NULL,'{\"x\":-1440.022,\"y\":-548.696,\"z\":33.74}','[]',NULL,0,0,1,NULL,0), + (41,'DellPerroHeightst4','Dell Perro Heights - Apt 28',NULL,'{\"x\":-1452.125,\"y\":-540.591,\"z\":73.044}','{\"x\":-1455.435,\"y\":-535.79,\"z\":73.044}',NULL,'[]','DellPerroHeights',0,1,0,'{\"x\":-1467.058,\"y\":-527.571,\"z\":72.443}',1700000), + (42,'DellPerroHeightst7','Dell Perro Heights - Apt 30',NULL,'{\"x\":-1451.562,\"y\":-523.535,\"z\":55.928}','{\"x\":-1456.02,\"y\":-519.209,\"z\":55.929}',NULL,'[]','DellPerroHeights',0,1,0,'{\"x\":-1457.026,\"y\":-530.219,\"z\":55.937}',1700000) +; + diff --git a/[esx_addons]/esx_property/localization/fi_esx_property.sql b/[esx_addons]/esx_property/localization/fi_esx_property.sql new file mode 100644 index 00000000..1024b797 --- /dev/null +++ b/[esx_addons]/esx_property/localization/fi_esx_property.sql @@ -0,0 +1,96 @@ +USE `es_extended`; + +ALTER TABLE `users` + ADD COLUMN `last_property` VARCHAR(255) NULL +; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('property_black_money','Kiinteistö Likainen raha',0) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('property','Kiinteistö',0) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('property','Kiinteistö',0) +; + +CREATE TABLE `owned_properties` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `price` double NOT NULL, + `rented` int(11) NOT NULL, + `owner` varchar(60) NOT NULL, + + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `properties` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `entering` varchar(255) DEFAULT NULL, + `exit` varchar(255) DEFAULT NULL, + `inside` varchar(255) DEFAULT NULL, + `outside` varchar(255) DEFAULT NULL, + `ipls` varchar(255) DEFAULT '[]', + `gateway` varchar(255) DEFAULT NULL, + `is_single` int(11) DEFAULT NULL, + `is_room` int(11) DEFAULT NULL, + `is_gateway` int(11) DEFAULT NULL, + `room_menu` varchar(255) DEFAULT NULL, + `price` int(11) NOT NULL, + + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +INSERT INTO `properties` VALUES + (1,'WhispymoundDrive','2677 Whispymound Drive','{\"y\":564.89,\"z\":182.959,\"x\":119.384}','{\"x\":117.347,\"y\":559.506,\"z\":183.304}','{\"y\":557.032,\"z\":183.301,\"x\":118.037}','{\"y\":567.798,\"z\":182.131,\"x\":119.249}','[]',NULL,1,1,0,'{\"x\":118.748,\"y\":566.573,\"z\":175.697}',1500000), + (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"x\":372.796,\"y\":428.327,\"z\":144.685}','{\"x\":373.548,\"y\":422.982,\"z\":144.907}','{\"y\":420.075,\"z\":145.904,\"x\":372.161}','{\"x\":372.454,\"y\":432.886,\"z\":143.443}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), + (3,'RichardMajesticApt2','Richard Majestic, Apt 2','{\"y\":-379.165,\"z\":37.961,\"x\":-936.363}','{\"y\":-365.476,\"z\":113.274,\"x\":-913.097}','{\"y\":-367.637,\"z\":113.274,\"x\":-918.022}','{\"y\":-382.023,\"z\":37.961,\"x\":-943.626}','[]',NULL,1,1,0,'{\"x\":-927.554,\"y\":-377.744,\"z\":112.674}',1700000), + (4,'NorthConkerAvenue2044','2044 North Conker Avenue','{\"y\":440.8,\"z\":146.702,\"x\":346.964}','{\"y\":437.456,\"z\":148.394,\"x\":341.683}','{\"y\":435.626,\"z\":148.394,\"x\":339.595}','{\"x\":350.535,\"y\":443.329,\"z\":145.764}','[]',NULL,1,1,0,'{\"x\":337.726,\"y\":436.985,\"z\":140.77}',1500000), + (5,'WildOatsDrive','3655 Wild Oats Drive','{\"y\":502.696,\"z\":136.421,\"x\":-176.003}','{\"y\":497.817,\"z\":136.653,\"x\":-174.349}','{\"y\":495.069,\"z\":136.666,\"x\":-173.331}','{\"y\":506.412,\"z\":135.0664,\"x\":-177.927}','[]',NULL,1,1,0,'{\"x\":-174.725,\"y\":493.095,\"z\":129.043}',1500000), + (6,'HillcrestAvenue2862','2862 Hillcrest Avenue','{\"y\":596.58,\"z\":142.641,\"x\":-686.554}','{\"y\":591.988,\"z\":144.392,\"x\":-681.728}','{\"y\":590.608,\"z\":144.392,\"x\":-680.124}','{\"y\":599.019,\"z\":142.059,\"x\":-689.492}','[]',NULL,1,1,0,'{\"x\":-680.46,\"y\":588.6,\"z\":136.769}',1500000), + (7,'LowEndApartment','Basic apartment','{\"y\":-1078.735,\"z\":28.4031,\"x\":292.528}','{\"y\":-1007.152,\"z\":-102.002,\"x\":265.845}','{\"y\":-1002.802,\"z\":-100.008,\"x\":265.307}','{\"y\":-1078.669,\"z\":28.401,\"x\":296.738}','[]',NULL,1,1,0,'{\"x\":265.916,\"y\":-999.38,\"z\":-100.008}',562500), + (8,'MadWayneThunder','2113 Mad Wayne Thunder','{\"y\":454.955,\"z\":96.462,\"x\":-1294.433}','{"x":-1289.917,"y":449.541,"z":96.902}','{\"y\":446.322,\"z\":96.899,\"x\":-1289.642}','{\"y\":455.453,\"z\":96.517,\"x\":-1298.851}','[]',NULL,1,1,0,'{\"x\":-1287.306,\"y\":455.901,\"z\":89.294}',1500000), + (9,'HillcrestAvenue2874','2874 Hillcrest Avenue','{\"x\":-853.346,\"y\":696.678,\"z\":147.782}','{\"y\":690.875,\"z\":151.86,\"x\":-859.961}','{\"y\":688.361,\"z\":151.857,\"x\":-859.395}','{\"y\":701.628,\"z\":147.773,\"x\":-855.007}','[]',NULL,1,1,0,'{\"x\":-858.543,\"y\":697.514,\"z\":144.253}',1500000), + (10,'HillcrestAvenue2868','2868 Hillcrest Avenue','{\"y\":620.494,\"z\":141.588,\"x\":-752.82}','{\"y\":618.62,\"z\":143.153,\"x\":-759.317}','{\"y\":617.629,\"z\":143.153,\"x\":-760.789}','{\"y\":621.281,\"z\":141.254,\"x\":-750.919}','[]',NULL,1,1,0,'{\"x\":-762.504,\"y\":618.992,\"z\":135.53}',1500000), + (11,'TinselTowersApt12','Tinsel Towers, Apt 42','{\"y\":37.025,\"z\":42.58,\"x\":-618.299}','{\"y\":58.898,\"z\":97.2,\"x\":-603.301}','{\"y\":58.941,\"z\":97.2,\"x\":-608.741}','{\"y\":30.603,\"z\":42.524,\"x\":-620.017}','[]',NULL,1,1,0,'{\"x\":-622.173,\"y\":54.585,\"z\":96.599}',1700000), + (12,'MiltonDrive','Milton Drive','{\"x\":-775.17,\"y\":312.01,\"z\":84.658}',NULL,NULL,'{\"x\":-775.346,\"y\":306.776,\"z\":84.7}','[]',NULL,0,0,1,NULL,0), + (13,'Modern1Apartment','Modern Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_01_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.661,\"y\":327.672,\"z\":210.396}',1300000), + (14,'Modern2Apartment','Modern Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_01_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.735,\"y\":326.757,\"z\":186.313}',1300000), + (15,'Modern3Apartment','Modern Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_01_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.386,\"y\":330.782,\"z\":195.08}',1300000), + (16,'Mody1Apartment','Mody Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_02_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.615,\"y\":327.878,\"z\":210.396}',1300000), + (17,'Mody2Apartment','Mody Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_02_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.297,\"y\":327.092,\"z\":186.313}',1300000), + (18,'Mody3Apartment','Mody Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_02_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.303,\"y\":330.932,\"z\":195.085}',1300000), + (19,'Vibrant1Apartment','Vibrant Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_03_a\"]','MiltonDrive',0,1,0,'{\"x\":-765.885,\"y\":327.641,\"z\":210.396}',1300000), + (20,'Vibrant2Apartment','Vibrant Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_03_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.607,\"y\":327.344,\"z\":186.313}',1300000), + (21,'Vibrant3Apartment','Vibrant Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_03_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.525,\"y\":330.851,\"z\":195.085}',1300000), + (22,'Sharp1Apartment','Sharp Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_04_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.527,\"y\":327.89,\"z\":210.396}',1300000), + (23,'Sharp2Apartment','Sharp Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_04_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.642,\"y\":326.497,\"z\":186.313}',1300000), + (24,'Sharp3Apartment','Sharp Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_04_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.503,\"y\":331.318,\"z\":195.085}',1300000), + (25,'Monochrome1Apartment','Monochrome Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_05_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.289,\"y\":328.086,\"z\":210.396}',1300000), + (26,'Monochrome2Apartment','Monochrome Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_05_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.692,\"y\":326.762,\"z\":186.313}',1300000), + (27,'Monochrome3Apartment','Monochrome Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_05_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.094,\"y\":330.976,\"z\":195.085}',1300000), + (28,'Seductive1Apartment','Seductive Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_06_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.263,\"y\":328.104,\"z\":210.396}',1300000), + (29,'Seductive2Apartment','Seductive Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_06_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.655,\"y\":326.611,\"z\":186.313}',1300000), + (30,'Seductive3Apartment','Seductive Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_06_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.3,\"y\":331.414,\"z\":195.085}',1300000), + (31,'Regal1Apartment','Regal Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_07_a\"]','MiltonDrive',0,1,0,'{\"x\":-765.956,\"y\":328.257,\"z\":210.396}',1300000), + (32,'Regal2Apartment','Regal Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_07_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.545,\"y\":326.659,\"z\":186.313}',1300000), + (33,'Regal3Apartment','Regal Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_07_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.087,\"y\":331.429,\"z\":195.123}',1300000), + (34,'Aqua1Apartment','Aqua Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_08_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.187,\"y\":328.47,\"z\":210.396}',1300000), + (35,'Aqua2Apartment','Aqua Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_08_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.658,\"y\":326.563,\"z\":186.313}',1300000), + (36,'Aqua3Apartment','Aqua Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_08_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.287,\"y\":331.084,\"z\":195.086}',1300000), + (37,'IntegrityWay','4 Integrity Way','{\"x\":-47.804,\"y\":-585.867,\"z\":36.956}',NULL,NULL,'{\"x\":-54.178,\"y\":-583.762,\"z\":35.798}','[]',NULL,0,0,1,NULL,0), + (38,'IntegrityWay28','4 Integrity Way - Apt 28',NULL,'{\"x\":-31.409,\"y\":-594.927,\"z\":79.03}','{\"x\":-26.098,\"y\":-596.909,\"z\":79.03}',NULL,'[]','IntegrityWay',0,1,0,'{\"x\":-11.923,\"y\":-597.083,\"z\":78.43}',1700000), + (39,'IntegrityWay30','4 Integrity Way - Apt 30',NULL,'{\"x\":-17.702,\"y\":-588.524,\"z\":89.114}','{\"x\":-16.21,\"y\":-582.569,\"z\":89.114}',NULL,'[]','IntegrityWay',0,1,0,'{\"x\":-26.327,\"y\":-588.384,\"z\":89.123}',1700000), + (40,'DellPerroHeights','Dell Perro Heights','{\"x\":-1447.06,\"y\":-538.28,\"z\":33.74}',NULL,NULL,'{\"x\":-1440.022,\"y\":-548.696,\"z\":33.74}','[]',NULL,0,0,1,NULL,0), + (41,'DellPerroHeightst4','Dell Perro Heights - Apt 28',NULL,'{\"x\":-1452.125,\"y\":-540.591,\"z\":73.044}','{\"x\":-1455.435,\"y\":-535.79,\"z\":73.044}',NULL,'[]','DellPerroHeights',0,1,0,'{\"x\":-1467.058,\"y\":-527.571,\"z\":72.443}',1700000), + (42,'DellPerroHeightst7','Dell Perro Heights - Apt 30',NULL,'{\"x\":-1451.562,\"y\":-523.535,\"z\":55.928}','{\"x\":-1456.02,\"y\":-519.209,\"z\":55.929}',NULL,'[]','DellPerroHeights',0,1,0,'{\"x\":-1457.026,\"y\":-530.219,\"z\":55.937}',1700000) +; + diff --git a/[esx_addons]/esx_property/localization/pl_esx_property.sql b/[esx_addons]/esx_property/localization/pl_esx_property.sql new file mode 100644 index 00000000..53687721 --- /dev/null +++ b/[esx_addons]/esx_property/localization/pl_esx_property.sql @@ -0,0 +1,96 @@ +USE `es_extended`; + +ALTER TABLE `users` + ADD COLUMN `last_property` VARCHAR(255) NULL +; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('property_black_money','Mieszkanie na sprzedaż',0) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('property','Mieszkanie',0) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('property','Mieszkanie',0) +; + +CREATE TABLE `owned_properties` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `price` double NOT NULL, + `rented` int(11) NOT NULL, + `owner` varchar(60) NOT NULL, + + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `properties` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `entering` varchar(255) DEFAULT NULL, + `exit` varchar(255) DEFAULT NULL, + `inside` varchar(255) DEFAULT NULL, + `outside` varchar(255) DEFAULT NULL, + `ipls` varchar(255) DEFAULT '[]', + `gateway` varchar(255) DEFAULT NULL, + `is_single` int(11) DEFAULT NULL, + `is_room` int(11) DEFAULT NULL, + `is_gateway` int(11) DEFAULT NULL, + `room_menu` varchar(255) DEFAULT NULL, + `price` int(11) NOT NULL, + + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +INSERT INTO `properties` VALUES + (1,'WhispymoundDrive','2677 Whispymound Drive','{\"y\":564.89,\"z\":182.959,\"x\":119.384}','{\"x\":117.347,\"y\":559.506,\"z\":183.304}','{\"y\":557.032,\"z\":183.301,\"x\":118.037}','{\"y\":567.798,\"z\":182.131,\"x\":119.249}','[]',NULL,1,1,0,'{\"x\":118.748,\"y\":566.573,\"z\":175.697}',1500000), + (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"x\":372.796,\"y\":428.327,\"z\":144.685}','{\"x\":373.548,\"y\":422.982,\"z\":144.907}','{\"y\":420.075,\"z\":145.904,\"x\":372.161}','{\"x\":372.454,\"y\":432.886,\"z\":143.443}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), + (3,'RichardMajesticApt2','Richard Majestic, Apt 2','{\"y\":-379.165,\"z\":37.961,\"x\":-936.363}','{\"y\":-365.476,\"z\":113.274,\"x\":-913.097}','{\"y\":-367.637,\"z\":113.274,\"x\":-918.022}','{\"y\":-382.023,\"z\":37.961,\"x\":-943.626}','[]',NULL,1,1,0,'{\"x\":-927.554,\"y\":-377.744,\"z\":112.674}',1700000), + (4,'NorthConkerAvenue2044','2044 North Conker Avenue','{\"y\":440.8,\"z\":146.702,\"x\":346.964}','{\"y\":437.456,\"z\":148.394,\"x\":341.683}','{\"y\":435.626,\"z\":148.394,\"x\":339.595}','{\"x\":350.535,\"y\":443.329,\"z\":145.764}','[]',NULL,1,1,0,'{\"x\":337.726,\"y\":436.985,\"z\":140.77}',1500000), + (5,'WildOatsDrive','3655 Wild Oats Drive','{\"y\":502.696,\"z\":136.421,\"x\":-176.003}','{\"y\":497.817,\"z\":136.653,\"x\":-174.349}','{\"y\":495.069,\"z\":136.666,\"x\":-173.331}','{\"y\":506.412,\"z\":135.0664,\"x\":-177.927}','[]',NULL,1,1,0,'{\"x\":-174.725,\"y\":493.095,\"z\":129.043}',1500000), + (6,'HillcrestAvenue2862','2862 Hillcrest Avenue','{\"y\":596.58,\"z\":142.641,\"x\":-686.554}','{\"y\":591.988,\"z\":144.392,\"x\":-681.728}','{\"y\":590.608,\"z\":144.392,\"x\":-680.124}','{\"y\":599.019,\"z\":142.059,\"x\":-689.492}','[]',NULL,1,1,0,'{\"x\":-680.46,\"y\":588.6,\"z\":136.769}',1500000), + (7,'LowEndApartment','Basic apartment','{\"y\":-1078.735,\"z\":28.4031,\"x\":292.528}','{\"y\":-1007.152,\"z\":-102.002,\"x\":265.845}','{\"y\":-1002.802,\"z\":-100.008,\"x\":265.307}','{\"y\":-1078.669,\"z\":28.401,\"x\":296.738}','[]',NULL,1,1,0,'{\"x\":265.916,\"y\":-999.38,\"z\":-100.008}',562500), + (8,'MadWayneThunder','2113 Mad Wayne Thunder','{\"y\":454.955,\"z\":96.462,\"x\":-1294.433}','{"x":-1289.917,"y":449.541,"z":96.902}','{\"y\":446.322,\"z\":96.899,\"x\":-1289.642}','{\"y\":455.453,\"z\":96.517,\"x\":-1298.851}','[]',NULL,1,1,0,'{\"x\":-1287.306,\"y\":455.901,\"z\":89.294}',1500000), + (9,'HillcrestAvenue2874','2874 Hillcrest Avenue','{\"x\":-853.346,\"y\":696.678,\"z\":147.782}','{\"y\":690.875,\"z\":151.86,\"x\":-859.961}','{\"y\":688.361,\"z\":151.857,\"x\":-859.395}','{\"y\":701.628,\"z\":147.773,\"x\":-855.007}','[]',NULL,1,1,0,'{\"x\":-858.543,\"y\":697.514,\"z\":144.253}',1500000), + (10,'HillcrestAvenue2868','2868 Hillcrest Avenue','{\"y\":620.494,\"z\":141.588,\"x\":-752.82}','{\"y\":618.62,\"z\":143.153,\"x\":-759.317}','{\"y\":617.629,\"z\":143.153,\"x\":-760.789}','{\"y\":621.281,\"z\":141.254,\"x\":-750.919}','[]',NULL,1,1,0,'{\"x\":-762.504,\"y\":618.992,\"z\":135.53}',1500000), + (11,'TinselTowersApt12','Tinsel Towers, Apt 42','{\"y\":37.025,\"z\":42.58,\"x\":-618.299}','{\"y\":58.898,\"z\":97.2,\"x\":-603.301}','{\"y\":58.941,\"z\":97.2,\"x\":-608.741}','{\"y\":30.603,\"z\":42.524,\"x\":-620.017}','[]',NULL,1,1,0,'{\"x\":-622.173,\"y\":54.585,\"z\":96.599}',1700000), + (12,'MiltonDrive','Milton Drive','{\"x\":-775.17,\"y\":312.01,\"z\":84.658}',NULL,NULL,'{\"x\":-775.346,\"y\":306.776,\"z\":84.7}','[]',NULL,0,0,1,NULL,0), + (13,'Modern1Apartment','Modern Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_01_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.661,\"y\":327.672,\"z\":210.396}',1300000), + (14,'Modern2Apartment','Modern Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_01_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.735,\"y\":326.757,\"z\":186.313}',1300000), + (15,'Modern3Apartment','Modern Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_01_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.386,\"y\":330.782,\"z\":195.08}',1300000), + (16,'Mody1Apartment','Mody Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_02_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.615,\"y\":327.878,\"z\":210.396}',1300000), + (17,'Mody2Apartment','Mody Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_02_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.297,\"y\":327.092,\"z\":186.313}',1300000), + (18,'Mody3Apartment','Mody Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_02_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.303,\"y\":330.932,\"z\":195.085}',1300000), + (19,'Vibrant1Apartment','Vibrant Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_03_a\"]','MiltonDrive',0,1,0,'{\"x\":-765.885,\"y\":327.641,\"z\":210.396}',1300000), + (20,'Vibrant2Apartment','Vibrant Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_03_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.607,\"y\":327.344,\"z\":186.313}',1300000), + (21,'Vibrant3Apartment','Vibrant Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_03_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.525,\"y\":330.851,\"z\":195.085}',1300000), + (22,'Sharp1Apartment','Sharp Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_04_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.527,\"y\":327.89,\"z\":210.396}',1300000), + (23,'Sharp2Apartment','Sharp Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_04_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.642,\"y\":326.497,\"z\":186.313}',1300000), + (24,'Sharp3Apartment','Sharp Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_04_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.503,\"y\":331.318,\"z\":195.085}',1300000), + (25,'Monochrome1Apartment','Monochrome Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_05_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.289,\"y\":328.086,\"z\":210.396}',1300000), + (26,'Monochrome2Apartment','Monochrome Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_05_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.692,\"y\":326.762,\"z\":186.313}',1300000), + (27,'Monochrome3Apartment','Monochrome Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_05_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.094,\"y\":330.976,\"z\":195.085}',1300000), + (28,'Seductive1Apartment','Seductive Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_06_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.263,\"y\":328.104,\"z\":210.396}',1300000), + (29,'Seductive2Apartment','Seductive Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_06_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.655,\"y\":326.611,\"z\":186.313}',1300000), + (30,'Seductive3Apartment','Seductive Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_06_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.3,\"y\":331.414,\"z\":195.085}',1300000), + (31,'Regal1Apartment','Regal Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_07_a\"]','MiltonDrive',0,1,0,'{\"x\":-765.956,\"y\":328.257,\"z\":210.396}',1300000), + (32,'Regal2Apartment','Regal Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_07_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.545,\"y\":326.659,\"z\":186.313}',1300000), + (33,'Regal3Apartment','Regal Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_07_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.087,\"y\":331.429,\"z\":195.123}',1300000), + (34,'Aqua1Apartment','Aqua Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_08_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.187,\"y\":328.47,\"z\":210.396}',1300000), + (35,'Aqua2Apartment','Aqua Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_08_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.658,\"y\":326.563,\"z\":186.313}',1300000), + (36,'Aqua3Apartment','Aqua Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_08_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.287,\"y\":331.084,\"z\":195.086}',1300000), + (37,'IntegrityWay','4 Integrity Way','{\"x\":-47.804,\"y\":-585.867,\"z\":36.956}',NULL,NULL,'{\"x\":-54.178,\"y\":-583.762,\"z\":35.798}','[]',NULL,0,0,1,NULL,0), + (38,'IntegrityWay28','4 Integrity Way - Apt 28',NULL,'{\"x\":-31.409,\"y\":-594.927,\"z\":79.03}','{\"x\":-26.098,\"y\":-596.909,\"z\":79.03}',NULL,'[]','IntegrityWay',0,1,0,'{\"x\":-11.923,\"y\":-597.083,\"z\":78.43}',1700000), + (39,'IntegrityWay30','4 Integrity Way - Apt 30',NULL,'{\"x\":-17.702,\"y\":-588.524,\"z\":89.114}','{\"x\":-16.21,\"y\":-582.569,\"z\":89.114}',NULL,'[]','IntegrityWay',0,1,0,'{\"x\":-26.327,\"y\":-588.384,\"z\":89.123}',1700000), + (40,'DellPerroHeights','Dell Perro Heights','{\"x\":-1447.06,\"y\":-538.28,\"z\":33.74}',NULL,NULL,'{\"x\":-1440.022,\"y\":-548.696,\"z\":33.74}','[]',NULL,0,0,1,NULL,0), + (41,'DellPerroHeightst4','Dell Perro Heights - Apt 28',NULL,'{\"x\":-1452.125,\"y\":-540.591,\"z\":73.044}','{\"x\":-1455.435,\"y\":-535.79,\"z\":73.044}',NULL,'[]','DellPerroHeights',0,1,0,'{\"x\":-1467.058,\"y\":-527.571,\"z\":72.443}',1700000), + (42,'DellPerroHeightst7','Dell Perro Heights - Apt 30',NULL,'{\"x\":-1451.562,\"y\":-523.535,\"z\":55.928}','{\"x\":-1456.02,\"y\":-519.209,\"z\":55.929}',NULL,'[]','DellPerroHeights',0,1,0,'{\"x\":-1457.026,\"y\":-530.219,\"z\":55.937}',1700000) +; + diff --git a/[esx_addons]/esx_property/offices.sql b/[esx_addons]/esx_property/offices.sql new file mode 100644 index 00000000..3c7ec94f --- /dev/null +++ b/[esx_addons]/esx_property/offices.sql @@ -0,0 +1,34 @@ +USE `es_extended`; + +INSERT INTO `properties` VALUES + (43, 'MazeBankBuilding', 'Maze Bank Building', '{\"x\":-79.18,\"y\":-795.92,\"z\":43.35}', NULL, NULL, '{\"x\":-72.50,\"y\":-786.92,\"z\":43.40}', '[]', NULL, 0, 0, 1, NULL, 0), + (44, 'OldSpiceWarm', 'Old Spice Warm', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_01a\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-71.81,\"y\":-814.34,\"z\":242.39}', 5000000), + (45, 'OldSpiceClassical', 'Old Spice Classical', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_01b\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-71.81,\"y\":-814.34,\"z\":242.39}', 5000000), + (46, 'OldSpiceVintage', 'Old Spice Vintage', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_01c\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-71.81,\"y\":-814.34,\"z\":242.39}', 5000000), + (47, 'ExecutiveRich', 'Executive Rich', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_02b\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-71.81,\"y\":-814.34,\"z\":242.39}', 5000000), + (48, 'ExecutiveCool', 'Executive Cool', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_02c\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-71.81,\"y\":-814.34,\"z\":242.39}', 5000000), + (49, 'ExecutiveContrast', 'Executive Contrast', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_02a\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-71.81,\"y\":-814.34,\"z\":242.39}', 5000000), + (50, 'PowerBrokerIce', 'Power Broker Ice', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_03a\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-71.81,\"y\":-814.34,\"z\":242.39}', 5000000), + (51, 'PowerBrokerConservative', 'Power Broker Conservative', NULL, '{"x":-75.69,"y":-827.08,"z":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_03b\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-71.81,\"y\":-814.34,\"z\":242.39}', 5000000), + (52, 'PowerBrokerPolished', 'Power Broker Polished', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_03c\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-71.81,\"y\":-814.34,\"z\":242.39}', 5000000), + (53, 'LomBank', 'Lom Bank', '{\"x\":-1581.36,\"y\":-558.23,\"z\":34.07}', NULL, NULL, '{\"x\":-1583.60,\"y\":-555.12,\"z\":34.07}', '[]', NULL, 0, 0, 1, NULL, 0), + (54, 'LBOldSpiceWarm', 'LB Old Spice Warm', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_01a\"]', 'LomBank', 0, 1, 0, '{\"x\":-1571.26,\"y\":-575.76,\"z\":107.52}', 3500000), + (55, 'LBOldSpiceClassical', 'LB Old Spice Classical', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_01b\"]', 'LomBank', 0, 1, 0, '{\"x\":-1571.26,\"y\":-575.76,\"z\":107.52}', 3500000), + (56, 'LBOldSpiceVintage', 'LB Old Spice Vintage', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_01c\"]', 'LomBank', 0, 1, 0, '{\"x\":-1571.26,\"y\":-575.76,\"z\":107.52}', 3500000), + (57, 'LBExecutiveRich', 'LB Executive Rich', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_02b\"]', 'LomBank', 0, 1, 0, '{\"x\":-1571.26,\"y\":-575.76,\"z\":107.52}', 3500000), + (58, 'LBExecutiveCool', 'LB Executive Cool', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_02c\"]', 'LomBank', 0, 1, 0, '{\"x\":-1571.26,\"y\":-575.76,\"z\":107.52}', 3500000), + (59, 'LBExecutiveContrast', 'LB Executive Contrast', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_02a\"]', 'LomBank', 0, 1, 0, '{\"x\":-1571.26,\"y\":-575.76,\"z\":107.52}', 3500000), + (60, 'LBPowerBrokerIce', 'LB Power Broker Ice', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_03a\"]', 'LomBank', 0, 1, 0, '{\"x\":-1571.26,\"y\":-575.76,\"z\":107.52}', 3500000), + (61, 'LBPowerBrokerConservative', 'LB Power Broker Conservative', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_03b\"]', 'LomBank', 0, 1, 0, '{\"x\":-1571.26,\"y\":-575.76,\"z\":107.52}', 3500000), + (62, 'LBPowerBrokerPolished', 'LB Power Broker Polished', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_03c\"]', 'LomBank', 0, 1, 0, '{\"x\":-1571.26,\"y\":-575.76,\"z\":107.52}', 3500000), + (63, 'MazeBankWest', 'Maze Bank West', '{\"x\":-1379.58,\"y\":-499.63,\"z\":32.22}', NULL, NULL, '{\"x\":-1378.95,\"y\":-502.82,\"z\":32.22}', '[]', NULL, 0, 0, 1, NULL, 0), + (64, 'MBWOldSpiceWarm', 'MBW Old Spice Warm', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_01a\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000), + (65, 'MBWOldSpiceClassical', 'MBW Old Spice Classical', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_01b\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000), + (66, 'MBWOldSpiceVintage', 'MBW Old Spice Vintage', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_01c\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000), + (67, 'MBWExecutiveRich', 'MBW Executive Rich', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_02b\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000), + (68, 'MBWExecutiveCool', 'MBW Executive Cool', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_02c\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000), + (69, 'MBWExecutive Contrast', 'MBW Executive Contrast', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_02a\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000), + (70, 'MBWPowerBrokerIce', 'MBW Power Broker Ice', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_03a\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000), + (71, 'MBWPowerBrokerConvservative', 'MBW Power Broker Convservative', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_03b\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000), + (72, 'MBWPowerBrokerPolished', 'MBW Power Broker Polished', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_03c\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000); +; diff --git a/[esx_addons]/esx_property/server/main.lua b/[esx_addons]/esx_property/server/main.lua new file mode 100644 index 00000000..ab9e1b00 --- /dev/null +++ b/[esx_addons]/esx_property/server/main.lua @@ -0,0 +1,468 @@ +ESX = nil + +TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + +function GetProperty(name) + for i=1, #Config.Properties, 1 do + if Config.Properties[i].name == name then + return Config.Properties[i] + end + end +end + +function SetPropertyOwned(name, price, rented, owner) + MySQL.Async.execute('INSERT INTO owned_properties (name, price, rented, owner) VALUES (@name, @price, @rented, @owner)', { + ['@name'] = name, + ['@price'] = price, + ['@rented'] = (rented and 1 or 0), + ['@owner'] = owner + }, function(rowsChanged) + local xPlayer = ESX.GetPlayerFromIdentifier(owner) + + if xPlayer then + TriggerClientEvent('esx_property:setPropertyOwned', xPlayer.source, name, true, rented) + + if rented then + xPlayer.showNotification(_U('rent_for', ESX.Math.GroupDigits(price))) + else + xPlayer.showNotification(_U('buy_for', ESX.Math.GroupDigits(price))) + end + end + end) +end + +function RemoveOwnedProperty(name, owner, noPay) + MySQL.Async.fetchAll('SELECT id, rented, price FROM owned_properties WHERE name = @name AND owner = @owner', { + ['@name'] = name, + ['@owner'] = owner + }, function(result) + if result[1] then + MySQL.Async.execute('DELETE FROM owned_properties WHERE id = @id', { + ['@id'] = result[1].id + }, function(rowsChanged) + local xPlayer = ESX.GetPlayerFromIdentifier(owner) + + if xPlayer then + xPlayer.triggerEvent('esx_property:setPropertyOwned', name, false) + + if not noPay then + if result[1].rented == 1 then + xPlayer.showNotification(_U('moved_out')) + else + local sellPrice = ESX.Math.Round(result[1].price / Config.SellModifier) + + xPlayer.showNotification(_U('moved_out_sold', ESX.Math.GroupDigits(sellPrice))) + xPlayer.addAccountMoney('bank', sellPrice) + end + end + end + end) + end + end) +end + +MySQL.ready(function() + Citizen.Wait(1500) + + MySQL.Async.fetchAll('SELECT * FROM `properties`', {}, function(properties) + + for i=1, #properties, 1 do + local entering = nil + local exit = nil + local inside = nil + local outside = nil + local isSingle = nil + local isRoom = nil + local isGateway = nil + local roomMenu = nil + + if properties[i].entering then + entering = json.decode(properties[i].entering) + end + + if properties[i].exit then + exit = json.decode(properties[i].exit) + end + + if properties[i].inside then + inside = json.decode(properties[i].inside) + end + + if properties[i].outside then + outside = json.decode(properties[i].outside) + end + + if properties[i].is_single == 0 then + isSingle = false + else + isSingle = true + end + + if properties[i].is_room == 0 then + isRoom = false + else + isRoom = true + end + + if properties[i].is_gateway == 0 then + isGateway = false + else + isGateway = true + end + + if properties[i].room_menu then + roomMenu = json.decode(properties[i].room_menu) + end + + table.insert(Config.Properties, { + name = properties[i].name, + label = properties[i].label, + entering = entering, + exit = exit, + inside = inside, + outside = outside, + ipls = json.decode(properties[i].ipls), + gateway = properties[i].gateway, + isSingle = isSingle, + isRoom = isRoom, + isGateway = isGateway, + roomMenu = roomMenu, + price = properties[i].price + }) + end + + TriggerClientEvent('esx_property:sendProperties', -1, Config.Properties) + end) +end) + +ESX.RegisterServerCallback('esx_property:getProperties', function(source, cb) + cb(Config.Properties) +end) + +AddEventHandler('esx_ownedproperty:getOwnedProperties', function(cb) + MySQL.Async.fetchAll('SELECT * FROM owned_properties', {}, function(result) + local properties = {} + + for i=1, #result, 1 do + table.insert(properties, { + id = result[i].id, + name = result[i].name, + label = GetProperty(result[i].name).label, + price = result[i].price, + rented = (result[i].rented == 1 and true or false), + owner = result[i].owner + }) + end + + cb(properties) + end) +end) + +AddEventHandler('esx_property:setPropertyOwned', function(name, price, rented, owner) + SetPropertyOwned(name, price, rented, owner) +end) + +AddEventHandler('esx_property:removeOwnedProperty', function(name, owner) + RemoveOwnedProperty(name, owner) +end) + +RegisterNetEvent('esx_property:rentProperty') +AddEventHandler('esx_property:rentProperty', function(propertyName) + local xPlayer = ESX.GetPlayerFromId(source) + local property = GetProperty(propertyName) + local rent = ESX.Math.Round(property.price / Config.RentModifier) + + SetPropertyOwned(propertyName, rent, true, xPlayer.identifier) +end) + +RegisterNetEvent('esx_property:buyProperty') +AddEventHandler('esx_property:buyProperty', function(propertyName) + local xPlayer = ESX.GetPlayerFromId(source) + local property = GetProperty(propertyName) + + if property.price <= xPlayer.getMoney() then + xPlayer.removeMoney(property.price) + SetPropertyOwned(propertyName, property.price, false, xPlayer.identifier) + else + xPlayer.showNotification(_U('not_enough')) + end +end) + +RegisterNetEvent('esx_property:removeOwnedProperty') +AddEventHandler('esx_property:removeOwnedProperty', function(propertyName) + local xPlayer = ESX.GetPlayerFromId(source) + RemoveOwnedProperty(propertyName, xPlayer.identifier) +end) + +AddEventHandler('esx_property:removeOwnedPropertyIdentifier', function(propertyName, identifier) + RemoveOwnedProperty(propertyName, identifier) +end) + +RegisterNetEvent('esx_property:saveLastProperty') +AddEventHandler('esx_property:saveLastProperty', function(property) + local xPlayer = ESX.GetPlayerFromId(source) + + MySQL.Async.execute('UPDATE users SET last_property = @last_property WHERE identifier = @identifier', { + ['@last_property'] = property, + ['@identifier'] = xPlayer.identifier + }) +end) + +RegisterNetEvent('esx_property:deleteLastProperty') +AddEventHandler('esx_property:deleteLastProperty', function() + local xPlayer = ESX.GetPlayerFromId(source) + + MySQL.Async.execute('UPDATE users SET last_property = NULL WHERE identifier = @identifier', { + ['@identifier'] = xPlayer.identifier + }) +end) + +RegisterNetEvent('esx_property:getItem') +AddEventHandler('esx_property:getItem', function(owner, type, item, count) + local xPlayer = ESX.GetPlayerFromId(source) + local xPlayerOwner = ESX.GetPlayerFromIdentifier(owner) + + if type == 'item_standard' then + TriggerEvent('esx_addoninventory:getInventory', 'property', xPlayerOwner.identifier, function(inventory) + local inventoryItem = inventory.getItem(item) + + -- is there enough in the property? + if count > 0 and inventoryItem.count >= count then + -- can the player carry the said amount of x item? + if xPlayer.canCarryItem(item, count) then + inventory.removeItem(item, count) + xPlayer.addInventoryItem(item, count) + xPlayer.showNotification(_U('have_withdrawn', count, inventoryItem.label)) + else + xPlayer.showNotification(_U('player_cannot_hold')) + end + else + xPlayer.showNotification(_U('not_enough_in_property')) + end + end) + elseif type == 'item_account' then + TriggerEvent('esx_addonaccount:getAccount', 'property_' .. item, xPlayerOwner.identifier, function(account) + if account.money >= count then + account.removeMoney(count) + xPlayer.addAccountMoney(item, count) + else + xPlayer.showNotification(_U('amount_invalid')) + end + end) + elseif type == 'item_weapon' then + TriggerEvent('esx_datastore:getDataStore', 'property', xPlayerOwner.identifier, function(store) + local storeWeapons = store.get('weapons') or {} + local weaponName = nil + local ammo = nil + + for i=1, #storeWeapons, 1 do + if storeWeapons[i].name == item then + weaponName = storeWeapons[i].name + ammo = storeWeapons[i].ammo + + table.remove(storeWeapons, i) + break + end + end + + store.set('weapons', storeWeapons) + xPlayer.addWeapon(weaponName, ammo) + end) + end +end) + +RegisterNetEvent('esx_property:putItem') +AddEventHandler('esx_property:putItem', function(owner, type, item, count) + local xPlayer = ESX.GetPlayerFromId(source) + local xPlayerOwner = ESX.GetPlayerFromIdentifier(owner) + + if type == 'item_standard' then + local playerItemCount = xPlayer.getInventoryItem(item).count + + if playerItemCount >= count and count > 0 then + TriggerEvent('esx_addoninventory:getInventory', 'property', xPlayerOwner.identifier, function(inventory) + xPlayer.removeInventoryItem(item, count) + inventory.addItem(item, count) + xPlayer.showNotification(_U('have_deposited', count, inventory.getItem(item).label)) + end) + else + xPlayer.showNotification(_U('invalid_quantity')) + end + elseif type == 'item_account' then + if xPlayer.getAccount(item).money >= count and count > 0 then + xPlayer.removeAccountMoney(item, count) + + TriggerEvent('esx_addonaccount:getAccount', 'property_' .. item, xPlayerOwner.identifier, function(account) + account.addMoney(count) + end) + else + xPlayer.showNotification(_U('amount_invalid')) + end + elseif type == 'item_weapon' then + if xPlayer.hasWeapon(item) then + xPlayer.removeWeapon(item) + + TriggerEvent('esx_datastore:getDataStore', 'property', xPlayerOwner.identifier, function(store) + local storeWeapons = store.get('weapons') or {} + + table.insert(storeWeapons, { + name = item, + ammo = count + }) + + store.set('weapons', storeWeapons) + end) + end + end +end) + +ESX.RegisterServerCallback('esx_property:getOwnedProperties', function(source, cb) + local xPlayer = ESX.GetPlayerFromId(source) + + MySQL.Async.fetchAll('SELECT name, rented FROM owned_properties WHERE owner = @owner', { + ['@owner'] = xPlayer.identifier + }, function(result) + cb(result) + end) +end) + +ESX.RegisterServerCallback('esx_property:getLastProperty', function(source, cb) + local xPlayer = ESX.GetPlayerFromId(source) + + MySQL.Async.fetchAll('SELECT last_property FROM users WHERE identifier = @identifier', { + ['@identifier'] = xPlayer.identifier + }, function(users) + cb(users[1].last_property) + end) +end) + +ESX.RegisterServerCallback('esx_property:getPropertyInventory', function(source, cb, owner) + local xPlayer = ESX.GetPlayerFromIdentifier(owner) + local blackMoney = 0 + local items = {} + local weapons = {} + + TriggerEvent('esx_addonaccount:getAccount', 'property_black_money', xPlayer.identifier, function(account) + blackMoney = account.money + end) + + TriggerEvent('esx_addoninventory:getInventory', 'property', xPlayer.identifier, function(inventory) + items = inventory.items + end) + + TriggerEvent('esx_datastore:getDataStore', 'property', xPlayer.identifier, function(store) + weapons = store.get('weapons') or {} + end) + + cb({ + blackMoney = blackMoney, + items = items, + weapons = weapons + }) +end) + +ESX.RegisterServerCallback('esx_property:getPlayerInventory', function(source, cb) + local xPlayer = ESX.GetPlayerFromId(source) + local blackMoney = xPlayer.getAccount('black_money').money + local items = xPlayer.inventory + + cb({ + blackMoney = blackMoney, + items = items, + weapons = xPlayer.getLoadout() + }) +end) + +ESX.RegisterServerCallback('esx_property:getPlayerDressing', function(source, cb) + local xPlayer = ESX.GetPlayerFromId(source) + + TriggerEvent('esx_datastore:getDataStore', 'property', xPlayer.identifier, function(store) + local count = store.count('dressing') + local labels = {} + + for i=1, count, 1 do + local entry = store.get('dressing', i) + table.insert(labels, entry.label) + end + + cb(labels) + end) +end) + +ESX.RegisterServerCallback('esx_property:getPlayerOutfit', function(source, cb, num) + local xPlayer = ESX.GetPlayerFromId(source) + + TriggerEvent('esx_datastore:getDataStore', 'property', xPlayer.identifier, function(store) + local outfit = store.get('dressing', num) + cb(outfit.skin) + end) +end) + +RegisterNetEvent('esx_property:removeOutfit') +AddEventHandler('esx_property:removeOutfit', function(label) + local xPlayer = ESX.GetPlayerFromId(source) + + TriggerEvent('esx_datastore:getDataStore', 'property', xPlayer.identifier, function(store) + local dressing = store.get('dressing') or {} + + table.remove(dressing, label) + store.set('dressing', dressing) + end) +end) + +function payRent(d, h, m) + local tasks, timeStart = {}, os.clock() + print('[esx_property] [^2INFO^7] Paying rent cron job started') + + MySQL.Async.fetchAll('SELECT * FROM owned_properties WHERE rented = 1', {}, function(result) + for k,v in ipairs(result) do + table.insert(tasks, function(cb) + local xPlayer = ESX.GetPlayerFromIdentifier(v.owner) + + if xPlayer then + if xPlayer.getAccount('bank').money >= v.price then + xPlayer.removeAccountMoney('bank', v.price) + xPlayer.showNotification(_U('paid_rent', ESX.Math.GroupDigits(v.price), GetProperty(v.name).label)) + else + xPlayer.showNotification(_U('paid_rent_evicted', GetProperty(v.name).label, ESX.Math.GroupDigits(v.price))) + RemoveOwnedProperty(v.name, v.owner, true) + end + else + MySQL.Async.fetchScalar('SELECT accounts FROM users WHERE identifier = @identifier', { + ['@identifier'] = v.owner + }, function(accounts) + if accounts then + local playerAccounts = json.decode(accounts) + + if playerAccounts and playerAccounts.bank then + if playerAccounts.bank >= v.price then + playerAccounts.bank = playerAccounts.bank - v.price + + MySQL.Async.execute('UPDATE users SET accounts = @accounts WHERE identifier = @identifier', { + ['@identifier'] = v.owner, + ['@accounts'] = json.encode(playerAccounts) + }) + else + RemoveOwnedProperty(v.name, v.owner, true) + end + end + end + end) + end + + TriggerEvent('esx_addonaccount:getSharedAccount', 'society_realestateagent', function(account) + account.addMoney(v.price) + end) + + cb() + end) + end + + Async.parallelLimit(tasks, 5, function(results) end) + + local elapsedTime = os.clock() - timeStart + print(('[esx_property] [^2INFO^7] Paying rent cron job took %s seconds'):format(elapsedTime)) + end) +end + +TriggerEvent('cron:runAt', 22, 0, payRent) diff --git a/[esx_addons]/esx_realestateagentjob/.editorconfig b/[esx_addons]/esx_realestateagentjob/.editorconfig new file mode 100644 index 00000000..9b425256 --- /dev/null +++ b/[esx_addons]/esx_realestateagentjob/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_size = 4 +indent_style = tab +end_of_line = crlf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/[esx_addons]/esx_realestateagentjob/LICENSE b/[esx_addons]/esx_realestateagentjob/LICENSE new file mode 100644 index 00000000..aa780afb --- /dev/null +++ b/[esx_addons]/esx_realestateagentjob/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + fxserver-esx_realestateagentjob + Copyright (C) 2015 Jérémie N'gadi + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + fxserver-esx_realestateagentjob Copyright (C) 2015 Jérémie N'gadi + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. \ No newline at end of file diff --git a/[esx_addons]/esx_realestateagentjob/README.md b/[esx_addons]/esx_realestateagentjob/README.md new file mode 100644 index 00000000..21d5fdb5 --- /dev/null +++ b/[esx_addons]/esx_realestateagentjob/README.md @@ -0,0 +1,40 @@ +# esx_realestateagentjob + +## Requirements +- [esx_addonaccount](https://github.com/ESX-Org/esx_addonaccount) +- [esx_property](https://github.com/ESX-Org/esx_property) +- [esx_society](https://github.com/ESX-Org/esx_society) + +## Download & Installation + +### Using [fvm](https://github.com/qlaffont/fvm-installer) +``` +fvm install --save --folder=esx esx-org/esx_realestateagentjob +``` + +### Using Git +``` +cd resources +git clone https://github.com/ESX-Org/esx_realestateagentjob [esx]/esx_realestateagentjob +``` + +### Manually +- Download https://github.com/ESX-Org/esx_realestateagentjob/archive/master.zip +- Put it in the `[esx]` directory + +## Installation +- Add `start esx_realestateagentjob` to your `server.cfg` +- Import `esx_realestateagentjob.sql` in your database +- Set `Config.EnablePlayerManagement` to `true` in esx_property + +# Legal +### License +esx_realestateagentjob - real estate job + +Copyright (C) 2015-2020 Jérémie N'gadi + +This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version. + +This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details. + +You should have received a copy Of the GNU General Public License along with this program. If Not, see http://www.gnu.org/licenses/. \ No newline at end of file diff --git a/[esx_addons]/esx_realestateagentjob/client/main.lua b/[esx_addons]/esx_realestateagentjob/client/main.lua new file mode 100644 index 00000000..df27035e --- /dev/null +++ b/[esx_addons]/esx_realestateagentjob/client/main.lua @@ -0,0 +1,312 @@ +local hasAlreadyEnteredMarker, CurrentActionData = false, {} +local CurrentAction, CurrentActionMsg, LastZone +ESX = nil + +Citizen.CreateThread(function() + while ESX == nil do + TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + Citizen.Wait(0) + end + + while ESX.GetPlayerData().job == nil do + Citizen.Wait(100) + end + + ESX.PlayerData = ESX.GetPlayerData() + + if ESX.PlayerData.job.name == 'realestateagent' then + Config.Zones.OfficeActions.Type = 1 + else + Config.Zones.OfficeActions.Type = -1 + end +end) + +function OpenRealestateAgentMenu() + local elements = { + {label = _U('properties'), value = 'properties'}, + {label = _U('clients'), value = 'customers'}, + } + + if ESX.PlayerData.job ~= nil and ESX.PlayerData.job.name == 'realestateagent' and ESX.PlayerData.job.grade_name == 'boss' then + table.insert(elements, { + label = _U('boss_action'), + value = 'boss_actions' + }) + end + + ESX.UI.Menu.CloseAll() + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'realestateagent', { + title = _U('realtor'), + align = 'top-left', + elements = elements + }, function(data, menu) + if data.current.value == 'properties' then + OpenPropertyMenu() + elseif data.current.value == 'customers' then + OpenCustomersMenu() + elseif data.current.value == 'boss_actions' then + TriggerEvent('esx_society:openBossMenu', 'realestateagent', function(data, menu) + menu.close() + end) + end + end, function(data, menu) + menu.close() + + CurrentAction = 'realestateagent_menu' + CurrentActionMsg = _U('press_to_access') + CurrentActionData = {} + end) +end + +function OpenPropertyMenu() + TriggerEvent('esx_property:getProperties', function(properties) + + local elements = { + head = {_U('property_name'), _U('property_actions')}, + rows = {} + } + + for i=1, #properties, 1 do + table.insert(elements.rows, { + data = properties[i], + cols = { + properties[i].label, + _U('property_actionbuttons') + } + }) + end + + ESX.UI.Menu.Open('list', GetCurrentResourceName(), 'properties', elements, function(data, menu) + if data.value == 'sell' then + menu.close() + + ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'sell_property_amount', { + title = _U('amount') + }, function(data2, menu2) + local amount = tonumber(data2.value) + + if amount == nil then + ESX.ShowNotification(_U('invalid_amount')) + else + local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() + if closestPlayer == -1 or closestDistance > 3.0 then + ESX.ShowNotification(_U('no_play_near')) + menu2.close() + else + TriggerServerEvent('esx_realestateagentjob:sell', GetPlayerServerId(closestPlayer), data.data.name, amount) + menu2.close() + end + + OpenPropertyMenu() + end + end, function(data2, menu2) + menu2.close() + end) + elseif data.value == 'rent' then + menu.close() + + ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'rent_property_amount', { + title = _U('amount') + }, function(data2, menu2) + local amount = tonumber(data2.value) + + if amount == nil then + ESX.ShowNotification(_U('invalid_amount')) + else + local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() + if closestPlayer == -1 or closestDistance > 3.0 then + ESX.ShowNotification(_U('no_play_near')) + menu2.close() + else + TriggerServerEvent('esx_realestateagentjob:rent', GetPlayerServerId(closestPlayer), data.data.name, amount) + menu2.close() + end + + OpenPropertyMenu() + end + end, function(data2, menu2) + menu2.close() + end) + elseif data.value == 'gps' then + TriggerEvent('esx_property:getProperty', data.data.name, function(property) + if property.isSingle then + SetNewWaypoint(property.entering.x, property.entering.y) + else + TriggerEvent('esx_property:getGateway', property, function(gateway) + SetNewWaypoint(gateway.entering.x, gateway.entering.y) + end) + end + end) + end + end, function(data, menu) + menu.close() + end) + end) +end + +function OpenCustomersMenu() + ESX.TriggerServerCallback('esx_realestateagentjob:getCustomers', function(customers) + local elements = { + head = {_U('customer_client'), _U('customer_property'), _U('customer_agreement'), _U('customer_actions')}, + rows = {} + } + + for i=1, #customers, 1 do + table.insert(elements.rows, { + data = customers[i], + cols = { + customers[i].name, + customers[i].propertyLabel, + (customers[i].propertyRented and _U('customer_rent') or _U('customer_sell')), + _U('customer_contractbuttons') + } + }) + end + + ESX.UI.Menu.Open('list', GetCurrentResourceName(), 'customers', elements, function(data, menu) + if data.value == 'revoke' then + TriggerServerEvent('esx_realestateagentjob:revoke', data.data.propertyName, data.data.propertyOwner) + OpenCustomersMenu() + elseif data.value == 'gps' then + TriggerEvent('esx_property:getProperty', data.data.propertyName, function(property) + if property.isSingle then + SetNewWaypoint(property.entering.x, property.entering.y) + else + TriggerEvent('esx_property:getGateway', property, function(gateway) + SetNewWaypoint(gateway.entering.x, gateway.entering.y) + end) + end + end) + end + end, function(data, menu) + menu.close() + end) + end) +end + +RegisterNetEvent('esx:setJob') +AddEventHandler('esx:setJob', function(job) + ESX.PlayerData.job = job + + if ESX.PlayerData.job.name == 'realestateagent' then + Config.Zones.OfficeActions.Type = 1 + else + Config.Zones.OfficeActions.Type = -1 + end +end) + +AddEventHandler('esx_realestateagentjob:hasEnteredMarker', function(zone) + if zone == 'OfficeEnter' then + local playerPed = PlayerPedId() + SetEntityCoords(playerPed, Config.Zones.OfficeInside.Pos.x, Config.Zones.OfficeInside.Pos.y, Config.Zones.OfficeInside.Pos.z) + elseif zone == 'OfficeExit' then + local playerPed = PlayerPedId() + SetEntityCoords(playerPed, Config.Zones.OfficeOutside.Pos.x, Config.Zones.OfficeOutside.Pos.y, Config.Zones.OfficeOutside.Pos.z) + elseif zone == 'OfficeActions' and ESX.PlayerData.job ~= nil and ESX.PlayerData.job.name == 'realestateagent' then + CurrentAction = 'realestateagent_menu' + CurrentActionMsg = _U('press_to_access') + CurrentActionData = {} + end +end) + +AddEventHandler('esx_realestateagentjob:hasExitedMarker', function(zone) + ESX.UI.Menu.CloseAll() + CurrentAction = nil +end) + +-- Create Blips +Citizen.CreateThread(function() + local blip = AddBlipForCoord(Config.Zones.OfficeEnter.Pos.x, Config.Zones.OfficeEnter.Pos.y, Config.Zones.OfficeEnter.Pos.z) + + SetBlipSprite (blip, 357) + SetBlipDisplay(blip, 4) + SetBlipScale (blip, 1.0) + SetBlipColour (blip, 59) + SetBlipAsShortRange(blip, true) + + BeginTextCommandSetBlipName('STRING') + AddTextComponentSubstringPlayerName(_U('realtors')) + EndTextCommandSetBlipName(blip) +end) + +-- Display markers +Citizen.CreateThread(function() + while true do + Citizen.Wait(0) + + local coords = GetEntityCoords(PlayerPedId()) + + for k,v in pairs(Config.Zones) do + if(v.Type ~= -1 and GetDistanceBetweenCoords(coords, v.Pos.x, v.Pos.y, v.Pos.z, true) < Config.DrawDistance) then + DrawMarker(v.Type, v.Pos.x, v.Pos.y, v.Pos.z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, v.Size.x, v.Size.y, v.Size.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) + end + end + end +end) + +-- Enter / Exit marker events +Citizen.CreateThread(function() + while true do + Citizen.Wait(0) + + local coords = GetEntityCoords(PlayerPedId()) + local isInMarker = false + local currentZone = nil + + for k,v in pairs(Config.Zones) do + if GetDistanceBetweenCoords(coords, v.Pos.x, v.Pos.y, v.Pos.z, true) < v.Size.x then + isInMarker = true + currentZone = k + end + end + + if (isInMarker and not hasAlreadyEnteredMarker) or (isInMarker and LastZone ~= currentZone) then + hasAlreadyEnteredMarker = true + LastZone = currentZone + TriggerEvent('esx_realestateagentjob:hasEnteredMarker', currentZone) + end + + if not isInMarker and hasAlreadyEnteredMarker then + hasAlreadyEnteredMarker = false + TriggerEvent('esx_realestateagentjob:hasExitedMarker', LastZone) + end + end +end) + +-- Key controls +Citizen.CreateThread(function() + while true do + Citizen.Wait(0) + + if CurrentAction then + ESX.ShowHelpNotification(CurrentActionMsg) + + if IsControlJustReleased(0, 38) then + if CurrentAction == 'realestateagent_menu' then + OpenRealestateAgentMenu() + end + + CurrentAction = nil + end + else + Citizen.Wait(500) + end + end +end) + +-- Load IPLS +Citizen.CreateThread(function() + RequestIpl('ex_dt1_02_office_02c') +end) + +RegisterNetEvent('esx_phone:loaded') +AddEventHandler('esx_phone:loaded', function(phoneNumber, contacts) + local specialContact = { + name = _U('realtor'), + number = 'realestateagent', + base64Icon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAMAAABHPGVmAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMAUExURQAAAAkuhgkvhwowhgowhwwxhwowiAwxiAwyiA0yiQ4zig80iQ40ihA0iRA0ihA1ixE2ixI3jBM4ixM4jBQ4jBQ4jRY6jRY6jhg7jhg7jxg8jRk8jhk8jxo+jxo+kBw/kB1AkB1AkR9Bkh9CkR9CkiBDkSBCkiFEkyNElCNGlCVGlCZIlSdIlihJlipKlilKlytMlyxLlyxNlytMmCxMmC5OmS9PmjBPmTBPmjFQmTBQmjNSmzNSnDRTnDVUmzVUnDdVnjZWnTdWnjhXnjpYnjxZnj1bnztaoD1aoD5coT9dokBdoUBdokFeokNgo0NgpERgo0RhpEVipEZipUdkpUdkpkhkpEhkpkpmpUpmpkpmp0xnpk5qp0xoqE5pqU5qqVBrqFBrqVFrqlJsqVJsqlJuqlNuq1RuqlRurFZwrFdyrVhxrllyrVhyrlt0r1x1r112r1x1sF12sF94sWF5sGB4sWF5smJ6smR8s2V9tGZ+tGd/tWl/tWh/tmmAtWmAtmuCtmqCt2yDt2yDuG6EuG+GuXGGuXGGunGIunSJunSJu3WKvHeMvXiNvHmOvnuQvnyQvn6SwICTwYCUwICUwYKWwoSWw4SYw4WYxIeaxIiaxIqcxoydx4yex46fyI+gyJGiyZGiypOkypSky5amzJeozZinzZmozZmpzpqqzpysz5+u0KCu0KGw0aKw0qWz06a01Ki11Ki21aq31qu41qy41q2616+72LC82LG+2bK+2rS/27XA2rbB3LfC3LjD3LrE3brF3rvG3rzG3r7I37/I4MHK4MPM4cTN4sXO4sbP5MfQ48fQ5MjQ5MnS5cvT5szT5s3U5s7W587W6NDX6NHY6NPa6dPa6tTa6tXc6tfd7Nnf7drg7dvg7tzh7t3i7t/k7+Dl8OLm8OPo8ePo8uTo8eTo8ubq8ufr9Ons9Oru9ezu9ezv9u3w9u/y9+/x+PDy+PL0+PP1+vP2+fT1+fX2+vb4+/f4/Pj5+/j5/Pn6/Pv8/fz8/fz8/v7+/gAAACSdcMIAAAEAdFJOU////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wBT9wclAAAACXBIWXMAAC4iAAAuIgGq4t2SAAAAGHRFWHRTb2Z0d2FyZQBwYWludC5uZXQgNC4xLjb9TgnoAAAKNUlEQVRoQ92af1hV5R3Ax/HuXI5eb9fimguQUEN3CbFEW1i51l2PVCJg6qTYapGhm1iaYm6r3O7UciQWmOkonWyOpWJkTh3TJobilIbKlETvvNvAS9zG3YTlxcvp/fE9v3/cK3uePXv2+eue97zn++Gc9/2+P87hS/x/gf89SfmKp+fm5eTMLFiwEkqiI1rJy9nJnJWRsFiHps1dBScjEY1k6fgRHMRWYrHH3/cKVDIjsuThL0NIA+IWQUVjIkieSJQ/IwOGpC6F6gaYSuY6IEwkYhJfhEt0MZE8HwchoiHG9QZcpoOhpOw2C1wfJdztcKUWI8mT16nA3FgKF6vRl6y/NQYuvC4sd8P1KnQlK/TTIgqSIIISPUkuXDEQLMshiBwdyZ0DaA6J2MchjAytZDzUNiFhlEkCxTwDgSQ0krFQ1xjn8hMtjXs3PPd110g7FCkYNBtCiaglke7DEpdzqLcfEe7r9Z+t31m28H7XyGEcy8J5zKAHIZiASnIn1DPCUVDTjRUi4VBve9Nvq17/UWFWRqJoegrCAUpJboQ2H7X70zBEVxLqCfq9LfWV30sh9WKVaamQrCA1jGAnec5BTCP+UjWJuRknmQMiUuSS9aY5mLyuLQSxDAhszbTZv7snGdceBTEJcsmtJJgc1soKD5B9dNuRCx2f9Yb1n1d/f7Aux2bP3hv8K+mfMfIuJpM8qR6vrPeXbVxdnHdvCsfYbmZZK3dTxqPLXnunpv6MrwciiwQPzI+zZVf5+/vbaRLEroGwCElSpm70wWsvhfo+vxLwtVZzWcfqN88fi3sPaxuWMG6Se+GW43KRryiBZSo68F2ChImFuAhJchs9J5BUfFR8MEe5uaTjdjbVvOl5Lv8baSgiw9jS81dV7jjQ2Oo7vTWddf2khdQVJYz0wETJ84obiVv8R9kfKkgwod6gv625/teeORNShrPovka4Jo/jRvz03FWoIErsEFkmkc+1jhl1ioculwhcC3V7T+7fsnJm+hiOmd4gdTxRwtwFoUXJXDhBKG70K3rrUW5mAH6qQa4WN3cMjjCSxAKxRYliWP1K2j3ZK9/95BpchiS5SOKt2OeDAgVX8wc3wU+MJGHugOAgeQKKEeOLZkwZdxNuIefUop9trTnUdH4fkZy0MWxyVkn5eRxKli6hAiPJEBpckCRCMWJJsLu99fjezSXu1CQHa7XHJaSmW0BC2ItDfVToqTpy0f9P9DNUwBlImMdodJDI1oklfaRuuC/U2dpQW7HY7Up2MBrJ7hvYWG74xNwDWMIcJ5dQ5JJbaHQqeRgKMSABwn1X/acqyeNqIckoSshva2XYTMI8S8JTiXxNrZQQTg3GktC5hsp5o69PQluFSJZCEYFIhMyiUAnF/zEan/r76742Eo/ZkSSMJFHMuVjiX1BcXtviC5CJVikBerzNh6tX507aHkFC1vtEMgJKCFjS4bKwnG3M1FnL3vrgjK+zkbSJlnAoeMW04RnGLUoUkxWR3A4HDMvdkOLOZfUlFFPJaEHyMhRQsOSyetGCJf9o0Z8ZTSUxgiQbCihYEr5Yt+21FwqzMlNguMGSk7bY9O+srtzRDtEETCVMGUjIpCyCJZjw1Z6A7+yx2vXFU5Nlycja9uGzH2+qPe0LkE5oLpkOEuX6QZAIhPs+PySMXQSaJ8M4++h7819qiiTBWyMsUe491RIE7cJ/gkcnT0bubW0X/io5I5BIJeVwCBhK/rVnjRvfjCLjf66RdKSSMwJ4BYYkqiUdlnStKa+qPXLa20X7k5SMvecPbv8E/9ibQCpbN/ZpJGL3J1ip5Gk4BLCkI9XCOZzJGe58D15t/UGbjIET75cXT3UlV17r7ys0k+CBBUkUMy9IpGS0cs60ybrJiHrE5XOoP4ejkeTBEYAlgaJ0suoRye6CEDpEJcmBI4A0/KfelsObilLEZdIjZOjVZ8ASSrjzxK4NnkX5mZaHkKRh7LQlr1e9X69eHUUlmQlHgExCQKu5ExyWNA5GZ1F/qMOllxq8/iCtGZWkAI4AtQTRZsMSRca/5xyenlW0trotSskCOAKik9BkZG3vhKOTrIQjAEtCyh5LJe3FLlJBkfFo+jWXcFTCK/cMWNLuGvNQScX2D46cuRRA60gqQQSadr+1phn/UkoOkbMUlcQJEu0AScYfmvTTvu351Q7S8ABdvP6tevWcjBSnjUoOkjKKSoKnRiwZCscUIkmXpSJaxTEyiQCa4L0n61pJw5tIJoAkDY4pWHJlc0mBO80pPUcdiYi5BL8EwRLl4IUlaF/e3dF2an9FASxkBi5B8YlklaLliUQk3N6ws2IxiyXN8zyb30W7N1iMiZhKyBISS3jFexilhNBKetdHHNmVuupxUfDvXYLMVJImSuKhhKAjuaBNxj2pU+Ys2bDnNBrITCU5ouQ+KCFgSc/BhnMd0irrgl0jIXnCcsO2RejCHlHyCpQQsKQ9I9GVmfVCdTN9JN44LDkLN6yT8cYSHJ5KFFtfLBEr2jMLX317x28cWNL/b+/hqnU/mE92oYIEzfFmkgQSnkoWQRmGSOSpw9ocUhcOh3pIm7WUPOBKclisG0wlZJEqSPghUIogbVJVMj012cmJ729EiUhfyN/aULNhv/Zxyf5AF40OEtlaCUvwjrHrzO+rN3oWzshMQU9GK6HgPbBK4s+AQOhG4GsESJZKb4iIBOjrDXZdaj1ZKR8gNaglkyCQ9OIDJLI9tlwCeJ1Y0v3SwtKtNQc7oFDEWJIFwQXJi+KtGEoCWag32eO2kqJDi9ftOnGpE7+CMZTYILYo4emshzCVIDaRop12luMSJs9CqwpDybcgtCR5Q9hARCfZRdNfJxlFifRxQJTwQveOTiIk46ZrhpLvQ2C5hL+Rnsv7sNkbUIp0JAdc5M51Mt4/kVQjGxNAJimlicc5kya681du+bDtcje4FJI3SVHwz0d+sfyBsfGb1JL2V+leKQ6iYmQS/m5ylkJW89MKV/2y/kLHZ61ySSlEQ1nU42u6qGj4sL/6Htq2lh9CUIxcwieR83JQFxqeMXMeSUaNBJAkl3fmwXTAfBNCEhQS1QpMRsbvgpElzdOdpAZiOASkKCXLY6GSFtvEPDoq/DhIIkpQydXGUrrDw8RDPEAp4R+P/FUu6ZGF699r9olTPJGEW0tGSUu1GPyGQIZKwj8zCCqaYEEtlTxl1rKK2lO+zmAoVMjs3Agv3AhD10IwAbWEnx2FBWA5W4p7nmfjVCZevvcbqvmmqZHwD0LdaLFwit0lE6O+Dz0J/5Rx60dBvKo9MDoSvtTkA18klH0X0JPw/KgBffpFj06RgyL6En72gB5ZnHwskWEg4dcMwCIbd5UYSdDN6H4ONSZJmj/UGEt4/i7DoUyLTZxrdTCT8PwdskWfCTF2YV2ij7mE5x+7BQIZE+OK8B8lESU8/2yEu6FralMiSxBL3aN1E2dIWg7Zf0QiKgmmLCc10SHu+Dnn6Anaj/tGRC35T/h/kfD8FwUEvcFd1jgBAAAAAElFTkSuQmCC' + } + + TriggerEvent('esx_phone:addSpecialContact', specialContact.name, specialContact.number, specialContact.base64Icon) +end) \ No newline at end of file diff --git a/[esx_addons]/esx_realestateagentjob/config.lua b/[esx_addons]/esx_realestateagentjob/config.lua new file mode 100644 index 00000000..33a9b9ba --- /dev/null +++ b/[esx_addons]/esx_realestateagentjob/config.lua @@ -0,0 +1,36 @@ +Config = {} +Config.DrawDistance = 100.0 +Config.MarkerColor = { r = 120, g = 120, b = 240 } +Config.Locale = 'en' + +Config.Zones = { + OfficeEnter = { + Pos = { x = -199.151, y = -575.000, z = 39.489 }, + Size = { x = 1.5, y = 1.5, z = 1.0 }, + Type = 1 + }, + + OfficeExit = { + Pos = { x = -141.226, y = -614.166, z = 167.820 }, + Size = { x = 1.5, y = 1.5, z = 1.0 }, + Type = 1 + }, + + OfficeInside = { + Pos = { x = -140.969, y = -616.785, z = 167.820 }, + Size = { x = 1.5, y = 1.5, z = 1.0 }, + Type = -1 + }, + + OfficeOutside = { + Pos = { x = -202.238, y = -578.193, z = 39.500 }, + Size = { x = 1.5, y = 1.5, z = 1.0 }, + Type = -1 + }, + + OfficeActions = { + Pos = { x = -124.786, y = -641.486, z = 167.820 }, + Size = { x = 1.5, y = 1.5, z = 1.0 }, + Type = -1 + } +} diff --git a/[esx_addons]/esx_realestateagentjob/esx_realestateagentjob.sql b/[esx_addons]/esx_realestateagentjob/esx_realestateagentjob.sql new file mode 100644 index 00000000..b382a957 --- /dev/null +++ b/[esx_addons]/esx_realestateagentjob/esx_realestateagentjob.sql @@ -0,0 +1,16 @@ +USE `es_extended`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_realestateagent','Agent immobilier',1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('realestateagent','Agent immobilier') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('realestateagent',0,'location','Location',10,'{}','{}'), + ('realestateagent',1,'vendeur','Vendeur',25,'{}','{}'), + ('realestateagent',2,'gestion','Gestion',40,'{}','{}'), + ('realestateagent',3,'boss','Patron',0,'{}','{}') +; diff --git a/[esx_addons]/esx_realestateagentjob/fxmanifest.lua b/[esx_addons]/esx_realestateagentjob/fxmanifest.lua new file mode 100644 index 00000000..4465e17a --- /dev/null +++ b/[esx_addons]/esx_realestateagentjob/fxmanifest.lua @@ -0,0 +1,43 @@ +fx_version 'adamant' + +game 'gta5' + +description 'ESX Real Estate Job' + +version '1.0.0' + +server_scripts { + '@es_extended/locale.lua', + '@mysql-async/lib/MySQL.lua', + 'locales/de.lua', + 'locales/br.lua', + 'locales/en.lua', + 'locales/fi.lua', + 'locales/fr.lua', + 'locales/sv.lua', + 'locales/tr.lua', + 'locales/cs.lua', + 'config.lua', + 'server/main.lua' +} + +client_scripts { + '@es_extended/locale.lua', + 'locales/de.lua', + 'locales/br.lua', + 'locales/en.lua', + 'locales/fi.lua', + 'locales/fr.lua', + 'locales/sv.lua', + 'locales/tr.lua', + 'locales/cs.lua', + 'config.lua', + 'client/main.lua' +} + +dependencies { + 'es_extended', + 'esx_property', + 'esx_addonaccount', + 'esx_society' +} diff --git a/[esx_addons]/esx_realestateagentjob/locales/br.lua b/[esx_addons]/esx_realestateagentjob/locales/br.lua new file mode 100644 index 00000000..637d0166 --- /dev/null +++ b/[esx_addons]/esx_realestateagentjob/locales/br.lua @@ -0,0 +1,27 @@ +Locales['br'] = { + ['properties'] = 'propriedades', + ['clients'] = 'clientes', + ['realtor'] = 'corretor de imóveis', + ['amount_withdraw'] = 'quantidade de retirada', + ['invalid_amount'] = 'quantidade inválida', + ['press_to_access'] = 'pressione ~INPUT_CONTEXT~ para abrir o menu', + ['amount'] = 'quantidade', + ['no_play_near'] = 'nenhum jogador nas proximidades', + ['realtors'] = 'agente Imobiliário', + ['boss_action'] = 'boss Actions', + ['client_poor'] = 'your client cannot afford that', + + -- Property menu + ['property_name'] = 'propriedade', + ['property_actions'] = 'actions', + ['property_actionbuttons'] = '{{Assign [Sell]|sell}} {{Assign [Rent]|rent}} {{GPS|gps}}', + + -- Customer menu + ['customer_client'] = 'clientes', + ['customer_property'] = 'propriedade', + ['customer_agreement'] = 'agreement', + ['customer_actions'] = 'actions', + ['customer_contractbuttons'] = '{{Revoke contract|revoke}} {{GPS|gps}}', + ['customer_rent'] = 'alugar', + ['customer_sell'] = 'vender', +} diff --git a/[esx_addons]/esx_realestateagentjob/locales/cs.lua b/[esx_addons]/esx_realestateagentjob/locales/cs.lua new file mode 100644 index 00000000..112e246c --- /dev/null +++ b/[esx_addons]/esx_realestateagentjob/locales/cs.lua @@ -0,0 +1,28 @@ +Locales['cs'] = { + ['properties'] = 'nemovitosti', + ['clients'] = 'zákazníci', + ['client'] = 'zákazník', + ['realtor'] = 'Realitní makléř', + ['amount_withdraw'] = 'výše výběru', + ['invalid_amount'] = 'neplatná částka', + ['press_to_access'] = 'stiskni ~INPUT_CONTEXT~ pro přístup do menz', + ['amount'] = 'částka', + ['no_play_near'] = 'žádní hráči poblíž', + ['realtors'] = 'Realitní makléři', + ['boss_action'] = 'akce šéfa', + ['client_poor'] = 'tví klienti si tohle nemůžou dovolit', + + -- Property menu + ['property_name'] = 'nemovitost', + ['property_actions'] = 'akce', + ['property_actionbuttons'] = '{{Assign [Sell]|sell}} {{Assign [Rent]|rent}} {{GPS|gps}}', + + -- Customer menu + ['customer_client'] = 'klienti', + ['customer_property'] = 'nemovitost', + ['customer_agreement'] = 'smlouvy', + ['customer_actions'] = 'akce', + ['customer_contractbuttons'] = '{{Zrušit smlouvu|revoke}} {{GPS|gps}}', + ['customer_rent'] = 'pronajato', + ['customer_sell'] = 'prodáno', +} diff --git a/[esx_addons]/esx_realestateagentjob/locales/de.lua b/[esx_addons]/esx_realestateagentjob/locales/de.lua new file mode 100644 index 00000000..c0df976c --- /dev/null +++ b/[esx_addons]/esx_realestateagentjob/locales/de.lua @@ -0,0 +1,27 @@ +Locales['de'] = { + ['properties'] = 'Immobilien', + ['clients'] = 'kunden', + ['realtor'] = 'makler', + ['amount_withdraw'] = 'betrag zun abheben', + ['invalid_amount'] = 'ungültiger Betrag', + ['press_to_access'] = 'drücke ~INPUT_CONTEXT~ um das Menü zu öffnen', + ['amount'] = 'betrag', + ['no_play_near'] = 'kein Spieler in der Nähe', + ['realtors'] = 'makler', + ['boss_action'] = 'boss Actions', + ['client_poor'] = 'your client cannot afford that', + + -- Property menu + ['property_name'] = 'immobilie', + ['property_actions'] = 'actions', + ['property_actionbuttons'] = '{{Zuweisen [Verkaufen]|sell}} {{Zuweisen [Vermieten]|rent}} {{GPS|gps}}', + + -- Customer menu + ['customer_client'] = 'kunden', + ['customer_property'] = 'immobilie', + ['customer_agreement'] = 'agreement', + ['customer_actions'] = 'actions', + ['customer_contractbuttons'] = '{{Revoke contract|revoke}} {{GPS|gps}}', + ['customer_rent'] = 'mieten', + ['customer_sell'] = 'verkaufen', +} diff --git a/[esx_addons]/esx_realestateagentjob/locales/en.lua b/[esx_addons]/esx_realestateagentjob/locales/en.lua new file mode 100644 index 00000000..18573e9c --- /dev/null +++ b/[esx_addons]/esx_realestateagentjob/locales/en.lua @@ -0,0 +1,27 @@ +Locales['en'] = { + ['properties'] = 'properties', + ['clients'] = 'clients', + ['realtor'] = 'real Estate Agent', + ['amount_withdraw'] = 'amount of withdrawal', + ['invalid_amount'] = 'invalid amount', + ['press_to_access'] = 'press ~INPUT_CONTEXT~ to access the menu', + ['amount'] = 'amount', + ['no_play_near'] = 'no players nearby', + ['realtors'] = 'real Estate Agents', + ['boss_action'] = 'boss Actions', + ['client_poor'] = 'your client cannot afford that', + + -- Property menu + ['property_name'] = 'property', + ['property_actions'] = 'actions', + ['property_actionbuttons'] = '{{Assign [Sell]|sell}} {{Assign [Rent]|rent}} {{GPS|gps}}', + + -- Customer menu + ['customer_client'] = 'client', + ['customer_property'] = 'property', + ['customer_agreement'] = 'agreement', + ['customer_actions'] = 'actions', + ['customer_contractbuttons'] = '{{Revoke contract|revoke}} {{GPS|gps}}', + ['customer_rent'] = 'rented', + ['customer_sell'] = 'sold', +} diff --git a/[esx_addons]/esx_realestateagentjob/locales/fi.lua b/[esx_addons]/esx_realestateagentjob/locales/fi.lua new file mode 100644 index 00000000..505ce10b --- /dev/null +++ b/[esx_addons]/esx_realestateagentjob/locales/fi.lua @@ -0,0 +1,27 @@ +Locales['fi'] = { + ['properties'] = 'kiinteistöt', + ['clients'] = 'asiakkaat', + ['realtor'] = 'kiinteistövälittäjä', + ['amount_withdraw'] = 'nostettava määrä', + ['invalid_amount'] = 'virheellinen summa', + ['press_to_access'] = 'paina ~INPUT_CONTEXT~ avataksesi menu', + ['amount'] = 'määrä', + ['no_play_near'] = 'ei pelaajia lähettyvillä', + ['realtors'] = 'Kiinteistövälitys', + ['boss_action'] = 'pomo Toiminnot', + ['client_poor'] = 'your client cannot afford that', + + -- Property menu + ['property_name'] = 'kiinteistö', + ['property_actions'] = 'actions', + ['property_actionbuttons'] = '{{Aseta [Myy]|sell}} {{Aseta [Vuokraa]|rent}} {{GPS|gps}}', + + -- Customer menu + ['customer_client'] = 'client', + ['customer_property'] = 'kiinteistö', + ['customer_agreement'] = 'agreement', + ['customer_actions'] = 'actions', + ['customer_contractbuttons'] = '{{Pura sopimus|revoke}} {{GPS|gps}}', + ['customer_rent'] = 'vuokraa', + ['customer_sell'] = 'myy', +} diff --git a/[esx_addons]/esx_realestateagentjob/locales/fr.lua b/[esx_addons]/esx_realestateagentjob/locales/fr.lua new file mode 100644 index 00000000..207125d0 --- /dev/null +++ b/[esx_addons]/esx_realestateagentjob/locales/fr.lua @@ -0,0 +1,27 @@ +Locales['fr'] = { + ['properties'] = 'propriétés', + ['clients'] = 'clients', + ['realtor'] = 'agent Immobilier', + ['amount_withdraw'] = 'montant du retrait', + ['invalid_amount'] = 'montant invalide', + ['press_to_access'] = 'appuez sur ~INPUT_CONTEXT~ pour accéder au menu', + ['amount'] = 'montant', + ['no_play_near'] = 'aucun joueur à proximité', + ['realtors'] = 'agents Immobilier', + ['boss_action'] = 'action Patron', + ['client_poor'] = 'your client cannot afford that', + + -- Property menu + ['property_name'] = 'propriété', + ['property_actions'] = 'actions', + ['property_actionbuttons'] = '{{Assigner [Vente]|sell}} {{Assigner [Location]|rent}} {{GPS|gps}}', + + -- Customer menu + ['customer_client'] = 'client', + ['customer_property'] = 'propriété', + ['customer_agreement'] = 'agreement', + ['customer_actions'] = 'actions', + ['customer_contractbuttons'] = '{{Révoquer contrat|revoke}} {{GPS|gps}}', + ['customer_rent'] = 'location', + ['customer_sell'] = 'vente', +} diff --git a/[esx_addons]/esx_realestateagentjob/locales/sv.lua b/[esx_addons]/esx_realestateagentjob/locales/sv.lua new file mode 100644 index 00000000..49e6e8ad --- /dev/null +++ b/[esx_addons]/esx_realestateagentjob/locales/sv.lua @@ -0,0 +1,27 @@ +Locales['sv'] = { + ['properties'] = 'fastigheter', + ['clients'] = 'klienter', + ['realtor'] = 'mäklare', + ['amount_withdraw'] = 'summa', + ['invalid_amount'] = 'ogiltigt belopp', + ['press_to_access'] = 'tryck ~INPUT_CONTEXT~ för att öppna menyn.', + ['amount'] = 'summa', + ['no_play_near'] = 'det finns inga spelare i närheten!', + ['realtors'] = 'mäklare', + ['boss_action'] = 'chefmeny', + ['client_poor'] = 'din klient har inte råd att betala det', + + -- Property menu + ['property_name'] = 'fastighet', + ['property_actions'] = 'åtgärder', + ['property_actionbuttons'] = '{{Sälj fastighet|sell}} {{Hyr ut fastighet|rent}} {{GPS|gps}}', + + -- Customer menu + ['customer_client'] = 'client', + ['customer_property'] = 'fastighet', + ['customer_agreement'] = 'överenskommelse', + ['customer_actions'] = 'åtgärder', + ['customer_contractbuttons'] = '{{Återkalla kontrakt|revoke}} {{GPS|gps}}', + ['customer_rent'] = 'hyrd', + ['customer_sell'] = 'såld', +} diff --git a/[esx_addons]/esx_realestateagentjob/locales/tr.lua b/[esx_addons]/esx_realestateagentjob/locales/tr.lua new file mode 100644 index 00000000..1b00002f --- /dev/null +++ b/[esx_addons]/esx_realestateagentjob/locales/tr.lua @@ -0,0 +1,27 @@ +Locales['tr'] = { + ['properties'] = 'Mülkler', + ['clients'] = 'Müşteriler', + ['realtor'] = 'Emlak Bürosu', + ['amount_withdraw'] = 'Çekilecek miktar', + ['invalid_amount'] = 'Geçersiz miktar', + ['press_to_access'] = 'Menüye erişmek için ~INPUT_CONTEXT~ tuşuna basın.', + ['amount'] = 'Miktar', + ['no_play_near'] = 'Yakında kimse yok', + ['realtors'] = 'Emlak Bürosu çalışanları', + ['boss_action'] = 'Patron eylemleri', + ['client_poor'] = 'Müşterinin bunu ödeyecek kadar parası yok.', + + -- Property menu + ['property_name'] = 'Mülk', + ['property_actions'] = 'Eylemler', + ['property_actionbuttons'] = '{{İşlem [Sat]|sell}} {{İşlem [Kirala]|rent}} {{GPS|gps}}', + + -- Customer menu + ['customer_client'] = 'Müşteri', + ['customer_property'] = 'Mülk', + ['customer_agreement'] = 'Sözleşme', + ['customer_actions'] = 'Eylemler', + ['customer_contractbuttons'] = '{{Sözleşmeyi iptal et|revoke}} {{GPS|gps}}', + ['customer_rent'] = 'Kiralandı', + ['customer_sell'] = 'Satıldı', +} diff --git a/[esx_addons]/esx_realestateagentjob/localization/de_esx_realestateagentjob.sql b/[esx_addons]/esx_realestateagentjob/localization/de_esx_realestateagentjob.sql new file mode 100644 index 00000000..4e5f7fa7 --- /dev/null +++ b/[esx_addons]/esx_realestateagentjob/localization/de_esx_realestateagentjob.sql @@ -0,0 +1,16 @@ +USE `es_extended`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_realestateagent','Immobilienverkauf',1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('realestateagent','Immobilienverkauf') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('realestateagent',0,'location','Vermieter',10,'{}','{}'), + ('realestateagent',1,'vendeur','Verkäufer',25,'{}','{}'), + ('realestateagent',2,'gestion','Manager',40,'{}','{}'), + ('realestateagent',3,'boss','Boss',0,'{}','{}') +; diff --git a/[esx_addons]/esx_realestateagentjob/localization/en_esx_realestateagentjob.sql b/[esx_addons]/esx_realestateagentjob/localization/en_esx_realestateagentjob.sql new file mode 100644 index 00000000..67a2f6de --- /dev/null +++ b/[esx_addons]/esx_realestateagentjob/localization/en_esx_realestateagentjob.sql @@ -0,0 +1,16 @@ +USE `es_extended`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_realestateagent','Real Estate Company',1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('realestateagent','Realtor') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('realestateagent',0,'location','Renting Agent',10,'{}','{}'), + ('realestateagent',1,'vendeur','Agent',25,'{}','{}'), + ('realestateagent',2,'gestion','Management',40,'{}','{}'), + ('realestateagent',3,'boss','Broker',0,'{}','{}') +; diff --git a/[esx_addons]/esx_realestateagentjob/localization/fi_esx_realestateagentjob.sql b/[esx_addons]/esx_realestateagentjob/localization/fi_esx_realestateagentjob.sql new file mode 100644 index 00000000..abfd5815 --- /dev/null +++ b/[esx_addons]/esx_realestateagentjob/localization/fi_esx_realestateagentjob.sql @@ -0,0 +1,16 @@ +USE `es_extended`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_realestateagent','Kiinteistvälittäjä',1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('realestateagent','Kiinteistövälittäjä') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('realestateagent',0,'location','Vuokraisäntä',10,'{}','{}'), + ('realestateagent',1,'vendeur','Myyjä',25,'{}','{}'), + ('realestateagent',2,'gestion','Johtaja',40,'{}','{}'), + ('realestateagent',3,'boss','Pomo',0,'{}','{}') +; diff --git a/[esx_addons]/esx_realestateagentjob/localization/tr_esx_realestateagentjob.sql b/[esx_addons]/esx_realestateagentjob/localization/tr_esx_realestateagentjob.sql new file mode 100644 index 00000000..7db966eb --- /dev/null +++ b/[esx_addons]/esx_realestateagentjob/localization/tr_esx_realestateagentjob.sql @@ -0,0 +1,16 @@ +USE `es_extended`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_realestateagent','Emlak Bürosu',1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('realestateagent','Emlak Bürosu') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('realestateagent',0,'location','Eleman',10,'{}','{}'), + ('realestateagent',1,'vendeur','Sekreter',25,'{}','{}'), + ('realestateagent',2,'gestion','Asistan',40,'{}','{}'), + ('realestateagent',3,'boss','Patron',0,'{}','{}') +; diff --git a/[esx_addons]/esx_realestateagentjob/server/main.lua b/[esx_addons]/esx_realestateagentjob/server/main.lua new file mode 100644 index 00000000..4b6db0d9 --- /dev/null +++ b/[esx_addons]/esx_realestateagentjob/server/main.lua @@ -0,0 +1,73 @@ +ESX = nil + +TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + +TriggerEvent('esx_phone:registerNumber', 'realestateagent', _U('clients'), false, false) +TriggerEvent('esx_society:registerSociety', 'realestateagent', _U('realtors'), 'society_realestateagent', 'society_realestateagent', 'society_realestateagent', {type = 'private'}) + +RegisterServerEvent('esx_realestateagentjob:revoke') +AddEventHandler('esx_realestateagentjob:revoke', function(property, owner) + local xPlayer = ESX.GetPlayerFromId(source) + + if xPlayer.job.name == 'realestateagent' then + TriggerEvent('esx_property:removeOwnedPropertyIdentifier', property, owner) + else + print(('esx_realestateagentjob: %s attempted to revoke a property!'):format(xPlayer.identifier)) + end +end) + +RegisterServerEvent('esx_realestateagentjob:sell') +AddEventHandler('esx_realestateagentjob:sell', function(target, property, price) + local xPlayer, xTarget = ESX.GetPlayerFromId(source), ESX.GetPlayerFromId(target) + + if xPlayer.job.name ~= 'realestateagent' then + print(('esx_realestateagentjob: %s attempted to sell a property!'):format(xPlayer.identifier)) + return + end + + if xTarget.getMoney() >= price then + xTarget.removeMoney(price) + + TriggerEvent('esx_addonaccount:getSharedAccount', 'society_realestateagent', function(account) + account.addMoney(price) + end) + + TriggerEvent('esx_property:setPropertyOwned', property, price, false, xTarget.identifier) + else + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('client_poor')) + end +end) + +RegisterServerEvent('esx_realestateagentjob:rent') +AddEventHandler('esx_realestateagentjob:rent', function(target, property, price) + local xPlayer = ESX.GetPlayerFromId(target) + + TriggerEvent('esx_property:setPropertyOwned', property, price, true, xPlayer.identifier) +end) + +ESX.RegisterServerCallback('esx_realestateagentjob:getCustomers', function(source, cb) + TriggerEvent('esx_ownedproperty:getOwnedProperties', function(properties) + local xPlayers = ESX.GetPlayers() + local customers = {} + + for i=1, #properties, 1 do + for j=1, #xPlayers, 1 do + local xPlayer = ESX.GetPlayerFromId(xPlayers[j]) + + if xPlayer.identifier == properties[i].owner then + table.insert(customers, { + name = xPlayer.name, + propertyOwner = properties[i].owner, + propertyRented = properties[i].rented, + propertyId = properties[i].id, + propertyPrice = properties[i].price, + propertyName = properties[i].name, + propertyLabel = properties[i].label + }) + end + end + end + + cb(customers) + end) +end) diff --git a/[esx_addons]/esx_rpchat/.editorconfig b/[esx_addons]/esx_rpchat/.editorconfig new file mode 100644 index 00000000..9b425256 --- /dev/null +++ b/[esx_addons]/esx_rpchat/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_size = 4 +indent_style = tab +end_of_line = crlf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/[esx_addons]/esx_rpchat/LICENSE b/[esx_addons]/esx_rpchat/LICENSE new file mode 100644 index 00000000..9cecc1d4 --- /dev/null +++ b/[esx_addons]/esx_rpchat/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + {one line to give the program's name and a brief idea of what it does.} + Copyright (C) {year} {name of author} + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + {project} Copyright (C) {year} {fullname} + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/[esx_addons]/esx_rpchat/README.md b/[esx_addons]/esx_rpchat/README.md new file mode 100644 index 00000000..bf364c90 --- /dev/null +++ b/[esx_addons]/esx_rpchat/README.md @@ -0,0 +1,36 @@ +# esx_rpchat + +#### Description +This is a proximity chat script. With a few commands such as Twitter, OOC and Local Me + +## Download & Installation + +### Using [fvm](https://github.com/qlaffont/fvm-installer) +``` +fvm install --save --folder=esx esx-org/esx_rpchat +``` + +### Using Git +``` +cd resources +git clone https://github.com/ESX-Org/esx_rpchat [esx]/esx_rpchat +``` + +### Manually +- Download https://github.com/ESX-Org/esx_rpchat/archive/master.zip +- Put it in the `[esx]` directory + +## Installation +- Add `start esx_rpchat` to your server.cfg + +# Legal +### License +esx_rpchat - RP chat for ESX + +Copyright (C) 2015-2020 Jérémie N'gadi + +This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version. + +This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details. + +You should have received a copy Of the GNU General Public License along with this program. If Not, see http://www.gnu.org/licenses/. \ No newline at end of file diff --git a/[esx_addons]/esx_rpchat/client/main.lua b/[esx_addons]/esx_rpchat/client/main.lua new file mode 100644 index 00000000..308233cb --- /dev/null +++ b/[esx_addons]/esx_rpchat/client/main.lua @@ -0,0 +1,32 @@ +RegisterNetEvent('esx_rpchat:sendProximityMessage') +AddEventHandler('esx_rpchat:sendProximityMessage', function(playerId, title, message, color) + local player = PlayerId() + local target = GetPlayerFromServerId(playerId) + + local playerPed = PlayerPedId() + local targetPed = GetPlayerPed(target) + local playerCoords = GetEntityCoords(playerPed) + local targetCoords = GetEntityCoords(targetPed) + + if target ~= -1 then + if target == player or #(playerCoords - targetCoords) < 20 then + TriggerEvent('chat:addMessage', {args = {title, message}, color = color}) + end + end +end) + +Citizen.CreateThread(function() + TriggerEvent('chat:addSuggestion', '/twt', _U('twt_help'), {{name = _U('generic_argument_name'), help = _U('generic_argument_help')}}) + TriggerEvent('chat:addSuggestion', '/anontwt', _U('twtanon_help'), {{name = _U('generic_argument_name'), help = _U('generic_argument_help')}}) + TriggerEvent('chat:addSuggestion', '/me', _U('me_help'), {{name = _U('generic_argument_name'), help = _U('generic_argument_help')}}) + TriggerEvent('chat:addSuggestion', '/do', _U('do_help'), {{name = _U('generic_argument_name'), help = _U('generic_argument_help')}}) +end) + +AddEventHandler('onResourceStop', function(resource) + if resource == GetCurrentResourceName() then + TriggerEvent('chat:removeSuggestion', '/twt') + TriggerEvent('chat:removeSuggestion', '/me') + TriggerEvent('chat:removeSuggestion', '/do') + end +end) + diff --git a/[esx_addons]/esx_rpchat/config.lua b/[esx_addons]/esx_rpchat/config.lua new file mode 100644 index 00000000..17fdaefd --- /dev/null +++ b/[esx_addons]/esx_rpchat/config.lua @@ -0,0 +1,5 @@ +Config = {} + +Config.Locale = 'en' +Config.OnlyFirstname = false +Config.EnableESXIdentity = true -- only turn this on if you are using esx_identity and want to use RP names diff --git a/[esx_addons]/esx_rpchat/fxmanifest.lua b/[esx_addons]/esx_rpchat/fxmanifest.lua new file mode 100644 index 00000000..003c4a22 --- /dev/null +++ b/[esx_addons]/esx_rpchat/fxmanifest.lua @@ -0,0 +1,31 @@ +fx_version 'adamant' + +game 'gta5' + +description 'ESX RP Chat' + +version '1.3.1' + +server_scripts { + '@es_extended/locale.lua', + 'locales/sv.lua', + 'locales/en.lua', + 'locales/fi.lua', + 'locales/fr.lua', + 'locales/cs.lua', + 'config.lua', + 'server/main.lua' +} + +client_scripts { + '@es_extended/locale.lua', + 'locales/sv.lua', + 'locales/en.lua', + 'locales/fi.lua', + 'locales/fr.lua', + 'locales/cs.lua', + 'config.lua', + 'client/main.lua' +} + +dependency 'es_extended' diff --git a/[esx_addons]/esx_rpchat/locales/cs.lua b/[esx_addons]/esx_rpchat/locales/cs.lua new file mode 100644 index 00000000..eccbecb3 --- /dev/null +++ b/[esx_addons]/esx_rpchat/locales/cs.lua @@ -0,0 +1,11 @@ +Locales['cs'] = { + ['ooc_prefix'] = 'OOC | %s', + ['twt_help'] = 'odeslat tweet', + ['twt_prefix'] = '^0[^4Twitter^0] (^5@%s^0)', + ['me_help'] = 'osobní akce', + ['me_prefix'] = 'me | %s', + ['do_help'] = 'RP informace', + ['do_prefix'] = 'do | %s', + ['generic_argument_name'] = 'zpráva', + ['generic_argument_help'] = 'zpráva', +} diff --git a/[esx_addons]/esx_rpchat/locales/en.lua b/[esx_addons]/esx_rpchat/locales/en.lua new file mode 100644 index 00000000..ab717d9e --- /dev/null +++ b/[esx_addons]/esx_rpchat/locales/en.lua @@ -0,0 +1,11 @@ +Locales['en'] = { + ['ooc_prefix'] = 'OOC | %s', + ['twt_help'] = 'send a tweet', + ['twt_prefix'] = '^0[^4Twitter^0] (^5@%s^0)', + ['me_help'] = 'personal action', + ['me_prefix'] = 'me | %s', + ['do_help'] = 'RP information', + ['do_prefix'] = 'do | %s', + ['generic_argument_name'] = 'message', + ['generic_argument_help'] = 'the message', +} diff --git a/[esx_addons]/esx_rpchat/locales/es.lua b/[esx_addons]/esx_rpchat/locales/es.lua new file mode 100644 index 00000000..315c6467 --- /dev/null +++ b/[esx_addons]/esx_rpchat/locales/es.lua @@ -0,0 +1,12 @@ +Locales['es'] = { + ['ooc_prefix'] = 'OOC | %s', + ['twt_help'] = 'Mandar tweet', + ['twtanon_help'] = 'Mandar tweet anonimo', + ['twt_prefix'] = '^0[^4Twitter^0] (^5@%s^0)', + ['me_help'] = 'Accion Global', + ['me_prefix'] = 'me | %s', + ['do_help'] = 'Accion Personal', + ['do_prefix'] = 'do | %s', + ['generic_argument_name'] = 'mensaje', + ['generic_argument_help'] = 'el mensaje', +} diff --git a/[esx_addons]/esx_rpchat/locales/fi.lua b/[esx_addons]/esx_rpchat/locales/fi.lua new file mode 100644 index 00000000..d76bde47 --- /dev/null +++ b/[esx_addons]/esx_rpchat/locales/fi.lua @@ -0,0 +1,11 @@ +Locales['fi'] = { + ['ooc_prefix'] = 'OOC | %s', + ['twt_help'] = 'lähetä twiitti', + ['twt_prefix'] = '^0[^4Twitter^0] (^5@%s^0)', + ['me_help'] = 'teet jotain', + ['me_prefix'] = 'me | %s', + ['do_help'] = 'roolipeliä tiedot', + ['do_prefix'] = 'do | %s', + ['generic_argument_name'] = 'viesti', + ['generic_argument_help'] = 'viestin sisältö', +} diff --git a/[esx_addons]/esx_rpchat/locales/fr.lua b/[esx_addons]/esx_rpchat/locales/fr.lua new file mode 100644 index 00000000..edb9e02a --- /dev/null +++ b/[esx_addons]/esx_rpchat/locales/fr.lua @@ -0,0 +1,11 @@ +Locales['fr'] = { + ['ooc_prefix'] = 'hrp | %s', + ['twt_help'] = 'envoie un tweet', + ['twt_prefix'] = '^0[^4Twitter^0] (^5@%s^0)', + ['me_help'] = 'action personnelle', + ['me_prefix'] = 'me | %s', + ['do_help'] = 'RP information', + ['do_prefix'] = 'faire | %s', + ['generic_argument_name'] = 'message', + ['generic_argument_help'] = 'le message', +} diff --git a/[esx_addons]/esx_rpchat/locales/sv.lua b/[esx_addons]/esx_rpchat/locales/sv.lua new file mode 100644 index 00000000..5dd7fb02 --- /dev/null +++ b/[esx_addons]/esx_rpchat/locales/sv.lua @@ -0,0 +1,11 @@ +Locales['sv'] = { + ['ooc_prefix'] = 'OOC | %s', + ['twt_help'] = 'skicka en tweet', + ['twt_prefix'] = '^5@%s^0', + ['me_help'] = 'skriv en händelse, t.ex \'visar körkort\'', + ['me_prefix'] = 'jag | %s', + ['do_help'] = 'något karaktären gör inom rollspel', + ['do_prefix'] = 'gör | %s', + ['generic_argument_name'] = 'meddelande', + ['generic_argument_help'] = 'det meddelandet du vill skicka', +} diff --git a/[esx_addons]/esx_rpchat/server/main.lua b/[esx_addons]/esx_rpchat/server/main.lua new file mode 100644 index 00000000..9c779630 --- /dev/null +++ b/[esx_addons]/esx_rpchat/server/main.lua @@ -0,0 +1,90 @@ +ESX = nil + +TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + +AddEventHandler('chatMessage', function(playerId, playerName, message) + if string.sub(message, 1, string.len('/')) ~= '/' then + CancelEvent() + + playerName = GetRealPlayerName(playerId) + TriggerClientEvent('chat:addMessage', -1, {args = {_U('ooc_prefix', playerName), message}, color = {128, 128, 128}}) + end +end) + +RegisterCommand('twt', function(playerId, args, rawCommand) + if playerId == 0 then + print('esx_rpchat: you can\'t use this command from console!') + else + args = table.concat(args, ' ') + + local playerName = GetRealPlayerName(playerId) + + TriggerClientEvent('chat:addMessage', -1, {args = {_U('twt_prefix', playerName), args}, color = {0, 153, 204}}) + end +end, false) + +RegisterCommand('anontwt', function(playerId, args, rawCommand) + if playerId == 0 then + print('esx_rpchat: you can\'t use this command from console!') + else + args = table.concat(args, ' ') + + local playerName = GetRealPlayerName(playerId) + + TriggerClientEvent('chat:addMessage', -1, {args = {_U('twt_prefix', "Anonymous"), args}, color = {0, 153, 204}}) + end +end, false) + +RegisterCommand('me', function(playerId, args, rawCommand) + if playerId == 0 then + print('esx_rpchat: you can\'t use this command from console!') + else + args = table.concat(args, ' ') + local playerName = GetRealPlayerName(playerId) + + TriggerClientEvent('esx_rpchat:sendProximityMessage', -1, playerId, _U('me_prefix', playerName), args, {255, 0, 0}) + end +end, false) + +RegisterCommand('do', function(playerId, args, rawCommand) + if playerId == 0 then + print('esx_rpchat: you can\'t use this command from console!') + else + args = table.concat(args, ' ') + local playerName = GetRealPlayerName(playerId) + + TriggerClientEvent('esx_rpchat:sendProximityMessage', -1, playerId, _U('do_prefix', playerName), args, {0, 0, 255}) + end +end, false) + +RegisterCommand('msg', function(source, args, user) + + if GetPlayerName(tonumber(args[1])) then + local player = tonumber(args[1]) + table.remove(args, 1) + + TriggerClientEvent('chat:addMessage', player, {args = {"^1PM from "..GetPlayerName(source).. "[" .. source .. "]: ^7" ..table.concat(args, " ")}, color = {255, 153, 0}}) + TriggerClientEvent('chat:addMessage', source, {args = {"^1PM SEND TO "..GetPlayerName(player).. "[" .. player .. "]: ^7" ..table.concat(args, " ")}, color = {255, 153, 0}}) + else + TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "ID de jugador incorrecta!") + end + +end,false) + +function GetRealPlayerName(playerId) + local xPlayer = ESX.GetPlayerFromId(playerId) + + if xPlayer then + if Config.EnableESXIdentity then + if Config.OnlyFirstname then + return xPlayer.get('firstName') + else + return xPlayer.getName() + end + else + return xPlayer.getName() + end + else + return GetPlayerName(playerId) + end +end diff --git a/[esx_addons]/esx_service/.editorconfig b/[esx_addons]/esx_service/.editorconfig new file mode 100644 index 00000000..9b425256 --- /dev/null +++ b/[esx_addons]/esx_service/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_size = 4 +indent_style = tab +end_of_line = crlf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/[esx_addons]/esx_service/LICENSE b/[esx_addons]/esx_service/LICENSE new file mode 100644 index 00000000..3728435e --- /dev/null +++ b/[esx_addons]/esx_service/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + fxserver-esx_service + Copyright (C) 2015 Jérémie N'gadi + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + fxserver-esx_service Copyright (C) 2015 Jérémie N'gadi + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. \ No newline at end of file diff --git a/[esx_addons]/esx_service/README.md b/[esx_addons]/esx_service/README.md new file mode 100644 index 00000000..8e314b88 --- /dev/null +++ b/[esx_addons]/esx_service/README.md @@ -0,0 +1,54 @@ +# esx_service + +## Download & Installation + +### Using [fvm](https://github.com/qlaffont/fvm-installer) +``` +fvm install --save --folder=esx esx-org/esx_service +``` + +### Using Git +``` +cd resources +git clone https://github.com/ESX-Org/esx_service [esx]/esx_service +``` + +### Manually +- Download https://github.com/ESX-Org/esx_service/archive/master.zip +- Put it in the `[esx]` directory + +## Installation +- Add this to your `server.cfg`: + +``` +start esx_service +``` + +## Usage +```lua +-- Enable service +ESX.TriggerServerCallback('esx_service:enableService', function(canTakeService, maxInService, inServiceCount) + + if canTakeService then + ESX.ShowNotification('You enabled service') + else + ESX.ShowNotification('Service is full: ' .. inServiceCount .. '/' .. maxInService) + end + +end, 'taxi') + +-- Disable service +TriggerServerEvent('esx_service:disableService', 'taxi') +``` + +# Legal +### License +esx_service - be in service + +Copyright (C) 2015-2020 Jérémie N'gadi + +This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version. + +This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details. + +You should have received a copy Of the GNU General Public License along with this program. If Not, see http://www.gnu.org/licenses/. diff --git a/[esx_addons]/esx_service/client/main.lua b/[esx_addons]/esx_service/client/main.lua new file mode 100644 index 00000000..87fa24a8 --- /dev/null +++ b/[esx_addons]/esx_service/client/main.lua @@ -0,0 +1,20 @@ +ESX = nil + +Citizen.CreateThread(function() + while ESX == nil do + TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + Citizen.Wait(0) + end +end) + +RegisterNetEvent('esx_service:notifyAllInService') +AddEventHandler('esx_service:notifyAllInService', function(notification, target) + target = GetPlayerFromServerId(target) + if target == PlayerId() then return end + + local targetPed = GetPlayerPed(target) + local mugshot, mugshotStr = ESX.Game.GetPedMugshot(targetPed) + + ESX.ShowAdvancedNotification(notification.title, notification.subject, notification.msg, mugshotStr, notification.iconType) + UnregisterPedheadshot(mugshot) +end) \ No newline at end of file diff --git a/[esx_addons]/esx_service/fxmanifest.lua b/[esx_addons]/esx_service/fxmanifest.lua new file mode 100644 index 00000000..babecdef --- /dev/null +++ b/[esx_addons]/esx_service/fxmanifest.lua @@ -0,0 +1,17 @@ +fx_version 'adamant' + +game 'gta5' + +description 'ESX Service' + +version '1.0.0' + +server_scripts { + 'server/main.lua' +} + +client_scripts { + 'client/main.lua' +} + +dependency 'es_extended' diff --git a/[esx_addons]/esx_service/server/main.lua b/[esx_addons]/esx_service/server/main.lua new file mode 100644 index 00000000..a01aee93 --- /dev/null +++ b/[esx_addons]/esx_service/server/main.lua @@ -0,0 +1,87 @@ +ESX = nil +local InService = {} +local MaxInService = {} + +TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + +function GetInServiceCount(name) + local count = 0 + + for k,v in pairs(InService[name]) do + if v == true then + count = count + 1 + end + end + + return count +end + +RegisterServerEvent('esx_service:activateService') +AddEventHandler('esx_service:activateService', function(name, max) + InService[name] = {} + MaxInService[name] = max +end) + +RegisterServerEvent('esx_service:disableService') +AddEventHandler('esx_service:disableService', function(name) + InService[name][source] = nil +end) + +RegisterServerEvent('esx_service:notifyAllInService') +AddEventHandler('esx_service:notifyAllInService', function(notification, name) + for k,v in pairs(InService[name]) do + if v == true then + TriggerClientEvent('esx_service:notifyAllInService', k, notification, source) + end + end +end) + +ESX.RegisterServerCallback('esx_service:enableService', function(source, cb, name) + local inServiceCount = GetInServiceCount(name) + + if inServiceCount >= MaxInService[name] then + cb(false, MaxInService[name], inServiceCount) + else + InService[name][source] = true + cb(true, MaxInService[name], inServiceCount) + end +end) + +ESX.RegisterServerCallback('esx_service:isInService', function(source, cb, name) + local isInService = false + + if InService[name] ~= nil then + if InService[name][source] then + isInService = true + end + else + print(('[esx_service] [^3WARNING^7] A service "%s" is not activated'):format(name)) + end + + cb(isInService) +end) + +ESX.RegisterServerCallback('esx_service:isPlayerInService', function(source, cb, name, target) + local isPlayerInService = false + local targetXPlayer = ESX.GetPlayerFromId(target) + + if InService[name][targetXPlayer.source] then + isPlayerInService = true + end + + cb(isPlayerInService) +end) + +ESX.RegisterServerCallback('esx_service:getInServiceList', function(source, cb, name) + cb(InService[name]) +end) + +AddEventHandler('playerDropped', function() + local _source = source + + for k,v in pairs(InService) do + if v[_source] == true then + v[_source] = nil + end + end +end) diff --git a/[esx_addons]/esx_shops/.editorconfig b/[esx_addons]/esx_shops/.editorconfig new file mode 100644 index 00000000..9b425256 --- /dev/null +++ b/[esx_addons]/esx_shops/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_size = 4 +indent_style = tab +end_of_line = crlf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/[esx_addons]/esx_shops/LICENSE b/[esx_addons]/esx_shops/LICENSE new file mode 100644 index 00000000..36cb0ed1 --- /dev/null +++ b/[esx_addons]/esx_shops/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + fxserver-esx_shops + Copyright (C) 2015 Jérémie N'gadi + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + fxserver-esx_shops Copyright (C) 2015 Jérémie N'gadi + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. \ No newline at end of file diff --git a/[esx_addons]/esx_shops/README.md b/[esx_addons]/esx_shops/README.md new file mode 100644 index 00000000..40271425 --- /dev/null +++ b/[esx_addons]/esx_shops/README.md @@ -0,0 +1,38 @@ +# esx_shops + +## Download & Installation + +### Using [fvm](https://github.com/qlaffont/fvm-installer) +``` +fvm install --save --folder=esx esx-org/esx_shops +``` + +### Using Git +``` +cd resources +git clone https://github.com/ESX-Org/esx_shops [esx]/esx_shops +``` + +### Manually +- Download https://github.com/ESX-Org/esx_shops/archive/master.zip +- Put it in the `[esx]` directory + +## Installation +- Import `esx_shops.sql` to your database +- Add this in your `server.cfg`: + +``` +start esx_shops +``` + +# Legal +### License +esx_shops - shoppin' + +Copyright (C) 2015-2020 Jérémie N'gadi + +This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version. + +This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details. + +You should have received a copy Of the GNU General Public License along with this program. If Not, see http://www.gnu.org/licenses/. diff --git a/[esx_addons]/esx_shops/client/main.lua b/[esx_addons]/esx_shops/client/main.lua new file mode 100644 index 00000000..64b2c98e --- /dev/null +++ b/[esx_addons]/esx_shops/client/main.lua @@ -0,0 +1,157 @@ +ESX = nil +local hasAlreadyEnteredMarker, lastZone +local currentAction, currentActionMsg, currentActionData = nil, nil, {} + +Citizen.CreateThread(function() + while ESX == nil do + TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + Citizen.Wait(0) + end + + Citizen.Wait(5000) + +end) + +function OpenShopMenu(zone) + local elements = {} + for i=1, #Config.Zones[zone].Items, 1 do + local item = Config.Zones[zone].Items[i] + + table.insert(elements, { + label = ('%s - %s'):format(item.label, _U('shop_item', ESX.Math.GroupDigits(item.price))), + itemLabel = item.label, + item = item.name, + price = item.price, + + -- menu properties + value = 1, + type = 'slider', + min = 1, + max = 100 + }) + end + + ESX.UI.Menu.CloseAll() + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'shop', { + title = _U('shop'), + align = 'bottom-right', + elements = elements + }, function(data, menu) + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'shop_confirm', { + title = _U('shop_confirm', data.current.value, data.current.itemLabel, ESX.Math.GroupDigits(data.current.price * data.current.value)), + align = 'bottom-right', + elements = { + {label = _U('no'), value = 'no'}, + {label = _U('yes'), value = 'yes'} + }}, function(data2, menu2) + if data2.current.value == 'yes' then + TriggerServerEvent('esx_shops:buyItem', data.current.item, data.current.value, zone) + end + + menu2.close() + end, function(data2, menu2) + menu2.close() + end) + end, function(data, menu) + menu.close() + + currentAction = 'shop_menu' + currentActionMsg = _U('press_menu') + currentActionData = {zone = zone} + end) +end + +AddEventHandler('esx_shops:hasEnteredMarker', function(zone) + currentAction = 'shop_menu' + currentActionMsg = _U('press_menu') + currentActionData = {zone = zone} +end) + +AddEventHandler('esx_shops:hasExitedMarker', function(zone) + currentAction = nil + ESX.UI.Menu.CloseAll() +end) + +-- Create Blips +Citizen.CreateThread(function() + for k,v in pairs(Config.Zones) do + for i = 1, #v.Pos, 1 do + if v.ShowBlip then + local blip = AddBlipForCoord(v.Pos[i]) + + SetBlipSprite (blip, v.Type) + SetBlipScale (blip, v.Size) + SetBlipColour (blip, v.Color) + SetBlipAsShortRange(blip, true) + + BeginTextCommandSetBlipName('STRING') + AddTextComponentSubstringPlayerName(_U('shops')) + EndTextCommandSetBlipName(blip) + end + end + end +end) + +-- Enter / Exit marker events +Citizen.CreateThread(function() + while true do + Citizen.Wait(0) + local playerCoords = GetEntityCoords(PlayerPedId()) + local isInMarker, letSleep, currentZone = false, false + + for k,v in pairs(Config.Zones) do + for i = 1, #v.Pos, 1 do + local distance = #(playerCoords - v.Pos[i]) + + if distance < Config.DrawDistance then + if v.ShowMarker then + DrawMarker(Config.MarkerType, v.Pos[i], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, nil, nil, false) + end + letSleep = false + + if distance < 2.0 then + isInMarker = true + currentZone = k + lastZone = k + end + end + end + end + + if isInMarker and not hasAlreadyEnteredMarker then + hasAlreadyEnteredMarker = true + TriggerEvent('esx_shops:hasEnteredMarker', currentZone) + end + + if not isInMarker and hasAlreadyEnteredMarker then + hasAlreadyEnteredMarker = false + TriggerEvent('esx_shops:hasExitedMarker', lastZone) + end + + if letSleep then + Citizen.Wait(500) + end + end +end) + +-- Key Controls +Citizen.CreateThread(function() + while true do + Citizen.Wait(0) + + if currentAction then + ESX.ShowHelpNotification(currentActionMsg) + + if IsControlJustReleased(0, 38) then + if currentAction == 'shop_menu' then + OpenShopMenu(currentActionData.zone) + end + + currentAction = nil + end + else + Citizen.Wait(500) + end + end +end) diff --git a/[esx_addons]/esx_shops/config.lua b/[esx_addons]/esx_shops/config.lua new file mode 100644 index 00000000..58047091 --- /dev/null +++ b/[esx_addons]/esx_shops/config.lua @@ -0,0 +1,97 @@ +Config = {} +Config.DrawDistance = 100 +Config.MarkerSize = {x = 1.1, y = 1.1, z = 0.9} +Config.MarkerType = 21 +Config.MarkerColor = {r = 102, g = 102, b = 204, a = 255} +Config.Locale = 'en' + +Config.Zones = { + + TwentyFourSeven = { + Items = { + { + name = "bread", + label = "bread", + price = 100 + }, + { + name = "water", + label = "water", + price = 100 + } + }, + Pos = { + vector3(373.8, 325.8, 102.5), + vector3(2557.4, 382.2, 107.6), + vector3(-3038.9, 585.9, 6.9), + vector3(-3241.9, 1001.4, 11.8), + vector3(547.4, 2671.7, 41.1), + vector3(1961.4, 3740.6, 31.3), + vector3(2678.9, 3280.6, 54.2), + vector3(1729.2, 6414.1, 34.0) + }, + Size = 1.0, + Type = 59, + Color = 25, + ShowBlip = true, + ShowMarker = true +}, + + RobsLiquor = { + Items = { + { + name = "bread", + label = "bread", + price = 100 + }, + { + name = "water", + label = "water", + price = 100 + } + }, + Pos = { + vector3(1135.8, -982.2, 45.4), + vector3(-1222.9, -906.9, 11.3), + vector3(-1487.5, -379.1, 39.1), + vector3(-2968.2, 390.9, 14.0), + vector3(1166.0, 2708.9, 37.1), + vector3(1392.5, 3604.6, 33.9), + vector3(127.8, -1284.7, 28.2), --StripClub + vector3(-1393.4, -606.6, 29.3), --Tequila la + vector3(-559.9, 287.0, 81.1) --Bahamamas + }, + Size = 1.0, + Type = 59, + Color = 25, + ShowBlip = true, + ShowMarker = true +}, + + LTDgasoline = { + Items = { + { + name = "bread", + label = "bread", + price = 100 + }, + { + name = "water", + label = "water", + price = 100 + } + }, + Pos = { + vector3(-48.5, -1757.5, 28.4), + vector3(1163.3, -323.8, 68.2), + vector3(-707.5, -914.2, 18.2), + vector3(-1820.5, 792.5, 137.1), + vector3(1698.3, 4924.4, 41.0) + }, + Size = 1.0, + Type = 59, + Color = 25, + ShowBlip = true, + ShowMarker = true +} +} diff --git a/[esx_addons]/esx_shops/fxmanifest.lua b/[esx_addons]/esx_shops/fxmanifest.lua new file mode 100644 index 00000000..3bb6d04d --- /dev/null +++ b/[esx_addons]/esx_shops/fxmanifest.lua @@ -0,0 +1,38 @@ +fx_version 'adamant' + +game 'gta5' + +description 'ESX Shops' + +version '1.1.0' + +client_scripts { + '@es_extended/locale.lua', + 'locales/de.lua', + 'locales/br.lua', + 'locales/en.lua', + 'locales/fi.lua', + 'locales/fr.lua', + 'locales/es.lua', + 'locales/sv.lua', + 'locales/pl.lua', + 'config.lua', + 'client/main.lua' +} + +server_scripts { + '@es_extended/locale.lua', + '@mysql-async/lib/MySQL.lua', + 'locales/de.lua', + 'locales/br.lua', + 'locales/en.lua', + 'locales/fi.lua', + 'locales/fr.lua', + 'locales/es.lua', + 'locales/sv.lua', + 'locales/pl.lua', + 'config.lua', + 'server/main.lua' +} + +dependency 'es_extended' diff --git a/[esx_addons]/esx_shops/locales/br.lua b/[esx_addons]/esx_shops/locales/br.lua new file mode 100644 index 00000000..b3182a66 --- /dev/null +++ b/[esx_addons]/esx_shops/locales/br.lua @@ -0,0 +1,12 @@ +Locales['br'] = { + ['shop'] = 'comprar', + ['shops'] = 'lojas', + ['press_menu'] = 'pressione ~INPUT_CONTEXT~ para acessar a loja.', + ['shop_item'] = '$%s', + ['bought'] = 'você acabou de comprar ~y~%sx~s~ ~b~%s~s~ por ~r~$%s~s~', + ['not_enough'] = 'você não tem ~r~dinheiro suficiente~s~: %s', + ['player_cannot_hold'] = 'você ~r~não~s~ tem bastante ~y~espaço livre~s~ no seu inventário!', + ['shop_confirm'] = 'comprou %sx %s por $%s?', + ['no'] = 'não', + ['yes'] = 'sim', +} diff --git a/[esx_addons]/esx_shops/locales/de.lua b/[esx_addons]/esx_shops/locales/de.lua new file mode 100644 index 00000000..f8ed240f --- /dev/null +++ b/[esx_addons]/esx_shops/locales/de.lua @@ -0,0 +1,12 @@ +Locales['de'] = { + ['shop'] = 'geschäft', + ['shops'] = 'geschäfte', + ['press_menu'] = 'drücke ~INPUT_CONTEXT~ um auf das Geschäft zuzugreifen.', + ['shop_item'] = '$%s', + ['bought'] = 'du kaufst ~y~%sx~s~ ~b~%s~s~ für ~r~$%s~s~', + ['not_enough'] = 'du ~r~hast nicht~s~ genug geld: %s', + ['player_cannot_hold'] = 'du hast ~r~nicht~s~ genug ~y~Platz~s~ in deinem Inventar', + ['shop_confirm'] = 'Kaufe %sx %s für $%s?', + ['no'] = 'nein', + ['yes'] = 'ja', +} diff --git a/[esx_addons]/esx_shops/locales/en.lua b/[esx_addons]/esx_shops/locales/en.lua new file mode 100644 index 00000000..9879faa7 --- /dev/null +++ b/[esx_addons]/esx_shops/locales/en.lua @@ -0,0 +1,12 @@ +Locales['en'] = { + ['shop'] = 'shop', + ['shops'] = 'shops', + ['press_menu'] = 'press ~INPUT_CONTEXT~ to access the ~y~store~s~.', + ['shop_item'] = '$%s', + ['bought'] = 'you just bought ~y~%sx~s~ ~b~%s~s~ for ~r~$%s~s~', + ['not_enough'] = 'you do not have ~r~enough~s~ money, you\'re ~y~missing~s~ ~r~$%s~s~!', + ['player_cannot_hold'] = 'you do ~r~not~s~ have enough ~y~free space~s~ in your inventory!', + ['shop_confirm'] = 'buy %sx %s for $%s?', + ['no'] = 'no', + ['yes'] = 'yes', +} diff --git a/[esx_addons]/esx_shops/locales/es.lua b/[esx_addons]/esx_shops/locales/es.lua new file mode 100644 index 00000000..c422abc1 --- /dev/null +++ b/[esx_addons]/esx_shops/locales/es.lua @@ -0,0 +1,12 @@ +Locales['es'] = { + ['shop'] = 'tienda', + ['shops'] = 'tiendas', + ['press_menu'] = 'pulsa ~INPUT_CONTEXT~ para comprar en la tienda.', + ['shop_item'] = '%s€', + ['bought'] = 'has comprado ~y~%sx~s~ ~b~%s~s~ por ~r~%s€~s~', + ['not_enough'] = 'no tienes ~r~suficiente ~s~ dinero: %s', + ['player_cannot_hold'] = 'no tienes ~y~espacio libre~s~ en tu inventario...', + ['shop_confirm'] = '¿Comprar %sx %s por $%s?', + ['no'] = 'no', + ['yes'] = 'si', +} diff --git a/[esx_addons]/esx_shops/locales/fi.lua b/[esx_addons]/esx_shops/locales/fi.lua new file mode 100644 index 00000000..6ee317e0 --- /dev/null +++ b/[esx_addons]/esx_shops/locales/fi.lua @@ -0,0 +1,12 @@ +Locales['fi'] = { + ['shop'] = 'kauppa', + ['shops'] = 'kaupat', + ['press_menu'] = 'paina ~INPUT_CONTEXT~ ostaaksesi jotain ~y~kaupasta~s~.', + ['shop_item'] = '$%s', + ['bought'] = 'Sinä ostit juuri ~y~%sx~s~ ~b~%s~s~. Summaksi tuli ~r~$%s~s~', + ['not_enough'] = 'sinulla ei ole ~r~tarpeeksi~s~ rahaa, sinulta ~y~puuttuu~s~ ~r~$%s~s~!', + ['player_cannot_hold'] = 'sinulla ~r~ei ole~s~ tarpeeksi ~y~tilaa~s~ repussasi!', + ['shop_confirm'] = 'osta %sx %s summa olisi $%s?', + ['no'] = 'ei', + ['yes'] = 'kyllä', +} diff --git a/[esx_addons]/esx_shops/locales/fr.lua b/[esx_addons]/esx_shops/locales/fr.lua new file mode 100644 index 00000000..b789e767 --- /dev/null +++ b/[esx_addons]/esx_shops/locales/fr.lua @@ -0,0 +1,12 @@ +Locales['fr'] = { + ['shop'] = 'magasin', + ['shops'] = 'magasins', + ['press_menu'] = 'appuyez sur ~INPUT_CONTEXT~ pour accéder au magasin.', + ['shop_item'] = '$%s', + ['bought'] = 'vous venez d\'acheter ~y~%sx~s~ ~b~%s~s~ pour ~r~$%s~s~', + ['not_enough'] = 'vous n\'avez ~r~pas assez~s~ d\'argent: %s', + ['player_cannot_hold'] = 'vous n\'avez ~r~pas~s~ assez ~y~de place~s~ dans votre inventaire!', + ['shop_confirm'] = 'acheter %sx %s pour $%s?', + ['no'] = 'non', + ['yes'] = 'oui', +} diff --git a/[esx_addons]/esx_shops/locales/pl.lua b/[esx_addons]/esx_shops/locales/pl.lua new file mode 100644 index 00000000..2b705713 --- /dev/null +++ b/[esx_addons]/esx_shops/locales/pl.lua @@ -0,0 +1,12 @@ +Locales['pl'] = { + ['shop'] = 'sklep', + ['shops'] = 'sklepy', + ['press_menu'] = 'naciśnij ~INPUT_CONTEXT~ żeby wejść do ~y~sklepu~s~.', + ['shop_item'] = '$%s', + ['bought'] = 'właśnie zakupiłeś ~y~%s~s~ x ~b~%s~s~ za ~g~%s $~s~', + ['not_enough'] = 'nie masz ~r~wystarczjąco~s~ pięniędzy, ~y~Brakuje Ci~s~ ~r~$%s~s~!', + ['player_cannot_hold'] = '~r~Nie~s~ masz wystarczająco ~y~wolnego miejsca~s~ w swoim ekwipunku!', + ['shop_confirm'] = 'chcesz kupić %sx %s za $%s?', + ['no'] = 'nie', + ['yes'] = 'tak', +} diff --git a/[esx_addons]/esx_shops/locales/sv.lua b/[esx_addons]/esx_shops/locales/sv.lua new file mode 100644 index 00000000..40658757 --- /dev/null +++ b/[esx_addons]/esx_shops/locales/sv.lua @@ -0,0 +1,12 @@ +Locales['sv'] = { + ['shop'] = 'affär', + ['shops'] = 'affärer', + ['press_menu'] = 'tryck ~INPUT_CONTEXT~ för att ~y~handla prylar~s~.', + ['shop_item'] = '%s SEK', + ['bought'] = 'du har köpt ~y~%sx~s~ ~b~%s~s~ för ~r~%s SEK~s~', + ['not_enough'] = 'du har inte ~r~tillräckligt~s~ med pengar, det ~y~saknas~s~ ~r~%s SEK~s~!', + ['player_cannot_hold'] = 'du har ~r~inte~s~ tillräckligt med ~y~utrymme~s~ för att hålla det!', + ['shop_confirm'] = 'köpa %sx %s för %s SEK?', + ['no'] = 'nej', + ['yes'] = 'ja', +} diff --git a/[esx_addons]/esx_shops/server/main.lua b/[esx_addons]/esx_shops/server/main.lua new file mode 100644 index 00000000..d003b4a6 --- /dev/null +++ b/[esx_addons]/esx_shops/server/main.lua @@ -0,0 +1,47 @@ +ESX = nil +local ShopItems = {} + +TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + +RegisterServerEvent('esx_shops:buyItem') +AddEventHandler('esx_shops:buyItem', function(itemName, amount, zone) + local _source = source + local xPlayer = ESX.GetPlayerFromId(_source) + + amount = ESX.Math.Round(amount) + + if amount < 0 then + print('esx_shops: ' .. xPlayer.identifier .. ' attempted to exploit the shop!') + return + end + + -- get price + local price = 0 + local itemLabel = '' + + for i=1, #Config.Zones[zone].Items, 1 do + local item = Config.Zones[zone].Items[i] + if item.name == itemName then + price = item.price + itemLabel = item.label + break + end + end + + price = price * amount + + -- can the player afford this item? + if xPlayer.getMoney() >= price then + -- can the player carry the said amount of x item? + if xPlayer.canCarryItem(itemName, amount) then + xPlayer.removeMoney(price) + xPlayer.addInventoryItem(itemName, amount) + xPlayer.showNotification(_U('bought', amount, itemLabel, ESX.Math.GroupDigits(price))) + else + xPlayer.showNotification(_U('player_cannot_hold')) + end + else + local missingMoney = price - xPlayer.getMoney() + xPlayer.showNotification(_U('not_enough', ESX.Math.GroupDigits(missingMoney))) + end +end) diff --git a/[esx_addons]/esx_sit/.editorconfig b/[esx_addons]/esx_sit/.editorconfig new file mode 100644 index 00000000..9b425256 --- /dev/null +++ b/[esx_addons]/esx_sit/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_size = 4 +indent_style = tab +end_of_line = crlf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/[esx_addons]/esx_sit/LICENSE b/[esx_addons]/esx_sit/LICENSE new file mode 100644 index 00000000..88c253ec --- /dev/null +++ b/[esx_addons]/esx_sit/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + fxserver-esx_sit + Copyright (C) 2015 Jérémie N'gadi + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + fxserver-esx_sit Copyright (C) 2015 Jérémie N'gadi + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. \ No newline at end of file diff --git a/[esx_addons]/esx_sit/README.md b/[esx_addons]/esx_sit/README.md new file mode 100644 index 00000000..74c5d7a7 --- /dev/null +++ b/[esx_addons]/esx_sit/README.md @@ -0,0 +1,49 @@ +# esx_sit + +This script allow you to sit in almost every object where you should be able to, the default keybind is SHIFT + E to toggle sitting. + +## Download & Installation + +### Using [fvm](https://github.com/qlaffont/fvm-installer) + +``` +fvm install --save --folder=esx esx-org/esx_sit +``` + +### Using Git + +``` +cd resources +git clone https://github.com/ESX-Org/esx_sit [esx]/esx_sit +``` + +### Manually + +- Download https://github.com/ESX-Org/esx_sit/releases/latest +- Put it in the `resource/[esx]` directory + +### Installation + +- Add this to your server.cfg: + +``` +start esx_sit +``` + +## Credits + +- [CmJustice](https://github.com/CmJustice) - Original author + +## Legal + +### License + +esx_sit + +Copyright (C) 2015-2020 Jérémie N'gadi + +This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version. + +This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details. + +You should have received a copy Of the GNU General Public License along with this program. If Not, see http://www.gnu.org/licenses/. diff --git a/[esx_addons]/esx_sit/client.lua b/[esx_addons]/esx_sit/client.lua new file mode 100644 index 00000000..46f7b23a --- /dev/null +++ b/[esx_addons]/esx_sit/client.lua @@ -0,0 +1,155 @@ +ESX = nil +local debugProps, sitting, lastPos, currentSitCoords, currentScenario = {} +local disableControls = false +local currentObj = nil + +Citizen.CreateThread(function() + while ESX == nil do + TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + Citizen.Wait(0) + end +end) + +if Config.Debug then + Citizen.CreateThread(function() + while true do + Citizen.Wait(0) + + for i=1, #debugProps, 1 do + local coords = GetEntityCoords(debugProps[i]) + local hash = GetEntityModel(debugProps[i]) + local id = coords.x .. coords.y .. coords.z + local model = 'unknown' + + for i=1, #Config.Interactables, 1 do + local seat = Config.Interactables[i] + + if hash == GetHashKey(seat) then + model = seat + break + end + end + + local text = ('ID: %s~n~Hash: %s~n~Model: %s'):format(id, hash, model) + + ESX.Game.Utils.DrawText3D({ + x = coords.x, + y = coords.y, + z = coords.z + 2.0 + }, text, 0.5) + end + + if #debugProps == 0 then + Citizen.Wait(500) + end + end + end) +end + +Citizen.CreateThread(function() + while true do + Citizen.Wait(0) + local playerPed = PlayerPedId() + + if sitting and not IsPedUsingScenario(playerPed, currentScenario) then + wakeup() + end + + -- Disable controls + if disableControls then + DisableControlAction(1, 37, true) -- Disables INPUT_SELECT_WEAPON (TAB) + end + + if IsControlJustPressed(0, 38) and IsControlPressed(0, 21) and IsInputDisabled(0) and IsPedOnFoot(playerPed) then + if sitting then + wakeup() + else + local object, distance = GetNearChair() + + if Config.Debug then + table.insert(debugProps, object) + end + + if distance and distance < 1.4 then + local hash = GetEntityModel(object) + + for k,v in pairs(Config.Sitable) do + if GetHashKey(k) == hash then + sit(object, k, v) + break + end + end + end + end + end + end +end) + +function GetNearChair() + local object, distance + local coords = GetEntityCoords(GetPlayerPed(-1)) + for i=1, #Config.Interactables do + object = GetClosestObjectOfType(coords, 3.0, GetHashKey(Config.Interactables[i]), false, false, false) + distance = #(coords - GetEntityCoords(object)) + if distance < 1.6 then + return object, distance + end + end + return nil, nil +end + +function wakeup() + local playerPed = PlayerPedId() + local pos = GetEntityCoords(GetPlayerPed(-1)) + + TaskStartScenarioAtPosition(playerPed, currentScenario, 0.0, 0.0, 0.0, 180.0, 2, true, false) + while IsPedUsingScenario(GetPlayerPed(-1), currentScenario) do + Wait(100) + end + ClearPedTasks(playerPed) + + FreezeEntityPosition(playerPed, false) + FreezeEntityPosition(currentObj, false) + + TriggerServerEvent('esx_sit:leavePlace', currentSitCoords) + currentSitCoords, currentScenario = nil, nil + sitting = false + disableControls = false +end + +function sit(object, modelName, data) + -- Fix for sit on chairs behind walls + if not HasEntityClearLosToEntity(GetPlayerPed(-1), object, 17) then + return + end + disableControls = true + currentObj = object + FreezeEntityPosition(object, true) + + PlaceObjectOnGroundProperly(object) + local pos = GetEntityCoords(object) + local playerPos = GetEntityCoords(GetPlayerPed(-1)) + local objectCoords = pos.x .. pos.y .. pos.z + + ESX.TriggerServerCallback('esx_sit:getPlace', function(occupied) + if occupied then + ESX.ShowNotification('There is someone on this chair') + else + local playerPed = PlayerPedId() + lastPos, currentSitCoords = GetEntityCoords(playerPed), objectCoords + + TriggerServerEvent('esx_sit:takePlace', objectCoords) + + currentScenario = data.scenario + TaskStartScenarioAtPosition(playerPed, currentScenario, pos.x, pos.y, pos.z + (playerPos.z - pos.z)/2, GetEntityHeading(object) + 180.0, 0, true, false) + + Citizen.Wait(2500) + if GetEntitySpeed(GetPlayerPed(-1)) > 0 then + ClearPedTasks(GetPlayerPed(-1)) + TaskStartScenarioAtPosition(playerPed, currentScenario, pos.x, pos.y, pos.z + (playerPos.z - pos.z)/2, GetEntityHeading(object) + 180.0, 0, true, true) + end + + sitting = true + end + end, objectCoords) +end \ No newline at end of file diff --git a/[esx_addons]/esx_sit/config.lua b/[esx_addons]/esx_sit/config.lua new file mode 100644 index 00000000..45ff65b6 --- /dev/null +++ b/[esx_addons]/esx_sit/config.lua @@ -0,0 +1,120 @@ +Config = {} + +Config.MaxDistance = 1.5 +Config.Debug = false + +Config.Interactables = { + 'prop_bench_01a', + 'prop_bench_01b', + 'prop_bench_01c', + 'prop_bench_02', + 'prop_bench_03', + 'prop_bench_04', + 'prop_bench_05', + 'prop_bench_06', + 'prop_bench_05', + 'prop_bench_08', + 'prop_bench_09', + 'prop_bench_10', + 'prop_bench_11', + 'prop_fib_3b_bench', + 'prop_ld_bench01', + 'prop_wait_bench_01', + 'hei_prop_heist_off_chair', + 'hei_prop_hei_skid_chair', + 'prop_chair_01a', + 'prop_chair_01b', + 'prop_chair_02', + 'prop_chair_03', + 'prop_chair_04a', + 'prop_chair_04b', + 'prop_chair_05', + 'prop_chair_06', + 'prop_chair_05', + 'prop_chair_08', + 'prop_chair_09', + 'prop_chair_10', + 'v_club_stagechair', + 'prop_chateau_chair_01', + 'prop_clown_chair', + 'prop_cs_office_chair', + 'prop_direct_chair_01', + 'prop_direct_chair_02', + 'prop_gc_chair02', + 'prop_off_chair_01', + 'prop_off_chair_03', + 'prop_off_chair_04', + 'prop_off_chair_04b', + 'prop_off_chair_04_s', + 'prop_off_chair_05', + 'prop_old_deck_chair', + 'prop_old_wood_chair', + 'prop_rock_chair_01', + 'prop_skid_chair_01', + 'prop_skid_chair_02', + 'prop_skid_chair_03', + 'prop_sol_chair', + 'prop_wheelchair_01', + 'prop_wheelchair_01_s', + 'p_armchair_01_s', + 'p_clb_officechair_s', + 'p_dinechair_01_s', + 'p_ilev_p_easychair_s', + 'p_soloffchair_s', + 'p_yacht_chair_01_s', + 'v_club_officechair', + 'v_corp_bk_chair3', + 'v_corp_cd_chair', + 'v_corp_offchair', + 'v_ilev_chair02_ped', + 'v_ilev_hd_chair', + 'v_ilev_p_easychair', + 'v_ret_gc_chair03', + 'prop_ld_farm_chair01', + 'prop_table_04_chr', + 'prop_table_05_chr', + 'prop_table_06_chr', + 'v_ilev_leath_chr', + 'prop_table_01_chr_a', + 'prop_table_01_chr_b', + 'prop_table_02_chr', + 'prop_table_03b_chr', + 'prop_table_03_chr', + 'prop_torture_ch_01', + 'v_ilev_fh_dineeamesa', + 'v_ilev_fh_kitchenstool', + 'v_ilev_tort_stool', + 'v_ilev_fh_kitchenstool', + 'v_ilev_fh_kitchenstool', + 'v_ilev_fh_kitchenstool', + 'v_ilev_fh_kitchenstool', + 'hei_prop_yah_seat_01', + 'hei_prop_yah_seat_02', + 'hei_prop_yah_seat_03', + 'prop_waiting_seat_01', + 'prop_yacht_seat_01', + 'prop_yacht_seat_02', + 'prop_yacht_seat_03', + 'prop_hobo_seat_01', + 'prop_rub_couch01', + 'miss_rub_couch_01', + 'prop_ld_farm_couch01', + 'prop_ld_farm_couch02', + 'prop_rub_couch02', + 'prop_rub_couch03', + 'prop_rub_couch04', + 'p_lev_sofa_s', + 'p_res_sofa_l_s', + 'p_v_med_p_sofa_s', + 'p_yacht_sofa_01_s', + 'v_ilev_m_sofa', + 'v_res_tre_sofa_s', + 'v_tre_sofa_mess_a_s', + 'v_tre_sofa_mess_b_s', + 'v_tre_sofa_mess_c_s', + 'prop_roller_car_01', + 'prop_roller_car_02', + -- Custom + 'v_ret_gc_chair02', + 'v_serv_ct_chair02', +} diff --git a/[esx_addons]/esx_sit/fxmanifest.lua b/[esx_addons]/esx_sit/fxmanifest.lua new file mode 100644 index 00000000..c91a36d5 --- /dev/null +++ b/[esx_addons]/esx_sit/fxmanifest.lua @@ -0,0 +1,19 @@ +fx_version 'adamant' + +game 'gta5' + +description 'ESX Sit' + +version '1.0.3' + +server_scripts { + 'config.lua', + 'lists/seat.lua', + 'server.lua' +} + +client_scripts { + 'config.lua', + 'lists/seat.lua', + 'client.lua' +} diff --git a/[esx_addons]/esx_sit/lists/seat.lua b/[esx_addons]/esx_sit/lists/seat.lua new file mode 100644 index 00000000..cc27adf6 --- /dev/null +++ b/[esx_addons]/esx_sit/lists/seat.lua @@ -0,0 +1,132 @@ +Config.Sitable = { + --Only verticalOffset works right now! + --all scenarios: pastebin.com/6mrYTdQv + + -- BENCH + prop_bench_01a = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_bench_01b = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_bench_01c = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_bench_02 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_bench_03 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_bench_04 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_bench_05 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_bench_06 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_bench_05 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.45, forwardOffset = 0.0, leftOffset = 0.0}, + prop_bench_08 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_bench_09 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.31, forwardOffset = 0.0, leftOffset = 0.0}, + prop_bench_10 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_bench_11 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_fib_3b_bench = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_ld_bench01 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_wait_bench_01 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + + -- CHAIR + v_club_stagechair = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + hei_prop_heist_off_chair = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + hei_prop_hei_skid_chair = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_chair_01a = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_chair_01b = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_chair_02 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_chair_03 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_chair_04a = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_chair_04b = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_chair_05 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_chair_06 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_chair_05 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_chair_08 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_chair_09 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_chair_10 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_chateau_chair_01 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_clown_chair = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_cs_office_chair = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_direct_chair_01 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_direct_chair_02 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_gc_chair02 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_off_chair_01 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_off_chair_03 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_off_chair_04 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_off_chair_04b = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_off_chair_04_s = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_off_chair_05 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.45, forwardOffset = 0.0, leftOffset = 0.0}, + prop_old_deck_chair = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_old_wood_chair = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_rock_chair_01 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_skid_chair_01 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_skid_chair_02 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_skid_chair_03 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_sol_chair = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_wheelchair_01 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_wheelchair_01_s = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + p_armchair_01_s = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + p_clb_officechair_s = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + p_dinechair_01_s = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + p_ilev_p_easychair_s = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + p_soloffchair_s = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + p_yacht_chair_01_s = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + v_club_officechair = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + v_corp_bk_chair3 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + v_corp_cd_chair = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + v_corp_offchair = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + v_ilev_chair02_ped = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + v_ilev_hd_chair = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + v_ilev_p_easychair = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + v_ret_gc_chair03 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_ld_farm_chair01 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_table_04_chr = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.56, forwardOffset = 0.0, leftOffset = 0.0}, + prop_table_05_chr = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_table_06_chr = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + v_ilev_leath_chr = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_table_01_chr_a = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_table_01_chr_b = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_table_02_chr = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_table_03b_chr = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_table_03_chr = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_torture_ch_01 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + v_ilev_fh_dineeamesa = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + + + v_ilev_fh_kitchenstool = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + v_ilev_tort_stool = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + v_ilev_fh_kitchenstool = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + v_ilev_fh_kitchenstool = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + v_ilev_fh_kitchenstool = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + v_ilev_fh_kitchenstool = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + + -- SEAT + hei_prop_yah_seat_01 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + hei_prop_yah_seat_02 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + hei_prop_yah_seat_03 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_waiting_seat_01 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_yacht_seat_01 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_yacht_seat_02 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_yacht_seat_03 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_hobo_seat_01 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.65, forwardOffset = 0.0, leftOffset = 0.0}, + + -- COUCH + prop_rub_couch01 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + miss_rub_couch_01 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_ld_farm_couch01 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_ld_farm_couch02 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_rub_couch02 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_rub_couch03 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_rub_couch04 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + + -- SOFA + p_lev_sofa_s = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + p_res_sofa_l_s = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + p_v_med_p_sofa_s = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + p_yacht_sofa_01_s = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + v_ilev_m_sofa = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + v_res_tre_sofa_s = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + v_tre_sofa_mess_a_s = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + v_tre_sofa_mess_b_s = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + v_tre_sofa_mess_c_s = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + + -- MISC + prop_roller_car_01 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + prop_roller_car_02 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + + -- CUSTOM + v_ret_gc_chair02 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, + v_serv_ct_chair02 = { scenario = 'PROP_HUMAN_SEAT_BENCH', verticalOffset = -0.5, forwardOffset = 0.0, leftOffset = 0.0}, +} diff --git a/[esx_addons]/esx_sit/server.lua b/[esx_addons]/esx_sit/server.lua new file mode 100644 index 00000000..98641f2e --- /dev/null +++ b/[esx_addons]/esx_sit/server.lua @@ -0,0 +1,20 @@ +ESX = nil +local seatsTaken = {} + +TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + +RegisterNetEvent('esx_sit:takePlace') +AddEventHandler('esx_sit:takePlace', function(objectCoords) + seatsTaken[objectCoords] = true +end) + +RegisterNetEvent('esx_sit:leavePlace') +AddEventHandler('esx_sit:leavePlace', function(objectCoords) + if seatsTaken[objectCoords] then + seatsTaken[objectCoords] = nil + end +end) + +ESX.RegisterServerCallback('esx_sit:getPlace', function(source, cb, objectCoords) + cb(seatsTaken[objectCoords]) +end) \ No newline at end of file diff --git a/[esx_addons]/esx_society/.editorconfig b/[esx_addons]/esx_society/.editorconfig new file mode 100644 index 00000000..9b425256 --- /dev/null +++ b/[esx_addons]/esx_society/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_size = 4 +indent_style = tab +end_of_line = crlf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/[esx_addons]/esx_society/LICENSE b/[esx_addons]/esx_society/LICENSE new file mode 100644 index 00000000..d215c267 --- /dev/null +++ b/[esx_addons]/esx_society/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + fxserver-esx_society + Copyright (C) 2015 Jérémie N'gadi + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + fxserver-esx_society Copyright (C) 2015 Jérémie N'gadi + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. \ No newline at end of file diff --git a/[esx_addons]/esx_society/README.md b/[esx_addons]/esx_society/README.md new file mode 100644 index 00000000..983abdd2 --- /dev/null +++ b/[esx_addons]/esx_society/README.md @@ -0,0 +1,62 @@ +# esx_society + +Society management for ESX. Adds employee management (hire, fire, promote / demote, change salary), society bank accounts and money washing. It's crucial that this script gets started before all resources that utilize societies do, or else many things will go wrong. + +## Requirements +- [cron](https://github.com/ESX-Org/cron) +- [esx_addonaccount](https://github.com/ESX-Org/esx_addonaccount) + +## Download & Installation + +### Using [fvm](https://github.com/qlaffont/fvm-installer) +``` +fvm install --save --folder=esx esx-org/esx_society +``` + +### Using Git +``` +cd resources +git clone https://github.com/ESX-Org/esx_society [esx]/esx_society +``` + +### Manually +- Download https://github.com/ESX-Org/esx_society/archive/master.zip +- Put it in the `[esx]` directory + +## Installation +- Import `esx_society.sql` in your database +- Add this in your `server.cfg`: + +``` +start esx_society +``` + +## Explanation +ESX Society works with addon accounts named 'society_xxx', for example 'society_taxi' or 'society_realestateagent'. If you job grade is 'boss' the society money will be displayed in your hud. + +## Usage +```lua +local society = 'taxi' +local amount = 100 + +TriggerServerEvent('esx_society:withdrawMoney', society, amount) +TriggerServerEvent('esx_society:depositMoney', society, amount) +TriggerServerEvent('esx_society:washMoney', society, amount) + + +TriggerEvent('esx_society:openBossMenu', society, function (data, menu) + menu.close() +end, {wash = false}) -- set custom options, e.g disable washing +``` + +# Legal +### License +esx_society - societies for ESX + +Copyright (C) 2015-2020 Jérémie N'gadi + +This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version. + +This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details. + +You should have received a copy Of the GNU General Public License along with this program. If Not, see http://www.gnu.org/licenses/. \ No newline at end of file diff --git a/[esx_addons]/esx_society/client/main.lua b/[esx_addons]/esx_society/client/main.lua new file mode 100644 index 00000000..f5deb025 --- /dev/null +++ b/[esx_addons]/esx_society/client/main.lua @@ -0,0 +1,361 @@ +ESX = nil + +local base64MoneyIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAMAAAAPdrEwAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAMAUExURQAAACmvPCmwPCuwPiywPi2wPy6xQC6xQS+yQTCxQTCyQTCyQjGyQzKyRDOzRTSzRTSzRjW0RjW0Rza0SDe0STi0STm1Sjq1Szq2Szu2TDy2TDy2TT22Tj63Tz+3UEC4UEG4UUG4UkK4U0O5VES5VEW6VUa6Vke6V0i7WEm7WUu8Wku8W0y8W028XE29XU++XlC9X1C+X1G+YFK+YVO/YlW/ZFXAZFfAZVfAZljBZlnBZ1rBaVvCaVvCalzDal7CbF/DbV/EbWHEbmLEb2LEcGTFcWfGdGjHdWrHd2vId2vIeGzIeW3JenHKfXLKfnPLf3TLgHXLgXXMgHXMgXbMgnjNg3nMhHrNhnrOhnzOiH7PiYLQjYPRjoTRjoTRj4XRkIXSkIfSkojSk4rUlYzUlo7VmJDWmpHWm5LXnJTXnZTXnpXYnpbYn5nZopzapJ3bpZ7bpp7bp6DcqKLcqqPcq6Tcq6TdrKberqjfr6jfsKnfsavgs6zgs6zgtK7hta/htrDit7LiuLLiubPjurTjurXju7bkvLbkvbnlv7rlwLrmwLzmwr3nw77nxMDnxcLox8PpyMTpycXpysXqysbqy8fqzMnrzcrrz8vsz8vs0Mzs0c3t0tHu1dHu1tPv19Tv2NXv2dXw2dbw2tfw29jw3Nnx3drx3t7z4d/z4uD04+H05OP15eP15uT15uT15+X16OX26Of26en36+r37Ov37er47Ov47ez47e347u347+758PD58fD68fD68vL69PT79fX79vb79/b89vb89/f8+Pj9+fn9+vr9+/v++/v+/Pz+/P3+/f3+/v7//wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALfZHJgAAAEAdFJOU////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wBT9wclAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAGHRFWHRTb2Z0d2FyZQBwYWludC5uZXQgNC4xLjb9TgnoAAAGdUlEQVRoQ7WZ93sURRiAFZO76O1eklt215OgBwqJgmgCRhAhRrAAiogBK4gBJEFEgWAEYiGIYEGp1kjXQECkiF0OWyjJ/k34zcy3db7Zu8fHe3/KTXnzPbPT56orRTEYAhMLUFgNKkeiGH8BNaV1KWSPVXveU9s3LW9pvhdoblm+afspTHZi5Wo1BnzpaOfcnFmWSBv29YBtpBNlZm5u59FLPDsmdJUaxQeXNugZw5IwMnrD0oO8iFKuUHNx/+bGZLWNMgm7Otm4uZ/LsVIEUs3F+Y5a3USNAlOv7cgr5ZSamQffyOnKgH1sPdfFi2PVILKaReEcmKwVIWbY2uQDvApW95HULIb+Ng0rFoXWxppcCjyqZuZjk4oNWWBrk44R7oiamXdkC3w9GTO7Q3aH1cy8OkWFnHtitstM4j/bqdWSO6Rm5nYdS4e5FbKQwxlMC6G3Q1bIHVQz8+IKLBphJLdydlRjWpiKxZAXdAfUPOak4gOO4FZOdxWmhbGTkbh9NTOvoVsDuGmAaxkdlZgWRV8Dub7bV0PyzhQWkqk5z7WMdjpqILUTslEXUEPQJ7Lq7pz9WXiBZ4iZUGBnTwTCdtVgvjgxpj+b3vTvTEteq5KbEy/6blcNVZapR3cmdc9Z4QV6Pnxzdr1GF9aWQQFUohqCPqQc3ZV17X3C6tP31kyL+Jy2dsgLW6jBPDgVc6OkR3XxCV/i9IqRRFedylxc6qk30L3DNF7ikz1Jft0oLOaT2hBSg/l8jmwOo24/amimYzkfOwfdlLtdNT1YjIaf0EFzgGhuNnB8teNcqCWDvs3vzSSLqC9Ze0F0EqaGoDeSQWt7UaHgXA0WDKFvFGEzNRS6mxot6VZhUNJNdm7zbsgSagj6UAKTQ5hnhEHJffRISIi+LdRLyNn9cTSoOExP3FZmiat2nIF66t9Xb0GFz8Df+AenVTEF2vUwAzM1BN1LfsTkcVS4bJs+fnRj84z3joqf+eFYUELvZWFzdSfZHjeeEwqXl6/myWaZ0bSVDf3uJP9NkOn01HPISXIMTJAB/hiB6WBPN+xxBpvxl4wxR6ihll8pSL1QupwLLhR22YL9ysVGrKRcfZJeAu4QSo+1yWA3rla2NGCeZGpoj13lmBJm1F/odDm+fv68phorU0l+miDlu6BFmLqbHDCWdhqVQQb/zPesW1inqxdoRqIb1SvSmBJG+wR1BF+/NkmLWUnTK1DdQq+i5gvoIbn85QPqtdRoQfU0TIgy4h/UKOi+gZ5DgGmonqIoob2CDhXHblE0ij2lgNo2YMcSy7fkhF2E2rIm/IoOFV/Q+78i1JkJheJ+jOzjnlr1GRk18swa4iC9t3U/o6LzCVLTP4dlVM14LBfC63yKIYOYeuMqcRoneZFqEW/IKAY6Q8xumla3YP2+PNnNt1Jqb6Arpifg5kXuHjNTaVi1s5/eJs0r+6gFUkxP6kkV2mKBs8UMZSYMdmAJcpxqTTGpqpcCEO1znCMTwlPFNbuF0uUs1UVwKYAWoRcwGDHsbNS/algwu+J1bvToI9TuAgZqetm1roPVk/FDazbhjaryr0SiSw/R1oFll94sWNnfsLrzS1eTkawyjKrE6HcwyeVtIix3s6Dc4ljzsTbnx74P1na83+uf8ZBn5cb0tjgsbHJjlvoMa8dxWT4XBDZmoCa3k7eH9yE0u4l9jr+dZN2P2ASnVorK8TwoVwxsglnYxNY9852oHMseogMEt+4QtnzgGDoTa8eRH4ulA4QOHCxs6ZhUBdNAIS7NIjp1+JgEaulwZzwsnXCjDDxPzB+Rwx1zS0fSoVZb/Mp4/lFqQxk5kjI1cZDWa179HTUEe8eRW9XoQZq5qeN/5fCFigWmd14VNRXLx3/et8lLC7N8XNtH0VP6mXfvV+z4iEsLFrbqqkXXho2Z8dynwgo8NdZK0SXpqxbmjrsgquhCsXrhgOYgL4h4k8Rca5VvFV7gTkySUVxrsbBjLuOGfMy1jCZFa6gv47hbeYU4ZA/XMmbRy13MFaJwqy4+Ez1cy3iSVsddfGLcdJvo33Ato5VcSeOva4WbvmQ2v+daxkrqfqXQJbNwk1fj9kOPuNwlZxdxNS7c5IW+MdRFMhd3oS/cpXmG4EOnRI8nAAt8sKsETz4AK1yahyqAy0vxvAaU7lEQcJ8yj9BPmUf+81MmR8iB//kBllOyZ2NOqR67XUAVABNjuXLlX2rCcoFjOcGoAAAAAElFTkSuQmCC' + +Citizen.CreateThread(function() + while ESX == nil do + TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + Citizen.Wait(0) + end + + while ESX.GetPlayerData().job == nil do + Citizen.Wait(10) + end + + ESX.PlayerData = ESX.GetPlayerData() + + RefreshBussHUD() +end) + +RegisterNetEvent('esx:setJob') +AddEventHandler('esx:setJob', function(job) + ESX.PlayerData.job = job + RefreshBussHUD() +end) + +function RefreshBussHUD() + DisableSocietyMoneyHUDElement() + + if ESX.PlayerData.job.grade_name == 'boss' then + EnableSocietyMoneyHUDElement() + + ESX.TriggerServerCallback('esx_society:getSocietyMoney', function(money) + UpdateSocietyMoneyHUDElement(money) + end, ESX.PlayerData.job.name) + end +end + +RegisterNetEvent('esx_addonaccount:setMoney') +AddEventHandler('esx_addonaccount:setMoney', function(society, money) + if ESX.PlayerData.job and ESX.PlayerData.job.grade_name == 'boss' and 'society_' .. ESX.PlayerData.job.name == society then + UpdateSocietyMoneyHUDElement(money) + end +end) + +function EnableSocietyMoneyHUDElement() + local societyMoneyHUDElementTpl = '
 {{money}}
' + + if ESX.GetConfig().EnableHud then + ESX.UI.HUD.RegisterElement('society_money', 3, 0, societyMoneyHUDElementTpl, { + money = 0 + }) + end + + TriggerEvent('esx_society:toggleSocietyHud', true) +end + +function DisableSocietyMoneyHUDElement() + if ESX.GetConfig().EnableHud then + ESX.UI.HUD.RemoveElement('society_money') + end + + TriggerEvent('esx_society:toggleSocietyHud', false) +end + +function UpdateSocietyMoneyHUDElement(money) + if ESX.GetConfig().EnableHud then + ESX.UI.HUD.UpdateElement('society_money', { + money = ESX.Math.GroupDigits(money) + }) + end + + TriggerEvent('esx_society:setSocietyMoney', money) +end + +function OpenBossMenu(society, close, options) + options = options or {} + local elements = {} + + ESX.TriggerServerCallback('esx_society:isBoss', function(isBoss) + if isBoss then + local defaultOptions = { + withdraw = true, + deposit = true, + wash = true, + employees = true, + grades = true + } + + for k,v in pairs(defaultOptions) do + if options[k] == nil then + options[k] = v + end + end + + if options.withdraw then + table.insert(elements, {label = _U('withdraw_society_money'), value = 'withdraw_society_money'}) + end + + if options.deposit then + table.insert(elements, {label = _U('deposit_society_money'), value = 'deposit_money'}) + end + + if options.wash then + table.insert(elements, {label = _U('wash_money'), value = 'wash_money'}) + end + + if options.employees then + table.insert(elements, {label = _U('employee_management'), value = 'manage_employees'}) + end + + if options.grades then + table.insert(elements, {label = _U('salary_management'), value = 'manage_grades'}) + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'boss_actions_' .. society, { + title = _U('boss_menu'), + align = 'top-left', + elements = elements + }, function(data, menu) + if data.current.value == 'withdraw_society_money' then + ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'withdraw_society_money_amount_' .. society, { + title = _U('withdraw_amount') + }, function(data2, menu2) + local amount = tonumber(data2.value) + + if amount == nil then + ESX.ShowNotification(_U('invalid_amount')) + else + menu2.close() + TriggerServerEvent('esx_society:withdrawMoney', society, amount) + end + end, function(data2, menu2) + menu2.close() + end) + elseif data.current.value == 'deposit_money' then + ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'deposit_money_amount_' .. society, { + title = _U('deposit_amount') + }, function(data2, menu2) + local amount = tonumber(data2.value) + + if amount == nil then + ESX.ShowNotification(_U('invalid_amount')) + else + menu2.close() + TriggerServerEvent('esx_society:depositMoney', society, amount) + end + end, function(data2, menu2) + menu2.close() + end) + elseif data.current.value == 'wash_money' then + ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'wash_money_amount_' .. society, { + title = _U('wash_money_amount') + }, function(data2, menu2) + local amount = tonumber(data2.value) + + if amount == nil then + ESX.ShowNotification(_U('invalid_amount')) + else + menu2.close() + TriggerServerEvent('esx_society:washMoney', society, amount) + end + end, function(data2, menu2) + menu2.close() + end) + elseif data.current.value == 'manage_employees' then + OpenManageEmployeesMenu(society) + elseif data.current.value == 'manage_grades' then + OpenManageGradesMenu(society) + end + end, function(data, menu) + if close then + close(data, menu) + end + end) + end + end, society) +end + +function OpenManageEmployeesMenu(society) + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'manage_employees_' .. society, { + title = _U('employee_management'), + align = 'top-left', + elements = { + {label = _U('employee_list'), value = 'employee_list'}, + {label = _U('recruit'), value = 'recruit'} + }}, function(data, menu) + if data.current.value == 'employee_list' then + OpenEmployeeList(society) + elseif data.current.value == 'recruit' then + OpenRecruitMenu(society) + end + end, function(data, menu) + menu.close() + end) +end + +function OpenEmployeeList(society) + ESX.TriggerServerCallback('esx_society:getEmployees', function(employees) + + local elements = { + head = {_U('employee'), _U('grade'), _U('actions')}, + rows = {} + } + + for i=1, #employees, 1 do + local gradeLabel = (employees[i].job.grade_label == '' and employees[i].job.label or employees[i].job.grade_label) + + table.insert(elements.rows, { + data = employees[i], + cols = { + employees[i].name, + gradeLabel, + '{{' .. _U('promote') .. '|promote}} {{' .. _U('fire') .. '|fire}}' + } + }) + end + + ESX.UI.Menu.Open('list', GetCurrentResourceName(), 'employee_list_' .. society, elements, function(data, menu) + local employee = data.data + + if data.value == 'promote' then + menu.close() + OpenPromoteMenu(society, employee) + elseif data.value == 'fire' then + ESX.ShowNotification(_U('you_have_fired', employee.name)) + + ESX.TriggerServerCallback('esx_society:setJob', function() + OpenEmployeeList(society) + end, employee.identifier, 'unemployed', 0, 'fire') + end + end, function(data, menu) + menu.close() + OpenManageEmployeesMenu(society) + end) + end, society) +end + +function OpenRecruitMenu(society) + ESX.TriggerServerCallback('esx_society:getOnlinePlayers', function(players) + local elements = {} + + for i=1, #players, 1 do + if players[i].job.name ~= society then + table.insert(elements, { + label = players[i].name, + value = players[i].source, + name = players[i].name, + identifier = players[i].identifier + }) + end + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'recruit_' .. society, { + title = _U('recruiting'), + align = 'top-left', + elements = elements + }, function(data, menu) + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'recruit_confirm_' .. society, { + title = _U('do_you_want_to_recruit', data.current.name), + align = 'top-left', + elements = { + {label = _U('no'), value = 'no'}, + {label = _U('yes'), value = 'yes'} + }}, function(data2, menu2) + menu2.close() + + if data2.current.value == 'yes' then + ESX.ShowNotification(_U('you_have_hired', data.current.name)) + + ESX.TriggerServerCallback('esx_society:setJob', function() + OpenRecruitMenu(society) + end, data.current.identifier, society, 0, 'hire') + end + end, function(data2, menu2) + menu2.close() + end) + end, function(data, menu) + menu.close() + end) + end) +end + +function OpenPromoteMenu(society, employee) + ESX.TriggerServerCallback('esx_society:getJob', function(job) + local elements = {} + + for i=1, #job.grades, 1 do + local gradeLabel = (job.grades[i].label == '' and job.label or job.grades[i].label) + + table.insert(elements, { + label = gradeLabel, + value = job.grades[i].grade, + selected = (employee.job.grade == job.grades[i].grade) + }) + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'promote_employee_' .. society, { + title = _U('promote_employee', employee.name), + align = 'top-left', + elements = elements + }, function(data, menu) + menu.close() + ESX.ShowNotification(_U('you_have_promoted', employee.name, data.current.label)) + + ESX.TriggerServerCallback('esx_society:setJob', function() + OpenEmployeeList(society) + end, employee.identifier, society, data.current.value, 'promote') + end, function(data, menu) + menu.close() + OpenEmployeeList(society) + end) + end, society) +end + +function OpenManageGradesMenu(society) + ESX.TriggerServerCallback('esx_society:getJob', function(job) + local elements = {} + + for i=1, #job.grades, 1 do + local gradeLabel = (job.grades[i].label == '' and job.label or job.grades[i].label) + + table.insert(elements, { + label = ('%s - %s'):format(gradeLabel, _U('money_generic', ESX.Math.GroupDigits(job.grades[i].salary))), + value = job.grades[i].grade + }) + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'manage_grades_' .. society, { + title = _U('salary_management'), + align = 'top-left', + elements = elements + }, function(data, menu) + ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'manage_grades_amount_' .. society, { + title = _U('salary_amount') + }, function(data2, menu2) + + local amount = tonumber(data2.value) + + if amount == nil then + ESX.ShowNotification(_U('invalid_amount')) + elseif amount > Config.MaxSalary then + ESX.ShowNotification(_U('invalid_amount_max')) + else + menu2.close() + + ESX.TriggerServerCallback('esx_society:setJobSalary', function() + OpenManageGradesMenu(society) + end, society, data.current.value, amount) + end + end, function(data2, menu2) + menu2.close() + end) + end, function(data, menu) + menu.close() + end) + end, society) +end + +AddEventHandler('esx_society:openBossMenu', function(society, close, options) + OpenBossMenu(society, close, options) +end) diff --git a/[esx_addons]/esx_society/config.lua b/[esx_addons]/esx_society/config.lua new file mode 100644 index 00000000..e5c831b1 --- /dev/null +++ b/[esx_addons]/esx_society/config.lua @@ -0,0 +1,5 @@ +Config = {} + +Config.Locale = 'en' +Config.EnableESXIdentity = false +Config.MaxSalary = 3500 diff --git a/[esx_addons]/esx_society/esx_society.sql b/[esx_addons]/esx_society/esx_society.sql new file mode 100644 index 00000000..3d63ece6 --- /dev/null +++ b/[esx_addons]/esx_society/esx_society.sql @@ -0,0 +1,11 @@ +USE `es_extended`; + +CREATE TABLE `society_moneywash` ( + `id` int NOT NULL AUTO_INCREMENT, + `identifier` varchar(60) NOT NULL, + `society` varchar(60) NOT NULL, + `amount` int NOT NULL, + + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + diff --git a/[esx_addons]/esx_society/fxmanifest.lua b/[esx_addons]/esx_society/fxmanifest.lua new file mode 100644 index 00000000..57346a16 --- /dev/null +++ b/[esx_addons]/esx_society/fxmanifest.lua @@ -0,0 +1,46 @@ +fx_version 'adamant' + +game 'gta5' + +description 'ESX Society' + +version '1.0.4' + +server_scripts { + '@mysql-async/lib/MySQL.lua', + '@es_extended/locale.lua', + 'locales/br.lua', + 'locales/en.lua', + 'locales/es.lua', + 'locales/fi.lua', + 'locales/fr.lua', + 'locales/sv.lua', + 'locales/pl.lua', + 'locales/nl.lua', + 'locales/cs.lua', + 'locales/tr.lua', + 'config.lua', + 'server/main.lua' +} + +client_scripts { + '@es_extended/locale.lua', + 'locales/br.lua', + 'locales/en.lua', + 'locales/es.lua', + 'locales/fi.lua', + 'locales/fr.lua', + 'locales/sv.lua', + 'locales/pl.lua', + 'locales/nl.lua', + 'locales/cs.lua', + 'locales/tr.lua', + 'config.lua', + 'client/main.lua' +} + +dependencies { + 'es_extended', + 'cron', + 'esx_addonaccount' +} diff --git a/[esx_addons]/esx_society/locales/br.lua b/[esx_addons]/esx_society/locales/br.lua new file mode 100644 index 00000000..70d5606a --- /dev/null +++ b/[esx_addons]/esx_society/locales/br.lua @@ -0,0 +1,38 @@ +Locales['br'] = { + ['actions'] = 'ações', + ['boss_menu'] = 'menu chefe', + ['money_generic'] = '$%s', + ['deposit_amount'] = 'valor do depósito', + ['deposit_society_money'] = 'depositar dinheiro da sociedade', + ['do_you_want_to_recruit'] = 'você quer recrutar %s?', + ['employee'] = 'empregado', + ['employee_list'] = 'lista de empregados', + ['employee_management'] = 'gestão de funcionários', + ['fire'] = 'fogo', + ['grade'] = 'grau(escolaridade)', + ['have_deposited'] = 'você depositou ~r~$%s~s~', + ['have_withdrawn'] = 'você retirou ~g~$%s~s~', + ['invalid_amount'] = 'montante inválido', + ['invalid_amount_max'] = 'esse salário não é permitido', + ['no'] = 'não', + ['promote'] = 'promover', + ['promote_employee'] = 'promover %s', + ['recruit'] = 'recrutar', + ['recruiting'] = 'recrutamento', + ['salary_amount'] = 'valor do salário', + ['salary_management'] = 'gestão salarial', + ['wash_money'] = 'lavar dinheiro', + ['wash_money_amount'] = 'quantidade a lavar', + ['withdraw_amount'] = 'retirar montante', + ['withdraw_society_money'] = 'retirar dinheiro da sociedade', + ['yes'] = 'sim', + ['you_have'] = 'você tem ~g~$%s~s~ esperando lavagem de dinheiro (24h).', + ['you_have_laundered'] = 'você lavou ~g~$%s~s~ do seu dinheiro ', + ['you_have_hired'] = 'você recrutou %s', + ['you_have_been_hired'] = 'você foi contratado por %s', + ['you_have_fired'] = 'você demitiu %s', + ['you_have_been_fired'] = 'você foi demitido de %s', + ['you_have_promoted'] = 'você promoveu %s a %s', + ['you_have_been_promoted'] = 'você foi promovido ~b~promoted~s~!', +} + diff --git a/[esx_addons]/esx_society/locales/cs.lua b/[esx_addons]/esx_society/locales/cs.lua new file mode 100644 index 00000000..46eb10a9 --- /dev/null +++ b/[esx_addons]/esx_society/locales/cs.lua @@ -0,0 +1,37 @@ +Locales['cs'] = { + ['actions'] = 'akce', + ['boss_menu'] = 'akce šéfa', + ['money_generic'] = '$%s', + ['deposit_amount'] = 'množství vkladu', + ['deposit_society_money'] = 'vložit peníze do společnosti', + ['do_you_want_to_recruit'] = 'chceš najmout %s?', + ['employee'] = 'zaměstnanec', + ['employee_list'] = 'seznam zaměstnanců', + ['employee_management'] = 'správa zaměstnanců', + ['fire'] = 'vyhodit', + ['grade'] = 'povýšit', + ['have_deposited'] = 'vložil jsi ~r~$%s~s~', + ['have_withdrawn'] = 'vybral jsi ~g~$%s~s~', + ['invalid_amount'] = 'neplatná částka', + ['invalid_amount_max'] = 'tento plat není povolen', + ['no'] = 'ne', + ['promote'] = 'povýšit', + ['promote_employee'] = 'povýšit %s', + ['recruit'] = 'najmout', + ['recruiting'] = 'najímání', + ['salary_amount'] = 'váše platu', + ['salary_management'] = 'správa platů', + ['wash_money'] = 'vyprat peníze', + ['wash_money_amount'] = 'množství na vyprání', + ['withdraw_amount'] = 'výběr peněz', + ['withdraw_society_money'] = 'vybrat peníze společnosti', + ['yes'] = 'ano', + ['you_have'] = 'máš ~g~$%s~s~ čekajících na vyprání~s~ (24h).', + ['you_have_laundered'] = '~r~Vypral jsi~s~ tvé peníze: ~g~$%s~s~', + ['you_have_hired'] = 'najmul jsi %s', + ['you_have_been_hired'] = 'byl jsi najmut hráčem %s', + ['you_have_fired'] = 'vyhodil jsi %s', + ['you_have_been_fired'] = 'byl jsi vyhozen hráčem %s', + ['you_have_promoted'] = 'byl jsi povýšen hráčem %s na %s', + ['you_have_been_promoted'] = 'byl jsi ~b~povýšen~s~!', +} diff --git a/[esx_addons]/esx_society/locales/en.lua b/[esx_addons]/esx_society/locales/en.lua new file mode 100644 index 00000000..bcba597f --- /dev/null +++ b/[esx_addons]/esx_society/locales/en.lua @@ -0,0 +1,37 @@ +Locales['en'] = { + ['actions'] = 'actions', + ['boss_menu'] = 'boss menu', + ['money_generic'] = '$%s', + ['deposit_amount'] = 'deposit amount', + ['deposit_society_money'] = 'deposit society money', + ['do_you_want_to_recruit'] = 'do you want to recruit %s?', + ['employee'] = 'employee', + ['employee_list'] = 'employee list', + ['employee_management'] = 'employee management', + ['fire'] = 'fire', + ['grade'] = 'grade', + ['have_deposited'] = 'you have deposited ~r~$%s~s~', + ['have_withdrawn'] = 'you have withdrawn ~g~$%s~s~', + ['invalid_amount'] = 'invalid amount', + ['invalid_amount_max'] = 'that salary is not allowed', + ['no'] = 'no', + ['promote'] = 'promote', + ['promote_employee'] = 'promote %s', + ['recruit'] = 'recruit', + ['recruiting'] = 'recruiting', + ['salary_amount'] = 'salary amount', + ['salary_management'] = 'salary management', + ['wash_money'] = 'wash money', + ['wash_money_amount'] = 'amount to wash', + ['withdraw_amount'] = 'witdraw amount', + ['withdraw_society_money'] = 'withdraw society money', + ['yes'] = 'yes', + ['you_have'] = 'you have ~g~$%s~s~ waiting in ~y~money laundering~s~ (24h).', + ['you_have_laundered'] = 'you have ~r~laundered~s~ your money: ~g~$%s~s~', + ['you_have_hired'] = 'you have recruited %s', + ['you_have_been_hired'] = 'you have been hired by %s', + ['you_have_fired'] = 'you have fired %s', + ['you_have_been_fired'] = 'you have been fired from %s', + ['you_have_promoted'] = 'you have promoted %s as %s', + ['you_have_been_promoted'] = 'you have been ~b~promoted~s~!', +} diff --git a/[esx_addons]/esx_society/locales/es.lua b/[esx_addons]/esx_society/locales/es.lua new file mode 100644 index 00000000..9c70ac9d --- /dev/null +++ b/[esx_addons]/esx_society/locales/es.lua @@ -0,0 +1,37 @@ +Locales['es'] = { + ['actions'] = 'Acciones', + ['boss_menu'] = 'Menú de jefe', + ['money_generic'] = '%s$', + ['deposit_amount'] = 'Depositar cantidad', + ['deposit_society_money'] = 'Depositar dinero en la sociedad', + ['do_you_want_to_recruit'] = '¿Quieres contratar a %s?', + ['employee'] = 'Empleado', + ['employee_list'] = 'Lista de empleados', + ['employee_management'] = 'Gestión de empleados', + ['fire'] = 'Despedir', + ['grade'] = 'Cargo', + ['have_deposited'] = 'Has depositado ~r~%s$~s~', + ['have_withdrawn'] = 'Has retirado ~g~%s$~s~', + ['invalid_amount'] = 'Cantidad inválida', + ['invalid_amount_max'] = 'Ese salario no está permitido', + ['no'] = 'No', + ['promote'] = 'Ascender', + ['promote_employee'] = 'Ascender %s', + ['recruit'] = 'Contratar', + ['recruiting'] = 'Contratando', + ['salary_amount'] = 'Cantidad de salario', + ['salary_management'] = 'Gestión de salario', + ['wash_money'] = 'Limpiar dinero', + ['wash_money_amount'] = 'Cantidad para limpiar', + ['withdraw_amount'] = 'Retirar cantidad', + ['withdraw_society_money'] = 'Retirar dinero de la sociedad', + ['yes'] = 'Si', + ['you_have'] = 'tienes ~g~$%s~s~ esperando en el ~y~lavado de dinero~s~ (24h).', + ['you_have_laundered'] = 'has ~r~lavado~s~ tu dinero: ~g~$%s~s~', + ['you_have_hired'] = 'Has contratado a %s', + ['you_have_been_hired'] = 'Has sido contratado por %s', + ['you_have_fired'] = 'Has despedido a %s', + ['you_have_been_fired'] = 'Has sido despedido de %s', + ['you_have_promoted'] = 'Has ascendido a %s a %s', + ['you_have_been_promoted'] = '¡Has sido ~b~ascendido~s~!', +} diff --git a/[esx_addons]/esx_society/locales/fi.lua b/[esx_addons]/esx_society/locales/fi.lua new file mode 100644 index 00000000..d5283c27 --- /dev/null +++ b/[esx_addons]/esx_society/locales/fi.lua @@ -0,0 +1,37 @@ +Locales['fi'] = { + ['actions'] = 'toiminnot', + ['boss_menu'] = 'boss menu', + ['money_generic'] = '€%s', + ['deposit_amount'] = 'talletus summa', + ['deposit_society_money'] = 'talleta yritykselle rahaa', + ['do_you_want_to_recruit'] = 'do you want to recruit %s?', + ['employee'] = 'työntekijä', + ['employee_list'] = 'työntekijä lista', + ['employee_management'] = 'työntekijöiden hallinta', + ['fire'] = 'anna potkut', + ['grade'] = 'taso', + ['have_deposited'] = 'sinä talletit ~r~€%s~s~', + ['have_withdrawn'] = 'sinä nostit ~g~€%s~s~', + ['invalid_amount'] = 'virheellinen summa', + ['invalid_amount_max'] = 'that salary is not allowed', + ['no'] = 'ei', + ['promote'] = 'ylennä', + ['promote_employee'] = 'ylennä henkilö %s', + ['recruit'] = 'rekrytoi', + ['recruiting'] = 'rekrytointi', + ['salary_amount'] = 'palkan määrä', + ['salary_management'] = 'palkan hallinta', + ['wash_money'] = 'pese rahaa', + ['wash_money_amount'] = 'pestävä määrä', + ['withdraw_amount'] = 'nostettava määrä', + ['withdraw_society_money'] = 'nosta yrityksen rahoja', + ['yes'] = 'kyllä', + ['you_have'] = 'you have ~g~€%s~s~ waiting in ~y~money laundering~s~ (24h).', + ['you_have_laundered'] = 'olet ~r~pessyt~s~ rahojasi: ~g~€%s~s~', + ['you_have_hired'] = 'sinä palkkasit henkilön %s', + ['you_have_been_hired'] = 'sinut on palkattu pelaajan %s toimesta', + ['you_have_fired'] = 'sinä annoit potkut pelaajalle %s', + ['you_have_been_fired'] = 'sinulle annettiin potkut työstä %s', + ['you_have_promoted'] = 'sinä ylensit henkilön %s arvolle %s', + ['you_have_been_promoted'] = 'sinut ylennettiin', +} diff --git a/[esx_addons]/esx_society/locales/fr.lua b/[esx_addons]/esx_society/locales/fr.lua new file mode 100644 index 00000000..ad90c3a8 --- /dev/null +++ b/[esx_addons]/esx_society/locales/fr.lua @@ -0,0 +1,37 @@ +Locales['fr'] = { + ['actions'] = 'actions', + ['boss_menu'] = 'patron', + ['money_generic'] = '$%s', + ['deposit_amount'] = 'montant du dépôt', + ['deposit_society_money'] = 'déposer argent société', + ['do_you_want_to_recruit'] = 'Voulez-vous recruter %s?', + ['employee'] = 'employé', + ['employee_list'] = 'liste des employés', + ['employee_management'] = 'gestion employés', + ['fire'] = 'licencier', + ['grade'] = 'grade', + ['have_deposited'] = 'vous avez déposé ~r~$%s~s~', + ['have_withdrawn'] = 'vous avez retiré ~g~$%s~s~', + ['invalid_amount'] = 'montant invalide', + ['invalid_amount_max'] = 'that salary is not allowed', + ['no'] = 'non', + ['promote'] = 'promouvoir', + ['promote_employee'] = 'promouvoir %s', + ['recruit'] = 'recruter', + ['recruiting'] = 'recrutement', + ['salary_amount'] = 'montant du salaire', + ['salary_management'] = 'gestion salaires', + ['wash_money'] = 'blanchir argent', + ['wash_money_amount'] = 'montant à blanchir', + ['withdraw_amount'] = 'montant du retrait', + ['withdraw_society_money'] = 'retirer argent société', + ['yes'] = 'oui', + ['you_have'] = 'vous avez ~g~$%s~s~ en attente de ~r~blanchiement~s~ (24h).', + ['you_have_laundered'] = 'vous avez ~r~blanchi~s~ votre argent : ~g~$%s~s~', + ['you_have_hired'] = 'Vous avez recruté %s', + ['you_have_been_hired'] = 'Vous avez été recruté dans la société %s', + ['you_have_fired'] = 'Vous avez viré %s', + ['you_have_been_fired'] = 'Vous avez été viré de la société %s', + ['you_have_promoted'] = 'Vous avez promu %s en tant que %s', + ['you_have_been_promoted'] = 'Vous avez été promu', +} diff --git a/[esx_addons]/esx_society/locales/nl.lua b/[esx_addons]/esx_society/locales/nl.lua new file mode 100644 index 00000000..c5aa6011 --- /dev/null +++ b/[esx_addons]/esx_society/locales/nl.lua @@ -0,0 +1,38 @@ +Locales['nl'] = { + ['actions'] = 'acties', + ['boss_menu'] = 'baas menu', + ['money_generic'] = '€%s', + ['deposit_amount'] = 'stort hoeveelheid', + ['deposit_society_money'] = 'stort maatschappij geld', + ['do_you_want_to_recruit'] = 'Wil je %s aannemen?', + ['employee'] = 'werknemer', + ['employee_list'] = 'werknemer lijst', + ['employee_management'] = 'werknemer beheer', + ['fire'] = 'ontslaan', + ['grade'] = 'schaal', + ['have_deposited'] = 'je hebt gestort ~r~$%s~s~', + ['have_withdrawn'] = 'je hebt opgenomen ~g~$%s~s~', + ['invalid_amount'] = 'ongeldige hoeveelheid', + ['invalid_amount_max'] = 'dit salaris is niet toegestaan', + ['no'] = 'nee', + ['promote'] = 'promoveer', + ['promote_employee'] = 'promoveer %s', + ['recruit'] = 'werv', + ['recruiting'] = 'werven', + ['salary_amount'] = 'salaris hoeveelheid', + ['salary_management'] = 'salaris beheer', + ['wash_money'] = 'witwas geld', + ['wash_money_amount'] = 'hoeveelheid om wit te wassen', + ['withdraw_amount'] = 'opneem hoeveelheid', + ['withdraw_society_money'] = 'neem maatschappelijk geld op', + ['yes'] = 'ja', + ['you_have'] = 'je hebt ~g~€%s~s~ staan in ~y~geld witwassen~s~ (24h).', + ['you_have_laundered'] = 'je hebt je geld: ~g~€%s~s~ ~r~witgewassen~s~ ', + ['you_have_hired'] = 'je bent gevraagt %s', + ['you_have_been_hired'] = 'je bent aangenomen door %s', + ['you_have_fired'] = 'je bent ontslagen %s', + ['you_have_been_fired'] = 'je bent ondslagen van %s', + ['you_have_promoted'] = 'je hebt gepromoveerd %s naar %s', + ['you_have_been_promoted'] = 'je bent ~b~gepromoveerd~s~!', +} + diff --git a/[esx_addons]/esx_society/locales/pl.lua b/[esx_addons]/esx_society/locales/pl.lua new file mode 100644 index 00000000..f314b4b3 --- /dev/null +++ b/[esx_addons]/esx_society/locales/pl.lua @@ -0,0 +1,37 @@ +Locales['pl'] = { + ['actions'] = 'akcje', + ['boss_menu'] = 'boss menu', + ['money_generic'] = '$%s', + ['deposit_amount'] = 'ilość depozytu', + ['deposit_society_money'] = 'zdeponuj społeczne pieniądze', + ['do_you_want_to_recruit'] = 'czy chcesz zrekrutować %s?', + ['employee'] = 'pracownik', + ['employee_list'] = 'lista pracowników', + ['employee_management'] = 'zarządzanie pracownikami', + ['fire'] = 'zwolnij', + ['grade'] = 'stopień', + ['have_deposited'] = 'zdeponowałeś ~r~$%s~s~', + ['have_withdrawn'] = 'wypłaciłeś ~g~$%s~s~', + ['invalid_amount'] = 'nieprawidłowa wartość', + ['invalid_amount_max'] = 'that salary is not allowed', + ['no'] = 'nie', + ['promote'] = 'awansuj', + ['promote_employee'] = 'awansuj %s', + ['recruit'] = 'zrekrutuj', + ['recruiting'] = 'rekrutacja', + ['salary_amount'] = 'wartość wynagrodzenia', + ['salary_management'] = 'zarządzaj wynagrodzeniem', + ['wash_money'] = 'wypierz pieniądze', + ['wash_money_amount'] = 'wartość do wyprania', + ['withdraw_amount'] = 'wartość wypłaty', + ['withdraw_society_money'] = 'wypłać społeczne pieniądze', + ['yes'] = 'tak', + ['you_have'] = 'masz ~g~%s$~s~ czekanie ~y~w pralni pieniędzmi~s~ (24h).', + ['you_have_laundered'] = '~r~Wyprałeś~s~ twoje pieniądze: ~g~$%s~s~', + ['you_have_hired'] = 'zatrudniłeś %s', + ['you_have_been_hired'] = 'zostałeś zatrudniony przez %s', + ['you_have_fired'] = 'zwolniłeś %s', + ['you_have_been_fired'] = 'zostałeś zwolniony %s', + ['you_have_promoted'] = 'awansowałeś %s na %s', + ['you_have_been_promoted'] = 'zostałeś awansowany', +} diff --git a/[esx_addons]/esx_society/locales/sv.lua b/[esx_addons]/esx_society/locales/sv.lua new file mode 100644 index 00000000..42faccb1 --- /dev/null +++ b/[esx_addons]/esx_society/locales/sv.lua @@ -0,0 +1,37 @@ +Locales['sv'] = { + ['actions'] = 'handlingar', + ['boss_menu'] = 'chefmeny', + ['money_generic'] = '%s SEK', + ['deposit_amount'] = 'insättningsbelopp', + ['deposit_society_money'] = 'insätt samhälls pengar', + ['do_you_want_to_recruit'] = 'vill du anställa %s?', + ['employee'] = 'anställd', + ['employee_list'] = 'anställningslista', + ['employee_management'] = 'medarbetarhantering', + ['fire'] = 'sparka', + ['grade'] = 'grade', + ['have_deposited'] = 'du har satt in ~r~%s SEK~s~', + ['have_withdrawn'] = 'du har tagit ut ~g~%s SEK~s~', + ['invalid_amount'] = 'ogiltigt belopp', + ['invalid_amount_max'] = 'den lönen är inte tillåten', + ['no'] = 'nej', + ['promote'] = 'befodra', + ['promote_employee'] = 'befodra %s', + ['recruit'] = 'rekrytera', + ['recruiting'] = 'rekrytering', + ['salary_amount'] = 'lön belopp', + ['salary_management'] = 'lönhantering', + ['wash_money'] = 'tvätta pengar', + ['wash_money_amount'] = 'belopp att tvätta', + ['withdraw_amount'] = 'Ta ut summan', + ['withdraw_society_money'] = 'ta ut samhällspengar', + ['yes'] = 'ja', + ['you_have'] = 'du har ~g~%s SEK~s~ som väntar på ~y~pengartvätt~s~ (24h).', + ['you_have_laundered'] = 'du har ~r~tvättat~s~ dina pengar: ~g~%s SEK~s~', + ['you_have_hired'] = 'du har anställt ~y~%s~s~', + ['you_have_been_hired'] = 'du har blivit anställd utav %s', + ['you_have_fired'] = 'du har ~r~sparkat~s~ ~y~%s~s~', + ['you_have_been_fired'] = 'du har blivit ~r~sparkad~s~ utav ~y~%s~s~', + ['you_have_promoted'] = 'du har befodrat ~y~%s~s~ till ~b~%s~s~', + ['you_have_been_promoted'] = 'du har blivit ~b~befodrad~s~', +} diff --git a/[esx_addons]/esx_society/locales/tr.lua b/[esx_addons]/esx_society/locales/tr.lua new file mode 100644 index 00000000..4dd19d00 --- /dev/null +++ b/[esx_addons]/esx_society/locales/tr.lua @@ -0,0 +1,37 @@ +Locales['tr'] = { + ['actions'] = 'eylemler', + ['boss_menu'] = 'patron menüsü', + ['money_generic'] = '%s TL', + ['deposit_amount'] = 'yatırılacak miktar', + ['deposit_society_money'] = 'şirkete para yatır', + ['do_you_want_to_recruit'] = '%s adlı kişiyi işe almak istiyor musun?', + ['employee'] = 'işçi', + ['employee_list'] = 'işçi listesi', + ['employee_management'] = 'işçi yönetimi', + ['fire'] = 'kov', + ['grade'] = 'kıdem ver', + ['have_deposited'] = '~r~%s~s~ lira yatırdın', + ['have_withdrawn'] = '~g~$%s~s~ lira çektin', + ['invalid_amount'] = 'miktar hatalı', + ['invalid_amount_max'] = 'bu maaşa izin verilmiyor', + ['no'] = 'hayır', + ['promote'] = 'yükseltme', + ['promote_employee'] = 'yükselt %s', + ['recruit'] = 'işe al', + ['recruiting'] = 'işe alım', + ['salary_amount'] = 'maaş miktarı', + ['salary_management'] = 'maaş yönetimi', + ['wash_money'] = 'para akla', + ['wash_money_amount'] = 'aklanacak miktar', + ['withdraw_amount'] = 'çekilecek miktar', + ['withdraw_society_money'] = 'çekilecek şirket parası', + ['yes'] = 'evet', + ['you_have'] = '~g~%s Lira~s~ para zaten ~y~aklanmayı~s~ bekliyor (24s).', + ['you_have_laundered'] = '~g~%s Lira~s~ para ~r~akladın~s~', + ['you_have_hired'] = '%s adlı kişiyi işe aldın', + ['you_have_been_hired'] = '%s tarafından işe alındın', + ['you_have_fired'] = '%s adlı kişi kovuldu', + ['you_have_been_fired'] = '%s tarafından kovuldun', + ['you_have_promoted'] = '%s olan kıdemin, %s yükseltildi', + ['you_have_been_promoted'] = '~b~Kıdem~s~ aldın!', +} diff --git a/[esx_addons]/esx_society/server/main.lua b/[esx_addons]/esx_society/server/main.lua new file mode 100644 index 00000000..7a8bb583 --- /dev/null +++ b/[esx_addons]/esx_society/server/main.lua @@ -0,0 +1,398 @@ +ESX = nil +local Jobs = {} +local RegisteredSocieties = {} + +TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) +local isLegacy = not not ESX.GetExtendedPlayers + +function GetSociety(name) + for i=1, #RegisteredSocieties, 1 do + if RegisteredSocieties[i].name == name then + return RegisteredSocieties[i] + end + end +end + +MySQL.ready(function() + local result = MySQL.Sync.fetchAll('SELECT * FROM jobs', {}) + + for i=1, #result, 1 do + Jobs[result[i].name] = result[i] + Jobs[result[i].name].grades = {} + end + + local result2 = MySQL.Sync.fetchAll('SELECT * FROM job_grades', {}) + + for i=1, #result2, 1 do + Jobs[result2[i].job_name].grades[tostring(result2[i].grade)] = result2[i] + end +end) + +AddEventHandler('esx_society:registerSociety', function(name, label, account, datastore, inventory, data) + local found = false + + local society = { + name = name, + label = label, + account = account, + datastore = datastore, + inventory = inventory, + data = data + } + + for i=1, #RegisteredSocieties, 1 do + if RegisteredSocieties[i].name == name then + found, RegisteredSocieties[i] = true, society + break + end + end + + if not found then + table.insert(RegisteredSocieties, society) + end +end) + +AddEventHandler('esx_society:getSocieties', function(cb) + cb(RegisteredSocieties) +end) + +AddEventHandler('esx_society:getSociety', function(name, cb) + cb(GetSociety(name)) +end) + +RegisterServerEvent('esx_society:withdrawMoney') +AddEventHandler('esx_society:withdrawMoney', function(societyName, amount) + local xPlayer = ESX.GetPlayerFromId(source) + local society = GetSociety(societyName) + amount = ESX.Math.Round(tonumber(amount)) + + if xPlayer.job.name == society.name then + TriggerEvent('esx_addonaccount:getSharedAccount', society.account, function(account) + if amount > 0 and account.money >= amount then + account.removeMoney(amount) + xPlayer.addMoney(amount) + xPlayer.showNotification(_U('have_withdrawn', ESX.Math.GroupDigits(amount))) + else + xPlayer.showNotification(_U('invalid_amount')) + end + end) + else + print(('esx_society: %s attempted to call withdrawMoney!'):format(xPlayer.identifier)) + end +end) + +RegisterServerEvent('esx_society:depositMoney') +AddEventHandler('esx_society:depositMoney', function(societyName, amount) + local xPlayer = ESX.GetPlayerFromId(source) + local society = GetSociety(societyName) + amount = ESX.Math.Round(tonumber(amount)) + + if xPlayer.job.name == society.name then + if amount > 0 and xPlayer.getMoney() >= amount then + TriggerEvent('esx_addonaccount:getSharedAccount', society.account, function(account) + xPlayer.removeMoney(amount) + xPlayer.showNotification(_U('have_deposited', ESX.Math.GroupDigits(amount))) + account.addMoney(amount) + end) + else + xPlayer.showNotification(_U('invalid_amount')) + end + else + print(('esx_society: %s attempted to call depositMoney!'):format(xPlayer.identifier)) + end +end) + +RegisterServerEvent('esx_society:washMoney') +AddEventHandler('esx_society:washMoney', function(society, amount) + local xPlayer = ESX.GetPlayerFromId(source) + local account = xPlayer.getAccount('black_money') + amount = ESX.Math.Round(tonumber(amount)) + + if xPlayer.job.name == society then + if amount and amount > 0 and account.money >= amount then + xPlayer.removeAccountMoney('black_money', amount) + + MySQL.Async.execute('INSERT INTO society_moneywash (identifier, society, amount) VALUES (@identifier, @society, @amount)', { + ['@identifier'] = xPlayer.identifier, + ['@society'] = society, + ['@amount'] = amount + }, function(rowsChanged) + xPlayer.showNotification(_U('you_have', ESX.Math.GroupDigits(amount))) + end) + else + xPlayer.showNotification(_U('invalid_amount')) + end + else + print(('esx_society: %s attempted to call washMoney!'):format(xPlayer.identifier)) + end +end) + +RegisterServerEvent('esx_society:putVehicleInGarage') +AddEventHandler('esx_society:putVehicleInGarage', function(societyName, vehicle) + local society = GetSociety(societyName) + + TriggerEvent('esx_datastore:getSharedDataStore', society.datastore, function(store) + local garage = store.get('garage') or {} + table.insert(garage, vehicle) + store.set('garage', garage) + end) +end) + +RegisterServerEvent('esx_society:removeVehicleFromGarage') +AddEventHandler('esx_society:removeVehicleFromGarage', function(societyName, vehicle) + local society = GetSociety(societyName) + + TriggerEvent('esx_datastore:getSharedDataStore', society.datastore, function(store) + local garage = store.get('garage') or {} + + for i=1, #garage, 1 do + if garage[i].plate == vehicle.plate then + table.remove(garage, i) + break + end + end + + store.set('garage', garage) + end) +end) + +ESX.RegisterServerCallback('esx_society:getSocietyMoney', function(source, cb, societyName) + local society = GetSociety(societyName) + + if society then + TriggerEvent('esx_addonaccount:getSharedAccount', society.account, function(account) + cb(account.money) + end) + else + cb(0) + end +end) + +ESX.RegisterServerCallback('esx_society:getEmployees', function(source, cb, society) + local employees = {} + + local xPlayers = isLegacy and ESX.GetExtendedPlayers() or ESX.GetPlayers() + for k,v in pairs(xPlayers) do + local xPlayer = type(v) == 'table' and v or ESX.GetPlayerFromId(v) + + local name = GetPlayerName(xPlayer.source) + if Config.EnableESXIdentity then + name = xPlayer.get('firstName') .. ' ' .. xPlayer.get('lastName') + end + + if xPlayer.getJob().name == society then + table.insert(employees, { + name = name, + identifier = xPlayer.identifier, + job = { + name = society, + label = xPlayer.getJob().label, + grade = xPlayer.getJob().grade, + grade_name = xPlayer.getJob().grade_name, + grade_label = xPlayer.getJob().grade_label + } + }) + end + end + + local query = "SELECT identifier, job_grade FROM `users` WHERE `job`=@job ORDER BY job_grade DESC" + + if Config.EnableESXIdentity then + query = "SELECT identifier, job_grade, firstname, lastname FROM `users` WHERE `job`=@job ORDER BY job_grade DESC" + end + + MySQL.Async.fetchAll(query, { + ['@job'] = society + }, function(result) + for k, row in pairs(result) do + local alreadyInTable + local identifier = row.identifier + + for k, v in pairs(employees) do + if v.identifier == identifier then + alreadyInTable = true + end + end + + if not alreadyInTable then + local name = "Name not found." -- maybe this should be a locale instead ¯\_(ツ)_/¯ + + if Config.EnableESXIdentity then + name = row.firstname .. ' ' .. row.lastname + end + + table.insert(employees, { + name = name, + identifier = identifier, + job = { + name = society, + label = Jobs[society].label, + grade = row.job_grade, + grade_name = Jobs[society].grades[tostring(row.job_grade)].name, + grade_label = Jobs[society].grades[tostring(row.job_grade)].label + } + }) + end + end + + cb(employees) + end) + +end) + +ESX.RegisterServerCallback('esx_society:getJob', function(source, cb, society) + local job = json.decode(json.encode(Jobs[society])) + local grades = {} + + for k,v in pairs(job.grades) do + table.insert(grades, v) + end + + table.sort(grades, function(a, b) + return a.grade < b.grade + end) + + job.grades = grades + + cb(job) +end) + +ESX.RegisterServerCallback('esx_society:setJob', function(source, cb, identifier, job, grade, type) + local xPlayer = ESX.GetPlayerFromId(source) + local isBoss = xPlayer.job.grade_name == 'boss' + + if isBoss then + local xTarget = ESX.GetPlayerFromIdentifier(identifier) + + if xTarget then + xTarget.setJob(job, grade) + + if type == 'hire' then + xTarget.showNotification(_U('you_have_been_hired', job)) + elseif type == 'promote' then + xTarget.showNotification(_U('you_have_been_promoted')) + elseif type == 'fire' then + xTarget.showNotification(_U('you_have_been_fired', xTarget.getJob().label)) + end + + cb() + else + MySQL.Async.execute('UPDATE users SET job = @job, job_grade = @job_grade WHERE identifier = @identifier', { + ['@job'] = job, + ['@job_grade'] = grade, + ['@identifier'] = identifier + }, function(rowsChanged) + cb() + end) + end + else + print(('esx_society: %s attempted to setJob'):format(xPlayer.identifier)) + cb() + end +end) + +ESX.RegisterServerCallback('esx_society:setJobSalary', function(source, cb, job, grade, salary) + local xPlayer = ESX.GetPlayerFromId(source) + + if xPlayer.job.name == job and xPlayer.job.grade_name == 'boss' then + if salary <= Config.MaxSalary then + MySQL.Async.execute('UPDATE job_grades SET salary = @salary WHERE job_name = @job_name AND grade = @grade', { + ['@salary'] = salary, + ['@job_name'] = job, + ['@grade'] = grade + }, function(rowsChanged) + Jobs[job].grades[tostring(grade)].salary = salary + + local xPlayers = isLegacy and ESX.GetExtendedPlayers() or ESX.GetPlayers() + for k,v in pairs(xPlayers) do + local xTarget = type(v) == 'table' and v or ESX.GetPlayerFromId(v) + + if xTarget.job.name == job and xTarget.job.grade == grade then + xTarget.setJob(job, grade) + end + end + + cb() + end) + else + print(('esx_society: %s attempted to setJobSalary over config limit!'):format(xPlayer.identifier)) + cb() + end + else + print(('esx_society: %s attempted to setJobSalary'):format(xPlayer.identifier)) + cb() + end +end) + +local getOnlinePlayers = false +local onlinePlayers = {} + +ESX.RegisterServerCallback('esx_society:getOnlinePlayers', function(source, cb) + if getOnlinePlayers == false and next(onlinePlayers) == nil then -- Prevent multiple xPlayer loops from running in quick succession + getOnlinePlayers, onlinePlayers = true, {} + + local xPlayers = isLegacy and ESX.GetExtendedPlayers() or ESX.GetPlayers() + for k,v in pairs(xPlayers) do + local xPlayer = type(v) == 'table' and v or ESX.GetPlayerFromId(v) + + table.insert(onlinePlayers, { + source = xPlayer.source, + identifier = xPlayer.identifier, + name = xPlayer.name, + job = xPlayer.job + }) + end + getOnlinePlayers = false + end + while getOnlinePlayers do Citizen.Wait(50) end -- Wait for the xPlayer loop to finish + cb(onlinePlayers) +end) + +ESX.RegisterServerCallback('esx_society:getVehiclesInGarage', function(source, cb, societyName) + local society = GetSociety(societyName) + + TriggerEvent('esx_datastore:getSharedDataStore', society.datastore, function(store) + local garage = store.get('garage') or {} + cb(garage) + end) +end) + +ESX.RegisterServerCallback('esx_society:isBoss', function(source, cb, job) + cb(isPlayerBoss(source, job)) +end) + +function isPlayerBoss(playerId, job) + local xPlayer = ESX.GetPlayerFromId(playerId) + + if xPlayer.job.name == job and xPlayer.job.grade_name == 'boss' then + return true + else + print(('esx_society: %s attempted open a society boss menu!'):format(xPlayer.identifier)) + return false + end +end + +function WashMoneyCRON(d, h, m) + MySQL.Async.fetchAll('SELECT * FROM society_moneywash', {}, function(result) + for i=1, #result, 1 do + local society = GetSociety(result[i].society) + local xPlayer = ESX.GetPlayerFromIdentifier(result[i].identifier) + + -- add society money + TriggerEvent('esx_addonaccount:getSharedAccount', society.account, function(account) + account.addMoney(result[i].amount) + end) + + -- send notification if player is online + if xPlayer then + xPlayer.showNotification(_U('you_have_laundered', ESX.Math.GroupDigits(result[i].amount))) + end + + MySQL.Async.execute('DELETE FROM society_moneywash WHERE id = @id', { + ['@id'] = result[i].id + }) + end + end) +end + +TriggerEvent('cron:runAt', 3, 0, WashMoneyCRON) diff --git a/[esx_addons]/esx_status/.editorconfig b/[esx_addons]/esx_status/.editorconfig new file mode 100644 index 00000000..9b425256 --- /dev/null +++ b/[esx_addons]/esx_status/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_size = 4 +indent_style = tab +end_of_line = crlf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/[esx_addons]/esx_status/LICENSE b/[esx_addons]/esx_status/LICENSE new file mode 100644 index 00000000..f1e87985 --- /dev/null +++ b/[esx_addons]/esx_status/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + fxserver-esx_status + Copyright (C) 2015 Jérémie N'gadi + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + fxserver-esx_status Copyright (C) 2015 Jérémie N'gadi + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. \ No newline at end of file diff --git a/[esx_addons]/esx_status/README.md b/[esx_addons]/esx_status/README.md new file mode 100644 index 00000000..b678dc87 --- /dev/null +++ b/[esx_addons]/esx_status/README.md @@ -0,0 +1,37 @@ +# esx_status +ESX Status +[INSTALLATION] + +1) CD in your resources/[esx] folder +2) Clone the repository +``` +git clone https://github.com/ESX-Org/esx_status esx_status +``` +3) Import esx_status.sql in your database +4) Add this in your server.cfg : + +``` +start esx_status +``` + +[HOWTO] + +server.lua +```lua + +local name = 'hunger' +local default = 1000000 +local color = '#CFAD0F' + +TriggerEvent('esx_status:registerStatus', name, default, color, + function(status) -- Visible calllback, if it return true the status will be visible + return true + end, + function(status) -- Tick callback, what to do at each tick + status.remove(200) + end, + {remove = 200} -- Client action (add / remove) so the client can be in sync with server +) + + +``` diff --git a/[esx_addons]/esx_status/client/classes/status.lua b/[esx_addons]/esx_status/client/classes/status.lua new file mode 100644 index 00000000..b71f6889 --- /dev/null +++ b/[esx_addons]/esx_status/client/classes/status.lua @@ -0,0 +1,50 @@ +function CreateStatus(name, default, color, visible, tickCallback) + + local self = {} + + self.val = default + self.name = name + self.default = default + self.color = color + self.visible = visible + self.tickCallback = tickCallback + + self._set = function(k, v) + self[k] = v + end + + self._get = function(k) + return self[k] + end + + self.onTick = function() + self.tickCallback(self) + end + + self.set = function(val) + self.val = val + end + + self.add = function(val) + if self.val + val > Config.StatusMax then + self.val = Config.StatusMax + else + self.val = self.val + val + end + end + + self.remove = function(val) + if self.val - val < 0 then + self.val = 0 + else + self.val = self.val - val + end + end + + self.getPercent = function() + return (self.val / Config.StatusMax) * 100 + end + + return self + +end diff --git a/[esx_addons]/esx_status/client/main.lua b/[esx_addons]/esx_status/client/main.lua new file mode 100644 index 00000000..d9beefd7 --- /dev/null +++ b/[esx_addons]/esx_status/client/main.lua @@ -0,0 +1,193 @@ +ESX = nil +local Status, isPaused = {}, false + +Citizen.CreateThread(function() + while ESX == nil do + TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + Citizen.Wait(0) + end +end) + +function GetStatusData(minimal) + local status = {} + + for i=1, #Status, 1 do + if minimal then + table.insert(status, { + name = Status[i].name, + val = Status[i].val, + percent = (Status[i].val / Config.StatusMax) * 100 + }) + else + table.insert(status, { + name = Status[i].name, + val = Status[i].val, + color = Status[i].color, + visible = Status[i].visible(Status[i]), + percent = (Status[i].val / Config.StatusMax) * 100 + }) + end + end + + return status +end + +AddEventHandler('esx_status:registerStatus', function(name, default, color, visible, tickCallback) + local status = CreateStatus(name, default, color, visible, tickCallback) + table.insert(Status, status) +end) + +AddEventHandler('esx_status:unregisterStatus', function(name) + for k,v in ipairs(Status) do + if v.name == name then + table.remove(Status, k) + break + end + end +end) + +RegisterNetEvent('esx:onPlayerLogout') +AddEventHandler('esx:onPlayerLogout', function() + Status = {} + if Config.Display then + SendNUIMessage({ + update = true, + status = Status + }) + end +end) + +RegisterNetEvent('esx_status:load') +AddEventHandler('esx_status:load', function(status) + TriggerEvent('esx_status:loaded') + for i=1, #Status, 1 do + for j=1, #status, 1 do + if Status[i].name == status[j].name then + Status[i].set(status[j].val) + end + end + end + + if Config.Display then TriggerEvent('esx_status:setDisplay', 0.5) end + + Citizen.CreateThread(function() + while #Status > 0 do + for i=1, #Status, 1 do + Status[i].onTick() + end + local data = GetStatusData(true) + + if Config.Display then + local fullData = data + for i=1, #data, 1 do + fullData[i].color = Status[i].color + fullData[i].visible = Status[i].visible(Status[i]) + end + SendNUIMessage({ + update = true, + status = fullData + }) + end + + TriggerEvent('esx_status:onTick', data) + Citizen.Wait(Config.TickTime) + end + end) +end) + +RegisterNetEvent('esx_status:set') +AddEventHandler('esx_status:set', function(name, val) + for i=1, #Status, 1 do + if Status[i].name == name then + Status[i].set(val) + break + end + end + if Config.Display then + SendNUIMessage({ + update = true, + status = GetStatusData() + }) + end +end) + +RegisterNetEvent('esx_status:add') +AddEventHandler('esx_status:add', function(name, val) + for i=1, #Status, 1 do + if Status[i].name == name then + Status[i].add(val) + break + end + end + if Config.Display then + SendNUIMessage({ + update = true, + status = GetStatusData() + }) + end +end) + +RegisterNetEvent('esx_status:remove') +AddEventHandler('esx_status:remove', function(name, val) + for i=1, #Status, 1 do + if Status[i].name == name then + Status[i].remove(val) + break + end + end + if Config.Display then + SendNUIMessage({ + update = true, + status = GetStatusData() + }) + end +end) + +AddEventHandler('esx_status:getStatus', function(name, cb) + for i=1, #Status, 1 do + if Status[i].name == name then + cb(Status[i]) + return + end + end +end) + +AddEventHandler('esx_status:setDisplay', function(val) + SendNUIMessage({ + setDisplay = true, + display = val + }) +end) + +-- Pause menu disable hud display +Citizen.CreateThread(function() + while true do + if Config.Display then + Citizen.Wait(300) + + if IsPauseMenuActive() and not isPaused then + isPaused = true + TriggerEvent('esx_status:setDisplay', 0.0) + elseif not IsPauseMenuActive() and isPaused then + isPaused = false + TriggerEvent('esx_status:setDisplay', 0.5) + end + else Citizen.Wait(1000) end + end +end) + +-- Loading screen off event +AddEventHandler('esx:loadingScreenOff', function() + if not isPaused then + TriggerEvent('esx_status:setDisplay', 0.3) + end +end) + +-- Update server +Citizen.CreateThread(function() + while true do + Citizen.Wait(Config.UpdateInterval) + + TriggerServerEvent('esx_status:update', GetStatusData(true)) + end +end) diff --git a/[esx_addons]/esx_status/config.lua b/[esx_addons]/esx_status/config.lua new file mode 100644 index 00000000..9eb09cb2 --- /dev/null +++ b/[esx_addons]/esx_status/config.lua @@ -0,0 +1,6 @@ +Config = {} + +Config.StatusMax = 1000000 +Config.TickTime = 1000 +Config.UpdateInterval = 10000 +Config.Display = true -- Enable the esx_status bars (disable if you are using another HUD) diff --git a/[esx_addons]/esx_status/esx_status.sql b/[esx_addons]/esx_status/esx_status.sql new file mode 100644 index 00000000..beabf83d --- /dev/null +++ b/[esx_addons]/esx_status/esx_status.sql @@ -0,0 +1,3 @@ +USE `es_extended`; + +ALTER TABLE `users` ADD COLUMN `status` LONGTEXT NULL; diff --git a/[esx_addons]/esx_status/fxmanifest.lua b/[esx_addons]/esx_status/fxmanifest.lua new file mode 100644 index 00000000..fa08f8d4 --- /dev/null +++ b/[esx_addons]/esx_status/fxmanifest.lua @@ -0,0 +1,27 @@ +fx_version 'adamant' + +game 'gta5' + +description 'ESX Status' + +version '1.0.0' + +server_scripts { + '@mysql-async/lib/MySQL.lua', + 'config.lua', + 'server/main.lua' +} + +client_scripts { + 'config.lua', + 'client/classes/status.lua', + 'client/main.lua' +} + +ui_page 'html/ui.html' + +files { + 'html/ui.html', + 'html/css/app.css', + 'html/scripts/app.js' +} diff --git a/[esx_addons]/esx_status/html/css/app.css b/[esx_addons]/esx_status/html/css/app.css new file mode 100644 index 00000000..8b2aacf5 --- /dev/null +++ b/[esx_addons]/esx_status/html/css/app.css @@ -0,0 +1,20 @@ +#status_list { + position: absolute; + left : 23; + bottom : 21%; + width : 14.5%; + opacity: 0.0; +} + +.status { + padding: 1px; + margin: 0.3em; +} + +.status_inner { + padding: 1px; +} + +.status_val { + height : 0.5em; +} \ No newline at end of file diff --git a/[esx_addons]/esx_status/html/scripts/app.js b/[esx_addons]/esx_status/html/scripts/app.js new file mode 100644 index 00000000..a5a53575 --- /dev/null +++ b/[esx_addons]/esx_status/html/scripts/app.js @@ -0,0 +1,59 @@ +(function () { + let status = []; + + let renderStatus = function () { + + $('#status_list').html(''); + + for (let i = 0; i < status.length; i++) { + + if (!status[i].visible) { + continue; + } + + let statusDiv = $( + '
' + + '
' + + '
' + + '
' + + '
'); + + statusDiv.find('.status_inner') + .css({ 'border': '1px solid ' + status[i].color }) + ; + + statusDiv.find('.status_val') + .css({ + 'background-color': status[i].color, + 'width': (status[i].percent) + '%' + }) + ; + + $('#status_list').append(statusDiv); + } + + }; + + window.onData = function (data) { + if (data.update) { + status.length = 0; + + for (let i = 0; i < data.status.length; i++) { + status.push(data.status[i]); + } + + renderStatus(); + } + + if (data.setDisplay) { + $('#status_list').css({ 'opacity': data.display }); + } + }; + + window.onload = function (e) { + window.addEventListener('message', function (event) { + onData(event.data); + }); + }; + +})(); diff --git a/[esx_addons]/esx_status/html/ui.html b/[esx_addons]/esx_status/html/ui.html new file mode 100644 index 00000000..300c6ec2 --- /dev/null +++ b/[esx_addons]/esx_status/html/ui.html @@ -0,0 +1,16 @@ + + + + + + + + + +
+ + + + + + \ No newline at end of file diff --git a/[esx_addons]/esx_status/server/classes/status.lua b/[esx_addons]/esx_status/server/classes/status.lua new file mode 100644 index 00000000..226daa60 --- /dev/null +++ b/[esx_addons]/esx_status/server/classes/status.lua @@ -0,0 +1,56 @@ +function CreateStatus(xPlayer, name, default, color, visible, tickCallback, clientAction) + + local self = {} + + self.val = default + self.xPlayer = xPlayer + self.name = name + self.default = default + self.color = color + self.visible = visible + self.tickCallback = tickCallback + self.clientAction = clientAction + + self._set = function(k, v) + self[k] = v + end + + self._get = function(k) + return self[k] + end + + self.onTick = function() + self.tickCallback(self) + end + + self.set = function(val) + self.val = val + end + + self.add = function(val) + if self.val + val > Config.StatusMax then + self.val = Config.StatusMax + else + self.val = self.val + val + end + end + + self.remove = function(val) + if self.val - val < 0 then + self.val = 0 + else + self.val = self.val - val + end + end + + self.getPercent = function() + return (self.val / Config.StatusMax) * 100 + end + + self.updateClient = function() + TriggerEvent('esx_status:updateClient', self.xPlayer.source) + end + + return self + +end diff --git a/[esx_addons]/esx_status/server/main.lua b/[esx_addons]/esx_status/server/main.lua new file mode 100644 index 00000000..0d80cc83 --- /dev/null +++ b/[esx_addons]/esx_status/server/main.lua @@ -0,0 +1,126 @@ +ESX = nil + +TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) +local isLegacy = not not ESX.GetExtendedPlayers + +AddEventHandler('onResourceStart', function(resourceName) + if (GetCurrentResourceName() ~= resourceName) then + return + end + + local xPlayers = isLegacy and ESX.GetExtendedPlayers() or ESX.GetPlayers() + + for k,v in pairs(xPlayers) do + local xPlayer = type(v) == 'table' and v or ESX.GetPlayerFromId(v) + MySQL.Async.fetchAll('SELECT status FROM users WHERE identifier = @identifier', { + ['@identifier'] = xPlayer.identifier + }, function(result) + local data = {} + + if result[1].status then + data = json.decode(result[1].status) + end + + xPlayer.set('status', data) + TriggerClientEvent('esx_status:load', k, data) + end) + end +end) + +AddEventHandler('esx:playerLoaded', function(playerId, xPlayer) + MySQL.Async.fetchAll('SELECT status FROM users WHERE identifier = @identifier', { + ['@identifier'] = xPlayer.identifier + }, function(result) + local data = {} + + if result[1].status then + data = json.decode(result[1].status) + end + + xPlayer.set('status', data) + TriggerClientEvent('esx_status:load', playerId, data) + end) +end) + +AddEventHandler('esx:playerDropped', function(playerId, reason) + local xPlayer = ESX.GetPlayerFromId(playerId) + local status = xPlayer.get('status') + + MySQL.Async.execute('UPDATE users SET status = @status WHERE identifier = @identifier', { + ['@status'] = json.encode(status), + ['@identifier'] = xPlayer.identifier + }) +end) + +AddEventHandler('esx_status:getStatus', function(playerId, statusName, cb) + local xPlayer = ESX.GetPlayerFromId(playerId) + local status = xPlayer.get('status') + + for i=1, #status, 1 do + if status[i].name == statusName then + cb(status[i]) + break + end + end +end) + +RegisterServerEvent('esx_status:update') +AddEventHandler('esx_status:update', function(status) + local xPlayer = ESX.GetPlayerFromId(source) + + if xPlayer then + xPlayer.set('status', status) + end +end) + +Citizen.CreateThread(function() + while(true) do + Citizen.Wait(10 * 60 * 1000) + + SaveData() + + end + +end) + +function SaveData() + -- Example of a bulk update statement that we are building below + --[[ + UPDATE users + SET status = (case when identifier = 'license:123' then '{hunger:45, thirst:23}' + when identifier = 'license:456' then '{hunger:1000, thirst:1000}' + when identifier = 'license:789' then '{hunger:1000, thirst:1000}' + end) + WHERE identifier in ('license:123', 'license:456', 'license:789') + + ]] + local updateStatement = 'UPDATE users SET status = (case %s end) where identifier in (%s)' + local whenList = '' + local whereList = '' + local firstItem = true + local playerCount = 0 + + local xPlayers = isLegacy and ESX.GetExtendedPlayers() or ESX.GetPlayers() + + for k,v in pairs(xPlayers) do + local xPlayer = type(v) == 'table' and v or ESX.GetPlayerFromId(v) + local status = xPlayer.get('status') + + whenList = whenList .. string.format('when identifier = \'%s\' then \'%s\' ', xPlayer.identifier, json.encode(status)) + + if firstItem == false then + whereList = whereList .. ', ' + end + whereList = whereList .. string.format('\'%s\'', xPlayer.identifier) + + firstItem = false + playerCount = playerCount + 1 + end + + if playerCount > 0 then + local sql = string.format(updateStatement, whenList, whereList) + MySQL.Async.execute(sql) + + end + +end diff --git a/[esx_addons]/esx_taxijob/.editorconfig b/[esx_addons]/esx_taxijob/.editorconfig new file mode 100644 index 00000000..9b425256 --- /dev/null +++ b/[esx_addons]/esx_taxijob/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_size = 4 +indent_style = tab +end_of_line = crlf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/[esx_addons]/esx_taxijob/LICENSE b/[esx_addons]/esx_taxijob/LICENSE new file mode 100644 index 00000000..4d837ce0 --- /dev/null +++ b/[esx_addons]/esx_taxijob/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + fxserver-esx_taxijob + Copyright (C) 2015 Jérémie N'gadi + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + fxserver-esx_taxijob Copyright (C) 2015 Jérémie N'gadi + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. \ No newline at end of file diff --git a/[esx_addons]/esx_taxijob/README.md b/[esx_addons]/esx_taxijob/README.md new file mode 100644 index 00000000..cc46a37a --- /dev/null +++ b/[esx_addons]/esx_taxijob/README.md @@ -0,0 +1,49 @@ +# esx_taxijob + +ESX Taxi Job adds driving cabs as a service, and more including NPC missions. + +## Requirements + +* Auto mode + * [esx_service](https://github.com/ESX-Org/esx_service) + +* Player management (billing and boss actions) + * [esx_society](https://github.com/ESX-Org/esx_society) + * [esx_billing](https://github.com/ESX-Org/esx_billing) + +## Download & Installation + +### Using [fvm](https://github.com/qlaffont/fvm-installer) +``` +fvm install --save --folder=esx esx-org/esx_taxijob +``` + +### Using Git +``` +cd resources +git clone https://github.com/ESX-Org/esx_taxijob [esx]/esx_taxijob +``` + +### Manually +- Download https://github.com/ESX-Org/esx_taxijob/archive/master.zip +- Put it in the `[esx]` directory + +## Installation +- Import `esx_taxijob.sql` in your database +- If you want player management you have to set `Config.EnablePlayerManagement` to `true` in `config.lua` +- Add this to your `server.cfg`: +``` +start esx_taxijob +``` + +# Legal +### License +esx_taxijob + +Copyright (C) 2015-2020 Jérémie N'gadi + +This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version. + +This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details. + +You should have received a copy Of the GNU General Public License along with this program. If Not, see http://www.gnu.org/licenses/. diff --git a/[esx_addons]/esx_taxijob/client/main.lua b/[esx_addons]/esx_taxijob/client/main.lua new file mode 100644 index 00000000..6dce9572 --- /dev/null +++ b/[esx_addons]/esx_taxijob/client/main.lua @@ -0,0 +1,764 @@ +local HasAlreadyEnteredMarker, OnJob, IsNearCustomer, CustomerIsEnteringVehicle, CustomerEnteredVehicle, IsDead, CurrentActionData = false, false, false, false, false, false, {} +local CurrentCustomer, CurrentCustomerBlip, DestinationBlip, targetCoords, LastZone, CurrentAction, CurrentActionMsg + +ESX = nil + +Citizen.CreateThread(function() + while ESX == nil do + TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + Citizen.Wait(0) + end + + while ESX.GetPlayerData().job == nil do + Citizen.Wait(10) + end + + ESX.PlayerData = ESX.GetPlayerData() +end) + +function DrawSub(msg, time) + ClearPrints() + BeginTextCommandPrint('STRING') + AddTextComponentSubstringPlayerName(msg) + EndTextCommandPrint(time, 1) +end + +function ShowLoadingPromt(msg, time, type) + Citizen.CreateThread(function() + Citizen.Wait(0) + + BeginTextCommandBusyspinnerOn('STRING') + AddTextComponentSubstringPlayerName(msg) + EndTextCommandBusyspinnerOn(type) + Citizen.Wait(time) + + BusyspinnerOff() + end) +end + +function GetRandomWalkingNPC() + local search = {} + local peds = ESX.Game.GetPeds() + + for i=1, #peds, 1 do + if IsPedHuman(peds[i]) and IsPedWalking(peds[i]) and not IsPedAPlayer(peds[i]) then + table.insert(search, peds[i]) + end + end + + if #search > 0 then + return search[GetRandomIntInRange(1, #search)] + end + + for i=1, 250, 1 do + local ped = GetRandomPedAtCoord(0.0, 0.0, 0.0, math.huge + 0.0, math.huge + 0.0, math.huge + 0.0, 26) + + if DoesEntityExist(ped) and IsPedHuman(ped) and IsPedWalking(ped) and not IsPedAPlayer(ped) then + table.insert(search, ped) + end + end + + if #search > 0 then + return search[GetRandomIntInRange(1, #search)] + end +end + +function ClearCurrentMission() + if DoesBlipExist(CurrentCustomerBlip) then + RemoveBlip(CurrentCustomerBlip) + end + + if DoesBlipExist(DestinationBlip) then + RemoveBlip(DestinationBlip) + end + + CurrentCustomer = nil + CurrentCustomerBlip = nil + DestinationBlip = nil + IsNearCustomer = false + CustomerIsEnteringVehicle = false + CustomerEnteredVehicle = false + targetCoords = nil +end + +function StartTaxiJob() + ShowLoadingPromt(_U('taking_service'), 5000, 3) + ClearCurrentMission() + + OnJob = true +end + +function StopTaxiJob() + local playerPed = PlayerPedId() + + if IsPedInAnyVehicle(playerPed, false) and CurrentCustomer ~= nil then + local vehicle = GetVehiclePedIsIn(playerPed, false) + TaskLeaveVehicle(CurrentCustomer, vehicle, 0) + + if CustomerEnteredVehicle then + TaskGoStraightToCoord(CurrentCustomer, targetCoords.x, targetCoords.y, targetCoords.z, 1.0, -1, 0.0, 0.0) + end + end + + ClearCurrentMission() + OnJob = false + DrawSub(_U('mission_complete'), 5000) +end + +function OpenCloakroom() + ESX.UI.Menu.CloseAll() + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'taxi_cloakroom', { + title = _U('cloakroom_menu'), + align = 'top-left', + elements = { + {label = _U('wear_citizen'), value = 'wear_citizen'}, + {label = _U('wear_work'), value = 'wear_work'} + }}, function(data, menu) + if data.current.value == 'wear_citizen' then + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin) + TriggerEvent('skinchanger:loadSkin', skin) + end) + elseif data.current.value == 'wear_work' then + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) + if skin.sex == 0 then + TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_male) + else + TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_female) + end + end) + end + end, function(data, menu) + menu.close() + + CurrentAction = 'cloakroom' + CurrentActionMsg = _U('cloakroom_prompt') + CurrentActionData = {} + end) +end + +function OpenVehicleSpawnerMenu() + ESX.UI.Menu.CloseAll() + + local elements = {} + + if Config.EnableSocietyOwnedVehicles then + + ESX.TriggerServerCallback('esx_society:getVehiclesInGarage', function(vehicles) + + for i=1, #vehicles, 1 do + table.insert(elements, { + label = GetDisplayNameFromVehicleModel(vehicles[i].model) .. ' [' .. vehicles[i].plate .. ']', + value = vehicles[i] + }) + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_spawner', { + title = _U('spawn_veh'), + align = 'top-left', + elements = elements + }, function(data, menu) + if not ESX.Game.IsSpawnPointClear(Config.Zones.VehicleSpawnPoint.Pos, 5.0) then + ESX.ShowNotification(_U('spawnpoint_blocked')) + return + end + + menu.close() + + local vehicleProps = data.current.value + ESX.Game.SpawnVehicle(vehicleProps.model, Config.Zones.VehicleSpawnPoint.Pos, Config.Zones.VehicleSpawnPoint.Heading, function(vehicle) + ESX.Game.SetVehicleProperties(vehicle, vehicleProps) + local playerPed = PlayerPedId() + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + end) + + TriggerServerEvent('esx_society:removeVehicleFromGarage', 'taxi', vehicleProps) + end, function(data, menu) + CurrentAction = 'vehicle_spawner' + CurrentActionMsg = _U('spawner_prompt') + CurrentActionData = {} + + menu.close() + end) + end, 'taxi') + + else -- not society vehicles + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_spawner', { + title = _U('spawn_veh'), + align = 'top-left', + elements = Config.AuthorizedVehicles + }, function(data, menu) + if not ESX.Game.IsSpawnPointClear(Config.Zones.VehicleSpawnPoint.Pos, 5.0) then + ESX.ShowNotification(_U('spawnpoint_blocked')) + return + end + + menu.close() + ESX.Game.SpawnVehicle(data.current.model, Config.Zones.VehicleSpawnPoint.Pos, Config.Zones.VehicleSpawnPoint.Heading, function(vehicle) + local playerPed = PlayerPedId() + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + end) + end, function(data, menu) + CurrentAction = 'vehicle_spawner' + CurrentActionMsg = _U('spawner_prompt') + CurrentActionData = {} + + menu.close() + end) + end +end + +function DeleteJobVehicle() + local playerPed = PlayerPedId() + + if Config.EnableSocietyOwnedVehicles then + local vehicleProps = ESX.Game.GetVehicleProperties(CurrentActionData.vehicle) + TriggerServerEvent('esx_society:putVehicleInGarage', 'taxi', vehicleProps) + ESX.Game.DeleteVehicle(CurrentActionData.vehicle) + else + if IsInAuthorizedVehicle() then + ESX.Game.DeleteVehicle(CurrentActionData.vehicle) + + if Config.MaxInService ~= -1 then + TriggerServerEvent('esx_service:disableService', 'taxi') + end + else + ESX.ShowNotification(_U('only_taxi')) + end + end +end + +function OpenTaxiActionsMenu() + local elements = { + {label = _U('deposit_stock'), value = 'put_stock'}, + {label = _U('take_stock'), value = 'get_stock'} + } + + if Config.EnablePlayerManagement and ESX.PlayerData.job ~= nil and ESX.PlayerData.job.grade_name == 'boss' then + table.insert(elements, {label = _U('boss_actions'), value = 'boss_actions'}) + end + + ESX.UI.Menu.CloseAll() + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'taxi_actions', { + title = _U('taxi'), + align = 'top-left', + elements = elements + }, function(data, menu) + + if data.current.value == 'put_stock' then + OpenPutStocksMenu() + elseif data.current.value == 'get_stock' then + OpenGetStocksMenu() + elseif data.current.value == 'boss_actions' then + TriggerEvent('esx_society:openBossMenu', 'taxi', function(data, menu) + menu.close() + end) + end + + end, function(data, menu) + menu.close() + + CurrentAction = 'taxi_actions_menu' + CurrentActionMsg = _U('press_to_open') + CurrentActionData = {} + end) +end + +function OpenMobileTaxiActionsMenu() + ESX.UI.Menu.CloseAll() + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'mobile_taxi_actions', { + title = _U('taxi'), + align = 'top-left', + elements = { + {label = _U('billing'), value = 'billing'}, + {label = _U('start_job'), value = 'start_job'} + }}, function(data, menu) + if data.current.value == 'billing' then + + ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'billing', { + title = _U('invoice_amount') + }, function(data, menu) + + local amount = tonumber(data.value) + if amount == nil then + ESX.ShowNotification(_U('amount_invalid')) + else + menu.close() + local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() + if closestPlayer == -1 or closestDistance > 3.0 then + ESX.ShowNotification(_U('no_players_near')) + else + TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(closestPlayer), 'society_taxi', 'Taxi', amount) + ESX.ShowNotification(_U('billing_sent')) + end + + end + + end, function(data, menu) + menu.close() + end) + + elseif data.current.value == 'start_job' then + if OnJob then + StopTaxiJob() + else + if ESX.PlayerData.job ~= nil and ESX.PlayerData.job.name == 'taxi' then + local playerPed = PlayerPedId() + local vehicle = GetVehiclePedIsIn(playerPed, false) + + if IsPedInAnyVehicle(playerPed, false) and GetPedInVehicleSeat(vehicle, -1) == playerPed then + if tonumber(ESX.PlayerData.job.grade) >= 3 then + StartTaxiJob() + else + if IsInAuthorizedVehicle() then + StartTaxiJob() + else + ESX.ShowNotification(_U('must_in_taxi')) + end + end + else + if tonumber(ESX.PlayerData.job.grade) >= 3 then + ESX.ShowNotification(_U('must_in_vehicle')) + else + ESX.ShowNotification(_U('must_in_taxi')) + end + end + end + end + end + end, function(data, menu) + menu.close() + end) +end + +function IsInAuthorizedVehicle() + local playerPed = PlayerPedId() + local vehModel = GetEntityModel(GetVehiclePedIsIn(playerPed, false)) + + for i=1, #Config.AuthorizedVehicles, 1 do + if vehModel == GetHashKey(Config.AuthorizedVehicles[i].model) then + return true + end + end + + return false +end + +function OpenGetStocksMenu() + ESX.TriggerServerCallback('esx_taxijob:getStockItems', function(items) + local elements = {} + + for i=1, #items, 1 do + table.insert(elements, { + label = 'x' .. items[i].count .. ' ' .. items[i].label, + value = items[i].name + }) + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'stocks_menu', { + title = _U('taxi_stock'), + align = 'top-left', + elements = elements + }, function(data, menu) + local itemName = data.current.value + + ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'stocks_menu_get_item_count', { + title = _U('quantity') + }, function(data2, menu2) + local count = tonumber(data2.value) + + if count == nil then + ESX.ShowNotification(_U('quantity_invalid')) + else + menu2.close() + menu.close() + + -- todo: refresh on callback + TriggerServerEvent('esx_taxijob:getStockItem', itemName, count) + Citizen.Wait(1000) + OpenGetStocksMenu() + end + end, function(data2, menu2) + menu2.close() + end) + end, function(data, menu) + menu.close() + end) + end) +end + +function OpenPutStocksMenu() + ESX.TriggerServerCallback('esx_taxijob:getPlayerInventory', function(inventory) + local elements = {} + + for i=1, #inventory.items, 1 do + local item = inventory.items[i] + + if item.count > 0 then + table.insert(elements, { + label = item.label .. ' x' .. item.count, + type = 'item_standard', + value = item.name + }) + end + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'stocks_menu', { + title = _U('inventory'), + align = 'top-left', + elements = elements + }, function(data, menu) + local itemName = data.current.value + + ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'stocks_menu_put_item_count', { + title = _U('quantity') + }, function(data2, menu2) + local count = tonumber(data2.value) + + if count == nil then + ESX.ShowNotification(_U('quantity_invalid')) + else + menu2.close() + menu.close() + + -- todo: refresh on callback + TriggerServerEvent('esx_taxijob:putStockItems', itemName, count) + Citizen.Wait(1000) + OpenPutStocksMenu() + end + end, function(data2, menu2) + menu2.close() + end) + end, function(data, menu) + menu.close() + end) + end) +end + +RegisterNetEvent('esx:playerLoaded') +AddEventHandler('esx:playerLoaded', function(xPlayer) + ESX.PlayerData = xPlayer +end) + +RegisterNetEvent('esx:setJob') +AddEventHandler('esx:setJob', function(job) + ESX.PlayerData.job = job +end) + +AddEventHandler('esx_taxijob:hasEnteredMarker', function(zone) + if zone == 'VehicleSpawner' then + CurrentAction = 'vehicle_spawner' + CurrentActionMsg = _U('spawner_prompt') + CurrentActionData = {} + elseif zone == 'VehicleDeleter' then + local playerPed = PlayerPedId() + local vehicle = GetVehiclePedIsIn(playerPed, false) + + if IsPedInAnyVehicle(playerPed, false) and GetPedInVehicleSeat(vehicle, -1) == playerPed then + CurrentAction = 'delete_vehicle' + CurrentActionMsg = _U('store_veh') + CurrentActionData = { vehicle = vehicle } + end + elseif zone == 'TaxiActions' then + CurrentAction = 'taxi_actions_menu' + CurrentActionMsg = _U('press_to_open') + CurrentActionData = {} + + elseif zone == 'Cloakroom' then + CurrentAction = 'cloakroom' + CurrentActionMsg = _U('cloakroom_prompt') + CurrentActionData = {} + end +end) + +AddEventHandler('esx_taxijob:hasExitedMarker', function(zone) + ESX.UI.Menu.CloseAll() + CurrentAction = nil +end) + +RegisterNetEvent('esx_phone:loaded') +AddEventHandler('esx_phone:loaded', function(phoneNumber, contacts) + local specialContact = { + name = _U('phone_taxi'), + number = 'taxi', + base64Icon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAGGElEQVR4XsWWW2gd1xWGv7Vn5pyRj47ut8iOYlmyWxw1KSZN4riOW6eFuCYldaBtIL1Ag4NNmt5ICORCaNKXlF6oCy0hpSoJKW4bp7Sk6YNb01RuLq4d0pQ0kWQrshVJ1uX46HJ0zpy5rCKfQYgjCUs4kA+GtTd786+ftW8jqsqHibB6TLZn2zeq09ZTWAIWCxACoTI1E+6v+eSpXwHRqkVZPcmqlBzCApLQ8dk3IWVKMQlYcHG81OODNmD6D7d9VQrTSbwsH73lFKePtvOxXSfn48U+Xpb58fl5gPmgl6DiR19PZN4+G7iODY4liIAACqiCHyp+AFvb7ML3uot1QP5yDUim292RtIqfU6Lr8wFVDVV8AsPKRDAxzYkKm2kj5sSFuUT3+v2FXkDXakD6f+7c1NGS7Ml0Pkah6jq8mhvwUy7Cyijg5Aoks6/hTp+k7vRjDJ73dmw8WHxlJRM2y5Nsb3GPDuzsZURbGMsUmRkoUPByCMrKCG7SobJiO01X7OKq6utoe3XX34BaoLDaCljj3faTcu3j3z3T+iADwzNYEmKIWcGAIAtqqkKAxZa2Sja/tY+59/7y48aveQ8A4Woq4Fa3bj7Q1/EgwWRAZ52NMTYCWAZEwIhBUEQgUiVQ8IpKvqj4kVJCyGRCRrb+hvap+gPAo0DuUhWQfx2q29u+t/vPmarbCLwII7qQTEQRLbUtBJ2PAkZARBADqkLBV/I+BGrhpoSN577FWz3P3XbTvRMvAlpuwC4crv5jwtK9RAFSu46+G8cRwESxQ+K2gESAgCiIASHuA8YCBdSUohdCKGCF0H6iGc3MgrEphvKi+6Wp24HABioSjuxFARGobyJ5OMXEiGHW6iLR0EmifhPJDddj3CoqtuwEZSkCc73/RAvTeEOvU5w8gz/Zj2TfoLFFibZvQrI5EOFiPqgAZmzApTINKKgPiW20ffkXtPXfA9Ysmf5/kHn/T0z8e5rpCS5JVQNUN1ayfn2a+qvT2JWboOOXMPg0ms6C2IAAWTc2ACPeupdbm5yb8XNQczOM90DOB0uoa01Ttz5FZ6IL3Ctg9DUIg7Lto2DZ0HIDFEbAz4AaiBRyxZJe9U7kQg84KYbH/JeJESANXPXwXdWffvzu1p+x5VE4/ST4EyAOoEAI6WsAhdx/AYulhJDqAgRm/hPPEVAfnAboeAB6v88jTw/f98SzU8eAwbgC5IGRg3vsW3E7YewYzJwF4wAhikJURGqvBO8ouAFIxBI0gqgPEp9B86+ASSAIEEHhbEnX7eTgnrFbn3iW5+K82EAA+M2V+d2EeRj9K/izIBYgJZGwCO4Gzm/uRQOwDEsI41PSfPZ+xJsBKwFo6dOwpJvezMU84Md5sSmRCM51uacGbUKvHWEjAKIelXaGJqePyopjzFTdx6Ef/gDbjo3FKEoQKN+8/yEqRt8jf67IaNDBnF9FZFwERRGspMM20+XC64nym9AMhSE1G7fjbb0bCQsISi6vFCdPMPzuUwR9AcmOKQ7cew+WZcq3IGEYMZeb4p13sjjmU4TX7Cfdtp0oDAFBbZfk/37N0MALAKbcAKaY4yPeuwy3t2J8MAKDIxDVd1Lz8Ts599vb8Wameen532GspRWIQmXPHV8k0BquvPP3TOSgsRmiCFRAHWh9420Gi7nl34JaBen7O7UWRMD740AQ7yEf8nW78TIeN+7+PCIsOYaqMJHxqKtpJ++D+DA5ARsawEmASqzv1Cz7FjRpbt951tUAOcAHdNEUC7C5NAJo7Dws03CAFMxlkdSRZmCMxaq8ejKuVwSqIJfzA61LmyIgBoxZfgmYmQazKLGumHitRso0ZVkD0aE/FI7UrYv2WUYXjo0ihNhEatA1GBEUIxEWAcKCHhHCVMG8AETlda0ENn3hrm+/6Zh47RBCtXn+mZ/sAXzWjnPHV77zkiXBgl6gFkee+em1wBlgdnEF8sCF5moLI7KwlSIMwABwgbVT21htMNjleheAfPkShEBh/PzQccexdxBT9IPjQAYYZ+3o2OjQ8cQiPb+kVwBCliENXA3sAm6Zj3E/zaq4fD07HmwEmuKYXsUFcDl6Hz7/B1RGfEbPim/bAAAAAElFTkSuQmCC', + } + + TriggerEvent('esx_phone:addSpecialContact', specialContact.name, specialContact.number, specialContact.base64Icon) +end) + +-- Create Blips +Citizen.CreateThread(function() + local blip = AddBlipForCoord(Config.Zones.TaxiActions.Pos.x, Config.Zones.TaxiActions.Pos.y, Config.Zones.TaxiActions.Pos.z) + + SetBlipSprite (blip, 198) + SetBlipDisplay(blip, 4) + SetBlipScale (blip, 1.0) + SetBlipColour (blip, 5) + SetBlipAsShortRange(blip, true) + + BeginTextCommandSetBlipName('STRING') + AddTextComponentSubstringPlayerName(_U('blip_taxi')) + EndTextCommandSetBlipName(blip) +end) + +-- Enter / Exit marker events, and draw markers +Citizen.CreateThread(function() + while true do + Citizen.Wait(0) + + if ESX.PlayerData.job and ESX.PlayerData.job.name == 'taxi' then + local coords = GetEntityCoords(PlayerPedId()) + local isInMarker, letSleep, currentZone = false, true + + for k,v in pairs(Config.Zones) do + local distance = GetDistanceBetweenCoords(coords, v.Pos.x, v.Pos.y, v.Pos.z, true) + + if v.Type ~= -1 and distance < Config.DrawDistance then + letSleep = false + DrawMarker(v.Type, v.Pos.x, v.Pos.y, v.Pos.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, v.Size.x, v.Size.y, v.Size.z, v.Color.r, v.Color.g, v.Color.b, 100, false, false, 2, v.Rotate, nil, nil, false) + end + + if distance < v.Size.x then + isInMarker, currentZone = true, k + end + end + + if (isInMarker and not HasAlreadyEnteredMarker) or (isInMarker and LastZone ~= currentZone) then + HasAlreadyEnteredMarker, LastZone = true, currentZone + TriggerEvent('esx_taxijob:hasEnteredMarker', currentZone) + end + + if not isInMarker and HasAlreadyEnteredMarker then + HasAlreadyEnteredMarker = false + TriggerEvent('esx_taxijob:hasExitedMarker', LastZone) + end + + if letSleep then + Citizen.Wait(500) + end + else + Citizen.Wait(1000) + end + end +end) + +-- Taxi Job +Citizen.CreateThread(function() + while true do + + Citizen.Wait(0) + local playerPed = PlayerPedId() + + if OnJob then + if CurrentCustomer == nil then + DrawSub(_U('drive_search_pass'), 5000) + + if IsPedInAnyVehicle(playerPed, false) and GetEntitySpeed(playerPed) > 0 then + local waitUntil = GetGameTimer() + GetRandomIntInRange(30000, 45000) + + while OnJob and waitUntil > GetGameTimer() do + Citizen.Wait(0) + end + + if OnJob and IsPedInAnyVehicle(playerPed, false) and GetEntitySpeed(playerPed) > 0 then + CurrentCustomer = GetRandomWalkingNPC() + + if CurrentCustomer ~= nil then + CurrentCustomerBlip = AddBlipForEntity(CurrentCustomer) + + SetBlipAsFriendly(CurrentCustomerBlip, true) + SetBlipColour(CurrentCustomerBlip, 2) + SetBlipCategory(CurrentCustomerBlip, 3) + SetBlipRoute(CurrentCustomerBlip, true) + + SetEntityAsMissionEntity(CurrentCustomer, true, false) + ClearPedTasksImmediately(CurrentCustomer) + SetBlockingOfNonTemporaryEvents(CurrentCustomer, true) + + local standTime = GetRandomIntInRange(60000, 180000) + TaskStandStill(CurrentCustomer, standTime) + + ESX.ShowNotification(_U('customer_found')) + end + end + end + else + if IsPedFatallyInjured(CurrentCustomer) then + ESX.ShowNotification(_U('client_unconcious')) + + if DoesBlipExist(CurrentCustomerBlip) then + RemoveBlip(CurrentCustomerBlip) + end + + if DoesBlipExist(DestinationBlip) then + RemoveBlip(DestinationBlip) + end + + SetEntityAsMissionEntity(CurrentCustomer, false, true) + + CurrentCustomer, CurrentCustomerBlip, DestinationBlip, IsNearCustomer, CustomerIsEnteringVehicle, CustomerEnteredVehicle, targetCoords = nil, nil, nil, false, false, false, nil + end + + if IsPedInAnyVehicle(playerPed, false) then + local vehicle = GetVehiclePedIsIn(playerPed, false) + local playerCoords = GetEntityCoords(playerPed) + local customerCoords = GetEntityCoords(CurrentCustomer) + local customerDistance = #(playerCoords - customerCoords) + + if IsPedSittingInVehicle(CurrentCustomer, vehicle) then + if CustomerEnteredVehicle then + local targetDistance = #(playerCoords - targetCoords) + + if targetDistance <= 10.0 then + TaskLeaveVehicle(CurrentCustomer, vehicle, 0) + + ESX.ShowNotification(_U('arrive_dest')) + + TaskGoStraightToCoord(CurrentCustomer, targetCoords.x, targetCoords.y, targetCoords.z, 1.0, -1, 0.0, 0.0) + SetEntityAsMissionEntity(CurrentCustomer, false, true) + TriggerServerEvent('esx_taxijob:success') + RemoveBlip(DestinationBlip) + + local scope = function(customer) + ESX.SetTimeout(60000, function() + DeletePed(customer) + end) + end + + scope(CurrentCustomer) + + CurrentCustomer, CurrentCustomerBlip, DestinationBlip, IsNearCustomer, CustomerIsEnteringVehicle, CustomerEnteredVehicle, targetCoords = nil, nil, nil, false, false, false, nil + end + + if targetCoords then + DrawMarker(36, targetCoords.x, targetCoords.y, targetCoords.z + 1.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 234, 223, 72, 155, false, false, 2, true, nil, nil, false) + end + else + RemoveBlip(CurrentCustomerBlip) + CurrentCustomerBlip = nil + targetCoords = Config.JobLocations[GetRandomIntInRange(1, #Config.JobLocations)] + local distance = #(playerCoords - targetCoords) + while distance < Config.MinimumDistance do + Citizen.Wait(5) + + targetCoords = Config.JobLocations[GetRandomIntInRange(1, #Config.JobLocations)] + distance = #(playerCoords - targetCoords) + end + + local street = table.pack(GetStreetNameAtCoord(targetCoords.x, targetCoords.y, targetCoords.z)) + local msg = nil + + if street[2] ~= 0 and street[2] ~= nil then + msg = string.format(_U('take_me_to_near', GetStreetNameFromHashKey(street[1]), GetStreetNameFromHashKey(street[2]))) + else + msg = string.format(_U('take_me_to', GetStreetNameFromHashKey(street[1]))) + end + + ESX.ShowNotification(msg) + + DestinationBlip = AddBlipForCoord(targetCoords.x, targetCoords.y, targetCoords.z) + + BeginTextCommandSetBlipName('STRING') + AddTextComponentSubstringPlayerName('Destination') + EndTextCommandSetBlipName(blip) + SetBlipRoute(DestinationBlip, true) + + CustomerEnteredVehicle = true + end + else + DrawMarker(36, customerCoords.x, customerCoords.y, customerCoords.z + 1.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 234, 223, 72, 155, false, false, 2, true, nil, nil, false) + + if not CustomerEnteredVehicle then + if customerDistance <= 40.0 then + + if not IsNearCustomer then + ESX.ShowNotification(_U('close_to_client')) + IsNearCustomer = true + end + + end + + if customerDistance <= 20.0 then + if not CustomerIsEnteringVehicle then + ClearPedTasksImmediately(CurrentCustomer) + + local maxSeats, freeSeat = GetVehicleMaxNumberOfPassengers(vehicle) + + for i=maxSeats - 1, 0, -1 do + if IsVehicleSeatFree(vehicle, i) then + freeSeat = i + break + end + end + + if freeSeat then + TaskEnterVehicle(CurrentCustomer, vehicle, -1, freeSeat, 2.0, 0) + CustomerIsEnteringVehicle = true + end + end + end + end + end + else + DrawSub(_U('return_to_veh'), 5000) + end + end + else + Citizen.Wait(500) + end + end +end) + +Citizen.CreateThread(function() + while onJob do + Citizen.Wait(10000) + if ESX.PlayerData.job ~= nil and ESX.PlayerData.job.grade < 3 then + if not IsInAuthorizedVehicle() then + ClearCurrentMission() + OnJob = false + ESX.ShowNotification(_U('not_in_taxi')) + end + end + end +end) + +-- Key Controls +Citizen.CreateThread(function() + while true do + Citizen.Wait(0) + + if CurrentAction and not IsDead then + ESX.ShowHelpNotification(CurrentActionMsg) + + if IsControlJustReleased(0, 38) and ESX.PlayerData.job and ESX.PlayerData.job.name == 'taxi' then + if CurrentAction == 'taxi_actions_menu' then + OpenTaxiActionsMenu() + elseif CurrentAction == 'cloakroom' then + OpenCloakroom() + elseif CurrentAction == 'vehicle_spawner' then + OpenVehicleSpawnerMenu() + elseif CurrentAction == 'delete_vehicle' then + DeleteJobVehicle() + end + + CurrentAction = nil + end + end + + if IsControlJustReleased(0, 167) and IsInputDisabled(0) and not IsDead and Config.EnablePlayerManagement and ESX.PlayerData.job and ESX.PlayerData.job.name == 'taxi' then + OpenMobileTaxiActionsMenu() + end + end +end) + +AddEventHandler('esx:onPlayerDeath', function() + IsDead = true +end) + +AddEventHandler('esx:onPlayerSpawn', function(spawn) + IsDead = false +end) \ No newline at end of file diff --git a/[esx_addons]/esx_taxijob/config.lua b/[esx_addons]/esx_taxijob/config.lua new file mode 100644 index 00000000..407366d3 --- /dev/null +++ b/[esx_addons]/esx_taxijob/config.lua @@ -0,0 +1,149 @@ +Config = {} + +Config.DrawDistance = 10.0 -- How close do you need to be for the markers to be drawn (in GTA units). + +Config.NPCJobEarnings = {min = 300, max = 600} +Config.MinimumDistance = 3000 -- Minimum NPC job destination distance from the pickup in GTA units, a higher number prevents nearby destionations. + +Config.MaxInService = -1 -- How much people can be in service at once? +Config.EnablePlayerManagement = true -- Enable society managing. +Config.EnableSocietyOwnedVehicles = false + +Config.Locale = 'en' + +Config.AuthorizedVehicles = { + {model = 'taxi', label = 'Taxi'} +} + +Config.Zones = { + + VehicleSpawner = { + Pos = {x = 915.039, y = -162.187, z = 74.5}, + Size = {x = 1.0, y = 1.0, z = 1.0}, + Color = {r = 204, g = 204, b = 0}, + Type = 36, Rotate = true + }, + + VehicleSpawnPoint = { + Pos = {x = 911.108, y = -177.867, z = 74.283}, + Size = {x = 1.5, y = 1.5, z = 1.0}, + Type = -1, Rotate = false, + Heading = 225.0 + }, + + VehicleDeleter = { + Pos = {x = 908.317, y = -183.070, z = 73.201}, + Size = {x = 3.0, y = 3.0, z = 0.25}, + Color = {r = 255, g = 0, b = 0}, + Type = 1, Rotate = false + }, + + TaxiActions = { + Pos = {x = 903.32, y = -170.55, z = 74.0}, + Size = {x = 1.0, y = 1.0, z = 1.0}, + Color = {r = 204, g = 204, b = 0}, + Type = 20, Rotate = true + }, + + Cloakroom = { + Pos = {x = 894.88, y = -180.23, z = 74.5}, + Size = {x = 1.0, y = 1.0, z = 1.0}, + Color = {r = 204, g = 204, b = 0}, + Type = 21, Rotate = true + } +} + +Config.JobLocations = { + vector3(293.5, -590.2, 42.7), + vector3(253.4, -375.9, 44.1), + vector3(120.8, -300.4, 45.1), + vector3(-38.4, -381.6, 38.3), + vector3(-107.4, -614.4, 35.7), + vector3(-252.3, -856.5, 30.6), + vector3(-236.1, -988.4, 28.8), + vector3(-277.0, -1061.2, 25.7), + vector3(-576.5, -999.0, 21.8), + vector3(-602.8, -952.6, 21.6), + vector3(-790.7, -961.9, 14.9), + vector3(-912.6, -864.8, 15.0), + vector3(-1069.8, -792.5, 18.8), + vector3(-1306.9, -854.1, 15.1), + vector3(-1468.5, -681.4, 26.2), + vector3(-1380.9, -452.7, 34.1), + vector3(-1326.3, -394.8, 36.1), + vector3(-1383.7, -270.0, 42.5), + vector3(-1679.6, -457.3, 39.4), + vector3(-1812.5, -416.9, 43.7), + vector3(-2043.6, -268.3, 23.0), + vector3(-2186.4, -421.6, 12.7), + vector3(-1862.1, -586.5, 11.2), + vector3(-1859.5, -617.6, 10.9), + vector3(-1635.0, -988.3, 12.6), + vector3(-1284.0, -1154.2, 5.3), + vector3(-1126.5, -1338.1, 4.6), + vector3(-867.9, -1159.7, 5.0), + vector3(-847.5, -1141.4, 6.3), + vector3(-722.6, -1144.6, 10.2), + vector3(-575.5, -318.4, 34.5), + vector3(-592.3, -224.9, 36.1), + vector3(-559.6, -162.9, 37.8), + vector3(-535.0, -65.7, 40.6), + vector3(-758.2, -36.7, 37.3), + vector3(-1375.9, 21.0, 53.2), + vector3(-1320.3, -128.0, 48.1), + vector3(-1285.7, 294.3, 64.5), + vector3(-1245.7, 386.5, 75.1), + vector3(-760.4, 285.0, 85.1), + vector3(-626.8, 254.1, 81.1), + vector3(-563.6, 268.0, 82.5), + vector3(-486.8, 272.0, 82.8), + vector3(88.3, 250.9, 108.2), + vector3(234.1, 344.7, 105.0), + vector3(435.0, 96.7, 99.2), + vector3(482.6, -142.5, 58.2), + vector3(762.7, -786.5, 25.9), + vector3(809.1, -1290.8, 25.8), + vector3(490.8, -1751.4, 28.1), + vector3(432.4, -1856.1, 27.0), + vector3(164.3, -1734.5, 28.9), + vector3(-57.7, -1501.4, 31.1), + vector3(52.2, -1566.7, 29.0), + vector3(310.2, -1376.8, 31.4), + vector3(182.0, -1332.8, 28.9), + vector3(-74.6, -1100.6, 25.7), + vector3(-887.0, -2187.5, 8.1), + vector3(-749.6, -2296.6, 12.5), + vector3(-1064.8, -2560.7, 19.7), + vector3(-1033.4, -2730.2, 19.7), + vector3(-1018.7, -2732.0, 13.3), + vector3(797.4, -174.4, 72.7), + vector3(508.2, -117.9, 60.8), + vector3(159.5, -27.6, 67.4), + vector3(-36.4, -106.9, 57.0), + vector3(-355.8, -270.4, 33.0), + vector3(-831.2, -76.9, 37.3), + vector3(-1038.7, -214.6, 37.0), + vector3(1918.4, 3691.4, 32.3), + vector3(1820.2, 3697.1, 33.5), + vector3(1619.3, 3827.2, 34.5), + vector3(1418.6, 3602.2, 34.5), + vector3(1944.9, 3856.3, 31.7), + vector3(2285.3, 3839.4, 34.0), + vector3(2760.9, 3387.8, 55.7), + vector3(1952.8, 2627.7, 45.4), + vector3(1051.4, 474.8, 93.7), + vector3(866.4, 17.6, 78.7), + vector3(319.0, 167.4, 103.3), + vector3(88.8, 254.1, 108.2), + vector3(-44.9, 70.4, 72.4), + vector3(-115.5, 84.3, 70.8), + vector3(-384.8, 226.9, 83.5), + vector3(-578.7, 139.1, 61.3), + vector3(-651.3, -584.9, 34.1), + vector3(-571.8, -1195.6, 17.9), + vector3(-1513.3, -670.0, 28.4), + vector3(-1297.5, -654.9, 26.1), + vector3(-1645.5, 144.6, 61.7), + vector3(-1160.6, 744.4, 154.6), + vector3(-798.1, 831.7, 204.4) +} diff --git a/[esx_addons]/esx_taxijob/esx_taxijob.sql b/[esx_addons]/esx_taxijob/esx_taxijob.sql new file mode 100644 index 00000000..03a4ba19 --- /dev/null +++ b/[esx_addons]/esx_taxijob/esx_taxijob.sql @@ -0,0 +1,25 @@ +USE `es_extended`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('taxi', 'Taxi') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('taxi',0,'recrue','Recrue',12,'{"hair_2":0,"hair_color_2":0,"torso_1":32,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":0,"age_2":0,"glasses_2":0,"ears_2":0,"arms":27,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',1,'novice','Novice',24,'{"hair_2":0,"hair_color_2":0,"torso_1":32,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":0,"age_2":0,"glasses_2":0,"ears_2":0,"arms":27,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',2,'experimente','Experimente',36,'{"hair_2":0,"hair_color_2":0,"torso_1":26,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":57,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":11,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',3,'uber','Uber',48,'{"hair_2":0,"hair_color_2":0,"torso_1":26,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":57,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":11,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',4,'boss','Patron',0,'{"hair_2":0,"hair_color_2":0,"torso_1":29,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":1,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":4,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}') +; diff --git a/[esx_addons]/esx_taxijob/fxmanifest.lua b/[esx_addons]/esx_taxijob/fxmanifest.lua new file mode 100644 index 00000000..4ca75e7c --- /dev/null +++ b/[esx_addons]/esx_taxijob/fxmanifest.lua @@ -0,0 +1,37 @@ +fx_version 'adamant' + +game 'gta5' + +description 'ESX Taxi Job' + +version '1.0.2' + +client_scripts { + '@es_extended/locale.lua', + 'locales/de.lua', + 'locales/br.lua', + 'locales/en.lua', + 'locales/es.lua', + 'locales/fi.lua', + 'locales/fr.lua', + 'locales/pl.lua', + 'locales/sv.lua', + 'config.lua', + 'client/main.lua' +} + +server_scripts { + '@es_extended/locale.lua', + 'locales/de.lua', + 'locales/br.lua', + 'locales/en.lua', + 'locales/es.lua', + 'locales/fi.lua', + 'locales/fr.lua', + 'locales/pl.lua', + 'locales/sv.lua', + 'config.lua', + 'server/main.lua' +} + +dependency 'es_extended' diff --git a/[esx_addons]/esx_taxijob/locales/br.lua b/[esx_addons]/esx_taxijob/locales/br.lua new file mode 100644 index 00000000..21e1b7a1 --- /dev/null +++ b/[esx_addons]/esx_taxijob/locales/br.lua @@ -0,0 +1,52 @@ +Locales['br'] = { + -- cloakroom + ['cloakroom_menu'] = 'guarda-roupa', + ['cloakroom_prompt'] = 'pressione ~INPUT_CONTEXT~ para abrir o ~y~cloakroom~s~.', + ['wear_citizen'] = 'roupa de cidadão', + ['wear_work'] = 'roupa de taxista', + + -- garage + ['spawner_prompt'] = 'pressione ~INPUT_CONTEXT~ para abrir a ~y~garage~s~.', + ['store_veh'] = 'pressione ~INPUT_CONTEXT~ para guardar o veículo', + ['spawn_veh'] = 'pegar veículo', + ['spawnpoint_blocked'] = 'existe um veículo bloqueando o ponto de spawn!', + ['only_taxi'] = 'você só pode guardar taxis.', + + ['taking_service'] = 'pegando serviço: Taxi/Uber', + ['full_service'] = 'serviço completo: ', + ['amount_invalid'] = 'valor inválido', + ['press_to_open'] = 'pressione ~INPUT_CONTEXT~ para acessar o menu', + ['billing'] = 'faturamento', + ['billing_sent'] = 'a fatura foi enviada!', + ['invoice_amount'] = 'valor da fatura', + ['no_players_near'] = 'nenhum jogador nas proximidades', + ['start_job'] = 'iniciar / parar missão', + ['drive_search_pass'] = 'dirigindo em busca de ~y~passageiros', + ['customer_found'] = 'você ~g~encontrou~s~ um passageiro, dirija até o destino', + ['client_unconcious'] = 'seu passageiro está ~r~insconsciente~s~. Procure por outro.', + ['arrive_dest'] = 'você ~g~chegou~s~ ao seu destino', + ['take_me_to_near'] = '~s~Leve me para~y~ %s~s~, perto~y~ %s', + ['take_me_to'] = '~s~Leve me para~y~ %s', + ['close_to_client'] = 'você está perto do passageiro, aproximisse dele', + ['return_to_veh'] = 'volte para o seu veículo para continuar a missão', + ['must_in_taxi'] = 'você deve estar em um táxi para começar a missão', + ['must_in_vehicle'] = 'você deve estar em um veículo para começar a missão', + ['not_in_taxi'] = 'You left the taxi while on mission!', + ['have_earned'] = 'você ganhou ~g~$%s~s~', + ['comp_earned'] = '- sua empresa ganhou ~g~$%s~s~\n- Você ganhou ~g~$%s~s~', + ['deposit_stock'] = 'depositar estoque', + ['take_stock'] = 'retirar estoque', + ['boss_actions'] = 'ações de chefe', + ['mission_complete'] = 'missão completa', + ['quantity'] = 'quantidade', + ['quantity_invalid'] = 'é uma quantidade inválida!', + ['inventory'] = 'inventário', + ['taxi_client'] = 'cliente do taxi', + ['have_withdrawn'] = 'você retirou ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'você depositou ~y~x%s~s~ ~b~%s~s~', + ['player_cannot_hold'] = 'você não tem espaço suficiente em seu inventário!', + ['blip_taxi'] = 'taxi', + ['phone_taxi'] = 'taxi', + ['taxi'] = 'taxi', + ['taxi_stock'] = 'taxi Stock' +} diff --git a/[esx_addons]/esx_taxijob/locales/de.lua b/[esx_addons]/esx_taxijob/locales/de.lua new file mode 100644 index 00000000..06a22aa3 --- /dev/null +++ b/[esx_addons]/esx_taxijob/locales/de.lua @@ -0,0 +1,52 @@ +Locales['de'] = { + -- cloakroom + ['cloakroom_menu'] = 'cloakroom', + ['cloakroom_prompt'] = 'press ~INPUT_CONTEXT~ to open the ~y~cloakroom~s~.', + ['wear_citizen'] = 'citizen wear', + ['wear_work'] = 'taxi wear', + + -- garage + ['spawner_prompt'] = 'press ~INPUT_CONTEXT~ to open the ~y~garage~s~.', + ['store_veh'] = 'Drücke ~INPUT_CONTEXT~ um das Fahrzeug zu parken', + ['spawn_veh'] = 'Fahrzeug spawnen', + ['spawnpoint_blocked'] = 'there is a vehicle blocking the spawnpoint!', + ['only_taxi'] = 'Du kannst nur Taxis parken.', + + ['taking_service'] = 'Service annehmen: Taxi/Uber', + ['full_service'] = 'Voller Service: ', + ['amount_invalid'] = 'Betrag ungültig', + ['press_to_open'] = 'Drücke ~INPUT_CONTEXT~ um das Menü zu öffnen', + ['billing'] = 'Rechnung', + ['billing_sent'] = 'the bill has been registered!', + ['invoice_amount'] = 'Rechnugsbetrag', + ['no_players_near'] = 'Kein Spieler in der Nähe', + ['start_job'] = 'start / stop driving NPC jobs', + ['drive_search_pass'] = 'Auf der Suche nach ~y~Passagieren', + ['customer_found'] = 'du hast einen Passagier ~g~gefunden~s~ , Fahre in zum Ziel', + ['client_unconcious'] = 'dein Passagier ist ~r~bewusstlos~s~. Suche nach einem anderen.', + ['arrive_dest'] = 'du bist an deinem Ziel ~g~angekommen~s~', + ['take_me_to_near'] = '~s~Bring mich nach~y~ %s~s~, in der Nähe von~y~ %s', + ['take_me_to'] = '~s~Bring mich nach~y~ %s', + ['close_to_client'] = 'du bist nahe an dem Passagier, du musst noch näher ran', + ['return_to_veh'] = 'bitte kehre zu deinem Fahezeug zurück umd die Mission fortzuführen', + ['must_in_taxi'] = 'Du musst in einem Taxis sein umd die Mission starten zu können', + ['must_in_vehicle'] = 'Du musst in einem Fahrzeug sein um die Mission starten zu können', + ['not_in_taxi'] = 'You left the taxi while on mission!', + ['have_earned'] = 'verdient ~g~$%s~s~', + ['comp_earned'] = '- Die Firma verdient ~g~$\n- Verdient ~g~$%s~s~', + ['deposit_stock'] = 'deposit Stock', + ['take_stock'] = 'take Stock', + ['boss_actions'] = 'boss Actions', + ['mission_complete'] = 'mission Completed', + ['quantity'] = 'quantity', + ['quantity_invalid'] = 'that is an invalid quantity!', + ['inventory'] = 'inventory', + ['taxi_client'] = 'taxi Client', + ['have_withdrawn'] = 'you have withdrawn ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'you have deposited ~y~x%s~s~ ~b~%s~s~', + ['player_cannot_hold'] = 'you do ~r~not~s~ have enough ~y~free space~s~ in your inventory!', + ['blip_taxi'] = 'taxi', + ['phone_taxi'] = 'taxi', + ['taxi'] = 'taxi', + ['taxi_stock'] = 'taxi Stock' +} diff --git a/[esx_addons]/esx_taxijob/locales/en.lua b/[esx_addons]/esx_taxijob/locales/en.lua new file mode 100644 index 00000000..4fb29760 --- /dev/null +++ b/[esx_addons]/esx_taxijob/locales/en.lua @@ -0,0 +1,52 @@ +Locales['en'] = { + -- cloakroom + ['cloakroom_menu'] = 'cloakroom', + ['cloakroom_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Cloakroom~s~.', + ['wear_citizen'] = 'citizen wear', + ['wear_work'] = 'taxi wear', + + -- garage + ['spawner_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Garage~s~.', + ['store_veh'] = 'press ~INPUT_CONTEXT~ to store the vehicle', + ['spawn_veh'] = 'spawn vehicle', + ['spawnpoint_blocked'] = 'there is a vehicle blocking the spawnpoint!', + ['only_taxi'] = 'you can only store taxis.', + + ['taking_service'] = 'taking service: Taxi/Uber', + ['full_service'] = 'full service: ', + ['amount_invalid'] = 'amount invalid', + ['press_to_open'] = 'press ~INPUT_CONTEXT~ to access the menu', + ['billing'] = 'billing', + ['billing_sent'] = 'the bill has been registered!', + ['invoice_amount'] = 'invoice amount', + ['no_players_near'] = 'no players nearby', + ['start_job'] = 'start / stop driving NPC jobs', + ['drive_search_pass'] = 'driving in search of ~y~passengers', + ['customer_found'] = 'you have ~g~found~s~ a customer, get closer to them', + ['client_unconcious'] = 'your client is ~r~unconscious~s~, look for another one', + ['arrive_dest'] = 'you have ~g~arrived~s~ at your destination', + ['take_me_to_near'] = '~s~Take me to~y~ %s~s~, near ~y~%s', + ['take_me_to'] = '~s~Take me to ~y~%s', + ['close_to_client'] = 'you are too far from the client, get close to them', + ['return_to_veh'] = 'please return to your vehicle to continue the mission', + ['must_in_taxi'] = 'you must be in a ~y~taxi~s~ to start the mission', + ['must_in_vehicle'] = 'you must be in a vehicle to begin the mission', + ['not_in_taxi'] = 'You left the taxi while on mission!', + ['have_earned'] = 'you have earned ~g~$%s~s~', + ['comp_earned'] = '- your company has earned ~g~$%s~s~\n- you have earned ~g~$%s~s~', + ['deposit_stock'] = 'deposit Stock', + ['take_stock'] = 'take Stock', + ['boss_actions'] = 'boss Actions', + ['mission_complete'] = 'mission Completed', + ['quantity'] = 'quantity', + ['quantity_invalid'] = 'that is an invalid quantity!', + ['inventory'] = 'inventory', + ['taxi_client'] = 'taxi Client', + ['have_withdrawn'] = 'you have withdrawn ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'you have deposited ~y~x%s~s~ ~b~%s~s~', + ['player_cannot_hold'] = 'you do ~r~not~s~ have enough ~y~free space~s~ in your inventory!', + ['blip_taxi'] = 'downtown Cab Co.', + ['phone_taxi'] = 'downtown Cab Co.', + ['taxi'] = 'taxi', + ['taxi_stock'] = 'taxi Stock' +} diff --git a/[esx_addons]/esx_taxijob/locales/es.lua b/[esx_addons]/esx_taxijob/locales/es.lua new file mode 100644 index 00000000..36707678 --- /dev/null +++ b/[esx_addons]/esx_taxijob/locales/es.lua @@ -0,0 +1,54 @@ +-- Traducción by: https://github.com/ItsManueh + +Locales['es'] = { + -- cloakroom + ['cloakroom_menu'] = 'Guardarropa', + ['cloakroom_prompt'] = 'Presiona ~INPUT_CONTEXT~ para acceder al ~y~Guardarropa~s~.', + ['wear_citizen'] = 'Ropa ciudadana', + ['wear_work'] = 'Ropa de taxista', + + -- garage + ['spawner_prompt'] = 'Presiona ~INPUT_CONTEXT~ para acceder al ~y~Garaje~s~.', + ['store_veh'] = 'Presiona ~INPUT_CONTEXT~ para almacenar el vehículo', + ['spawn_veh'] = 'Vehículo de generación', + ['spawnpoint_blocked'] = '¡Hay un vehículo bloqueando el punto de generación!', + ['only_taxi'] = 'Solo puede almacenar taxis.', + + ['taking_service'] = 'Tomando servicio: Taxi / Uber', + ['full_service'] = 'Servicio completo: ', + ['amount_invalid'] = 'Cantidad inválida', + ['press_to_open'] = 'Presiona ~INPUT_CONTEXT~ para acceder al menú', + ['billing'] = 'Facturación', + ['billing_sent'] = '¡La factura ha sido registrada!', + ['invoice_amount'] = 'Factura inválida', + ['no_players_near'] = 'No hay jugadores cerca', + ['start_job'] = 'Iniciar / Detener la conducción de trabajos NPC', + ['drive_search_pass'] = 'Conduciendo en busca de ~y~pasajeros', + ['customer_found'] = 'Has ~g~encontrado~s~ un cliente, acércate a ellos', + ['client_unconcious'] = 'Tu cliente es ~r~inconsciente~s~, busca otro', + ['arrive_dest'] = 'Has ~g~llegado~s~ al destino correctamente', + ['take_me_to_near'] = '~s~Llévame a~y~ %s~s~, cerca ~y~%s', + ['take_me_to'] = '~s~Llévame a ~y~%s', + ['close_to_client'] = 'Estás demasiado lejos del cliente, acércate a él', + ['return_to_veh'] = 'Por favor regrese a su vehículo para continuar la misión', + ['must_in_taxi'] = 'Debes estar en un ~y~taxi~s~ para comenzar la misión', + ['must_in_vehicle'] = 'Debes estar en un vehículo para comenzar la misión', + ['not_in_taxi'] = '¡Dejaste el taxi mientras estabas en misión!', + ['have_earned'] = 'Usted ha ganado ~g~$%s~s~', + ['comp_earned'] = '- Tu empresa se ha ganado ~g~$%s~s~\n- usted ha ganado ~g~$%s~s~', + ['deposit_stock'] = 'Depositar stock', + ['take_stock'] = 'Coger Stock', + ['boss_actions'] = 'Acciones del jefe', + ['mission_complete'] = 'Misión completada', + ['quantity'] = 'Cantidad', + ['quantity_invalid'] = '¡Esa es una cantidad inválida!', + ['inventory'] = 'Inventario', + ['taxi_client'] = 'Cliente taxi', + ['have_withdrawn'] = 'Has retirado ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'Has depositado ~y~x%s~s~ ~b~%s~s~', + ['player_cannot_hold'] = '!Tu ~r~no~s~ tienes suficiente ~y~espacio libre~s~ en tu inventario!', + ['blip_taxi'] = 'Downtown Cab Co.', + ['phone_taxi'] = 'Downtown Cab Co.', + ['taxi'] = 'Taxi', + ['taxi_stock'] = 'Taxi Stock' +} diff --git a/[esx_addons]/esx_taxijob/locales/fi.lua b/[esx_addons]/esx_taxijob/locales/fi.lua new file mode 100644 index 00000000..a1fb5d91 --- /dev/null +++ b/[esx_addons]/esx_taxijob/locales/fi.lua @@ -0,0 +1,52 @@ +Locales['fi'] = { + -- cloakroom + ['cloakroom_menu'] = 'cloakroom', + ['cloakroom_prompt'] = 'press ~INPUT_CONTEXT~ to open the ~y~cloakroom~s~.', + ['wear_citizen'] = 'citizen wear', + ['wear_work'] = 'taxi wear', + + -- garage + ['spawner_prompt'] = 'press ~INPUT_CONTEXT~ to open the ~y~garage~s~.', + ['store_veh'] = 'paina ~INPUT_CONTEXT~ laittaaksesi auto talliin', + ['spawn_veh'] = 'spawnaa ajoneuvo', + ['spawnpoint_blocked'] = 'there is a vehicle blocking the spawnpoint!', + ['only_taxi'] = 'Voit vain tallettaa taxeja', + + ['taking_service'] = 'Aloitetaan työ: Taxi/Uber', + ['full_service'] = 'täysi palvelu: ', + ['amount_invalid'] = 'virheellinen summa', + ['press_to_open'] = 'paina ~INPUT_CONTEXT~ avataksesi valikko', + ['billing'] = 'Laskutus', + ['billing_sent'] = 'the bill has been registered!', + ['invoice_amount'] = 'laskun määrä', + ['no_players_near'] = 'ei pelaajia lähellä', + ['start_job'] = 'start / stop driving NPC jobs', + ['drive_search_pass'] = 'Ajele ympäriinsä etsi uusia ~y~asiakkaita', + ['customer_found'] = 'Sinä ~g~löysit~s~ asiakkaan, aja lähemmäksi', + ['client_unconcious'] = 'Sinun asiakkaasi on ~r~tajuton~s~. Etsi uusi.', + ['arrive_dest'] = 'Sinä ~g~saavuit~s~ kohteeseen', + ['take_me_to_near'] = '~s~Vie minut ~y~ %s~s~, lähellä~y~ %s', + ['take_me_to'] = '~s~Vie minut~y~ %s', + ['close_to_client'] = 'Olet asiakkaan lähellä, mene lähemmäksi', + ['return_to_veh'] = 'Mene takaisin ajoneuvoon, jatkaaksesi töitä', + ['must_in_taxi'] = 'Sinun pitää olla taxissa että voit alottaa työn', + ['must_in_vehicle'] = 'Sinun pitää olla ajoneuvossa että voit alottaa työn', + ['not_in_taxi'] = 'You left the taxi while on mission!', + ['have_earned'] = 'Sinä tienasit ~g~€%s~s~', + ['comp_earned'] = '- Yrityksesi tienasi ~g~€%s~s~\n- Sinä tienasit ~g~€%s~s~', + ['deposit_stock'] = 'Talleta varastoon', + ['take_stock'] = 'ota varastosta', + ['boss_actions'] = 'pomon toiminnot', + ['mission_complete'] = 'tehtävä suoritettu', + ['quantity'] = 'määrä', + ['quantity_invalid'] = 'virheellinen Määrä', + ['inventory'] = 'reppu', + ['taxi_client'] = 'taxi Asiakas', + ['have_withdrawn'] = 'sinä nostit ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'sinä talletit ~y~x%s~s~ ~b~%s~s~', + ['player_cannot_hold'] = 'sinulla ~r~ei ole~s~ enempää ~y~vapaata tilaa~s~ repussasi!', + ['blip_taxi'] = 'taxi', + ['phone_taxi'] = 'taxi', + ['taxi'] = 'taxi', + ['taxi_stock'] = 'taxi Stock' +} diff --git a/[esx_addons]/esx_taxijob/locales/fr.lua b/[esx_addons]/esx_taxijob/locales/fr.lua new file mode 100644 index 00000000..56aae71b --- /dev/null +++ b/[esx_addons]/esx_taxijob/locales/fr.lua @@ -0,0 +1,52 @@ +Locales['fr'] = { + -- cloakroom + ['cloakroom_menu'] = 'vestiaire', + ['cloakroom_prompt'] = 'appuyez sur ~INPUT_CONTEXT~ pour ouvrir le ~y~cloakroom~s~.', + ['wear_citizen'] = 'tenue civile', + ['wear_work'] = 'tenue de travail', + + -- garage + ['spawner_prompt'] = 'appuyez sur ~INPUT_CONTEXT~ pour ouvrir le ~y~garage~s~.', + ['store_veh'] = 'appuyez sur ~INPUT_CONTEXT~ pour ranger le véhicule', + ['spawn_veh'] = 'sortir véhicule', + ['spawnpoint_blocked'] = 'un véhicule bloque la sortie!!', + ['only_taxi'] = 'vous ne pouvez ranger que les taxi', + + ['taking_service'] = 'prise de service : Taxi/Uber', + ['full_service'] = 'service complet : ', + ['amount_invalid'] = 'montant invalide', + ['press_to_open'] = 'appuyez sur ~INPUT_CONTEXT~ pour accéder au menu', + ['billing'] = 'facuration', + ['billing_sent'] = 'the bill has been registered!', + ['invoice_amount'] = 'montant de la facture', + ['no_players_near'] = 'aucun joueur à proximité', + ['start_job'] = 'start / stop driving NPC jobs', + ['drive_search_pass'] = 'conduisez à la recherche de ~y~passagers', + ['customer_found'] = 'vous avez ~g~trouvé~s~ un client, conduisez jusqu\'à ce dernier', + ['client_unconcious'] = 'votre client est ~r~inconscient~s~. Cherchez-en un autre.', + ['arrive_dest'] = 'vous êtes ~g~arrivé~s~ à destination', + ['take_me_to_near'] = '~s~Emmenez-moi à~y~ %s~s~, près de~y~ %s', + ['take_me_to'] = '~s~Emmenez-moi à~y~ %s', + ['close_to_client'] = 'vous êtes à proximité du client, approchez-vous de lui', + ['return_to_veh'] = 'veuillez remonter dans votre véhicule pour continuer la mission', + ['must_in_taxi'] = 'vous devez être dans un taxi pour commencer la mission', + ['must_in_vehicle'] = 'vous devez être dans un véhicule pour commencer la mission', + ['not_in_taxi'] = 'You left the taxi while on mission!', + ['have_earned'] = 'vous avez gagné ~g~$%s~s~', + ['comp_earned'] = '- Votre société a gagné ~g~$%s~s~\n- Vous avez gagné ~g~$%s~s~', + ['deposit_stock'] = 'Déposer Stock', + ['take_stock'] = 'Prendre Stock', + ['boss_actions'] = 'action Patron', + ['mission_complete'] = 'Mission terminée', + ['quantity'] = 'Quantité', + ['quantity_invalid'] = 'Quantité invalide', + ['inventory'] = 'Inventaire', + ['taxi_client'] = 'client Taxi', + ['have_withdrawn'] = 'vous avez pris ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'vous avez déposé ~y~x%s~s~ ~b~%s~s~', + ['player_cannot_hold'] = 'vous n\'avez pas assez ~y~de place~s~ dans votre inventaire!', + ['blip_taxi'] = 'taxi', + ['phone_taxi'] = 'taxi', + ['taxi'] = 'taxi', + ['taxi_stock'] = 'taxi Stock' +} diff --git a/[esx_addons]/esx_taxijob/locales/pl.lua b/[esx_addons]/esx_taxijob/locales/pl.lua new file mode 100644 index 00000000..47a8358a --- /dev/null +++ b/[esx_addons]/esx_taxijob/locales/pl.lua @@ -0,0 +1,52 @@ +Locales['pl'] = { + -- cloakroom + ['cloakroom_menu'] = 'szatnia', + ['cloakroom_prompt'] = 'naciśnij ~INPUT_CONTEXT~ aby użyć ~y~szatni~s~.', + ['wear_citizen'] = 'strój cywilny', + ['wear_work'] = 'strój pracownika taxi', + + -- garage + ['spawner_prompt'] = 'naciśnij ~INPUT_CONTEXT~ aby otworzyć ~y~garaż~s~.', + ['store_veh'] = 'naciśnij ~INPUT_CONTEXT~ aby zdać pojazd', + ['spawn_veh'] = 'sprowadź pojazd', + ['spawnpoint_blocked'] = 'jakiś pojazd blokuje wyjazd z garażu!', + ['only_taxi'] = 'możesz przechowywać tylko taksówki.', + + ['taking_service'] = 'przyjmowanie usługi: Taxi/Uber', + ['full_service'] = 'pełny serwis: ', + ['amount_invalid'] = 'wartość nieprawidłowa', + ['press_to_open'] = 'naciśnij ~INPUT_CONTEXT~ aby wejść do menu', + ['billing'] = 'rachunek', + ['billing_sent'] = 'rachunek został wystawiony!', + ['invoice_amount'] = 'wartość należności', + ['no_players_near'] = 'brak graczy w pobliżu', + ['start_job'] = 'rozpocznij / zakończ wykonywanie zadań NPC', + ['drive_search_pass'] = 'jazda w poszukiwaniu ~y~pasażerów', + ['customer_found'] = '~g~Znajdujesz~s~ klienta, jedź do niego', + ['client_unconcious'] = 'klient jest ~r~nieprzytomny~s~. Poszukaj innego.', + ['arrive_dest'] = '~g~Dojeżdżasz~s~ do celu', + ['take_me_to_near'] = '~s~Zabierz mnie do~y~ %s~s~, w pobliżu ~y~ %s', + ['take_me_to'] = '~s~Weź mnie do~y~ %s', + ['close_to_client'] = 'jesteś blisko klienta, podjedź do niego bliżej', + ['return_to_veh'] = 'proszę wróć do swojego pojazdu aby kontynuować misję', + ['must_in_taxi'] = 'musisz być w taksówce aby rozpocząć misję', + ['must_in_vehicle'] = 'musisz być w pojeździe aby rozpocząć misję', + ['not_in_taxi'] = 'You left the taxi while on mission!', + ['have_earned'] = 'zarabiasz ~g~$%s~s~', + ['comp_earned'] = '- Twoja firma zarobiła ~g~$%s~s~\n- Zarabiasz ~g~$%s~s~', + ['deposit_stock'] = 'depozyt', + ['take_stock'] = 'weź depozyt', + ['boss_actions'] = 'akcje szefa', + ['mission_complete'] = 'misja zakończona', + ['quantity'] = 'ilość', + ['quantity_invalid'] = 'nieprawidłowa ilość', + ['inventory'] = 'ekwipunek', + ['taxi_client'] = 'klient taksówki', + ['have_withdrawn'] = 'wyciągasz ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'deponujesz ~y~x%s~s~ ~b~%s~s~', + ['player_cannot_hold'] = '~r~Nie~s~ masz wystarczająco ~y~wolnego miejsca~s~ w swoim ekwipunku!', + ['blip_taxi'] = 'taxi', + ['phone_taxi'] = 'taxi', + ['taxi'] = 'taxi', + ['taxi_stock'] = 'taxi Stock' +} diff --git a/[esx_addons]/esx_taxijob/locales/sv.lua b/[esx_addons]/esx_taxijob/locales/sv.lua new file mode 100644 index 00000000..c703a57c --- /dev/null +++ b/[esx_addons]/esx_taxijob/locales/sv.lua @@ -0,0 +1,52 @@ +Locales['sv'] = { + -- cloakroom + ['cloakroom_menu'] = 'omklädningsrum', + ['cloakroom_prompt'] = 'tryck ~INPUT_CONTEXT~ för att öppna ~y~omklädningsrummet~s~.', + ['wear_citizen'] = 'civila kläder', + ['wear_work'] = 'taxikläder', + + -- garage + ['spawner_prompt'] = 'tryck ~INPUT_CONTEXT~ för att öppna ~y~garaget~s~.', + ['store_veh'] = 'tryck ~INPUT_CONTEXT~ för att ~y~spara~s~ fordonet.', + ['spawn_veh'] = 'plocka ut taxi', + ['spawnpoint_blocked'] = 'det är ett fordon som blockerar spawnpointen!', + ['only_taxi'] = 'du kan endast lagra ~y~taxi fordon~s~ här..', + + ['taking_service'] = 'du deltog tjänst: Taxi/Uber', + ['full_service'] = 'du kan inte delta tjänst: ', + ['amount_invalid'] = 'ogiltig mängd!', + ['press_to_open'] = 'tryck ~INPUT_CONTEXT~ för att öppna menyn.', + ['billing'] = 'skapa räkning', + ['billing_sent'] = 'räkningen har registrerats!', + ['invoice_amount'] = 'faktureringsbelopp', + ['no_players_near'] = 'det finns ingen spelare i närheten!', + ['start_job'] = 'starta / sluta köra NPC', + ['drive_search_pass'] = 'Åk runt för att hitta ~y~kunder~s~', + ['customer_found'] = 'du har ~g~hittat~s~ en kund!', + ['client_unconcious'] = 'din kund är ~r~medvetslös~s~. Hitta en ny.', + ['arrive_dest'] = 'du har ~g~anlänt~s~ till din destination', + ['take_me_to_near'] = '~s~Ta mig till ~y~%s~s~, vid ~y~%s~s~', + ['take_me_to'] = '~s~Ta mig till ~y~%s~s~', + ['close_to_client'] = 'åk närmare din kund!', + ['return_to_veh'] = 'vänligen återvänd till ditt fordon och återuppta körningen.', + ['must_in_taxi'] = 'du måste vara i en ~y~taxi~s~ för att starta uppdraget.', + ['must_in_vehicle'] = 'du måste vara i ett ~b~fordon~s~ för att starta uppdraget.', + ['not_in_taxi'] = 'You left the taxi while on mission!', + ['have_earned'] = 'du har tjärnat ~g~%s SEK~s~', + ['comp_earned'] = '- ditt företag har tjärnat ~g~%s SEK~s~\n- du har tjärnat ~g~%s SEK~s~', + ['deposit_stock'] = 'lagra objekt', + ['take_stock'] = 'ta ut objekt', + ['boss_actions'] = 'chefmeny', + ['mission_complete'] = 'uppdraget har ~y~slutförts~s~!', + ['quantity'] = 'mängd', + ['quantity_invalid'] = 'det är en ogiltig mängd', + ['inventory'] = 'inventory', + ['taxi_client'] = 'taxi klient', + ['have_withdrawn'] = 'du har tagit ut ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'du har lagrat ~y~x%s~s~ ~b~%s~s~', + ['player_cannot_hold'] = 'du har ~r~inte~s~ tillräckligt med ~y~utrymme~s~ för att hålla det!', + ['blip_taxi'] = 'taxifirman', + ['phone_taxi'] = 'taxi', + ['taxi'] = 'taxi', + ['taxi_stock'] = 'taxi Stock' +} diff --git a/[esx_addons]/esx_taxijob/localization/br_esx_taxijob.sql b/[esx_addons]/esx_taxijob/localization/br_esx_taxijob.sql new file mode 100644 index 00000000..556e62e7 --- /dev/null +++ b/[esx_addons]/esx_taxijob/localization/br_esx_taxijob.sql @@ -0,0 +1,25 @@ +USE `es_extended`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('taxi', 'Taxi') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('taxi',0,'recrue','Recrutar',12,'{"hair_2":0,"hair_color_2":0,"torso_1":32,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":0,"age_2":0,"glasses_2":0,"ears_2":0,"arms":27,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',1,'novice','Taxista',24,'{"hair_2":0,"hair_color_2":0,"torso_1":32,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":0,"age_2":0,"glasses_2":0,"ears_2":0,"arms":27,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',2,'experimente','Taxista Experiente',36,'{"hair_2":0,"hair_color_2":0,"torso_1":26,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":57,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":11,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',3,'uber','Uber',48,'{"hair_2":0,"hair_color_2":0,"torso_1":26,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":57,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":11,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',4,'boss','Taxista Chefe',0,'{"hair_2":0,"hair_color_2":0,"torso_1":29,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":1,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":4,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}') +; diff --git a/[esx_addons]/esx_taxijob/localization/de_esx_taxijob.sql b/[esx_addons]/esx_taxijob/localization/de_esx_taxijob.sql new file mode 100644 index 00000000..e674a7f7 --- /dev/null +++ b/[esx_addons]/esx_taxijob/localization/de_esx_taxijob.sql @@ -0,0 +1,25 @@ +USE `es_extended`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('taxi', 'Taxi') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('taxi',0,'recrue','Rekrut',12,'{"hair_2":0,"hair_color_2":0,"torso_1":32,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":0,"age_2":0,"glasses_2":0,"ears_2":0,"arms":27,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',1,'novice','Anfänger',24,'{"hair_2":0,"hair_color_2":0,"torso_1":32,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":0,"age_2":0,"glasses_2":0,"ears_2":0,"arms":27,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',2,'experimente','Experte',36,'{"hair_2":0,"hair_color_2":0,"torso_1":26,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":57,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":11,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',3,'uber','Schichtführer',48,'{"hair_2":0,"hair_color_2":0,"torso_1":26,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":57,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":11,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',4,'boss','Chef',0,'{"hair_2":0,"hair_color_2":0,"torso_1":29,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":1,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":4,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}') +; diff --git a/[esx_addons]/esx_taxijob/localization/en_esx_taxijob.sql b/[esx_addons]/esx_taxijob/localization/en_esx_taxijob.sql new file mode 100644 index 00000000..619f492a --- /dev/null +++ b/[esx_addons]/esx_taxijob/localization/en_esx_taxijob.sql @@ -0,0 +1,25 @@ +USE `es_extended`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('taxi', 'Taxi') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('taxi',0,'recrue','Recruit',12,'{"hair_2":0,"hair_color_2":0,"torso_1":32,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":0,"age_2":0,"glasses_2":0,"ears_2":0,"arms":27,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',1,'novice','Cabby',24,'{"hair_2":0,"hair_color_2":0,"torso_1":32,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":0,"age_2":0,"glasses_2":0,"ears_2":0,"arms":27,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',2,'experimente','Experienced',36,'{"hair_2":0,"hair_color_2":0,"torso_1":26,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":57,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":11,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',3,'uber','Uber Cabby',48,'{"hair_2":0,"hair_color_2":0,"torso_1":26,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":57,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":11,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',4,'boss','Lead Cabby',0,'{"hair_2":0,"hair_color_2":0,"torso_1":29,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":1,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":4,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}') +; diff --git a/[esx_addons]/esx_taxijob/localization/fi_esx_taxijob.sql b/[esx_addons]/esx_taxijob/localization/fi_esx_taxijob.sql new file mode 100644 index 00000000..03b506f4 --- /dev/null +++ b/[esx_addons]/esx_taxijob/localization/fi_esx_taxijob.sql @@ -0,0 +1,25 @@ +USE `es_extended`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('taxi', 'Taxi') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('taxi',0,'recrue','Harjottelija',12,'{"hair_2":0,"hair_color_2":0,"torso_1":32,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":0,"age_2":0,"glasses_2":0,"ears_2":0,"arms":27,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',1,'novice','Alottelija',24,'{"hair_2":0,"hair_color_2":0,"torso_1":32,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":0,"age_2":0,"glasses_2":0,"ears_2":0,"arms":27,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',2,'experimente','Kokenut',36,'{"hair_2":0,"hair_color_2":0,"torso_1":26,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":57,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":11,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',3,'uber','Uber',48,'{"hair_2":0,"hair_color_2":0,"torso_1":26,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":57,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":11,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',4,'boss','Pomo',0,'{"hair_2":0,"hair_color_2":0,"torso_1":29,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":1,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":4,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}') +; diff --git a/[esx_addons]/esx_taxijob/localization/pl_esx_taxijob.sql b/[esx_addons]/esx_taxijob/localization/pl_esx_taxijob.sql new file mode 100644 index 00000000..105d9baa --- /dev/null +++ b/[esx_addons]/esx_taxijob/localization/pl_esx_taxijob.sql @@ -0,0 +1,25 @@ +USE `es_extended`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('taxi', 'Taxi') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('taxi',0,'recrue','Tymczasowy',12,'{"hair_2":0,"hair_color_2":0,"torso_1":32,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":0,"age_2":0,"glasses_2":0,"ears_2":0,"arms":27,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',1,'novice','Nowy',24,'{"hair_2":0,"hair_color_2":0,"torso_1":32,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":0,"age_2":0,"glasses_2":0,"ears_2":0,"arms":27,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',2,'experimente','Etatowy',36,'{"hair_2":0,"hair_color_2":0,"torso_1":26,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":57,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":11,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',3,'uber','Uber',48,'{"hair_2":0,"hair_color_2":0,"torso_1":26,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":57,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":11,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',4,'boss','Właściciel',0,'{"hair_2":0,"hair_color_2":0,"torso_1":29,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":1,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":4,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}') +; diff --git a/[esx_addons]/esx_taxijob/localization/sv_esx_taxijob.sql b/[esx_addons]/esx_taxijob/localization/sv_esx_taxijob.sql new file mode 100644 index 00000000..44cf8ef9 --- /dev/null +++ b/[esx_addons]/esx_taxijob/localization/sv_esx_taxijob.sql @@ -0,0 +1,25 @@ +USE `es_extended`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_taxi', 'Taxi', 1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('taxi', 'Taxi') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('taxi',0,'recrue','Nyrekryterad',12,'{"hair_2":0,"hair_color_2":0,"torso_1":32,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":0,"age_2":0,"glasses_2":0,"ears_2":0,"arms":27,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',1,'novice','Skicklig förare',24,'{"hair_2":0,"hair_color_2":0,"torso_1":32,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":0,"age_2":0,"glasses_2":0,"ears_2":0,"arms":27,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',2,'experimente','Erfaren förare',36,'{"hair_2":0,"hair_color_2":0,"torso_1":26,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":57,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":11,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',3,'uber','Professionell förare',48,'{"hair_2":0,"hair_color_2":0,"torso_1":26,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":57,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":11,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}'), + ('taxi',4,'boss','Företagsägare',0,'{"hair_2":0,"hair_color_2":0,"torso_1":29,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":31,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":4,"age_2":0,"glasses_2":0,"ears_2":0,"arms":1,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":0,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":0,"bproof_1":0,"mask_1":0,"decals_1":0,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":4,"eyebrows_1":0,"face":0,"shoes_1":10,"pants_1":24}', '{"hair_2":0,"hair_color_2":0,"torso_1":57,"bags_1":0,"helmet_2":0,"chain_2":0,"eyebrows_3":0,"makeup_3":0,"makeup_2":0,"tshirt_1":38,"makeup_1":0,"bags_2":0,"makeup_4":0,"eyebrows_4":0,"chain_1":0,"lipstick_4":0,"bproof_2":0,"hair_color_1":0,"decals_2":0,"pants_2":1,"age_2":0,"glasses_2":0,"ears_2":0,"arms":21,"lipstick_1":0,"ears_1":-1,"mask_2":0,"sex":1,"lipstick_3":0,"helmet_1":-1,"shoes_2":0,"beard_2":0,"beard_1":0,"lipstick_2":0,"beard_4":0,"glasses_1":5,"bproof_1":0,"mask_1":0,"decals_1":1,"hair_1":0,"eyebrows_2":0,"beard_3":0,"age_1":0,"tshirt_2":0,"skin":0,"torso_2":0,"eyebrows_1":0,"face":0,"shoes_1":49,"pants_1":11}') +; diff --git a/[esx_addons]/esx_taxijob/server/main.lua b/[esx_addons]/esx_taxijob/server/main.lua new file mode 100644 index 00000000..932e1b32 --- /dev/null +++ b/[esx_addons]/esx_taxijob/server/main.lua @@ -0,0 +1,108 @@ +ESX = nil +local lastPlayerSuccess = {} + +TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + +if Config.MaxInService ~= -1 then + TriggerEvent('esx_service:activateService', 'taxi', Config.MaxInService) +end + +TriggerEvent('esx_phone:registerNumber', 'taxi', _U('taxi_client'), true, true) +TriggerEvent('esx_society:registerSociety', 'taxi', 'Taxi', 'society_taxi', 'society_taxi', 'society_taxi', {type = 'public'}) + +RegisterNetEvent('esx_taxijob:success') +AddEventHandler('esx_taxijob:success', function() + local xPlayer = ESX.GetPlayerFromId(source) + local timeNow = os.clock() + + if xPlayer.job.name == 'taxi' then + if not lastPlayerSuccess[source] or timeNow - lastPlayerSuccess[source] > 5 then + lastPlayerSuccess[source] = timeNow + + math.randomseed(os.time()) + local total = math.random(Config.NPCJobEarnings.min, Config.NPCJobEarnings.max) + + if xPlayer.job.grade >= 3 then + total = total * 2 + end + + TriggerEvent('esx_addonaccount:getSharedAccount', 'society_taxi', function(account) + if account then + local playerMoney = ESX.Math.Round(total / 100 * 30) + local societyMoney = ESX.Math.Round(total / 100 * 70) + + xPlayer.addMoney(playerMoney) + account.addMoney(societyMoney) + + xPlayer.showNotification(_U('comp_earned', societyMoney, playerMoney)) + else + xPlayer.addMoney(total) + xPlayer.showNotification(_U('have_earned', total)) + end + end) + end + else + print(('[esx_taxijob] [^3WARNING^7] %s attempted to trigger success (cheating)'):format(xPlayer.identifier)) + end +end) + +RegisterNetEvent('esx_taxijob:getStockItem') +AddEventHandler('esx_taxijob:getStockItem', function(itemName, count) + local xPlayer = ESX.GetPlayerFromId(source) + + if xPlayer.job.name == 'taxi' then + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_taxi', function(inventory) + local item = inventory.getItem(itemName) + + -- is there enough in the society? + if count > 0 and item.count >= count then + -- can the player carry the said amount of x item? + if xPlayer.canCarryItem(itemName, count) then + inventory.removeItem(itemName, count) + xPlayer.addInventoryItem(itemName, count) + xPlayer.showNotification(_U('have_withdrawn', count, item.label)) + else + xPlayer.showNotification(_U('player_cannot_hold')) + end + else + xPlayer.showNotification(_U('quantity_invalid')) + end + end) + else + print(('[esx_taxijob] [^3WARNING^7] %s attempted to trigger getStockItem'):format(xPlayer.identifier)) + end +end) + +ESX.RegisterServerCallback('esx_taxijob:getStockItems', function(source, cb) + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_taxi', function(inventory) + cb(inventory.items) + end) +end) + +RegisterNetEvent('esx_taxijob:putStockItems') +AddEventHandler('esx_taxijob:putStockItems', function(itemName, count) + local xPlayer = ESX.GetPlayerFromId(source) + + if xPlayer.job.name == 'taxi' then + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_taxi', function(inventory) + local item = inventory.getItem(itemName) + + if item.count >= 0 then + xPlayer.removeInventoryItem(itemName, count) + inventory.addItem(itemName, count) + xPlayer.showNotification(_U('have_deposited', count, item.label)) + else + xPlayer.showNotification(_U('quantity_invalid')) + end + end) + else + print(('[esx_taxijob] [^3WARNING^7] %s attempted to trigger putStockItems'):format(xPlayer.identifier)) + end +end) + +ESX.RegisterServerCallback('esx_taxijob:getPlayerInventory', function(source, cb) + local xPlayer = ESX.GetPlayerFromId(source) + local items = xPlayer.inventory + + cb({items = items}) +end) diff --git a/[esx_addons]/esx_vehicleshop/.editorconfig b/[esx_addons]/esx_vehicleshop/.editorconfig new file mode 100644 index 00000000..9b425256 --- /dev/null +++ b/[esx_addons]/esx_vehicleshop/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_size = 4 +indent_style = tab +end_of_line = crlf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/[esx_addons]/esx_vehicleshop/LICENSE b/[esx_addons]/esx_vehicleshop/LICENSE new file mode 100644 index 00000000..12a695e0 --- /dev/null +++ b/[esx_addons]/esx_vehicleshop/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + fxserver-esx_vehicleshop + Copyright (C) 2015 Jérémie N'gadi + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + fxserver-esx_vehicleshop Copyright (C) 2015 Jérémie N'gadi + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. \ No newline at end of file diff --git a/[esx_addons]/esx_vehicleshop/README.md b/[esx_addons]/esx_vehicleshop/README.md new file mode 100644 index 00000000..77e40f64 --- /dev/null +++ b/[esx_addons]/esx_vehicleshop/README.md @@ -0,0 +1,59 @@ +# esx_vehicleshop + +ESX Vehicle Shop adds an vehicle shop to the game, where employeed players can sell vehicles to other players. You can also disable the job part so any player can buy vehicles with a menu based interaction. + +## Requirements + +* Auto mode (everyone can buy vehicles from the dealer) + * No need to download other resources + +* Player management (the car dealer job): billing, boss actions and more! + * [esx_society](https://github.com/ESX-Org/esx_society) + * [esx_billing](https://github.com/ESX-Org/esx_billing) + * [esx_addonaccount](https://github.com/ESX-Org/esx_addonaccount) + * [esx_addoninventory](https://github.com/ESX-Org/esx_addoninventory) + * [cron](https://github.com/ESX-Org/cron) + +## Download & Installation + +### Using [fvm](https://github.com/qlaffont/fvm-installer) + +``` +fvm install --save --folder=esx esx-org/esx_vehicleshop +``` + +### Using Git + +``` +cd resources +git clone https://github.com/ESX-Org/esx_vehicleshop [esx]/esx_vehicleshop +``` + +### Manually + +- Download https://github.com/ESX-Org/esx_vehicleshop/archive/master.zip +- Put it in the `[esx]` directory + +### Installation + +- Import `esx_vehicleshop.sql` in your database +- Add this in your `server.cfg`: + +``` +start esx_vehicleshop +``` +- If you want player management you have to set `Config.EnablePlayerManagement` to `true` in `config.lua` + +## Legal + +### License + +esx_vehicleshop - vehicle shop for ESX + +Copyright (C) 2015-2020 Jérémie N'gadi + +This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version. + +This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details. + +You should have received a copy Of the GNU General Public License along with this program. If Not, see http://www.gnu.org/licenses/. diff --git a/[esx_addons]/esx_vehicleshop/client/main.lua b/[esx_addons]/esx_vehicleshop/client/main.lua new file mode 100644 index 00000000..a63bcdb9 --- /dev/null +++ b/[esx_addons]/esx_vehicleshop/client/main.lua @@ -0,0 +1,866 @@ +local HasAlreadyEnteredMarker, IsInShopMenu = false, false +local CurrentAction, CurrentActionMsg, LastZone, currentDisplayVehicle, CurrentVehicleData +local CurrentActionData, Vehicles, Categories = {}, {}, {} + +ESX = nil + +Citizen.CreateThread(function() + while ESX == nil do + TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + Citizen.Wait(0) + end + + PlayerManagement() +end) + +function getVehicleLabelFromModel(model) + for k,v in ipairs(Vehicles) do + if v.model == model then + return v.name + end + end + + return +end + +function getVehicles() + ESX.TriggerServerCallback('esx_vehicleshop:getCategories', function(categories) + Categories = categories + end) + + ESX.TriggerServerCallback('esx_vehicleshop:getVehicles', function(vehicles) + Vehicles = vehicles + end) +end + +function PlayerManagement() + if Config.EnablePlayerManagement then + if ESX.PlayerData.job.name == 'cardealer' then + Config.Zones.ShopEntering.Type = 1 + + if ESX.PlayerData.job.grade_name == 'boss' then + Config.Zones.BossActions.Type = 1 + end + + else + Config.Zones.ShopEntering.Type = -1 + Config.Zones.BossActions.Type = -1 + Config.Zones.ResellVehicle.Type = -1 + end + end +end + +RegisterNetEvent('esx:playerLoaded') +AddEventHandler('esx:playerLoaded', function(xPlayer) + ESX.PlayerData = xPlayer + + PlayerManagement() + getVehicles() +end) + +RegisterNetEvent('esx_vehicleshop:sendCategories') +AddEventHandler('esx_vehicleshop:sendCategories', function(categories) + Categories = categories +end) + +RegisterNetEvent('esx_vehicleshop:sendVehicles') +AddEventHandler('esx_vehicleshop:sendVehicles', function(vehicles) + Vehicles = vehicles +end) + + +RegisterNetEvent('esx:setJob') AddEventHandler('esx:setJob', PlayerManagement) + +function DeleteDisplayVehicleInsideShop() + local attempt = 0 + + if currentDisplayVehicle and DoesEntityExist(currentDisplayVehicle) then + while DoesEntityExist(currentDisplayVehicle) and not NetworkHasControlOfEntity(currentDisplayVehicle) and attempt < 100 do + Citizen.Wait(100) + NetworkRequestControlOfEntity(currentDisplayVehicle) + attempt = attempt + 1 + end + + if DoesEntityExist(currentDisplayVehicle) and NetworkHasControlOfEntity(currentDisplayVehicle) then + ESX.Game.DeleteVehicle(currentDisplayVehicle) + end + end +end + +function ReturnVehicleProvider() + ESX.TriggerServerCallback('esx_vehicleshop:getCommercialVehicles', function(vehicles) + local elements = {} + + for k,v in ipairs(vehicles) do + local returnPrice = ESX.Math.Round(v.price * 0.75) + local vehicleLabel = getVehicleLabelFromModel(v.vehicle) + + table.insert(elements, { + label = ('%s [%s]'):format(vehicleLabel, _U('generic_shopitem', ESX.Math.GroupDigits(returnPrice))), + value = v.vehicle + }) + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'return_provider_menu', { + title = _U('return_provider_menu'), + align = 'top-left', + elements = elements + }, function(data, menu) + TriggerServerEvent('esx_vehicleshop:returnProvider', data.current.value) + + Citizen.Wait(300) + menu.close() + ReturnVehicleProvider() + end, function(data, menu) + menu.close() + end) + end) +end + +function StartShopRestriction() + Citizen.CreateThread(function() + while IsInShopMenu do + Citizen.Wait(0) + + DisableControlAction(0, 75, true) -- Disable exit vehicle + DisableControlAction(27, 75, true) -- Disable exit vehicle + end + end) +end + +function OpenShopMenu() + if #Vehicles == 0 then + print('[esx_vehicleshop] [^3ERROR^7] No vehicles found') + return + end + + IsInShopMenu = true + + StartShopRestriction() + ESX.UI.Menu.CloseAll() + + local playerPed = PlayerPedId() + + FreezeEntityPosition(playerPed, true) + SetEntityVisible(playerPed, false) + SetEntityCoords(playerPed, Config.Zones.ShopInside.Pos) + + local vehiclesByCategory = {} + local elements = {} + local firstVehicleData = nil + + for i=1, #Categories, 1 do + vehiclesByCategory[Categories[i].name] = {} + end + + for i=1, #Vehicles, 1 do + if IsModelInCdimage(GetHashKey(Vehicles[i].model)) then + table.insert(vehiclesByCategory[Vehicles[i].category], Vehicles[i]) + else + print(('[esx_vehicleshop] [^3ERROR^7] Vehicle "%s" does not exist'):format(Vehicles[i].model)) + end + end + + for k,v in pairs(vehiclesByCategory) do + table.sort(v, function(a, b) + return a.name < b.name + end) + end + + for i=1, #Categories, 1 do + local category = Categories[i] + local categoryVehicles = vehiclesByCategory[category.name] + local options = {} + + for j=1, #categoryVehicles, 1 do + local vehicle = categoryVehicles[j] + + if i == 1 and j == 1 then + firstVehicleData = vehicle + end + + table.insert(options, ('%s %s'):format(vehicle.name, _U('generic_shopitem', ESX.Math.GroupDigits(vehicle.price)))) + end + + table.sort(options) + + table.insert(elements, { + name = category.name, + label = category.label, + value = 0, + type = 'slider', + max = #Categories[i], + options = options + }) + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_shop', { + title = _U('car_dealer'), + align = 'top-left', + elements = elements + }, function(data, menu) + local vehicleData = vehiclesByCategory[data.current.name][data.current.value + 1] + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'shop_confirm', { + title = _U('buy_vehicle_shop', vehicleData.name, ESX.Math.GroupDigits(vehicleData.price)), + align = 'top-left', + elements = { + {label = _U('no'), value = 'no'}, + {label = _U('yes'), value = 'yes'} + }}, function(data2, menu2) + if data2.current.value == 'yes' then + if Config.EnablePlayerManagement then + ESX.TriggerServerCallback('esx_vehicleshop:buyCarDealerVehicle', function(success) + if success then + IsInShopMenu = false + DeleteDisplayVehicleInsideShop() + + CurrentAction = 'shop_menu' + CurrentActionMsg = _U('shop_menu') + CurrentActionData = {} + + local playerPed = PlayerPedId() + FreezeEntityPosition(playerPed, false) + SetEntityVisible(playerPed, true) + SetEntityCoords(playerPed, Config.Zones.ShopEntering.Pos) + + menu2.close() + menu.close() + ESX.ShowNotification(_U('vehicle_purchased')) + else + ESX.ShowNotification(_U('broke_company')) + end + end, vehicleData.model) + else + local generatedPlate = GeneratePlate() + + ESX.TriggerServerCallback('esx_vehicleshop:buyVehicle', function(success) + if success then + IsInShopMenu = false + menu2.close() + menu.close() + DeleteDisplayVehicleInsideShop() + + ESX.Game.SpawnVehicle(vehicleData.model, Config.Zones.ShopOutside.Pos, Config.Zones.ShopOutside.Heading, function(vehicle) + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + SetVehicleNumberPlateText(vehicle, generatedPlate) + + FreezeEntityPosition(playerPed, false) + SetEntityVisible(playerPed, true) + end) + else + ESX.ShowNotification(_U('not_enough_money')) + end + end, vehicleData.model, generatedPlate) + end + else + menu2.close() + end + end, function(data2, menu2) + menu2.close() + end) + end, function(data, menu) + menu.close() + DeleteDisplayVehicleInsideShop() + local playerPed = PlayerPedId() + + CurrentAction = 'shop_menu' + CurrentActionMsg = _U('shop_menu') + CurrentActionData = {} + + FreezeEntityPosition(playerPed, false) + SetEntityVisible(playerPed, true) + SetEntityCoords(playerPed, Config.Zones.ShopEntering.Pos) + + IsInShopMenu = false + end, function(data, menu) + local vehicleData = vehiclesByCategory[data.current.name][data.current.value + 1] + local playerPed = PlayerPedId() + + DeleteDisplayVehicleInsideShop() + WaitForVehicleToLoad(vehicleData.model) + + ESX.Game.SpawnLocalVehicle(vehicleData.model, Config.Zones.ShopInside.Pos, Config.Zones.ShopInside.Heading, function(vehicle) + currentDisplayVehicle = vehicle + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + FreezeEntityPosition(vehicle, true) + SetModelAsNoLongerNeeded(vehicleData.model) + end) + end) + + DeleteDisplayVehicleInsideShop() + WaitForVehicleToLoad(firstVehicleData.model) + + ESX.Game.SpawnLocalVehicle(firstVehicleData.model, Config.Zones.ShopInside.Pos, Config.Zones.ShopInside.Heading, function(vehicle) + currentDisplayVehicle = vehicle + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + FreezeEntityPosition(vehicle, true) + SetModelAsNoLongerNeeded(firstVehicleData.model) + end) +end + +function WaitForVehicleToLoad(modelHash) + modelHash = (type(modelHash) == 'number' and modelHash or GetHashKey(modelHash)) + + if not HasModelLoaded(modelHash) then + RequestModel(modelHash) + + BeginTextCommandBusyspinnerOn('STRING') + AddTextComponentSubstringPlayerName(_U('shop_awaiting_model')) + EndTextCommandBusyspinnerOn(4) + + while not HasModelLoaded(modelHash) do + Citizen.Wait(0) + DisableAllControlActions(0) + end + + BusyspinnerOff() + end +end + +function OpenResellerMenu() + ESX.UI.Menu.CloseAll() + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'reseller', { + title = _U('car_dealer'), + align = 'top-left', + elements = { + {label = _U('buy_vehicle'), value = 'buy_vehicle'}, + {label = _U('pop_vehicle'), value = 'pop_vehicle'}, + {label = _U('depop_vehicle'), value = 'depop_vehicle'}, + {label = _U('return_provider'), value = 'return_provider'}, + {label = _U('create_bill'), value = 'create_bill'}, + {label = _U('get_rented_vehicles'), value = 'get_rented_vehicles'}, + {label = _U('set_vehicle_owner_sell'), value = 'set_vehicle_owner_sell'}, + {label = _U('set_vehicle_owner_rent'), value = 'set_vehicle_owner_rent'}, + {label = _U('deposit_stock'), value = 'put_stock'}, + {label = _U('take_stock'), value = 'get_stock'} + }}, function(data, menu) + local action = data.current.value + + if action == 'buy_vehicle' then + OpenShopMenu() + elseif action == 'put_stock' then + OpenPutStocksMenu() + elseif action == 'get_stock' then + OpenGetStocksMenu() + elseif action == 'pop_vehicle' then + OpenPopVehicleMenu() + elseif action == 'depop_vehicle' then + if currentDisplayVehicle then + DeleteDisplayVehicleInsideShop() + else + ESX.ShowNotification(_U('no_current_vehicle')) + end + elseif action == 'return_provider' then + ReturnVehicleProvider() + elseif action == 'create_bill' then + local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() + + if closestPlayer ~= -1 and closestDistance < 3 then + ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'set_vehicle_owner_sell_amount', { + title = _U('invoice_amount') + }, function(data2, menu2) + local amount = tonumber(data2.value) + + if amount == nil then + ESX.ShowNotification(_U('invalid_amount')) + else + menu2.close() + local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() + + if closestPlayer == -1 or closestDistance > 3.0 then + ESX.ShowNotification(_U('no_players')) + else + TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(closestPlayer), 'society_cardealer', _U('car_dealer'), tonumber(data2.value)) + end + end + end, function(data2, menu2) + menu2.close() + end) + else + ESX.ShowNotification(_U('no_players')) + end + elseif action == 'get_rented_vehicles' then + OpenRentedVehiclesMenu() + elseif action == 'set_vehicle_owner_sell' then + if currentDisplayVehicle then + local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() + + if closestPlayer ~= -1 and closestDistance < 3 then + local newPlate = GeneratePlate() + local vehicleProps = ESX.Game.GetVehicleProperties(currentDisplayVehicle) + vehicleProps.plate = newPlate + SetVehicleNumberPlateText(currentDisplayVehicle, newPlate) + TriggerServerEvent('esx_vehicleshop:setVehicleOwnedPlayerId', GetPlayerServerId(closestPlayer), vehicleProps, CurrentVehicleData.model, CurrentVehicleData.name) + currentDisplayVehicle = nil + else + ESX.ShowNotification(_U('no_players')) + end + else + ESX.ShowNotification(_U('no_current_vehicle')) + end + elseif action == 'set_vehicle_owner_rent' then + if currentDisplayVehicle then + local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() + + if closestPlayer ~= -1 and closestDistance < 3 then + ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'set_vehicle_owner_rent_amount', { + title = _U('rental_amount') + }, function(data2, menu2) + local amount = tonumber(data2.value) + + if not amount then + ESX.ShowNotification(_U('invalid_amount')) + else + menu2.close() + local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() + + if closestPlayer ~= -1 and closestDistance < 3 then + local newPlate = 'RENT' .. string.upper(ESX.GetRandomString(4)) + local model = CurrentVehicleData.model + SetVehicleNumberPlateText(currentDisplayVehicle, newPlate) + TriggerServerEvent('esx_vehicleshop:rentVehicle', model, newPlate, amount, GetPlayerServerId(closestPlayer)) + currentDisplayVehicle = nil + else + ESX.ShowNotification(_U('no_players')) + end + end + end, function(data2, menu2) + menu2.close() + end) + else + ESX.ShowNotification(_U('no_players')) + end + else + ESX.ShowNotification(_U('no_current_vehicle')) + end + end + end, function(data, menu) + menu.close() + + CurrentAction = 'reseller_menu' + CurrentActionMsg = _U('shop_menu') + CurrentActionData = {} + end) +end + +function OpenPopVehicleMenu() + ESX.TriggerServerCallback('esx_vehicleshop:getCommercialVehicles', function(vehicles) + local elements = {} + + for k,v in ipairs(vehicles) do + local vehicleLabel = getVehicleLabelFromModel(v.vehicle) + + table.insert(elements, { + label = ('%s [MSRP %s]'):format(vehicleLabel, _U('generic_shopitem', ESX.Math.GroupDigits(v.price))), + value = v.vehicle + }) + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'commercial_vehicles', { + title = _U('vehicle_dealer'), + align = 'top-left', + elements = elements + }, function(data, menu) + local model = data.current.value + DeleteDisplayVehicleInsideShop() + + ESX.Game.SpawnVehicle(model, Config.Zones.ShopInside.Pos, Config.Zones.ShopInside.Heading, function(vehicle) + currentDisplayVehicle = vehicle + + for i=1, #Vehicles, 1 do + if model == Vehicles[i].model then + CurrentVehicleData = Vehicles[i] + break + end + end + end) + end, function(data, menu) + menu.close() + end) + end) +end + +function OpenRentedVehiclesMenu() + ESX.TriggerServerCallback('esx_vehicleshop:getRentedVehicles', function(vehicles) + local elements = {} + + for k,v in ipairs(vehicles) do + local vehicleLabel = getVehicleLabelFromModel(v.name) + + table.insert(elements, { + label = ('%s: %s - %s'):format(v.playerName, vehicleLabel, v.plate), + value = v.name + }) + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'rented_vehicles', { + title = _U('rent_vehicle'), + align = 'top-left', + elements = elements + }, nil, function(data, menu) + menu.close() + end) + end) +end + +function OpenBossActionsMenu() + ESX.UI.Menu.CloseAll() + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'reseller',{ + title = _U('dealer_boss'), + align = 'top-left', + elements = { + {label = _U('boss_actions'), value = 'boss_actions'}, + {label = _U('boss_sold'), value = 'sold_vehicles'} + }}, function(data, menu) + if data.current.value == 'boss_actions' then + TriggerEvent('esx_society:openBossMenu', 'cardealer', function(data2, menu2) + menu2.close() + end) + elseif data.current.value == 'sold_vehicles' then + + ESX.TriggerServerCallback('esx_vehicleshop:getSoldVehicles', function(customers) + local elements = { + head = { _U('customer_client'), _U('customer_model'), _U('customer_plate'), _U('customer_soldby'), _U('customer_date') }, + rows = {} + } + + for i=1, #customers, 1 do + table.insert(elements.rows, { + data = customers[i], + cols = { + customers[i].client, + customers[i].model, + customers[i].plate, + customers[i].soldby, + customers[i].date + } + }) + end + + ESX.UI.Menu.Open('list', GetCurrentResourceName(), 'sold_vehicles', elements, function(data2, menu2) + + end, function(data2, menu2) + menu2.close() + end) + end) + end + + end, function(data, menu) + menu.close() + + CurrentAction = 'boss_actions_menu' + CurrentActionMsg = _U('shop_menu') + CurrentActionData = {} + end) +end + +function OpenGetStocksMenu() + ESX.TriggerServerCallback('esx_vehicleshop:getStockItems', function(items) + local elements = {} + + for i=1, #items, 1 do + if items[i].count > 0 then + table.insert(elements, { + label = 'x' .. items[i].count .. ' ' .. items[i].label, + value = items[i].name + }) + end + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'stocks_menu', { + title = _U('dealership_stock'), + align = 'top-left', + elements = elements + }, function(data, menu) + local itemName = data.current.value + + ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'stocks_menu_get_item_count', { + title = _U('amount') + }, function(data2, menu2) + local count = tonumber(data2.value) + + if count == nil then + ESX.ShowNotification(_U('quantity_invalid')) + else + TriggerServerEvent('esx_vehicleshop:getStockItem', itemName, count) + menu2.close() + menu.close() + OpenGetStocksMenu() + end + end, function(data2, menu2) + menu2.close() + end) + end, function(data, menu) + menu.close() + end) + end) +end + +function OpenPutStocksMenu() + ESX.TriggerServerCallback('esx_vehicleshop:getPlayerInventory', function(inventory) + local elements = {} + + for i=1, #inventory.items, 1 do + local item = inventory.items[i] + + if item.count > 0 then + table.insert(elements, { + label = item.label .. ' x' .. item.count, + type = 'item_standard', + value = item.name + }) + end + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'stocks_menu', { + title = _U('inventory'), + align = 'top-left', + elements = elements + }, function(data, menu) + local itemName = data.current.value + + ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'stocks_menu_put_item_count', { + title = _U('amount') + }, function(data2, menu2) + local count = tonumber(data2.value) + + if count == nil then + ESX.ShowNotification(_U('quantity_invalid')) + else + TriggerServerEvent('esx_vehicleshop:putStockItems', itemName, count) + menu2.close() + menu.close() + OpenPutStocksMenu() + end + end, function(data2, menu2) + menu2.close() + end) + end, function(data, menu) + menu.close() + end) + end) +end + +AddEventHandler('esx_vehicleshop:hasEnteredMarker', function(zone) + if zone == 'ShopEntering' then + + if Config.EnablePlayerManagement then + if ESX.PlayerData.job ~= nil and ESX.PlayerData.job.name == 'cardealer' then + CurrentAction = 'reseller_menu' + CurrentActionMsg = _U('shop_menu') + CurrentActionData = {} + end + else + CurrentAction = 'shop_menu' + CurrentActionMsg = _U('shop_menu') + CurrentActionData = {} + end + + elseif zone == 'GiveBackVehicle' and Config.EnablePlayerManagement then + local playerPed = PlayerPedId() + + if IsPedInAnyVehicle(playerPed, false) then + local vehicle = GetVehiclePedIsIn(playerPed, false) + + CurrentAction = 'give_back_vehicle' + CurrentActionMsg = _U('vehicle_menu') + CurrentActionData = {vehicle = vehicle} + end + elseif zone == 'ResellVehicle' then + local playerPed = PlayerPedId() + + if IsPedSittingInAnyVehicle(playerPed) then + local vehicle = GetVehiclePedIsIn(playerPed, false) + local vehicleData, model, resellPrice, plate + + if GetPedInVehicleSeat(vehicle, -1) == playerPed then + for i=1, #Vehicles, 1 do + if GetHashKey(Vehicles[i].model) == GetEntityModel(vehicle) then + vehicleData = Vehicles[i] + break + end + end + + if vehicleData then + resellPrice = ESX.Math.Round(vehicleData.price / 100 * Config.ResellPercentage) + model = GetEntityModel(vehicle) + plate = ESX.Math.Trim(GetVehicleNumberPlateText(vehicle)) + + CurrentAction = 'resell_vehicle' + CurrentActionMsg = _U('sell_menu', vehicleData.name, ESX.Math.GroupDigits(resellPrice)) + + CurrentActionData = { + vehicle = vehicle, + label = vehicleData.name, + price = resellPrice, + model = model, + plate = plate + } + else + ESX.ShowNotification(_U('invalid_vehicle')) + end + end + end + + elseif zone == 'BossActions' and Config.EnablePlayerManagement and ESX.PlayerData.job ~= nil and ESX.PlayerData.job.name == 'cardealer' and ESX.PlayerData.job.grade_name == 'boss' then + CurrentAction = 'boss_actions_menu' + CurrentActionMsg = _U('shop_menu') + CurrentActionData = {} + end +end) + +AddEventHandler('esx_vehicleshop:hasExitedMarker', function(zone) + if not IsInShopMenu then + ESX.UI.Menu.CloseAll() + end + + CurrentAction = nil +end) + +AddEventHandler('onResourceStop', function(resource) + if resource == GetCurrentResourceName() then + if IsInShopMenu then + ESX.UI.Menu.CloseAll() + + local playerPed = PlayerPedId() + + FreezeEntityPosition(playerPed, false) + SetEntityVisible(playerPed, true) + SetEntityCoords(playerPed, Config.Zones.ShopEntering.Pos) + end + + DeleteDisplayVehicleInsideShop() + end +end) + +if Config.EnablePlayerManagement then + RegisterNetEvent('esx_phone:loaded') + AddEventHandler('esx_phone:loaded', function(phoneNumber, contacts) + local specialContact = { + name = _U('dealership'), + number = 'cardealer', + base64Icon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAMAAABrrFhUAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMAUExURQAAADMzMzszM0M0M0w0M1Q1M101M2U2M242M3Y3M383Moc4MpA4Mpg5MqE5Mqk6MrI6Mro7Mrw8Mr89M71DML5EO8I+NMU/NcBMLshANctBNs5CN8RULMddKsheKs9YLtBCONZEOdlFOtxGO99HPNhMNsplKM1nKM1uJtRhLddiLt5kMNJwJ9B2JNR/IeNIPeVJPehKPuRQOuhSO+lZOOlhNuloM+p3Lep/KupwMMFORsVYUcplXc1waNJ7delUSepgVexrYe12bdeHH9iIH9qQHd2YG+udH+OEJeuGJ+uOJeuVIuChGeSpF+aqGOykHOysGeeyFeuzFuyzFuq6E+27FO+Cee3CEdaGgdqTjvCNhfKYkvOkngAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJezdycAAAEAdFJOU////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wBT9wclAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAGHRFWHRTb2Z0d2FyZQBwYWludC5uZXQgNC4xLjb9TgnoAAAQGElEQVR4Xt2d+WMUtxXHbS6bEGMPMcQQ04aEUnqYo9xJWvC6kAKmQLM2rdn//9+g0uir2Tl0PElPszP7+cnH7Fj6rPTeG2lmvfKld2azk8lk/36L/cnkZDbDIT3Sp4DZ8QS9dTI57tNDTwJOOu+4j/0TvDQz+QXMSG+7mUn+sZBZQELnNROcKhMZBXx+gS4k8+IzTpmBXAJOnqPxTDzPFRKyCODuvSKPgwwC2EZ+lxf4E4xwCzhBU7PBPQx4BWR88+fwDgNGAbMsM9/Ec8bygE3A5966L3nOlhiZBGSf+l2YggGLgBna1DMsE4FBQH9zvw1HLEgX0Evkt5GeEVIFMFztpJF6rZQm4DNasVDSEkKSgIVN/ibP0ZwoEgQsfPTPSZgH8QIG8vYr4gdBrIABvf2K2EEQKWBQb78ichBECRhE8O8SlQ5iBAQvcffFPhoYQoSAAQ5/TcQ0CBYw0OGvCZ4GoQIGF/3bhGaDQAELvfKhERgIwgQMePrPCQsEQQLwFwYPmksiQMCC1n1iCFgooQtYwLJfPPQFQ7KAUfU/wABVwMj6TzdAFDDY6tcOMR3SBIyw/1QDJAGj7D/RAEXA6Oa/hhIHCAJG23+SAb+AEfefYsArYET1nwlvTegVgBONFnTDik8ATjNi0BEbHgGjuP5147k6dgsYaQHQxF0OOAUMfv2LhnOVzCVg4OufdFwrpS4BePkSgA6ZcAhYggCocQRCu4ClCIAaeyC0CliaAKCwhgGrALxwaUC3OtgELFEAUNjCgEXAklQAdSzVgEUAXrRUoGstzAKWbgJIzJPAKGAJJ4DEOAmMAvCCpQPda2ASsJQTQGKaBAYBS1YC1TGUQwYBOHgpQRdrdAUsaQRUdONgVwAOXVLQyTkdASO4CyiFzhMWbQEj3wbw094oaAtY2hSoaafCloClHwCdIdASgIOWGnQVNAWMeiOUSnPDtCkAh3Dz2MBD/G4BoLOKhgD2AfDo6Zv3v32y89v7929eP3n8AIf3RKMgbghgTQEPn/56hH56OXr/+ll/FhqJoC6AMwU8+RV9o/Ph6SO8ODf1RFAXwDcAnrjGvYMPT3sZB/UhUBeAXyfz+AP6E8HR2z6iIzosqQngugp4g77E8jr/KKhdEdQE4JeJPHiPfhCZHn7EVxVHz3CufKDLgrkAnhz4QA//6as7t653ead+uye/3i4qrt8+qHt4m3sQzIuhuQD8Kg3d///8FT1rc6h+fx3f1tk9mKpfCv79h7s4YybQaW4Buv//uoROdXAIKIrtvUrBdPcazpkHdLomgCUEquR/9Gd0yIBTgFBwoH4vDVy9h7PmoAqDlQD8IomnZdOPfo/emPAIENFAx4Lp7pWcBtDtSgBHCHykWm6b/iVeAcU24qQwcOkmzpwBHQa1AI4qUCXAf6IjZvwCiuKlOubTx+1LP+DU/OhqUAvAj1N4glajG2YoAioD74riBk7ODzoOARwzQNX/t9EJCyQBlYGXRZEtGWAOQADDDMAAQBds0AQUOg7cKopcyQBzAALwwxRIA4AqYBu5YLpTFFcy1USq50oAw36oGgBTdMAKUUCxq477dCi+zpQM1MKQEsBQBakUcKCab4cqoNhTB37aE19fyhIKVS2kBOBHCTxUzd1VrbdDFqCPnJZZJYuBsutcAtQigC8EhgjYwXXBq/K7HMmg7HopgGFHXIVAkbY80AUUd9ShOPZb/mRQ7pWXAvCDBFAFi6zlIUBAgUwgyiFJhmTAKEBdBn1yV4GSEAHX1bE6tfInAy2AYTlc5QC8Vy5CBBSv1ME6srAnA7k8LgUwhADVUhWvnAQJ2FEHz6srZgMyCEgB+DaBx6qhd9BOB0EC9DWBSoUS5mTAJuC1aqivDhaECdCpcG6Wd5GETQCWwgndChOgU+F8CBRXOEOhEsBwKYxdUH4B250hwJoMxCWxEJD+cBDq4E9oootAAYYhwBkK90sB+CYBxMAcAgxDoCi+x99Nh0kAYmAOAcYhwJcMmARgO1Reu/sIFmAcAmzJQApgqwPzCKiGAL4FTMlgJgQc4+sEsCGWR4AeAq0i49KP+ONJHAsBbIUwpRKOEKCHQGetgSMZTIQAfJmCaiGlEo4RoBdIO9fa3+HPp8AiQGfBTAKK2+o13QF2LT0UjkKAXhnZwbdz0pPBOATsqRft4dsa36Qmgy8rDFkQy0H5BGBdwLTekpoMZhwCdCHoXxGMFGCfA4K0ZDBbYbgW1AIovYoTgIUR83pDUjI4WWEoA/ILsOaBkpRkMBmHAOwU2vZdEpLBZIXho0LyCyjUq6yXm/GLJPsr+ILOQzzxMEffGJ5RAF5W3l9p4nd/UU15dP/+3bDhECjg4VvHMwAZBehbRrwcvf1bWG0QJuCZ8xGIjAJwQUTh6I9BGyhBArADaMO7Ny6IFKB3yUjshmTGIAGexyAwH53Ub5YOAHmQhkgW9LwQIkDdBTMCRMFEzgshAt7i/IOnvE2BGAhCBGDpb/iotTlagRgigPwU3KLBGjrplooAAaMJAdVVE+VW4wAB4U8CLozqosG/h0QXoDcAR0FVZ3hvtKUL0Os+o2B+4ewrjOkCIh8GXRDzxSNPYUwW4CmDh0b9nl1nYUwWMJoqSNHYSnTdZEleEBlNEQAa64f2wnifuiQ2oiJA0VpDtwUC8prgiIoA0LrithTGE+Ky+KiKAEX7xm1zYXxC3BgZVREA2tsoxk0k6s7QuIoARXenzlAYz2ibo/Qi4PDwUD/xlYF34vS4YcSPYRehWxgTd4dJHwrx7o6OOzu3XpKbSWX68rYe09f3aI4NO2mdW4uIAvxFwPSgNeVuYfmTh8NWZ3buEAyb7llqF8Y0Ac9wRjsHjdv4FHoBNJ2PhkXkbcJKuXGZulkYCwGEQsBXBHy0LIgHrOa7sNx3sOsVbH6EqV4Yy5uk/LfJPcD5bLwyvP2KXYZQMLXvIXj3i8wNqxXG8jY5fx70FAENz5sbG1v4UuJ/l3xM66Nrq3l2rwHDTTUlVSCQN0r6g4D7c5Gq/m9dOHd6teTM+tf4WfXIQyzz/n+9dgZnX6vO7jNg20+vbjYm3SvsLgJ0qN1cU80Dp8/jrUqcBRj/W+dP4cQlp9Y31c/1c1U2rHftoDAmCXAWAViB3lpH0+acxvuEW7ziQPxrdl9y6rz6jb6L0oL97l1VGJcCfCsCziJAKb6Isd9kTQ2ChIJAXdNuncUJG5xRZ/dsmxrvq1KIQKAemPBcDzqLAGX4QucNUqg26offIignwEXL2U9dlL/1hAFzJlRcvacemfHMAWcRULbwa7SoizJAvruhTanX1n9twO23+aBFiyuUp8acRYCnhaurZ+UB0UNA6t1C7DdxuvTrjoOGC4I5FAHOIqA8u6OFq6tlrIosBsokdg4nMnJOHnELh5uxZkIJBDiLYX0LmBE5vs6jMRZkvopMBHJpewOnsVBmGneilUdY+AUCnLWgazVUzoAtxwSQrIlj9AeCBCJngDG9zDkt++GcA/ZEWBT/gwDnHHDFAJmlPQNADYG4Yki80B5fwQVxkPOay3IlVSL77hXg2hGRIcDzFq2urouDokoBWQQ4I4BERgFXKeDMApUAZxB4YF8PFGPUM0cFcpR6ClYzYvBu4RwORCJwCXAlARkClABPIrReDAkB3hlQzoGohQEhwDsDVBjECwz4kiBJgMgElkEgBBir1CaiiVECXpH0yjyLF7SZvnQUwoKy60qA94OUHvwJN+w1EPPLWQQoRBN38IIgxIVw8wrTSBkEjFiWqSp+KruuBBA+SusGXtYCzXCB67YYCOOrrDWj+G/ZdSXANwckN40flIpmuBiqANVzCKB8nN7dK3hlHTTDxUAFXFY9hwDSFum9a3htDVoMiMVbBiQI+IfqOQRQ5oCgGwhoWSAWYhaIAh3XAogfKfljOxAQmqjWLaIg1AGyFo4BM6ASQH16rh0I/E0sr1ciIVSCenU0FMyASgBxDnQDgediUF0ORuMNMWdwYDDo9lwA/UMlm4HAW6skzICiuICTWImdAaoKElQCyEOgFQg20RIb8Xm6xDPATqml4XDQ6TgBzUDgGQIbOCwSzxD4CocFg07XBYQ8RFwPBO4lIbkakIQzz0ZHAB0C6wJChkAjELiWBLB7kcCmw++p2BQwHwB1AWGfrVsLBPZhir2LJC7iXAaip1cVAhsCwoZAPRDYDHD0377vFJ0B6gOgISDwA8ZrgcDcxjPRI7SJeeclwa6uAiV1AcEfJjEPBJuGWJVwEdRiy3BRdC4husjlcE1dQPhnzNcDQWt5eI3p7VdstASfTcmu9QHQFBD+Gev1iuDieuXg7Fes3Zdsrldl8Znq9og41FIQaAgIDIOS5qXB1oaEJfSZKM+eWFkJ0FlFU0BIMaSxLBYOl3kRJGkKiBgChjWCYdOIAB0BwYlAYlwsHCz1FCBoCYj7ZyOmxcKh0hoAHQFRQ2BMgaA1ADoCYv/bxlgCQe0qQNEREBUHBTfHEQjQyTldAcTHyDrcu4q/MWTKHfEGXQGxQ+D+/e/xVwYMuljDICD+nw79MPRA0CiCFQYBcamwZOCBoJ0CJSYB8ZNg4IEA3WtgFBAbByUDDgTdCCgwCkiYBAMOBKYJYBOQMAmGGwjQtRYWASmTYKCBwDgBrAKSJsEgA4F5AtgFJE2CIQYCdKuDVUDi/2AcWiAwlEAKq4DU/70yrEDwMzrVxS4gMQwMKhDYAoDAISAxDAwpEKBDJlwCkv8V61ACgTUACFwC0qoByTACgaUCUDgFMPwTqgEEAnsAlLgFJAfCAQQCRwCUeAQkB8LFBwJ0xIZPAIOBxQYCdMOKV0DkRkGDBQaC9jZAB6+AqA3TNgsLBM2NUBN+ASwGbn6DFvWLv/8UASwG7n2LNvUJof8kAQzlgOA7tKo/nAWQhiSAx8CNngOBuwDS0ATwGOg3END6TxXAEgd6DQSU+S+hCuAx0F8goPafLoDJQE+BgNz/AAEsNWFPgcBb/80JEMBxXSDoIRCguSSCBDBcHUsyBwLP9W+LMAE86TBvICCmP02ggPRVspKMgYBU/tUIFZC+UlqSLRC41j+NBAsYdCAIm/4lEQKGGwgCp39JjACmacAeCIKHvyRKANM04A0EEcNfEimAKRswBoK/o2GhxApgGgRcgSDy7RfEC+AZBDyBIDT510gQwDMIGAJB/NsvSBLAkw5SA0FU8K9IE8AzD5ICQcLoL0kVEP2ERR3zZzRR6Dz/EEy6gC+z9FBwL24D9XLAwocNBgEsa0URj11xdJ9JAMeCYfBjV/RlPydMAkRCSJ0IQYGA592XsAlIjwX0QMDXfVYBgsSMQAsE6ZG/Dq+A1GBACARMU7+CW4AgZRh4AgHvm1+SQYAYBvHRwBEILnO/+SVZBAjiHZgDQZ7eC3IJEHyOnAvdQPBT2vWOk4wCJFHXSs1AkHq14yGzAMEsXEIVCH5hTPgW8gsoOQlcSr9W/Jxr0rfoSUDJ7Jg0GCbHM7ygD/oUAGazk8mkMyL2J5OTWZ89L/ny5f+yiDXCPYKoAQAAAABJRU5ErkJggg==', + } + + TriggerEvent('esx_phone:addSpecialContact', specialContact.name, specialContact.number, specialContact.base64Icon) + end) +end + +-- Create Blips +Citizen.CreateThread(function() + local blip = AddBlipForCoord(Config.Zones.ShopEntering.Pos) + + SetBlipSprite (blip, 326) + SetBlipDisplay(blip, 4) + SetBlipScale (blip, 1.0) + SetBlipAsShortRange(blip, true) + + BeginTextCommandSetBlipName('STRING') + AddTextComponentSubstringPlayerName(_U('car_dealer')) + EndTextCommandSetBlipName(blip) +end) + +-- Enter / Exit marker events & Draw Markers +Citizen.CreateThread(function() + while true do + Citizen.Wait(4) + local playerCoords = GetEntityCoords(PlayerPedId()) + local isInMarker, letSleep, currentZone = false, true + + for k,v in pairs(Config.Zones) do + local distance = #(playerCoords - v.Pos) + + if distance < Config.DrawDistance then + letSleep = false + + if v.Type ~= -1 then + DrawMarker(v.Type, v.Pos, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, v.Size.x, v.Size.y, v.Size.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, nil, nil, false) + end + + if distance < v.Size.x then + isInMarker, currentZone = true, k + end + end + end + + if (isInMarker and not HasAlreadyEnteredMarker) or (isInMarker and LastZone ~= currentZone) then + HasAlreadyEnteredMarker, LastZone = true, currentZone + LastZone = currentZone + TriggerEvent('esx_vehicleshop:hasEnteredMarker', currentZone) + end + + if not isInMarker and HasAlreadyEnteredMarker then + HasAlreadyEnteredMarker = false + TriggerEvent('esx_vehicleshop:hasExitedMarker', LastZone) + end + + if letSleep then + Citizen.Wait(500) + end + end +end) + +-- Key controls +Citizen.CreateThread(function() + while true do + Citizen.Wait(5) + + if CurrentAction then + ESX.ShowHelpNotification(CurrentActionMsg) + + if IsControlJustReleased(0, 38) then + if CurrentAction == 'shop_menu' then + if Config.LicenseEnable then + ESX.TriggerServerCallback('esx_license:checkLicense', function(hasDriversLicense) + if hasDriversLicense then + OpenShopMenu() + else + ESX.ShowNotification(_U('license_missing')) + end + end, GetPlayerServerId(PlayerId()), 'drive') + else + OpenShopMenu() + end + elseif CurrentAction == 'reseller_menu' then + OpenResellerMenu() + elseif CurrentAction == 'give_back_vehicle' then + ESX.TriggerServerCallback('esx_vehicleshop:giveBackVehicle', function(isRentedVehicle) + if isRentedVehicle then + ESX.Game.DeleteVehicle(CurrentActionData.vehicle) + ESX.ShowNotification(_U('delivered')) + else + ESX.ShowNotification(_U('not_rental')) + end + end, ESX.Math.Trim(GetVehicleNumberPlateText(CurrentActionData.vehicle))) + elseif CurrentAction == 'resell_vehicle' then + ESX.TriggerServerCallback('esx_vehicleshop:resellVehicle', function(vehicleSold) + if vehicleSold then + ESX.Game.DeleteVehicle(CurrentActionData.vehicle) + ESX.ShowNotification(_U('vehicle_sold_for', CurrentActionData.label, ESX.Math.GroupDigits(CurrentActionData.price))) + else + ESX.ShowNotification(_U('not_yours')) + end + end, CurrentActionData.plate, CurrentActionData.model) + elseif CurrentAction == 'boss_actions_menu' then + OpenBossActionsMenu() + end + + CurrentAction = nil + end + else + Citizen.Wait(500) + end + end +end) + +Citizen.CreateThread(function() + RequestIpl('shr_int') -- Load walls and floor + + local interiorID = 7170 + LoadInterior(interiorID) + EnableInteriorProp(interiorID, 'csr_beforeMission') -- Load large window + RefreshInterior(interiorID) +end) diff --git a/[esx_addons]/esx_vehicleshop/client/utils.lua b/[esx_addons]/esx_vehicleshop/client/utils.lua new file mode 100644 index 00000000..88a30d50 --- /dev/null +++ b/[esx_addons]/esx_vehicleshop/client/utils.lua @@ -0,0 +1,69 @@ +local NumberCharset = {} +local Charset = {} + +for i = 48, 57 do table.insert(NumberCharset, string.char(i)) end + +for i = 65, 90 do table.insert(Charset, string.char(i)) end +for i = 97, 122 do table.insert(Charset, string.char(i)) end + +function GeneratePlate() + local generatedPlate + local doBreak = false + + while true do + Citizen.Wait(2) + math.randomseed(GetGameTimer()) + if Config.PlateUseSpace then + generatedPlate = string.upper(GetRandomLetter(Config.PlateLetters) .. ' ' .. GetRandomNumber(Config.PlateNumbers)) + else + generatedPlate = string.upper(GetRandomLetter(Config.PlateLetters) .. GetRandomNumber(Config.PlateNumbers)) + end + + ESX.TriggerServerCallback('esx_vehicleshop:isPlateTaken', function(isPlateTaken) + if not isPlateTaken then + doBreak = true + end + end, generatedPlate) + + if doBreak then + break + end + end + + return generatedPlate +end + +-- mixing async with sync tasks +function IsPlateTaken(plate) + local callback = 'waiting' + + ESX.TriggerServerCallback('esx_vehicleshop:isPlateTaken', function(isPlateTaken) + callback = isPlateTaken + end, plate) + + while type(callback) == 'string' do + Citizen.Wait(0) + end + + return callback +end + +function GetRandomNumber(length) + Citizen.Wait(0) + math.randomseed(GetGameTimer()) + if length > 0 then + return GetRandomNumber(length - 1) .. NumberCharset[math.random(1, #NumberCharset)] + else + return '' + end +end + +function GetRandomLetter(length) + Citizen.Wait(0) + math.randomseed(GetGameTimer()) + if length > 0 then + return GetRandomLetter(length - 1) .. Charset[math.random(1, #Charset)] + else + return '' + end +end diff --git a/[esx_addons]/esx_vehicleshop/config.lua b/[esx_addons]/esx_vehicleshop/config.lua new file mode 100644 index 00000000..f233dad5 --- /dev/null +++ b/[esx_addons]/esx_vehicleshop/config.lua @@ -0,0 +1,57 @@ +Config = {} +Config.DrawDistance = 100 +Config.MarkerColor = {r = 120, g = 120, b = 240} +Config.EnablePlayerManagement = false -- enables the actual car dealer job. You'll need esx_addonaccount, esx_billing and esx_society +Config.ResellPercentage = 50 + +Config.Locale = 'en' + +Config.LicenseEnable = false -- require people to own drivers license when buying vehicles? Only applies if EnablePlayerManagement is disabled. Requires esx_license + +-- looks like this: 'LLL NNN' +-- The maximum plate length is 8 chars (including spaces & symbols), don't go past it! +Config.PlateLetters = 3 +Config.PlateNumbers = 3 +Config.PlateUseSpace = true + +Config.Zones = { + + ShopEntering = { + Pos = vector3(-33.7, -1102.0, 25.4), + Size = {x = 1.5, y = 1.5, z = 1.0}, + Type = 1 + }, + + ShopInside = { + Pos = vector3(-47.5, -1097.2, 25.4), + Size = {x = 1.5, y = 1.5, z = 1.0}, + Heading = -20.0, + Type = -1 + }, + + ShopOutside = { + Pos = vector3(-28.6, -1085.6, 25.5), + Size = {x = 1.5, y = 1.5, z = 1.0}, + Heading = 330.0, + Type = -1 + }, + + BossActions = { + Pos = vector3(-32.0, -1114.2, 25.4), + Size = {x = 1.5, y = 1.5, z = 1.0}, + Type = -1 + }, + + GiveBackVehicle = { + Pos = vector3(-18.2, -1078.5, 25.6), + Size = {x = 3.0, y = 3.0, z = 1.0}, + Type = (Config.EnablePlayerManagement and 1 or -1) + }, + + ResellVehicle = { + Pos = vector3(-44.6, -1080.7, 25.6), + Size = {x = 3.0, y = 3.0, z = 1.0}, + Type = 1 + } + +} diff --git a/[esx_addons]/esx_vehicleshop/esx_vehicleshop.sql b/[esx_addons]/esx_vehicleshop/esx_vehicleshop.sql new file mode 100644 index 00000000..eb4ae549 --- /dev/null +++ b/[esx_addons]/esx_vehicleshop/esx_vehicleshop.sql @@ -0,0 +1,339 @@ +USE `es_extended`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_cardealer','Concessionnaire',1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_cardealer','Concesionnaire',1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('cardealer','Concessionnaire') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('cardealer',0,'recruit','Recrue',10,'{}','{}'), + ('cardealer',1,'novice','Novice',25,'{}','{}'), + ('cardealer',2,'experienced','Experimente',40,'{}','{}'), + ('cardealer',3,'boss','Patron',0,'{}','{}') +; + +CREATE TABLE `cardealer_vehicles` ( + `id` int NOT NULL AUTO_INCREMENT, + `vehicle` varchar(255) NOT NULL, + `price` int NOT NULL, + + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `vehicle_sold` ( + `client` VARCHAR(50) NOT NULL, + `model` VARCHAR(50) NOT NULL, + `plate` VARCHAR(50) NOT NULL, + `soldby` VARCHAR(50) NOT NULL, + `date` VARCHAR(50) NOT NULL, + + PRIMARY KEY (`plate`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `owned_vehicles` ( + `owner` VARCHAR(60) NOT NULL, + `plate` varchar(12) NOT NULL, + `vehicle` longtext, + `type` VARCHAR(20) NOT NULL DEFAULT 'car', + `job` VARCHAR(20) NULL DEFAULT NULL, + `stored` TINYINT(1) NOT NULL DEFAULT '0', + + PRIMARY KEY (`plate`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `rented_vehicles` ( + `vehicle` varchar(60) NOT NULL, + `plate` varchar(12) NOT NULL, + `player_name` varchar(255) NOT NULL, + `base_price` int NOT NULL, + `rent_price` int NOT NULL, + `owner` VARCHAR(60) NOT NULL, + + PRIMARY KEY (`plate`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `vehicle_categories` ( + `name` varchar(60) NOT NULL, + `label` varchar(60) NOT NULL, + + PRIMARY KEY (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +INSERT INTO `vehicle_categories` (name, label) VALUES + ('compacts','Compacts'), + ('coupes','Coupés'), + ('sedans','Sedans'), + ('sports','Sports'), + ('sportsclassics','Sports Classics'), + ('super','Super'), + ('muscle','Muscle'), + ('offroad','Off Road'), + ('suvs','SUVs'), + ('vans','Vans'), + ('motorcycles','Motos') +; + +CREATE TABLE `vehicles` ( + `name` varchar(60) NOT NULL, + `model` varchar(60) NOT NULL, + `price` int NOT NULL, + `category` varchar(60) DEFAULT NULL, + + PRIMARY KEY (`model`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +INSERT INTO `vehicles` (name, model, price, category) VALUES + ('Blade','blade',15000,'muscle'), + ('Buccaneer','buccaneer',18000,'muscle'), + ('Buccaneer Rider','buccaneer2',24000,'muscle'), + ('Chino','chino',15000,'muscle'), + ('Chino Luxe','chino2',19000,'muscle'), + ('Coquette BlackFin','coquette3',55000,'muscle'), + ('Dominator','dominator',35000,'muscle'), + ('Dukes','dukes',28000,'muscle'), + ('Gauntlet','gauntlet',30000,'muscle'), + ('Hotknife','hotknife',125000,'muscle'), + ('Faction','faction',20000,'muscle'), + ('Faction Rider','faction2',30000,'muscle'), + ('Faction XL','faction3',40000,'muscle'), + ('Nightshade','nightshade',65000,'muscle'), + ('Phoenix','phoenix',12500,'muscle'), + ('Picador','picador',18000,'muscle'), + ('Sabre Turbo','sabregt',20000,'muscle'), + ('Sabre GT','sabregt2',25000,'muscle'), + ('Slam Van','slamvan3',11500,'muscle'), + ('Tampa','tampa',16000,'muscle'), + ('Virgo','virgo',14000,'muscle'), + ('Vigero','vigero',12500,'muscle'), + ('Voodoo','voodoo',7200,'muscle'), + ('Blista','blista',8000,'compacts'), + ('Brioso R/A','brioso',18000,'compacts'), + ('Issi','issi2',10000,'compacts'), + ('Panto','panto',10000,'compacts'), + ('Prairie','prairie',12000,'compacts'), + ('Bison','bison',45000,'vans'), + ('Bobcat XL','bobcatxl',32000,'vans'), + ('Burrito','burrito3',19000,'vans'), + ('Burrito','gburrito2',29000,'vans'), + ('Camper','camper',42000,'vans'), + ('Gang Burrito','gburrito',45000,'vans'), + ('Journey','journey',6500,'vans'), + ('Minivan','minivan',13000,'vans'), + ('Moonbeam','moonbeam',18000,'vans'), + ('Moonbeam Rider','moonbeam2',35000,'vans'), + ('Paradise','paradise',19000,'vans'), + ('Rumpo','rumpo',15000,'vans'), + ('Rumpo Trail','rumpo3',19500,'vans'), + ('Surfer','surfer',12000,'vans'), + ('Youga','youga',10800,'vans'), + ('Youga Luxuary','youga2',14500,'vans'), + ('Asea','asea',5500,'sedans'), + ('Cognoscenti','cognoscenti',55000,'sedans'), + ('Emperor','emperor',8500,'sedans'), + ('Fugitive','fugitive',12000,'sedans'), + ('Glendale','glendale',6500,'sedans'), + ('Intruder','intruder',7500,'sedans'), + ('Premier','premier',8000,'sedans'), + ('Primo Custom','primo2',14000,'sedans'), + ('Regina','regina',5000,'sedans'), + ('Schafter','schafter2',25000,'sedans'), + ('Stretch','stretch',90000,'sedans'), + ('Super Diamond','superd',130000,'sedans'), + ('Tailgater','tailgater',30000,'sedans'), + ('Warrener','warrener',4000,'sedans'), + ('Washington','washington',9000,'sedans'), + ('Baller','baller2',40000,'suvs'), + ('Baller Sport','baller3',60000,'suvs'), + ('Cavalcade','cavalcade2',55000,'suvs'), + ('Contender','contender',70000,'suvs'), + ('Dubsta','dubsta',45000,'suvs'), + ('Dubsta Luxuary','dubsta2',60000,'suvs'), + ('Fhantom','fq2',17000,'suvs'), + ('Grabger','granger',50000,'suvs'), + ('Gresley','gresley',47500,'suvs'), + ('Huntley S','huntley',40000,'suvs'), + ('Landstalker','landstalker',35000,'suvs'), + ('Mesa','mesa',16000,'suvs'), + ('Mesa Trail','mesa3',40000,'suvs'), + ('Patriot','patriot',55000,'suvs'), + ('Radius','radi',29000,'suvs'), + ('Rocoto','rocoto',45000,'suvs'), + ('Seminole','seminole',25000,'suvs'), + ('XLS','xls',32000,'suvs'), + ('Btype','btype',62000,'sportsclassics'), + ('Btype Luxe','btype3',85000,'sportsclassics'), + ('Btype Hotroad','btype2',155000,'sportsclassics'), + ('Casco','casco',30000,'sportsclassics'), + ('Coquette Classic','coquette2',40000,'sportsclassics'), + ('Manana','manana',12800,'sportsclassics'), + ('Monroe','monroe',55000,'sportsclassics'), + ('Pigalle','pigalle',20000,'sportsclassics'), + ('Stinger','stinger',80000,'sportsclassics'), + ('Stinger GT','stingergt',75000,'sportsclassics'), + ('Stirling GT','feltzer3',65000,'sportsclassics'), + ('Z-Type','ztype',220000,'sportsclassics'), + ('Bifta','bifta',12000,'offroad'), + ('Bf Injection','bfinjection',16000,'offroad'), + ('Blazer','blazer',6500,'offroad'), + ('Blazer Sport','blazer4',8500,'offroad'), + ('Brawler','brawler',45000,'offroad'), + ('Bubsta 6x6','dubsta3',120000,'offroad'), + ('Dune Buggy','dune',8000,'offroad'), + ('Guardian','guardian',45000,'offroad'), + ('Rebel','rebel2',35000,'offroad'), + ('Sandking','sandking',55000,'offroad'), + ('The Liberator','monster',210000,'offroad'), + ('Trophy Truck','trophytruck',60000,'offroad'), + ('Trophy Truck Limited','trophytruck2',80000,'offroad'), + ('Cognoscenti Cabrio','cogcabrio',55000,'coupes'), + ('Exemplar','exemplar',32000,'coupes'), + ('F620','f620',40000,'coupes'), + ('Felon','felon',42000,'coupes'), + ('Felon GT','felon2',55000,'coupes'), + ('Jackal','jackal',38000,'coupes'), + ('Oracle XS','oracle2',35000,'coupes'), + ('Sentinel','sentinel',32000,'coupes'), + ('Sentinel XS','sentinel2',40000,'coupes'), + ('Windsor','windsor',95000,'coupes'), + ('Windsor Drop','windsor2',125000,'coupes'), + ('Zion','zion',36000,'coupes'), + ('Zion Cabrio','zion2',45000,'coupes'), + ('9F','ninef',65000,'sports'), + ('9F Cabrio','ninef2',80000,'sports'), + ('Alpha','alpha',60000,'sports'), + ('Banshee','banshee',70000,'sports'), + ('Bestia GTS','bestiagts',55000,'sports'), + ('Buffalo','buffalo',12000,'sports'), + ('Buffalo S','buffalo2',20000,'sports'), + ('Carbonizzare','carbonizzare',75000,'sports'), + ('Comet','comet2',65000,'sports'), + ('Coquette','coquette',65000,'sports'), + ('Drift Tampa','tampa2',80000,'sports'), + ('Elegy','elegy2',38500,'sports'), + ('Feltzer','feltzer2',55000,'sports'), + ('Furore GT','furoregt',45000,'sports'), + ('Fusilade','fusilade',40000,'sports'), + ('Jester','jester',65000,'sports'), + ('Jester(Racecar)','jester2',135000,'sports'), + ('Khamelion','khamelion',38000,'sports'), + ('Kuruma','kuruma',30000,'sports'), + ('Lynx','lynx',40000,'sports'), + ('Mamba','mamba',70000,'sports'), + ('Massacro','massacro',65000,'sports'), + ('Massacro(Racecar)','massacro2',130000,'sports'), + ('Omnis','omnis',35000,'sports'), + ('Penumbra','penumbra',28000,'sports'), + ('Rapid GT','rapidgt',35000,'sports'), + ('Rapid GT Convertible','rapidgt2',45000,'sports'), + ('Schafter V12','schafter3',50000,'sports'), + ('Seven 70','seven70',39500,'sports'), + ('Sultan','sultan',15000,'sports'), + ('Surano','surano',50000,'sports'), + ('Tropos','tropos',40000,'sports'), + ('Verlierer','verlierer2',70000,'sports'), + ('Adder','adder',900000,'super'), + ('Banshee 900R','banshee2',255000,'super'), + ('Bullet','bullet',90000,'super'), + ('Cheetah','cheetah',375000,'super'), + ('Entity XF','entityxf',425000,'super'), + ('ETR1','sheava',220000,'super'), + ('FMJ','fmj',185000,'super'), + ('Infernus','infernus',180000,'super'), + ('Osiris','osiris',160000,'super'), + ('Pfister','pfister811',85000,'super'), + ('RE-7B','le7b',325000,'super'), + ('Reaper','reaper',150000,'super'), + ('Sultan RS','sultanrs',65000,'super'), + ('T20','t20',300000,'super'), + ('Turismo R','turismor',350000,'super'), + ('Tyrus','tyrus',600000,'super'), + ('Vacca','vacca',120000,'super'), + ('Voltic','voltic',90000,'super'), + ('X80 Proto','prototipo',2500000,'super'), + ('Zentorno','zentorno',1500000,'super'), + ('Akuma','AKUMA',7500,'motorcycles'), + ('Avarus','avarus',18000,'motorcycles'), + ('Bagger','bagger',13500,'motorcycles'), + ('Bati 801','bati',12000,'motorcycles'), + ('Bati 801RR','bati2',19000,'motorcycles'), + ('BF400','bf400',6500,'motorcycles'), + ('BMX (velo)','bmx',160,'motorcycles'), + ('Carbon RS','carbonrs',18000,'motorcycles'), + ('Chimera','chimera',38000,'motorcycles'), + ('Cliffhanger','cliffhanger',9500,'motorcycles'), + ('Cruiser (velo)','cruiser',510,'motorcycles'), + ('Daemon','daemon',11500,'motorcycles'), + ('Daemon High','daemon2',13500,'motorcycles'), + ('Defiler','defiler',9800,'motorcycles'), + ('Double T','double',28000,'motorcycles'), + ('Enduro','enduro',5500,'motorcycles'), + ('Esskey','esskey',4200,'motorcycles'), + ('Faggio','faggio',1900,'motorcycles'), + ('Vespa','faggio2',2800,'motorcycles'), + ('Fixter (velo)','fixter',225,'motorcycles'), + ('Gargoyle','gargoyle',16500,'motorcycles'), + ('Hakuchou','hakuchou',31000,'motorcycles'), + ('Hakuchou Sport','hakuchou2',55000,'motorcycles'), + ('Hexer','hexer',12000,'motorcycles'), + ('Innovation','innovation',23500,'motorcycles'), + ('Manchez','manchez',5300,'motorcycles'), + ('Nemesis','nemesis',5800,'motorcycles'), + ('Nightblade','nightblade',35000,'motorcycles'), + ('PCJ-600','pcj',6200,'motorcycles'), + ('Ruffian','ruffian',6800,'motorcycles'), + ('Sanchez','sanchez',5300,'motorcycles'), + ('Sanchez Sport','sanchez2',5300,'motorcycles'), + ('Sanctus','sanctus',25000,'motorcycles'), + ('Scorcher (velo)','scorcher',280,'motorcycles'), + ('Sovereign','sovereign',22000,'motorcycles'), + ('Shotaro Concept','shotaro',320000,'motorcycles'), + ('Thrust','thrust',24000,'motorcycles'), + ('Tri bike (velo)','tribike3',520,'motorcycles'), + ('Vader','vader',7200,'motorcycles'), + ('Vortex','vortex',9800,'motorcycles'), + ('Woflsbane','wolfsbane',9000,'motorcycles'), + ('Zombie','zombiea',9500,'motorcycles'), + ('Zombie Luxuary','zombieb',12000,'motorcycles'), + ('blazer5', 'blazer5', 1755600, 'offroad'), + ('Ruiner 2', 'ruiner2', 5745600, 'muscle'), + ('Voltic 2', 'voltic2', 3830400, 'super'), + ('Ardent', 'ardent', 1150000, 'sportsclassics'), + ('Oppressor', 'oppressor', 3524500, 'super'), + ('Visione', 'visione', 2250000, 'super'), + ('Retinue', 'retinue', 615000, 'sportsclassics'), + ('Cyclone', 'cyclone', 1890000, 'super'), + ('Rapid GT3', 'rapidgt3', 885000, 'sportsclassics'), + ('raiden', 'raiden', 1375000, 'sports'), + ('Yosemite', 'yosemite', 485000, 'muscle'), + ('Deluxo', 'deluxo', 4721500, 'sportsclassics'), + ('Pariah', 'pariah', 1420000, 'sports'), + ('Stromberg', 'stromberg', 3185350, 'sports'), + ('SC 1', 'sc1', 1603000, 'super'), + ('riata', 'riata', 380000, 'offroad'), + ('Hermes', 'hermes', 535000, 'muscle'), + ('Savestra', 'savestra', 990000, 'sportsclassics'), + ('Streiter', 'streiter', 500000, 'sports'), + ('Kamacho', 'kamacho', 345000, 'offroad'), + ('GT 500', 'gt500', 785000, 'sportsclassics'), + ('Z190', 'z190', 900000, 'sportsclassics'), + ('Viseris', 'viseris', 875000, 'sportsclassics'), + ('Autarch', 'autarch', 1955000, 'super'), + ('Comet 5', 'comet5', 1145000, 'sports'), + ('Neon', 'neon', 1500000, 'sports'), + ('Revolter', 'revolter', 1610000, 'sports'), + ('Sentinel3', 'sentinel3', 650000, 'sports'), + ('Hustler', 'hustler', 625000, 'muscle') +; diff --git a/[esx_addons]/esx_vehicleshop/fxmanifest.lua b/[esx_addons]/esx_vehicleshop/fxmanifest.lua new file mode 100644 index 00000000..5f171a6d --- /dev/null +++ b/[esx_addons]/esx_vehicleshop/fxmanifest.lua @@ -0,0 +1,40 @@ +fx_version 'adamant' + +game 'gta5' + +description 'ESX Vehicle Shop' + +version '1.1.0' + +server_scripts { + '@async/async.lua', + '@mysql-async/lib/MySQL.lua', + '@es_extended/locale.lua', + 'locales/br.lua', + 'locales/en.lua', + 'locales/fi.lua', + 'locales/fr.lua', + 'locales/sv.lua', + 'locales/pl.lua', + 'locales/cs.lua', + 'config.lua', + 'server/main.lua' +} + +client_scripts { + '@es_extended/locale.lua', + 'locales/br.lua', + 'locales/en.lua', + 'locales/fi.lua', + 'locales/fr.lua', + 'locales/sv.lua', + 'locales/pl.lua', + 'locales/cs.lua', + 'config.lua', + 'client/utils.lua', + 'client/main.lua' +} + +dependency 'es_extended' + +export 'GeneratePlate' diff --git a/[esx_addons]/esx_vehicleshop/locales/br.lua b/[esx_addons]/esx_vehicleshop/locales/br.lua new file mode 100644 index 00000000..02f25d2c --- /dev/null +++ b/[esx_addons]/esx_vehicleshop/locales/br.lua @@ -0,0 +1,65 @@ +Locales['br'] = { + -- global menus + ['not_enough_in_society'] = 'não há o suficiente desse ~r~that item~s~ na sociedade!', + ['player_cannot_hold'] = 'você não tem espaço suficiente em seu inventário!', + ['vehicle_belongs'] = 'um veículo com placa ~y~%s~s~ agora pertence a ~b~you~s~', + ['broke_company'] = 'você não tem dinheiro suficiente na conta da empresa', + ['license_missing'] = 'você não tem carteira de motorista!', + ['buy_vehicle_shop'] = 'comprar %s por $%s?', + ['buy_vehicle'] = 'comprar veículo', + ['car_dealer'] = 'Concessionária de carros', + ['shop_awaiting_model'] = 'o veículo está carregando no momento, aguarde', + ['create_bill'] = 'criar recibo', + ['dealer_boss'] = 'Concessionária de carros - Chefe', + ['delivered'] = 'veículo ~g~entregue~s~ para o revendedor', + ['depop_vehicle'] = 'volte ao veiculo', + ['return_provider'] = 'devolver veículo ao fornecedor', + ['get_rented_vehicles'] = 'veículos para alugar', + ['no_current_vehicle'] = 'you do not currently have an vehicle displayed', + ['invalid_amount'] = 'Montante inválido', + ['invoice_amount'] = 'valor da fatura', + ['no'] = 'não', + ['yes'] = 'sim', + ['no_players'] = 'sem jogadores nas proximidades', + ['not_enough_money'] = 'você não tem dinheiro suficiente', + ['not_rental'] = 'isso não é um ~r~veículo de aluguel~s~', + ['not_yours'] = 'este veículo não pertence a você', + ['paid_rental'] = 'you have paid ~g~$%s~s~ for renting an vehicle with plate ~y~%s~s~', + ['paid_rental_evicted'] = 'you could not afford to pay ~g~$%s~s~ for your rented vehicle with plate ~y~%s~s~, it has been returned to the dealership', + ['pop_vehicle'] = 'sai do veiculo', + ['rent_vehicle'] = 'Concessionária - Veículos para alugar', + ['return_provider_menu'] = 'revendedor de carros - Devolver veículo ao fornecedor', + ['rental_amount'] = 'montante do aluguel', + ['sell_menu'] = 'Pressione ~INPUT_CONTEXT~ para vender ', + ['set_vehicle_owner_rent'] = 'Atribuir veículo [Alugar]', + ['set_vehicle_owner_sell'] = 'Veículos para [Venda]', + ['shop_menu'] = 'pressione ~INPUT_CONTEXT~ para acessar o menu', + ['generic_shopitem'] = '$%s', + ['vehicle_dealer'] = 'Veículo - Concessionária', + ['vehicle_menu'] = 'Pressione ~INPUT_CONTEXT~ para fazer o seu veículo', + ['vehicle_purchased'] = 'você comprou um veículo', + ['vehicle_set_owned'] = 'Veículo ~y~%s~s~ foi atribuído a ~b~%s~s~', + ['vehicle_set_rented'] = 'Veículo ~y~%s~s~ foi alugado para ~b~%s~s~', + ['vehicle_sold_for'] = 'o ~b~%s~s~ foi vendido com sucesso para ~g~$%s~s~', + ['vehicle_sold_to'] = 'Veículo ~y~%s~s~ vendido para ~b~%s~s~', + ['deposit_stock'] = 'Colocar no estoque', + ['take_stock'] = 'Retirar do estoque', + ['dealership_stock'] = 'estoque da concessionária', + ['amount'] = 'montante', + ['quantity_invalid'] = 'quantidade inválida', + ['inventory'] = 'Inventário', + ['dealership'] = 'Concessionária', + ['dealer_customers'] = 'clientes revendedores', + ['have_withdrawn'] = 'você retirou ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'você depositou ~y~x%s~s~ ~b~%s~s~', + ['boss_actions'] = 'ações do chefe', + ['invalid_vehicle'] = 'Veículo inválido', + + -- sold vehicles + ['boss_sold'] = 'lista de veículos vendidos', + ['customer_client'] = 'nome do cliente', + ['customer_model'] = 'modelo de carro', + ['customer_plate'] = 'placa do carro', + ['customer_soldby'] = 'vendido por', + ['customer_date'] = 'data', +} diff --git a/[esx_addons]/esx_vehicleshop/locales/cs.lua b/[esx_addons]/esx_vehicleshop/locales/cs.lua new file mode 100644 index 00000000..c284826f --- /dev/null +++ b/[esx_addons]/esx_vehicleshop/locales/cs.lua @@ -0,0 +1,65 @@ +Locales['cs'] = { + -- global menus + ['not_enough_in_society'] = 'neni zde dostatek ~r~tohoto predmetu~s~ ve spolecnosti!', + ['player_cannot_hold'] = '~r~nemas~s~ dostatek ~y~volneho mista~s~ ve tvem inventari!', + ['vehicle_belongs'] = 'vozidlo se značkou ~y~%s~s~ nyní patří ~b~tobě~s~', + ['broke_company'] = 'nemáš dostatek peněz na účtě společnosti', + ['license_missing'] = 'nemáš ridicský prukaz!', + ['buy_vehicle_shop'] = 'přeješ si zakoupit %s za $%s?', + ['buy_vehicle'] = 'zakoupit vozidlo', + ['car_dealer'] = 'autosalon', + ['shop_awaiting_model'] = 'vozidlo se právě ~g~STAHUJE & NAČÍTÁ~s~, čekej prosím', + ['create_bill'] = 'vytvořit účtenku', + ['dealer_boss'] = 'prodejce aut - Sef', + ['delivered'] = 'vozidlo bylo ~g~doruceno~s~ dealerovi', + ['depop_vehicle'] = 'vrátit vozidlo do garaze', + ['return_provider'] = 'vratit vozidlo zprostredkovateli', + ['get_rented_vehicles'] = 'vozidla na pujceni', + ['no_current_vehicle'] = 'momentalne nemas zobrazene vozidlo', + ['invalid_amount'] = 'neplatná částka', + ['invoice_amount'] = 'castka na fakture', + ['no'] = 'ne', + ['yes'] = 'ano', + ['no_players'] = 'žádní hráči poblíž tebe', + ['not_enough_money'] = 'nemáš dostatek peněz', + ['not_rental'] = 'tohle není ~r~půjčitelné vozidlo~s~', + ['not_yours'] = 'tohle auto ti nepatří', + ['paid_rental'] = 'you have paid ~g~$%s~s~ for renting an vehicle with plate ~y~%s~s~', + ['paid_rental_evicted'] = 'you could not afford to pay ~g~$%s~s~ for your rented vehicle with plate ~y~%s~s~, it has been returned to the dealership', + ['pop_vehicle'] = 'vlozit vozidlo k prodeji', + ['rent_vehicle'] = 'autosalon - Vozidla k pujceni', + ['return_provider_menu'] = 'autosalon - Vratit vozidlo zprostredkovateli', + ['rental_amount'] = 'cena pujceni', + ['sell_menu'] = 'stiskni ~INPUT_CONTEXT~ pro prodani ~y~%s~s~ za ~g~$%s~s~', + ['set_vehicle_owner_rent'] = 'pujcit vozidlo', + ['set_vehicle_owner_sell'] = 'prodat vozidlo', + ['shop_menu'] = 'stiskni ~INPUT_CONTEXT~ pro přístup do menu', + ['generic_shopitem'] = '$%s', + ['vehicle_dealer'] = 'vozidlo - Prodejce aut', + ['vehicle_menu'] = 'stiskni ~INPUT_CONTEXT~ pro vraceni vozidla zpet', + ['vehicle_purchased'] = 'zakoupil jsi vozidlo', + ['vehicle_set_owned'] = 'vozidlo ~y~%s~s~ bylo prirazeno ~b~%s~s~', + ['vehicle_set_rented'] = 'vozidlo ~y~%s~s~ bylo pujceno za ~b~%s~s~', + ['vehicle_sold_for'] = '~b~%s~s~ bylo ~y~prodano~s~ za ~g~$%s~s~', + ['vehicle_sold_to'] = 'vozidlo se znackou ~y~%s~s~ bylo prodano za ~b~%s~s~', + ['deposit_stock'] = 'vlozit do skladu', + ['take_stock'] = 'vybraz ze skladu', + ['dealership_stock'] = 'sklad Autosalonu', + ['amount'] = 'castka', + ['quantity_invalid'] = 'to je neplatne mnozstvi', + ['inventory'] = 'inventar', + ['dealership'] = 'autodealer', + ['dealer_customers'] = 'zakaznici dealera', + ['have_withdrawn'] = 'vybral jsi ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'vlozil jsi ~y~x%s~s~ ~b~%s~s~', + ['boss_actions'] = 'akce šéfa', + ['invalid_vehicle'] = 'neplatné vozidlo', + + -- sold vehicles + ['boss_sold'] = 'seznam prodaných vozidel', + ['customer_client'] = 'jméno zákazníka', + ['customer_model'] = 'model auta', + ['customer_plate'] = 'značka auta', + ['customer_soldby'] = 'prodáno zaměstnancem', + ['customer_date'] = 'datum', +} diff --git a/[esx_addons]/esx_vehicleshop/locales/en.lua b/[esx_addons]/esx_vehicleshop/locales/en.lua new file mode 100644 index 00000000..a596a8be --- /dev/null +++ b/[esx_addons]/esx_vehicleshop/locales/en.lua @@ -0,0 +1,65 @@ +Locales['en'] = { + -- global menus + ['not_enough_in_society'] = 'there\'s not enough of ~r~that item~s~ in the society!', + ['player_cannot_hold'] = 'you do ~r~not~s~ have enough ~y~free space~s~ in your inventory!', + ['vehicle_belongs'] = 'a vehicle with plate ~y~%s~s~ now belongs to ~b~you~s~', + ['broke_company'] = 'you do not have enough money in the company account', + ['license_missing'] = 'you don\'t have a driver\'s license!', + ['buy_vehicle_shop'] = 'do you want to purchase %s for $%s?', + ['buy_vehicle'] = 'buy vehicle', + ['car_dealer'] = 'car Dealership', + ['shop_awaiting_model'] = 'the vehicle is currently loading, please wait', + ['create_bill'] = 'create bill', + ['dealer_boss'] = 'car Dealer - Boss', + ['delivered'] = 'the vehicle has been ~g~delivered~s~ to the dealer', + ['depop_vehicle'] = 'return vehicle to garage', + ['return_provider'] = 'return vehicle to provider', + ['get_rented_vehicles'] = 'vehicles for rent', + ['no_current_vehicle'] = 'you do not currently have a vehicle on display', + ['invalid_amount'] = 'invalid amount', + ['invoice_amount'] = 'invoice amount', + ['no'] = 'no', + ['yes'] = 'yes', + ['no_players'] = 'there is no players near you', + ['not_enough_money'] = 'you do not have enough money', + ['not_rental'] = 'this is not a ~r~rental vehicle~s~', + ['not_yours'] = 'this vehicle does not belong to you', + ['paid_rental'] = 'you have paid ~g~$%s~s~ for renting a vehicle with plate ~y~%s~s~', + ['paid_rental_evicted'] = 'you could not afford to pay ~g~$%s~s~ for your rented vehicle with plate ~y~%s~s~, it has been returned to the dealership', + ['pop_vehicle'] = 'put out vehicle for sale', + ['rent_vehicle'] = 'car Dealer - Vehicles for rent', + ['return_provider_menu'] = 'car Dealer - Return vehicle to provider', + ['rental_amount'] = 'rental amount', + ['sell_menu'] = 'press ~INPUT_CONTEXT~ to sell your ~y~%s~s~ for ~g~$%s~s~', + ['set_vehicle_owner_rent'] = 'rent vehicle', + ['set_vehicle_owner_sell'] = 'sell vehicle', + ['shop_menu'] = 'press ~INPUT_CONTEXT~ to access the menu', + ['generic_shopitem'] = '$%s', + ['vehicle_dealer'] = 'vehicle - Car Dealer', + ['vehicle_menu'] = 'press ~INPUT_CONTEXT~ to give back the rented vehicle', + ['vehicle_purchased'] = 'you bought a vehicle', + ['vehicle_set_owned'] = 'vehicle ~y~%s~s~ has been assigned to ~b~%s~s~', + ['vehicle_set_rented'] = 'vehicle ~y~%s~s~ has been rented to ~b~%s~s~', + ['vehicle_sold_for'] = 'the ~b~%s~s~ has been ~y~sold~s~ for ~g~$%s~s~', + ['vehicle_sold_to'] = 'the vehicle with plate ~y~%s~s~ has been sold to ~b~%s~s~', + ['deposit_stock'] = 'deposit stock', + ['take_stock'] = 'withdraw stock', + ['dealership_stock'] = 'dealership Stock', + ['amount'] = 'amount', + ['quantity_invalid'] = 'that\'s an invalid quantity', + ['inventory'] = 'inventory', + ['dealership'] = 'car Dealer', + ['dealer_customers'] = 'dealer customers', + ['have_withdrawn'] = 'you have withdrawn ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'you have deposited ~y~x%s~s~ ~b~%s~s~', + ['boss_actions'] = 'boss actions', + ['invalid_vehicle'] = 'Invalid vehicle', + + -- sold vehicles + ['boss_sold'] = 'list of sold vehicles', + ['customer_client'] = 'customer name', + ['customer_model'] = 'car model', + ['customer_plate'] = 'car plate', + ['customer_soldby'] = 'sold by', + ['customer_date'] = 'date', +} diff --git a/[esx_addons]/esx_vehicleshop/locales/fi.lua b/[esx_addons]/esx_vehicleshop/locales/fi.lua new file mode 100644 index 00000000..74a17c40 --- /dev/null +++ b/[esx_addons]/esx_vehicleshop/locales/fi.lua @@ -0,0 +1,65 @@ +Locales['fi'] = { + -- global menus + ['not_enough_in_society'] = 'firman varastossa ei ole enempää ~r~tuota esinettä~s~!', + ['player_cannot_hold'] = 'sinulla ~r~ei ole~s~ tarpeeksi ~y~vapaata tilaa~s~ repussasi!', + ['vehicle_belongs'] = 'ajoneuvo kilvellä ~y~%s~s~ on nyt ~b~sinun~s~ omistuksessasi', + ['broke_company'] = 'sinulla ei ole tarpeeksi rahaa yrityksen tilillä', + ['license_missing'] = 'you don\'t have a driver\'s license!', + ['buy_vehicle_shop'] = 'haluatko ostaa ajoneuvon %s hintaan $%s?', + ['buy_vehicle'] = 'osta ajoneuvo', + ['car_dealer'] = 'autokauppa', + ['shop_awaiting_model'] = 'the vehicle is currently loading, please wait', + ['create_bill'] = 'tee lasku', + ['dealer_boss'] = 'autokauppa - Pomo', + ['delivered'] = 'ajoneuvo on ~g~kuljetettu~s~ myyjälle', + ['depop_vehicle'] = 'palauta ajoneuvo', + ['return_provider'] = 'return vehicle to provider', + ['get_rented_vehicles'] = 'vuokrattavat ajoneuvot', + ['no_current_vehicle'] = 'you do not currently have an vehicle displayed', + ['invalid_amount'] = 'virheellinen summa', + ['invoice_amount'] = 'laskun summa', + ['no'] = 'ei', + ['yes'] = 'kyllä', + ['no_players'] = 'ei pelaajia lähettyvillä', + ['not_enough_money'] = 'sinulla ei ole tarpeeksi rahaa', + ['not_rental'] = 'tämä ei ole ~r~vuokra ajoneuvo~s~', + ['not_yours'] = 'tämä ajoneuvo ei kuulu sinulle', + ['paid_rental'] = 'you have paid ~g~$%s~s~ for renting an vehicle with plate ~y~%s~s~', + ['paid_rental_evicted'] = 'you could not afford to pay ~g~$%s~s~ for your rented vehicle with plate ~y~%s~s~, it has been returned to the dealership', + ['pop_vehicle'] = 'ota ajoneuvo ulos näkyville myyntiä varten', + ['rent_vehicle'] = 'autokauppa - Vuokrattavat ajokit', + ['return_provider_menu'] = 'car Dealer - Return vehicle to provider', + ['rental_amount'] = 'vuokran summa', + ['sell_menu'] = 'paina ~INPUT_CONTEXT~ myydäksesi ~y~%s~s~ hintaan: ~g~$%s~s~', + ['set_vehicle_owner_rent'] = 'määritä ajoneuvon [Vuokra]', + ['set_vehicle_owner_sell'] = 'myy ajoneuvo', + ['shop_menu'] = 'paina ~INPUT_CONTEXT~ avataksesi menu', + ['generic_shopitem'] = '$%s', + ['vehicle_dealer'] = 'ajonevuo - Autokauppa', + ['vehicle_menu'] = 'paina ~INPUT_CONTEXT~ tehdäksesi tästä sinun ajoneuvo', + ['vehicle_purchased'] = 'sinä ostit ajoneuvon', + ['vehicle_set_owned'] = 'ajoneuvo ~y~%s~s~ on nyt määritetty henkilölle ~b~%s~s~', + ['vehicle_set_rented'] = 'ajoneuvo ~y~%s~s~ on nyt vuokrattu henkilölle ~b~%s~s~', + ['vehicle_sold_for'] = 'the ~b~%s~s~ has been ~y~sold~s~ for ~g~$%s~s~', + ['vehicle_sold_to'] = 'ajoneuvo ~y~%s~s~ myyty henkilölle ~b~%s~s~', + ['deposit_stock'] = 'talleta firman varastoon', + ['take_stock'] = 'nosta firman varastosta', + ['dealership_stock'] = 'autokaupan varasto', + ['amount'] = 'määrä', + ['quantity_invalid'] = 'virheellinen määrä', + ['inventory'] = 'reppu', + ['dealership'] = 'autokauppa', + ['dealer_customers'] = 'autokaupan asiakas', + ['have_withdrawn'] = 'sinä otit ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'sinä talletit ~y~x%s~s~ ~b~%s~s~', + ['boss_actions'] = 'Pomo toiminnot', + ['invalid_vehicle'] = 'di-wastong sasakyan', + + -- sold vehicles + ['boss_sold'] = 'list of sold vehicles', + ['customer_client'] = 'customer name', + ['customer_model'] = 'car model', + ['customer_plate'] = 'car plate', + ['customer_soldby'] = 'sold by', + ['customer_date'] = 'date', +} diff --git a/[esx_addons]/esx_vehicleshop/locales/fr.lua b/[esx_addons]/esx_vehicleshop/locales/fr.lua new file mode 100644 index 00000000..db3dde65 --- /dev/null +++ b/[esx_addons]/esx_vehicleshop/locales/fr.lua @@ -0,0 +1,65 @@ +Locales['fr'] = { + -- global menus + ['not_enough_in_society'] = 'il n\'y à plus assez ~r~de cet objet~s~ dans la societé!', + ['player_cannot_hold'] = 'vous n\'avez ~r~pas~s~ assez ~y~d\'espace~s~ dans votre inventaire!', + ['vehicle_belongs'] = 'le véhicule avec la plaque ~y~%s~s~ est désormais à ~b~vous~s~', + ['broke_company'] = 'vous n\avez pas assez d\'argent sur le compte de la societé', + ['license_missing'] = 'vous n\'avez pas de permis de conduire !', + ['buy_vehicle_shop'] = 'acheter %s pour $%s?', + ['buy_vehicle'] = 'acheter véhicule', + ['car_dealer'] = 'concessionnaire', + ['shop_awaiting_model'] = 'le véhicule est en train de charger, veuillez patienter...', + ['create_bill'] = 'créer facture', + ['dealer_boss'] = 'concessionnaire - Patron', + ['delivered'] = 'véhicule ~g~rendu~s~ au concessionnaire', + ['depop_vehicle'] = 'rentrer véhicule', + ['return_provider'] = 'rendre le véhicule', + ['get_rented_vehicles'] = 'véhicules en location', + ['no_current_vehicle'] = 'vous n\'avez aucun véhicule d\'affiché pour le moment', + ['invalid_amount'] = 'montant invalide', + ['invoice_amount'] = 'montant de la facture', + ['no'] = 'non', + ['yes'] = 'oui', + ['no_players'] = 'aucun joueur à proximité', + ['not_enough_money'] = 'vous n\'avez pas assez d\'argent', + ['not_rental'] = 'ce n\'est pas un ~r~véhicule de location~s~', + ['not_yours'] = 'ce véhicule ne vous appartient pas', + ['paid_rental'] = 'vous avez payé ~g~$%s~s~ pour louer une voiture avec la plaque ~y~%s~s~', + ['paid_rental_evicted'] = 'vous ne pouviez pas vous permettre de payer ~g~$%s~s~ pour votre véhicule loué avec la plaque ~y~%s~s~, il a été retourné au concessionnaire', + ['pop_vehicle'] = 'sortir véhicule', + ['rent_vehicle'] = 'concessionnaire - Véhicules en location', + ['return_provider_menu'] = 'concessionnaire - Retour de véhicule', + ['rental_amount'] = 'montant de la location', + ['sell_menu'] = 'appuyez sur ~INPUT_CONTEXT~ pour vendre ~y~%s~s~ au prix de ~g~$%s~s~', + ['set_vehicle_owner_rent'] = 'attribuer véhicule [Location]', + ['set_vehicle_owner_sell'] = 'attribuer véhicule [Vente]', + ['shop_menu'] = 'appuyez sur ~INPUT_CONTEXT~ pour accéder au menu', + ['generic_shopitem'] = '$%s', + ['vehicle_dealer'] = 'concessionnaire - Véhicules', + ['vehicle_menu'] = 'appuez sur ~INPUT_CONTEXT~ pour rendre votre véhicule', + ['vehicle_purchased'] = 'vous avez acheté un véhicule', + ['vehicle_set_owned'] = 'le véhicule ~y~%s~s~ a été attribué à ~b~%s~s~', + ['vehicle_set_rented'] = 'le véhicule ~y~%s~s~ a été loué à ~b~%s~s~', + ['vehicle_sold_for'] = 'le ~b~%s~s~ a été ~y~vendu~s~ pour ~g~$%s~s~', + ['vehicle_sold_to'] = 'véhicule ~y~%s~s~ vendu à ~b~%s~s~', + ['deposit_stock'] = 'déposer Stock', + ['take_stock'] = 'prendre Stock', + ['dealership_stock'] = 'concession Stock', + ['amount'] = 'quantité', + ['quantity_invalid'] = 'quantité invalide', + ['inventory'] = 'inventaire', + ['dealership'] = 'concession', + ['dealer_customers'] = 'client concession', + ['have_withdrawn'] = 'vous avez retiré ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'vous avez deposé ~y~x%s~s~ ~b~%s~s~', + ['boss_actions'] = 'actions du chef', + ['invalid_vehicle'] = 'Véhicule invalide', + + -- sold vehicles + ['boss_sold'] = 'liste des véhicule vendu', + ['customer_client'] = 'nom du client', + ['customer_model'] = 'modèle de voiture', + ['customer_plate'] = 'plaque d\'immatriculation', + ['customer_soldby'] = 'vendu par', + ['customer_date'] = 'date', +} diff --git a/[esx_addons]/esx_vehicleshop/locales/pl.lua b/[esx_addons]/esx_vehicleshop/locales/pl.lua new file mode 100644 index 00000000..4ee3b293 --- /dev/null +++ b/[esx_addons]/esx_vehicleshop/locales/pl.lua @@ -0,0 +1,65 @@ +Locales['pl'] = { + -- global menus + ['not_enough_in_society'] = 'brak tego ~r~przedmiotu~s~ w firmie!', + ['player_cannot_hold'] = '~r~Nie masz~s~ wystarczająco ~y~wolnego~s~ miejsca w ekwipunku!', + ['vehicle_belongs'] = 'pojazd z rejestracją ~y~%s~s~ teraz należy do ~b~ciebie~s~', + ['broke_company'] = 'twoja firma nie ma wystarczająco pieniedzy', + ['license_missing'] = 'you don\'t have a driver\'s license!', + ['buy_vehicle_shop'] = 'czy chcesz kupić %s za $%s?', + ['buy_vehicle'] = 'kup pojazd', + ['car_dealer'] = 'sprzedawca Aut', + ['shop_awaiting_model'] = 'the vehicle is currently loading, please wait', + ['create_bill'] = 'stwórz fakture', + ['dealer_boss'] = 'salon samochodowy - Szef', + ['delivered'] = 'pojazd został ~g~dostarczony~s~ do salonu', + ['depop_vehicle'] = 'oddaj pojazd', + ['return_provider'] = 'return vehicle to provider', + ['get_rented_vehicles'] = 'pojazdy do wynajęcia', + ['no_current_vehicle'] = 'you do not currently have an vehicle displayed', + ['invalid_amount'] = 'nieprawidłowa ilość', + ['invoice_amount'] = 'suma faktury', + ['no'] = 'nie', + ['yes'] = 'tak', + ['no_players'] = 'brak graczy w pobliżu', + ['not_enough_money'] = 'nie masz wystarczająco pieniędzy', + ['not_rental'] = 'to nie jest ~r~wypożyczone auto~s~', + ['not_yours'] = 'ten pojazd nie należy do ciebie', + ['paid_rental'] = 'you have paid ~g~$%s~s~ for renting an vehicle with plate ~y~%s~s~', + ['paid_rental_evicted'] = 'you could not afford to pay ~g~$%s~s~ for your rented vehicle with plate ~y~%s~s~, it has been returned to the dealership', + ['pop_vehicle'] = 'wyciągnij auto do sprzedaży', + ['rent_vehicle'] = 'salon samochodowy - Pojazdy do wynajęcia', + ['return_provider_menu'] = 'car Dealer - Return vehicle to provider', + ['rental_amount'] = 'suma wynajęcia', + ['sell_menu'] = 'wcisnij ~INPUT_CONTEXT~ aby sprzedać ~y~%s~s~ za ~g~$%s~s~', + ['set_vehicle_owner_rent'] = 'zarejestruj pojazd [Wynajem]', + ['set_vehicle_owner_sell'] = 'zarejestruj pojazd [Kupno]', + ['shop_menu'] = 'wcisnij ~INPUT_CONTEXT~ aby wejść do menu', + ['generic_shopitem'] = '$%s', + ['vehicle_dealer'] = 'pojazdy - Sprzedawca aut', + ['vehicle_menu'] = 'wcisnij ~INPUT_CONTEXT~ aby wyjąć pojazd', + ['vehicle_purchased'] = 'kupujesz pojazd', + ['vehicle_set_owned'] = 'pojazd ~y~%s~s~ został zarejestrowany na ~b~%s~s~', + ['vehicle_set_rented'] = 'pojazd ~y~%s~s~ został wynajęty przez ~b~%s~s~', + ['vehicle_sold_for'] = 'the ~b~%s~s~ has been ~y~sold~s~ for ~g~$%s~s~', + ['vehicle_sold_to'] = 'pojazd ~y~%s~s~ został sprzedany do ~b~%s~s~', + ['deposit_stock'] = 'deponuj przedmioty', + ['take_stock'] = 'wyciągnij przedmioty', + ['dealership_stock'] = 'zaopatrzenie salonu', + ['amount'] = 'suma', + ['quantity_invalid'] = 'nieprawidłowa ilość', + ['inventory'] = 'ekwipunek', + ['dealership'] = 'sprzedawca Aut', + ['dealer_customers'] = 'klienci salonu', + ['have_withdrawn'] = 'wyciągasz ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'deponujesz ~y~x%s~s~ ~b~%s~s~', + ['boss_actions'] = 'akcje szefa', + ['invalid_vehicle'] = 'nieprawidłowy pojazd', + + -- sold vehicles + ['boss_sold'] = 'list of sold vehicles', + ['customer_client'] = 'customer name', + ['customer_model'] = 'car model', + ['customer_plate'] = 'car plate', + ['customer_soldby'] = 'sold by', + ['customer_date'] = 'date', +} diff --git a/[esx_addons]/esx_vehicleshop/locales/sv.lua b/[esx_addons]/esx_vehicleshop/locales/sv.lua new file mode 100644 index 00000000..59588ae9 --- /dev/null +++ b/[esx_addons]/esx_vehicleshop/locales/sv.lua @@ -0,0 +1,65 @@ +Locales['sv'] = { + -- global menus + ['not_enough_in_society'] = 'det finns inte tillräckligt många av ~r~det föremålet~s~ i förrådet!', + ['player_cannot_hold'] = 'du har ~r~inte~s~ tillräckligt mycket~y~plats~s~ på dig!', + ['vehicle_belongs'] = 'fordonet med reg numret ~y~%s~s~ tillhör nu ~b~dig~s~', + ['broke_company'] = 'det finns inte tillräckligt mycket pengar i företagskontot', + ['license_missing'] = 'du är inte behörig att köpa bilar, B-körkort krävs!', + ['buy_vehicle_shop'] = 'vill du köpa in %s för %s SEK?', + ['buy_vehicle'] = 'Köp in fordon', + ['car_dealer'] = 'bilförsäljare', + ['shop_awaiting_model'] = 'fordon laddas in, vänligen vänta', + ['create_bill'] = 'ge faktura', + ['dealer_boss'] = 'chefmeny', + ['delivered'] = 'fordonet har ~g~lämnats tillbaka~s~ till bilförsäljaren', + ['depop_vehicle'] = 'ställ tillbaka fordonet', + ['return_provider'] = 'sälj tillbaka fordon till leverantör', + ['get_rented_vehicles'] = 'uthyrda fordon', + ['no_current_vehicle'] = 'du har inget fordon ute till salu', + ['invalid_amount'] = 'ogiltigt belopp', + ['invoice_amount'] = 'belopp att betala', + ['no'] = 'nej', + ['yes'] = 'ja', + ['no_players'] = 'det finns ingen i närheten', + ['not_enough_money'] = 'du har inte tillräckligt mycket pengar', + ['not_rental'] = 'detta är inte ett ~r~uthyrt fordon~s~', + ['not_yours'] = 'det här fordonet tillhör inte dig', + ['paid_rental'] = 'du har betalat ~g~%s SEK~s~ för att hyra ett fordon med reg nummer ~y~%s~s~', + ['paid_rental_evicted'] = 'du hade ej råd att betala ~g~%s SEK~s~ för ditt hyrda fordon med reg nummer ~y~%s~s~, den har tagits av bilförsäljaren', + ['pop_vehicle'] = 'ställ ut fordon till salu', + ['rent_vehicle'] = 'bilförsäljare - fordon för uthyrning', + ['return_provider_menu'] = 'bilförsäljare - sälj tillbaka fordon till leverantör', + ['rental_amount'] = 'uthyrningsbelopp', + ['sell_menu'] = 'tryck ~INPUT_CONTEXT~ för att sälja ~y~%s~s~ för ~g~%s SEK~s~', + ['set_vehicle_owner_rent'] = 'hyr ut fordon', + ['set_vehicle_owner_sell'] = 'sälj fordon', + ['shop_menu'] = 'tryck ~INPUT_CONTEXT~ för öppna ~y~bilförsäljarsmenyn~s~.', + ['generic_shopitem'] = '%s SEK', + ['vehicle_dealer'] = 'bilförsäljare - fordon för visning', + ['vehicle_menu'] = 'tryck på ~INPUT_CONTEXT~ för att ~o~lämna tillbaka~s~ fordonet till bilförsäljaren.', + ['vehicle_purchased'] = 'du köpte fordonet', + ['vehicle_set_owned'] = 'fordonet ~y~%s~s~ har tilldelats till ~b~%s~s~', + ['vehicle_set_rented'] = 'fordonet ~y~%s~s~ har hyrts ut till ~b~%s~s~', + ['vehicle_sold_for'] = '~b~%s~s~ har ~y~sålts~s~ för ~g~%s SEK~s~', + ['vehicle_sold_to'] = '~y~%s~s~ har sålts till ~b~%s~s~', + ['deposit_stock'] = 'lägg in i förråd', + ['take_stock'] = 'ta ut ur förråd', + ['dealership_stock'] = 'bilförsäljares förråd', + ['amount'] = 'mängd', + ['quantity_invalid'] = 'ogiltig mängd', + ['inventory'] = 'förråd', + ['dealership'] = 'bilförsäljare', + ['dealer_customers'] = 'kund', + ['have_withdrawn'] = 'du har tagit ut ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'du har lagt in ~y~x%s~s~ ~b~%s~s~', + ['boss_actions'] = 'chef handlingar', + ['invalid_vehicle'] = 'ogiltigt fordon', + + -- sold vehicles + ['boss_sold'] = 'lista av sålda fordon', + ['customer_client'] = 'kund', + ['customer_model'] = 'bil modell', + ['customer_plate'] = 'registreringsnummer', + ['customer_soldby'] = 'såld av', + ['customer_date'] = 'datum', +} diff --git a/[esx_addons]/esx_vehicleshop/localization/br_esx_vehicleshop.sql b/[esx_addons]/esx_vehicleshop/localization/br_esx_vehicleshop.sql new file mode 100644 index 00000000..fd366481 --- /dev/null +++ b/[esx_addons]/esx_vehicleshop/localization/br_esx_vehicleshop.sql @@ -0,0 +1,339 @@ +USE `es_extended`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_cardealer','Vendedor de carros',1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_cardealer','Vendedor de carros',1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('cardealer','Vendedor de carros') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('cardealer',0,'recrutar','Recrutar',10,'{}','{}'), + ('cardealer',1,'novato','Novato',25,'{}','{}'), + ('cardealer',2,'experiente','Experiente',40,'{}','{}'), + ('cardealer',3,'chefe','Chefe',0,'{}','{}') +; + +CREATE TABLE `cardealer_vehicles` ( + `id` int NOT NULL AUTO_INCREMENT, + `vehicle` varchar(255) NOT NULL, + `price` int NOT NULL, + + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `vehicle_sold` ( + `client` VARCHAR(50) NOT NULL, + `model` VARCHAR(50) NOT NULL, + `plate` VARCHAR(50) NOT NULL, + `soldby` VARCHAR(50) NOT NULL, + `date` VARCHAR(50) NOT NULL, + + PRIMARY KEY (`plate`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `owned_vehicles` ( + `owner` VARCHAR(60) NOT NULL, + `plate` varchar(12) NOT NULL, + `vehicle` longtext, + `type` VARCHAR(20) NOT NULL DEFAULT 'car', + `job` VARCHAR(20) NULL DEFAULT NULL, + `stored` TINYINT(1) NOT NULL DEFAULT '0', + + PRIMARY KEY (`plate`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `rented_vehicles` ( + `vehicle` varchar(60) NOT NULL, + `plate` varchar(12) NOT NULL, + `player_name` varchar(255) NOT NULL, + `base_price` int NOT NULL, + `rent_price` int NOT NULL, + `owner` VARCHAR(60) NOT NULL, + + PRIMARY KEY (`plate`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `vehicle_categories` ( + `name` varchar(60) NOT NULL, + `label` varchar(60) NOT NULL, + + PRIMARY KEY (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +INSERT INTO `vehicle_categories` (name, label) VALUES + ('compacts','Compactos'), + ('coupes','Cupês'), + ('sedans','Sedans'), + ('sports','Esportes'), + ('sportsclassics','Clássicos Esportivos'), + ('super','Super'), + ('muscle','Músculo'), + ('offroad','Fora da estrada'), + ('suvs','SUVs'), + ('vans','Vans'), + ('motorcycles','Motos') +; + +CREATE TABLE `vehicles` ( + `name` varchar(60) NOT NULL, + `model` varchar(60) NOT NULL, + `price` int NOT NULL, + `category` varchar(60) DEFAULT NULL, + + PRIMARY KEY (`model`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +INSERT INTO `vehicles` (name, model, price, category) VALUES + ('Blade','blade',15000,'muscle'), + ('Buccaneer','buccaneer',18000,'muscle'), + ('Buccaneer Rider','buccaneer2',24000,'muscle'), + ('Chino','chino',15000,'muscle'), + ('Chino Luxe','chino2',19000,'muscle'), + ('Coquette BlackFin','coquette3',55000,'muscle'), + ('Dominator','dominator',35000,'muscle'), + ('Dukes','dukes',28000,'muscle'), + ('Gauntlet','gauntlet',30000,'muscle'), + ('Hotknife','hotknife',125000,'muscle'), + ('Faction','faction',20000,'muscle'), + ('Faction Rider','faction2',30000,'muscle'), + ('Faction XL','faction3',40000,'muscle'), + ('Nightshade','nightshade',65000,'muscle'), + ('Phoenix','phoenix',12500,'muscle'), + ('Picador','picador',18000,'muscle'), + ('Sabre Turbo','sabregt',20000,'muscle'), + ('Sabre GT','sabregt2',25000,'muscle'), + ('Slam Van','slamvan3',11500,'muscle'), + ('Tampa','tampa',16000,'muscle'), + ('Virgo','virgo',14000,'muscle'), + ('Vigero','vigero',12500,'muscle'), + ('Voodoo','voodoo',7200,'muscle'), + ('Blista','blista',8000,'compacts'), + ('Brioso R/A','brioso',18000,'compacts'), + ('Issi','issi2',10000,'compacts'), + ('Panto','panto',10000,'compacts'), + ('Prairie','prairie',12000,'compacts'), + ('Bison','bison',45000,'vans'), + ('Bobcat XL','bobcatxl',32000,'vans'), + ('Burrito','burrito3',19000,'vans'), + ('Burrito','gburrito2',29000,'vans'), + ('Camper','camper',42000,'vans'), + ('Gang Burrito','gburrito',45000,'vans'), + ('Journey','journey',6500,'vans'), + ('Minivan','minivan',13000,'vans'), + ('Moonbeam','moonbeam',18000,'vans'), + ('Moonbeam Rider','moonbeam2',35000,'vans'), + ('Paradise','paradise',19000,'vans'), + ('Rumpo','rumpo',15000,'vans'), + ('Rumpo Trail','rumpo3',19500,'vans'), + ('Surfer','surfer',12000,'vans'), + ('Youga','youga',10800,'vans'), + ('Youga Luxuary','youga2',14500,'vans'), + ('Asea','asea',5500,'sedans'), + ('Cognoscenti','cognoscenti',55000,'sedans'), + ('Emperor','emperor',8500,'sedans'), + ('Fugitive','fugitive',12000,'sedans'), + ('Glendale','glendale',6500,'sedans'), + ('Intruder','intruder',7500,'sedans'), + ('Premier','premier',8000,'sedans'), + ('Primo Custom','primo2',14000,'sedans'), + ('Regina','regina',5000,'sedans'), + ('Schafter','schafter2',25000,'sedans'), + ('Stretch','stretch',90000,'sedans'), + ('Super Diamond','superd',130000,'sedans'), + ('Tailgater','tailgater',30000,'sedans'), + ('Warrener','warrener',4000,'sedans'), + ('Washington','washington',9000,'sedans'), + ('Baller','baller2',40000,'suvs'), + ('Baller Sport','baller3',60000,'suvs'), + ('Cavalcade','cavalcade2',55000,'suvs'), + ('Contender','contender',70000,'suvs'), + ('Dubsta','dubsta',45000,'suvs'), + ('Dubsta Luxuary','dubsta2',60000,'suvs'), + ('Fhantom','fq2',17000,'suvs'), + ('Grabger','granger',50000,'suvs'), + ('Gresley','gresley',47500,'suvs'), + ('Huntley S','huntley',40000,'suvs'), + ('Landstalker','landstalker',35000,'suvs'), + ('Mesa','mesa',16000,'suvs'), + ('Mesa Trail','mesa3',40000,'suvs'), + ('Patriot','patriot',55000,'suvs'), + ('Radius','radi',29000,'suvs'), + ('Rocoto','rocoto',45000,'suvs'), + ('Seminole','seminole',25000,'suvs'), + ('XLS','xls',32000,'suvs'), + ('Btype','btype',62000,'sportsclassics'), + ('Btype Luxe','btype3',85000,'sportsclassics'), + ('Btype Hotroad','btype2',155000,'sportsclassics'), + ('Casco','casco',30000,'sportsclassics'), + ('Coquette Classic','coquette2',40000,'sportsclassics'), + ('Manana','manana',12800,'sportsclassics'), + ('Monroe','monroe',55000,'sportsclassics'), + ('Pigalle','pigalle',20000,'sportsclassics'), + ('Stinger','stinger',80000,'sportsclassics'), + ('Stinger GT','stingergt',75000,'sportsclassics'), + ('Stirling GT','feltzer3',65000,'sportsclassics'), + ('Z-Type','ztype',220000,'sportsclassics'), + ('Bifta','bifta',12000,'offroad'), + ('Bf Injection','bfinjection',16000,'offroad'), + ('Blazer','blazer',6500,'offroad'), + ('Blazer Sport','blazer4',8500,'offroad'), + ('Brawler','brawler',45000,'offroad'), + ('Bubsta 6x6','dubsta3',120000,'offroad'), + ('Dune Buggy','dune',8000,'offroad'), + ('Guardian','guardian',45000,'offroad'), + ('Rebel','rebel2',35000,'offroad'), + ('Sandking','sandking',55000,'offroad'), + ('The Liberator','monster',210000,'offroad'), + ('Trophy Truck','trophytruck',60000,'offroad'), + ('Trophy Truck Limited','trophytruck2',80000,'offroad'), + ('Cognoscenti Cabrio','cogcabrio',55000,'coupes'), + ('Exemplar','exemplar',32000,'coupes'), + ('F620','f620',40000,'coupes'), + ('Felon','felon',42000,'coupes'), + ('Felon GT','felon2',55000,'coupes'), + ('Jackal','jackal',38000,'coupes'), + ('Oracle XS','oracle2',35000,'coupes'), + ('Sentinel','sentinel',32000,'coupes'), + ('Sentinel XS','sentinel2',40000,'coupes'), + ('Windsor','windsor',95000,'coupes'), + ('Windsor Drop','windsor2',125000,'coupes'), + ('Zion','zion',36000,'coupes'), + ('Zion Cabrio','zion2',45000,'coupes'), + ('9F','ninef',65000,'sports'), + ('9F Cabrio','ninef2',80000,'sports'), + ('Alpha','alpha',60000,'sports'), + ('Banshee','banshee',70000,'sports'), + ('Bestia GTS','bestiagts',55000,'sports'), + ('Buffalo','buffalo',12000,'sports'), + ('Buffalo S','buffalo2',20000,'sports'), + ('Carbonizzare','carbonizzare',75000,'sports'), + ('Comet','comet2',65000,'sports'), + ('Coquette','coquette',65000,'sports'), + ('Drift Tampa','tampa2',80000,'sports'), + ('Elegy','elegy2',38500,'sports'), + ('Feltzer','feltzer2',55000,'sports'), + ('Furore GT','furoregt',45000,'sports'), + ('Fusilade','fusilade',40000,'sports'), + ('Jester','jester',65000,'sports'), + ('Jester(Racecar)','jester2',135000,'sports'), + ('Khamelion','khamelion',38000,'sports'), + ('Kuruma','kuruma',30000,'sports'), + ('Lynx','lynx',40000,'sports'), + ('Mamba','mamba',70000,'sports'), + ('Massacro','massacro',65000,'sports'), + ('Massacro(Racecar)','massacro2',130000,'sports'), + ('Omnis','omnis',35000,'sports'), + ('Penumbra','penumbra',28000,'sports'), + ('Rapid GT','rapidgt',35000,'sports'), + ('Rapid GT Convertible','rapidgt2',45000,'sports'), + ('Schafter V12','schafter3',50000,'sports'), + ('Seven 70','seven70',39500,'sports'), + ('Sultan','sultan',15000,'sports'), + ('Surano','surano',50000,'sports'), + ('Tropos','tropos',40000,'sports'), + ('Verlierer','verlierer2',70000,'sports'), + ('Adder','adder',900000,'super'), + ('Banshee 900R','banshee2',255000,'super'), + ('Bullet','bullet',90000,'super'), + ('Cheetah','cheetah',375000,'super'), + ('Entity XF','entityxf',425000,'super'), + ('ETR1','sheava',220000,'super'), + ('FMJ','fmj',185000,'super'), + ('Infernus','infernus',180000,'super'), + ('Osiris','osiris',160000,'super'), + ('Pfister','pfister811',85000,'super'), + ('RE-7B','le7b',325000,'super'), + ('Reaper','reaper',150000,'super'), + ('Sultan RS','sultanrs',65000,'super'), + ('T20','t20',300000,'super'), + ('Turismo R','turismor',350000,'super'), + ('Tyrus','tyrus',600000,'super'), + ('Vacca','vacca',120000,'super'), + ('Voltic','voltic',90000,'super'), + ('X80 Proto','prototipo',2500000,'super'), + ('Zentorno','zentorno',1500000,'super'), + ('Akuma','AKUMA',7500,'motorcycles'), + ('Avarus','avarus',18000,'motorcycles'), + ('Bagger','bagger',13500,'motorcycles'), + ('Bati 801','bati',12000,'motorcycles'), + ('Bati 801RR','bati2',19000,'motorcycles'), + ('BF400','bf400',6500,'motorcycles'), + ('BMX (velo)','bmx',160,'motorcycles'), + ('Carbon RS','carbonrs',18000,'motorcycles'), + ('Chimera','chimera',38000,'motorcycles'), + ('Cliffhanger','cliffhanger',9500,'motorcycles'), + ('Cruiser (velo)','cruiser',510,'motorcycles'), + ('Daemon','daemon',11500,'motorcycles'), + ('Daemon High','daemon2',13500,'motorcycles'), + ('Defiler','defiler',9800,'motorcycles'), + ('Double T','double',28000,'motorcycles'), + ('Enduro','enduro',5500,'motorcycles'), + ('Esskey','esskey',4200,'motorcycles'), + ('Faggio','faggio',1900,'motorcycles'), + ('Vespa','faggio2',2800,'motorcycles'), + ('Fixter (velo)','fixter',225,'motorcycles'), + ('Gargoyle','gargoyle',16500,'motorcycles'), + ('Hakuchou','hakuchou',31000,'motorcycles'), + ('Hakuchou Sport','hakuchou2',55000,'motorcycles'), + ('Hexer','hexer',12000,'motorcycles'), + ('Innovation','innovation',23500,'motorcycles'), + ('Manchez','manchez',5300,'motorcycles'), + ('Nemesis','nemesis',5800,'motorcycles'), + ('Nightblade','nightblade',35000,'motorcycles'), + ('PCJ-600','pcj',6200,'motorcycles'), + ('Ruffian','ruffian',6800,'motorcycles'), + ('Sanchez','sanchez',5300,'motorcycles'), + ('Sanchez Sport','sanchez2',5300,'motorcycles'), + ('Sanctus','sanctus',25000,'motorcycles'), + ('Scorcher (velo)','scorcher',280,'motorcycles'), + ('Sovereign','sovereign',22000,'motorcycles'), + ('Shotaro Concept','shotaro',320000,'motorcycles'), + ('Thrust','thrust',24000,'motorcycles'), + ('Tri bike (velo)','tribike3',520,'motorcycles'), + ('Vader','vader',7200,'motorcycles'), + ('Vortex','vortex',9800,'motorcycles'), + ('Woflsbane','wolfsbane',9000,'motorcycles'), + ('Zombie','zombiea',9500,'motorcycles'), + ('Zombie Luxuary','zombieb',12000,'motorcycles'), + ('blazer5', 'blazer5', 1755600, 'offroad'), + ('Ruiner 2', 'ruiner2', 5745600, 'muscle'), + ('Voltic 2', 'voltic2', 3830400, 'super'), + ('Ardent', 'ardent', 1150000, 'sportsclassics'), + ('Oppressor', 'oppressor', 3524500, 'super'), + ('Visione', 'visione', 2250000, 'super'), + ('Retinue', 'retinue', 615000, 'sportsclassics'), + ('Cyclone', 'cyclone', 1890000, 'super'), + ('Rapid GT3', 'rapidgt3', 885000, 'sportsclassics'), + ('raiden', 'raiden', 1375000, 'sports'), + ('Yosemite', 'yosemite', 485000, 'muscle'), + ('Deluxo', 'deluxo', 4721500, 'sportsclassics'), + ('Pariah', 'pariah', 1420000, 'sports'), + ('Stromberg', 'stromberg', 3185350, 'sports'), + ('SC 1', 'sc1', 1603000, 'super'), + ('riata', 'riata', 380000, 'offroad'), + ('Hermes', 'hermes', 535000, 'muscle'), + ('Savestra', 'savestra', 990000, 'sportsclassics'), + ('Streiter', 'streiter', 500000, 'sports'), + ('Kamacho', 'kamacho', 345000, 'offroad'), + ('GT 500', 'gt500', 785000, 'sportsclassics'), + ('Z190', 'z190', 900000, 'sportsclassics'), + ('Viseris', 'viseris', 875000, 'sportsclassics'), + ('Autarch', 'autarch', 1955000, 'super'), + ('Comet 5', 'comet5', 1145000, 'sports'), + ('Neon', 'neon', 1500000, 'sports'), + ('Revolter', 'revolter', 1610000, 'sports'), + ('Sentinel3', 'sentinel3', 650000, 'sports'), + ('Hustler', 'hustler', 625000, 'muscle') +; diff --git a/[esx_addons]/esx_vehicleshop/localization/de_esx_vehicleshop.sql b/[esx_addons]/esx_vehicleshop/localization/de_esx_vehicleshop.sql new file mode 100644 index 00000000..cda712b1 --- /dev/null +++ b/[esx_addons]/esx_vehicleshop/localization/de_esx_vehicleshop.sql @@ -0,0 +1,339 @@ +USE `es_extended`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_cardealer','Händler',1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_cardealer','Händler',1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('cardealer','Händler') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('cardealer',0,'recruit','Neuling',10,'{}','{}'), + ('cardealer',1,'novice','Verkäufer',25,'{}','{}'), + ('cardealer',2,'experienced','Verkaufsleiter',40,'{}','{}'), + ('cardealer',3,'boss','Boss',0,'{}','{}') +; + +CREATE TABLE `cardealer_vehicles` ( + `id` int NOT NULL AUTO_INCREMENT, + `vehicle` varchar(255) NOT NULL, + `price` int NOT NULL, + + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `vehicle_sold` ( + `client` VARCHAR(50) NOT NULL, + `model` VARCHAR(50) NOT NULL, + `plate` VARCHAR(50) NOT NULL, + `soldby` VARCHAR(50) NOT NULL, + `date` VARCHAR(50) NOT NULL, + + PRIMARY KEY (`plate`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `owned_vehicles` ( + `owner` VARCHAR(60) NOT NULL, + `plate` varchar(12) NOT NULL, + `vehicle` longtext, + `type` VARCHAR(20) NOT NULL DEFAULT 'car', + `job` VARCHAR(20) NULL DEFAULT NULL, + `stored` TINYINT(1) NOT NULL DEFAULT '0', + + PRIMARY KEY (`plate`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `rented_vehicles` ( + `vehicle` varchar(60) NOT NULL, + `plate` varchar(12) NOT NULL, + `player_name` varchar(255) NOT NULL, + `base_price` int NOT NULL, + `rent_price` int NOT NULL, + `owner` VARCHAR(60) NOT NULL, + + PRIMARY KEY (`plate`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `vehicle_categories` ( + `name` varchar(60) NOT NULL, + `label` varchar(60) NOT NULL, + + PRIMARY KEY (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +INSERT INTO `vehicle_categories` (name, label) VALUES + ('compacts','Compacts'), + ('coupes','Coupés'), + ('sedans','Sedans'), + ('sports','Sports'), + ('sportsclassics','Sports Classics'), + ('super','Super'), + ('muscle','Muscle'), + ('offroad','Off Road'), + ('suvs','SUVs'), + ('vans','Vans'), + ('motorcycles','Motos') +; + +CREATE TABLE `vehicles` ( + `name` varchar(60) NOT NULL, + `model` varchar(60) NOT NULL, + `price` int NOT NULL, + `category` varchar(60) DEFAULT NULL, + + PRIMARY KEY (`model`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +INSERT INTO `vehicles` (name, model, price, category) VALUES + ('Blade','blade',15000,'muscle'), + ('Buccaneer','buccaneer',18000,'muscle'), + ('Buccaneer Rider','buccaneer2',24000,'muscle'), + ('Chino','chino',15000,'muscle'), + ('Chino Luxe','chino2',19000,'muscle'), + ('Coquette BlackFin','coquette3',55000,'muscle'), + ('Dominator','dominator',35000,'muscle'), + ('Dukes','dukes',28000,'muscle'), + ('Gauntlet','gauntlet',30000,'muscle'), + ('Hotknife','hotknife',125000,'muscle'), + ('Faction','faction',20000,'muscle'), + ('Faction Rider','faction2',30000,'muscle'), + ('Faction XL','faction3',40000,'muscle'), + ('Nightshade','nightshade',65000,'muscle'), + ('Phoenix','phoenix',12500,'muscle'), + ('Picador','picador',18000,'muscle'), + ('Sabre Turbo','sabregt',20000,'muscle'), + ('Sabre GT','sabregt2',25000,'muscle'), + ('Slam Van','slamvan3',11500,'muscle'), + ('Tampa','tampa',16000,'muscle'), + ('Virgo','virgo',14000,'muscle'), + ('Vigero','vigero',12500,'muscle'), + ('Voodoo','voodoo',7200,'muscle'), + ('Blista','blista',8000,'compacts'), + ('Brioso R/A','brioso',18000,'compacts'), + ('Issi','issi2',10000,'compacts'), + ('Panto','panto',10000,'compacts'), + ('Prairie','prairie',12000,'compacts'), + ('Bison','bison',45000,'vans'), + ('Bobcat XL','bobcatxl',32000,'vans'), + ('Burrito','burrito3',19000,'vans'), + ('Burrito','gburrito2',29000,'vans'), + ('Camper','camper',42000,'vans'), + ('Gang Burrito','gburrito',45000,'vans'), + ('Journey','journey',6500,'vans'), + ('Minivan','minivan',13000,'vans'), + ('Moonbeam','moonbeam',18000,'vans'), + ('Moonbeam Rider','moonbeam2',35000,'vans'), + ('Paradise','paradise',19000,'vans'), + ('Rumpo','rumpo',15000,'vans'), + ('Rumpo Trail','rumpo3',19500,'vans'), + ('Surfer','surfer',12000,'vans'), + ('Youga','youga',10800,'vans'), + ('Youga Luxuary','youga2',14500,'vans'), + ('Asea','asea',5500,'sedans'), + ('Cognoscenti','cognoscenti',55000,'sedans'), + ('Emperor','emperor',8500,'sedans'), + ('Fugitive','fugitive',12000,'sedans'), + ('Glendale','glendale',6500,'sedans'), + ('Intruder','intruder',7500,'sedans'), + ('Premier','premier',8000,'sedans'), + ('Primo Custom','primo2',14000,'sedans'), + ('Regina','regina',5000,'sedans'), + ('Schafter','schafter2',25000,'sedans'), + ('Stretch','stretch',90000,'sedans'), + ('Super Diamond','superd',130000,'sedans'), + ('Tailgater','tailgater',30000,'sedans'), + ('Warrener','warrener',4000,'sedans'), + ('Washington','washington',9000,'sedans'), + ('Baller','baller2',40000,'suvs'), + ('Baller Sport','baller3',60000,'suvs'), + ('Cavalcade','cavalcade2',55000,'suvs'), + ('Contender','contender',70000,'suvs'), + ('Dubsta','dubsta',45000,'suvs'), + ('Dubsta Luxuary','dubsta2',60000,'suvs'), + ('Fhantom','fq2',17000,'suvs'), + ('Grabger','granger',50000,'suvs'), + ('Gresley','gresley',47500,'suvs'), + ('Huntley S','huntley',40000,'suvs'), + ('Landstalker','landstalker',35000,'suvs'), + ('Mesa','mesa',16000,'suvs'), + ('Mesa Trail','mesa3',40000,'suvs'), + ('Patriot','patriot',55000,'suvs'), + ('Radius','radi',29000,'suvs'), + ('Rocoto','rocoto',45000,'suvs'), + ('Seminole','seminole',25000,'suvs'), + ('XLS','xls',32000,'suvs'), + ('Btype','btype',62000,'sportsclassics'), + ('Btype Luxe','btype3',85000,'sportsclassics'), + ('Btype Hotroad','btype2',155000,'sportsclassics'), + ('Casco','casco',30000,'sportsclassics'), + ('Coquette Classic','coquette2',40000,'sportsclassics'), + ('Manana','manana',12800,'sportsclassics'), + ('Monroe','monroe',55000,'sportsclassics'), + ('Pigalle','pigalle',20000,'sportsclassics'), + ('Stinger','stinger',80000,'sportsclassics'), + ('Stinger GT','stingergt',75000,'sportsclassics'), + ('Stirling GT','feltzer3',65000,'sportsclassics'), + ('Z-Type','ztype',220000,'sportsclassics'), + ('Bifta','bifta',12000,'offroad'), + ('Bf Injection','bfinjection',16000,'offroad'), + ('Blazer','blazer',6500,'offroad'), + ('Blazer Sport','blazer4',8500,'offroad'), + ('Brawler','brawler',45000,'offroad'), + ('Bubsta 6x6','dubsta3',120000,'offroad'), + ('Dune Buggy','dune',8000,'offroad'), + ('Guardian','guardian',45000,'offroad'), + ('Rebel','rebel2',35000,'offroad'), + ('Sandking','sandking',55000,'offroad'), + ('The Liberator','monster',210000,'offroad'), + ('Trophy Truck','trophytruck',60000,'offroad'), + ('Trophy Truck Limited','trophytruck2',80000,'offroad'), + ('Cognoscenti Cabrio','cogcabrio',55000,'coupes'), + ('Exemplar','exemplar',32000,'coupes'), + ('F620','f620',40000,'coupes'), + ('Felon','felon',42000,'coupes'), + ('Felon GT','felon2',55000,'coupes'), + ('Jackal','jackal',38000,'coupes'), + ('Oracle XS','oracle2',35000,'coupes'), + ('Sentinel','sentinel',32000,'coupes'), + ('Sentinel XS','sentinel2',40000,'coupes'), + ('Windsor','windsor',95000,'coupes'), + ('Windsor Drop','windsor2',125000,'coupes'), + ('Zion','zion',36000,'coupes'), + ('Zion Cabrio','zion2',45000,'coupes'), + ('9F','ninef',65000,'sports'), + ('9F Cabrio','ninef2',80000,'sports'), + ('Alpha','alpha',60000,'sports'), + ('Banshee','banshee',70000,'sports'), + ('Bestia GTS','bestiagts',55000,'sports'), + ('Buffalo','buffalo',12000,'sports'), + ('Buffalo S','buffalo2',20000,'sports'), + ('Carbonizzare','carbonizzare',75000,'sports'), + ('Comet','comet2',65000,'sports'), + ('Coquette','coquette',65000,'sports'), + ('Drift Tampa','tampa2',80000,'sports'), + ('Elegy','elegy2',38500,'sports'), + ('Feltzer','feltzer2',55000,'sports'), + ('Furore GT','furoregt',45000,'sports'), + ('Fusilade','fusilade',40000,'sports'), + ('Jester','jester',65000,'sports'), + ('Jester(Racecar)','jester2',135000,'sports'), + ('Khamelion','khamelion',38000,'sports'), + ('Kuruma','kuruma',30000,'sports'), + ('Lynx','lynx',40000,'sports'), + ('Mamba','mamba',70000,'sports'), + ('Massacro','massacro',65000,'sports'), + ('Massacro(Racecar)','massacro2',130000,'sports'), + ('Omnis','omnis',35000,'sports'), + ('Penumbra','penumbra',28000,'sports'), + ('Rapid GT','rapidgt',35000,'sports'), + ('Rapid GT Convertible','rapidgt2',45000,'sports'), + ('Schafter V12','schafter3',50000,'sports'), + ('Seven 70','seven70',39500,'sports'), + ('Sultan','sultan',15000,'sports'), + ('Surano','surano',50000,'sports'), + ('Tropos','tropos',40000,'sports'), + ('Verlierer','verlierer2',70000,'sports'), + ('Adder','adder',900000,'super'), + ('Banshee 900R','banshee2',255000,'super'), + ('Bullet','bullet',90000,'super'), + ('Cheetah','cheetah',375000,'super'), + ('Entity XF','entityxf',425000,'super'), + ('ETR1','sheava',220000,'super'), + ('FMJ','fmj',185000,'super'), + ('Infernus','infernus',180000,'super'), + ('Osiris','osiris',160000,'super'), + ('Pfister','pfister811',85000,'super'), + ('RE-7B','le7b',325000,'super'), + ('Reaper','reaper',150000,'super'), + ('Sultan RS','sultanrs',65000,'super'), + ('T20','t20',300000,'super'), + ('Turismo R','turismor',350000,'super'), + ('Tyrus','tyrus',600000,'super'), + ('Vacca','vacca',120000,'super'), + ('Voltic','voltic',90000,'super'), + ('X80 Proto','prototipo',2500000,'super'), + ('Zentorno','zentorno',1500000,'super'), + ('Akuma','AKUMA',7500,'motorcycles'), + ('Avarus','avarus',18000,'motorcycles'), + ('Bagger','bagger',13500,'motorcycles'), + ('Bati 801','bati',12000,'motorcycles'), + ('Bati 801RR','bati2',19000,'motorcycles'), + ('BF400','bf400',6500,'motorcycles'), + ('BMX (velo)','bmx',160,'motorcycles'), + ('Carbon RS','carbonrs',18000,'motorcycles'), + ('Chimera','chimera',38000,'motorcycles'), + ('Cliffhanger','cliffhanger',9500,'motorcycles'), + ('Cruiser (velo)','cruiser',510,'motorcycles'), + ('Daemon','daemon',11500,'motorcycles'), + ('Daemon High','daemon2',13500,'motorcycles'), + ('Defiler','defiler',9800,'motorcycles'), + ('Double T','double',28000,'motorcycles'), + ('Enduro','enduro',5500,'motorcycles'), + ('Esskey','esskey',4200,'motorcycles'), + ('Faggio','faggio',1900,'motorcycles'), + ('Vespa','faggio2',2800,'motorcycles'), + ('Fixter (velo)','fixter',225,'motorcycles'), + ('Gargoyle','gargoyle',16500,'motorcycles'), + ('Hakuchou','hakuchou',31000,'motorcycles'), + ('Hakuchou Sport','hakuchou2',55000,'motorcycles'), + ('Hexer','hexer',12000,'motorcycles'), + ('Innovation','innovation',23500,'motorcycles'), + ('Manchez','manchez',5300,'motorcycles'), + ('Nemesis','nemesis',5800,'motorcycles'), + ('Nightblade','nightblade',35000,'motorcycles'), + ('PCJ-600','pcj',6200,'motorcycles'), + ('Ruffian','ruffian',6800,'motorcycles'), + ('Sanchez','sanchez',5300,'motorcycles'), + ('Sanchez Sport','sanchez2',5300,'motorcycles'), + ('Sanctus','sanctus',25000,'motorcycles'), + ('Scorcher (velo)','scorcher',280,'motorcycles'), + ('Sovereign','sovereign',22000,'motorcycles'), + ('Shotaro Concept','shotaro',320000,'motorcycles'), + ('Thrust','thrust',24000,'motorcycles'), + ('Tri bike (velo)','tribike3',520,'motorcycles'), + ('Vader','vader',7200,'motorcycles'), + ('Vortex','vortex',9800,'motorcycles'), + ('Woflsbane','wolfsbane',9000,'motorcycles'), + ('Zombie','zombiea',9500,'motorcycles'), + ('Zombie Luxuary','zombieb',12000,'motorcycles'), + ('blazer5', 'blazer5', 1755600, 'offroad'), + ('Ruiner 2', 'ruiner2', 5745600, 'muscle'), + ('Voltic 2', 'voltic2', 3830400, 'super'), + ('Ardent', 'ardent', 1150000, 'sportsclassics'), + ('Oppressor', 'oppressor', 3524500, 'super'), + ('Visione', 'visione', 2250000, 'super'), + ('Retinue', 'retinue', 615000, 'sportsclassics'), + ('Cyclone', 'cyclone', 1890000, 'super'), + ('Rapid GT3', 'rapidgt3', 885000, 'sportsclassics'), + ('raiden', 'raiden', 1375000, 'sports'), + ('Yosemite', 'yosemite', 485000, 'muscle'), + ('Deluxo', 'deluxo', 4721500, 'sportsclassics'), + ('Pariah', 'pariah', 1420000, 'sports'), + ('Stromberg', 'stromberg', 3185350, 'sports'), + ('SC 1', 'sc1', 1603000, 'super'), + ('riata', 'riata', 380000, 'offroad'), + ('Hermes', 'hermes', 535000, 'muscle'), + ('Savestra', 'savestra', 990000, 'sportsclassics'), + ('Streiter', 'streiter', 500000, 'sports'), + ('Kamacho', 'kamacho', 345000, 'offroad'), + ('GT 500', 'gt500', 785000, 'sportsclassics'), + ('Z190', 'z190', 900000, 'sportsclassics'), + ('Viseris', 'viseris', 875000, 'sportsclassics'), + ('Autarch', 'autarch', 1955000, 'super'), + ('Comet 5', 'comet5', 1145000, 'sports'), + ('Neon', 'neon', 1500000, 'sports'), + ('Revolter', 'revolter', 1610000, 'sports'), + ('Sentinel3', 'sentinel3', 650000, 'sports'), + ('Hustler', 'hustler', 625000, 'muscle') +; diff --git a/[esx_addons]/esx_vehicleshop/localization/en_esx_vehicleshop.sql b/[esx_addons]/esx_vehicleshop/localization/en_esx_vehicleshop.sql new file mode 100644 index 00000000..232c1f87 --- /dev/null +++ b/[esx_addons]/esx_vehicleshop/localization/en_esx_vehicleshop.sql @@ -0,0 +1,339 @@ +USE `es_extended`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_cardealer','Cardealer',1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_cardealer','Cardealer',1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('cardealer','Cardealer') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('cardealer',0,'recruit','Recruit',10,'{}','{}'), + ('cardealer',1,'novice','Novice',25,'{}','{}'), + ('cardealer',2,'experienced','Experienced',40,'{}','{}'), + ('cardealer',3,'boss','Boss',0,'{}','{}') +; + +CREATE TABLE `cardealer_vehicles` ( + `id` int NOT NULL AUTO_INCREMENT, + `vehicle` varchar(255) NOT NULL, + `price` int NOT NULL, + + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `vehicle_sold` ( + `client` VARCHAR(50) NOT NULL, + `model` VARCHAR(50) NOT NULL, + `plate` VARCHAR(50) NOT NULL, + `soldby` VARCHAR(50) NOT NULL, + `date` VARCHAR(50) NOT NULL, + + PRIMARY KEY (`plate`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `owned_vehicles` ( + `owner` VARCHAR(60) NOT NULL, + `plate` varchar(12) NOT NULL, + `vehicle` longtext, + `type` VARCHAR(20) NOT NULL DEFAULT 'car', + `job` VARCHAR(20) NULL DEFAULT NULL, + `stored` TINYINT(1) NOT NULL DEFAULT '0', + + PRIMARY KEY (`plate`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `rented_vehicles` ( + `vehicle` varchar(60) NOT NULL, + `plate` varchar(12) NOT NULL, + `player_name` varchar(255) NOT NULL, + `base_price` int NOT NULL, + `rent_price` int NOT NULL, + `owner` VARCHAR(60) NOT NULL, + + PRIMARY KEY (`plate`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `vehicle_categories` ( + `name` varchar(60) NOT NULL, + `label` varchar(60) NOT NULL, + + PRIMARY KEY (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +INSERT INTO `vehicle_categories` (name, label) VALUES + ('compacts','Compacts'), + ('coupes','Coupes'), + ('sedans','Sedans'), + ('sports','Sports'), + ('sportsclassics','Sports Classics'), + ('super','Super'), + ('muscle','Muscle'), + ('offroad','Off Road'), + ('suvs','SUVs'), + ('vans','Vans'), + ('motorcycles','Motos') +; + +CREATE TABLE `vehicles` ( + `name` varchar(60) NOT NULL, + `model` varchar(60) NOT NULL, + `price` int NOT NULL, + `category` varchar(60) DEFAULT NULL, + + PRIMARY KEY (`model`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +INSERT INTO `vehicles` (name, model, price, category) VALUES + ('Blade','blade',15000,'muscle'), + ('Buccaneer','buccaneer',18000,'muscle'), + ('Buccaneer Rider','buccaneer2',24000,'muscle'), + ('Chino','chino',15000,'muscle'), + ('Chino Luxe','chino2',19000,'muscle'), + ('Coquette BlackFin','coquette3',55000,'muscle'), + ('Dominator','dominator',35000,'muscle'), + ('Dukes','dukes',28000,'muscle'), + ('Gauntlet','gauntlet',30000,'muscle'), + ('Hotknife','hotknife',125000,'muscle'), + ('Faction','faction',20000,'muscle'), + ('Faction Rider','faction2',30000,'muscle'), + ('Faction XL','faction3',40000,'muscle'), + ('Nightshade','nightshade',65000,'muscle'), + ('Phoenix','phoenix',12500,'muscle'), + ('Picador','picador',18000,'muscle'), + ('Sabre Turbo','sabregt',20000,'muscle'), + ('Sabre GT','sabregt2',25000,'muscle'), + ('Slam Van','slamvan3',11500,'muscle'), + ('Tampa','tampa',16000,'muscle'), + ('Virgo','virgo',14000,'muscle'), + ('Vigero','vigero',12500,'muscle'), + ('Voodoo','voodoo',7200,'muscle'), + ('Blista','blista',8000,'compacts'), + ('Brioso R/A','brioso',18000,'compacts'), + ('Issi','issi2',10000,'compacts'), + ('Panto','panto',10000,'compacts'), + ('Prairie','prairie',12000,'compacts'), + ('Bison','bison',45000,'vans'), + ('Bobcat XL','bobcatxl',32000,'vans'), + ('Burrito','burrito3',19000,'vans'), + ('Burrito','gburrito2',29000,'vans'), + ('Camper','camper',42000,'vans'), + ('Gang Burrito','gburrito',45000,'vans'), + ('Journey','journey',6500,'vans'), + ('Minivan','minivan',13000,'vans'), + ('Moonbeam','moonbeam',18000,'vans'), + ('Moonbeam Rider','moonbeam2',35000,'vans'), + ('Paradise','paradise',19000,'vans'), + ('Rumpo','rumpo',15000,'vans'), + ('Rumpo Trail','rumpo3',19500,'vans'), + ('Surfer','surfer',12000,'vans'), + ('Youga','youga',10800,'vans'), + ('Youga Luxuary','youga2',14500,'vans'), + ('Asea','asea',5500,'sedans'), + ('Cognoscenti','cognoscenti',55000,'sedans'), + ('Emperor','emperor',8500,'sedans'), + ('Fugitive','fugitive',12000,'sedans'), + ('Glendale','glendale',6500,'sedans'), + ('Intruder','intruder',7500,'sedans'), + ('Premier','premier',8000,'sedans'), + ('Primo Custom','primo2',14000,'sedans'), + ('Regina','regina',5000,'sedans'), + ('Schafter','schafter2',25000,'sedans'), + ('Stretch','stretch',90000,'sedans'), + ('Super Diamond','superd',130000,'sedans'), + ('Tailgater','tailgater',30000,'sedans'), + ('Warrener','warrener',4000,'sedans'), + ('Washington','washington',9000,'sedans'), + ('Baller','baller2',40000,'suvs'), + ('Baller Sport','baller3',60000,'suvs'), + ('Cavalcade','cavalcade2',55000,'suvs'), + ('Contender','contender',70000,'suvs'), + ('Dubsta','dubsta',45000,'suvs'), + ('Dubsta Luxuary','dubsta2',60000,'suvs'), + ('Fhantom','fq2',17000,'suvs'), + ('Grabger','granger',50000,'suvs'), + ('Gresley','gresley',47500,'suvs'), + ('Huntley S','huntley',40000,'suvs'), + ('Landstalker','landstalker',35000,'suvs'), + ('Mesa','mesa',16000,'suvs'), + ('Mesa Trail','mesa3',40000,'suvs'), + ('Patriot','patriot',55000,'suvs'), + ('Radius','radi',29000,'suvs'), + ('Rocoto','rocoto',45000,'suvs'), + ('Seminole','seminole',25000,'suvs'), + ('XLS','xls',32000,'suvs'), + ('Btype','btype',62000,'sportsclassics'), + ('Btype Luxe','btype3',85000,'sportsclassics'), + ('Btype Hotroad','btype2',155000,'sportsclassics'), + ('Casco','casco',30000,'sportsclassics'), + ('Coquette Classic','coquette2',40000,'sportsclassics'), + ('Manana','manana',12800,'sportsclassics'), + ('Monroe','monroe',55000,'sportsclassics'), + ('Pigalle','pigalle',20000,'sportsclassics'), + ('Stinger','stinger',80000,'sportsclassics'), + ('Stinger GT','stingergt',75000,'sportsclassics'), + ('Stirling GT','feltzer3',65000,'sportsclassics'), + ('Z-Type','ztype',220000,'sportsclassics'), + ('Bifta','bifta',12000,'offroad'), + ('Bf Injection','bfinjection',16000,'offroad'), + ('Blazer','blazer',6500,'offroad'), + ('Blazer Sport','blazer4',8500,'offroad'), + ('Brawler','brawler',45000,'offroad'), + ('Bubsta 6x6','dubsta3',120000,'offroad'), + ('Dune Buggy','dune',8000,'offroad'), + ('Guardian','guardian',45000,'offroad'), + ('Rebel','rebel2',35000,'offroad'), + ('Sandking','sandking',55000,'offroad'), + ('The Liberator','monster',210000,'offroad'), + ('Trophy Truck','trophytruck',60000,'offroad'), + ('Trophy Truck Limited','trophytruck2',80000,'offroad'), + ('Cognoscenti Cabrio','cogcabrio',55000,'coupes'), + ('Exemplar','exemplar',32000,'coupes'), + ('F620','f620',40000,'coupes'), + ('Felon','felon',42000,'coupes'), + ('Felon GT','felon2',55000,'coupes'), + ('Jackal','jackal',38000,'coupes'), + ('Oracle XS','oracle2',35000,'coupes'), + ('Sentinel','sentinel',32000,'coupes'), + ('Sentinel XS','sentinel2',40000,'coupes'), + ('Windsor','windsor',95000,'coupes'), + ('Windsor Drop','windsor2',125000,'coupes'), + ('Zion','zion',36000,'coupes'), + ('Zion Cabrio','zion2',45000,'coupes'), + ('9F','ninef',65000,'sports'), + ('9F Cabrio','ninef2',80000,'sports'), + ('Alpha','alpha',60000,'sports'), + ('Banshee','banshee',70000,'sports'), + ('Bestia GTS','bestiagts',55000,'sports'), + ('Buffalo','buffalo',12000,'sports'), + ('Buffalo S','buffalo2',20000,'sports'), + ('Carbonizzare','carbonizzare',75000,'sports'), + ('Comet','comet2',65000,'sports'), + ('Coquette','coquette',65000,'sports'), + ('Drift Tampa','tampa2',80000,'sports'), + ('Elegy','elegy2',38500,'sports'), + ('Feltzer','feltzer2',55000,'sports'), + ('Furore GT','furoregt',45000,'sports'), + ('Fusilade','fusilade',40000,'sports'), + ('Jester','jester',65000,'sports'), + ('Jester(Racecar)','jester2',135000,'sports'), + ('Khamelion','khamelion',38000,'sports'), + ('Kuruma','kuruma',30000,'sports'), + ('Lynx','lynx',40000,'sports'), + ('Mamba','mamba',70000,'sports'), + ('Massacro','massacro',65000,'sports'), + ('Massacro(Racecar)','massacro2',130000,'sports'), + ('Omnis','omnis',35000,'sports'), + ('Penumbra','penumbra',28000,'sports'), + ('Rapid GT','rapidgt',35000,'sports'), + ('Rapid GT Convertible','rapidgt2',45000,'sports'), + ('Schafter V12','schafter3',50000,'sports'), + ('Seven 70','seven70',39500,'sports'), + ('Sultan','sultan',15000,'sports'), + ('Surano','surano',50000,'sports'), + ('Tropos','tropos',40000,'sports'), + ('Verlierer','verlierer2',70000,'sports'), + ('Adder','adder',900000,'super'), + ('Banshee 900R','banshee2',255000,'super'), + ('Bullet','bullet',90000,'super'), + ('Cheetah','cheetah',375000,'super'), + ('Entity XF','entityxf',425000,'super'), + ('ETR1','sheava',220000,'super'), + ('FMJ','fmj',185000,'super'), + ('Infernus','infernus',180000,'super'), + ('Osiris','osiris',160000,'super'), + ('Pfister','pfister811',85000,'super'), + ('RE-7B','le7b',325000,'super'), + ('Reaper','reaper',150000,'super'), + ('Sultan RS','sultanrs',65000,'super'), + ('T20','t20',300000,'super'), + ('Turismo R','turismor',350000,'super'), + ('Tyrus','tyrus',600000,'super'), + ('Vacca','vacca',120000,'super'), + ('Voltic','voltic',90000,'super'), + ('X80 Proto','prototipo',2500000,'super'), + ('Zentorno','zentorno',1500000,'super'), + ('Akuma','AKUMA',7500,'motorcycles'), + ('Avarus','avarus',18000,'motorcycles'), + ('Bagger','bagger',13500,'motorcycles'), + ('Bati 801','bati',12000,'motorcycles'), + ('Bati 801RR','bati2',19000,'motorcycles'), + ('BF400','bf400',6500,'motorcycles'), + ('BMX (velo)','bmx',160,'motorcycles'), + ('Carbon RS','carbonrs',18000,'motorcycles'), + ('Chimera','chimera',38000,'motorcycles'), + ('Cliffhanger','cliffhanger',9500,'motorcycles'), + ('Cruiser (velo)','cruiser',510,'motorcycles'), + ('Daemon','daemon',11500,'motorcycles'), + ('Daemon High','daemon2',13500,'motorcycles'), + ('Defiler','defiler',9800,'motorcycles'), + ('Double T','double',28000,'motorcycles'), + ('Enduro','enduro',5500,'motorcycles'), + ('Esskey','esskey',4200,'motorcycles'), + ('Faggio','faggio',1900,'motorcycles'), + ('Vespa','faggio2',2800,'motorcycles'), + ('Fixter (velo)','fixter',225,'motorcycles'), + ('Gargoyle','gargoyle',16500,'motorcycles'), + ('Hakuchou','hakuchou',31000,'motorcycles'), + ('Hakuchou Sport','hakuchou2',55000,'motorcycles'), + ('Hexer','hexer',12000,'motorcycles'), + ('Innovation','innovation',23500,'motorcycles'), + ('Manchez','manchez',5300,'motorcycles'), + ('Nemesis','nemesis',5800,'motorcycles'), + ('Nightblade','nightblade',35000,'motorcycles'), + ('PCJ-600','pcj',6200,'motorcycles'), + ('Ruffian','ruffian',6800,'motorcycles'), + ('Sanchez','sanchez',5300,'motorcycles'), + ('Sanchez Sport','sanchez2',5300,'motorcycles'), + ('Sanctus','sanctus',25000,'motorcycles'), + ('Scorcher (velo)','scorcher',280,'motorcycles'), + ('Sovereign','sovereign',22000,'motorcycles'), + ('Shotaro Concept','shotaro',320000,'motorcycles'), + ('Thrust','thrust',24000,'motorcycles'), + ('Tri bike (velo)','tribike3',520,'motorcycles'), + ('Vader','vader',7200,'motorcycles'), + ('Vortex','vortex',9800,'motorcycles'), + ('Woflsbane','wolfsbane',9000,'motorcycles'), + ('Zombie','zombiea',9500,'motorcycles'), + ('Zombie Luxuary','zombieb',12000,'motorcycles'), + ('blazer5', 'blazer5', 1755600, 'offroad'), + ('Ruiner 2', 'ruiner2', 5745600, 'muscle'), + ('Voltic 2', 'voltic2', 3830400, 'super'), + ('Ardent', 'ardent', 1150000, 'sportsclassics'), + ('Oppressor', 'oppressor', 3524500, 'super'), + ('Visione', 'visione', 2250000, 'super'), + ('Retinue', 'retinue', 615000, 'sportsclassics'), + ('Cyclone', 'cyclone', 1890000, 'super'), + ('Rapid GT3', 'rapidgt3', 885000, 'sportsclassics'), + ('raiden', 'raiden', 1375000, 'sports'), + ('Yosemite', 'yosemite', 485000, 'muscle'), + ('Deluxo', 'deluxo', 4721500, 'sportsclassics'), + ('Pariah', 'pariah', 1420000, 'sports'), + ('Stromberg', 'stromberg', 3185350, 'sports'), + ('SC 1', 'sc1', 1603000, 'super'), + ('riata', 'riata', 380000, 'offroad'), + ('Hermes', 'hermes', 535000, 'muscle'), + ('Savestra', 'savestra', 990000, 'sportsclassics'), + ('Streiter', 'streiter', 500000, 'sports'), + ('Kamacho', 'kamacho', 345000, 'offroad'), + ('GT 500', 'gt500', 785000, 'sportsclassics'), + ('Z190', 'z190', 900000, 'sportsclassics'), + ('Viseris', 'viseris', 875000, 'sportsclassics'), + ('Autarch', 'autarch', 1955000, 'super'), + ('Comet 5', 'comet5', 1145000, 'sports'), + ('Neon', 'neon', 1500000, 'sports'), + ('Revolter', 'revolter', 1610000, 'sports'), + ('Sentinel3', 'sentinel3', 650000, 'sports'), + ('Hustler', 'hustler', 625000, 'muscle') +; diff --git a/[esx_addons]/esx_vehicleshop/localization/fi_esx_vehicleshop.sql b/[esx_addons]/esx_vehicleshop/localization/fi_esx_vehicleshop.sql new file mode 100644 index 00000000..0b2fea53 --- /dev/null +++ b/[esx_addons]/esx_vehicleshop/localization/fi_esx_vehicleshop.sql @@ -0,0 +1,339 @@ +USE `es_extended`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_cardealer','Autokauppa',1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_cardealer','Autokauppa',1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('cardealer','Autokauppa') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('cardealer',0,'recruit','Harjoittelija',10,'{}','{}'), + ('cardealer',1,'novice','Aloittelija',25,'{}','{}'), + ('cardealer',2,'experienced','Kokenut',40,'{}','{}'), + ('cardealer',3,'boss','Pomo',0,'{}','{}') +; + +CREATE TABLE `cardealer_vehicles` ( + `id` int NOT NULL AUTO_INCREMENT, + `vehicle` varchar(255) NOT NULL, + `price` int NOT NULL, + + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `vehicle_sold` ( + `client` VARCHAR(50) NOT NULL, + `model` VARCHAR(50) NOT NULL, + `plate` VARCHAR(50) NOT NULL, + `soldby` VARCHAR(50) NOT NULL, + `date` VARCHAR(50) NOT NULL, + + PRIMARY KEY (`plate`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `owned_vehicles` ( + `owner` VARCHAR(60) NOT NULL, + `plate` varchar(12) NOT NULL, + `vehicle` longtext, + `type` VARCHAR(20) NOT NULL DEFAULT 'car', + `job` VARCHAR(20) NULL DEFAULT NULL, + `stored` TINYINT(1) NOT NULL DEFAULT '0', + + PRIMARY KEY (`plate`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `rented_vehicles` ( + `vehicle` varchar(60) NOT NULL, + `plate` varchar(12) NOT NULL, + `player_name` varchar(255) NOT NULL, + `base_price` int NOT NULL, + `rent_price` int NOT NULL, + `owner` VARCHAR(60) NOT NULL, + + PRIMARY KEY (`plate`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `vehicle_categories` ( + `name` varchar(60) NOT NULL, + `label` varchar(60) NOT NULL, + + PRIMARY KEY (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +INSERT INTO `vehicle_categories` (name, label) VALUES + ('compacts','Compacts'), + ('coupes','Coupés'), + ('sedans','Sedans'), + ('sports','Sports'), + ('sportsclassics','Sports Classics'), + ('super','Super'), + ('muscle','Muscle'), + ('offroad','Off Road'), + ('suvs','SUVs'), + ('vans','Vans'), + ('motorcycles','Motos') +; + +CREATE TABLE `vehicles` ( + `name` varchar(60) NOT NULL, + `model` varchar(60) NOT NULL, + `price` int NOT NULL, + `category` varchar(60) DEFAULT NULL, + + PRIMARY KEY (`model`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +INSERT INTO `vehicles` (name, model, price, category) VALUES + ('Blade','blade',15000,'muscle'), + ('Buccaneer','buccaneer',18000,'muscle'), + ('Buccaneer Rider','buccaneer2',24000,'muscle'), + ('Chino','chino',15000,'muscle'), + ('Chino Luxe','chino2',19000,'muscle'), + ('Coquette BlackFin','coquette3',55000,'muscle'), + ('Dominator','dominator',35000,'muscle'), + ('Dukes','dukes',28000,'muscle'), + ('Gauntlet','gauntlet',30000,'muscle'), + ('Hotknife','hotknife',125000,'muscle'), + ('Faction','faction',20000,'muscle'), + ('Faction Rider','faction2',30000,'muscle'), + ('Faction XL','faction3',40000,'muscle'), + ('Nightshade','nightshade',65000,'muscle'), + ('Phoenix','phoenix',12500,'muscle'), + ('Picador','picador',18000,'muscle'), + ('Sabre Turbo','sabregt',20000,'muscle'), + ('Sabre GT','sabregt2',25000,'muscle'), + ('Slam Van','slamvan3',11500,'muscle'), + ('Tampa','tampa',16000,'muscle'), + ('Virgo','virgo',14000,'muscle'), + ('Vigero','vigero',12500,'muscle'), + ('Voodoo','voodoo',7200,'muscle'), + ('Blista','blista',8000,'compacts'), + ('Brioso R/A','brioso',18000,'compacts'), + ('Issi','issi2',10000,'compacts'), + ('Panto','panto',10000,'compacts'), + ('Prairie','prairie',12000,'compacts'), + ('Bison','bison',45000,'vans'), + ('Bobcat XL','bobcatxl',32000,'vans'), + ('Burrito','burrito3',19000,'vans'), + ('Burrito','gburrito2',29000,'vans'), + ('Camper','camper',42000,'vans'), + ('Gang Burrito','gburrito',45000,'vans'), + ('Journey','journey',6500,'vans'), + ('Minivan','minivan',13000,'vans'), + ('Moonbeam','moonbeam',18000,'vans'), + ('Moonbeam Rider','moonbeam2',35000,'vans'), + ('Paradise','paradise',19000,'vans'), + ('Rumpo','rumpo',15000,'vans'), + ('Rumpo Trail','rumpo3',19500,'vans'), + ('Surfer','surfer',12000,'vans'), + ('Youga','youga',10800,'vans'), + ('Youga Luxuary','youga2',14500,'vans'), + ('Asea','asea',5500,'sedans'), + ('Cognoscenti','cognoscenti',55000,'sedans'), + ('Emperor','emperor',8500,'sedans'), + ('Fugitive','fugitive',12000,'sedans'), + ('Glendale','glendale',6500,'sedans'), + ('Intruder','intruder',7500,'sedans'), + ('Premier','premier',8000,'sedans'), + ('Primo Custom','primo2',14000,'sedans'), + ('Regina','regina',5000,'sedans'), + ('Schafter','schafter2',25000,'sedans'), + ('Stretch','stretch',90000,'sedans'), + ('Super Diamond','superd',130000,'sedans'), + ('Tailgater','tailgater',30000,'sedans'), + ('Warrener','warrener',4000,'sedans'), + ('Washington','washington',9000,'sedans'), + ('Baller','baller2',40000,'suvs'), + ('Baller Sport','baller3',60000,'suvs'), + ('Cavalcade','cavalcade2',55000,'suvs'), + ('Contender','contender',70000,'suvs'), + ('Dubsta','dubsta',45000,'suvs'), + ('Dubsta Luxuary','dubsta2',60000,'suvs'), + ('Fhantom','fq2',17000,'suvs'), + ('Grabger','granger',50000,'suvs'), + ('Gresley','gresley',47500,'suvs'), + ('Huntley S','huntley',40000,'suvs'), + ('Landstalker','landstalker',35000,'suvs'), + ('Mesa','mesa',16000,'suvs'), + ('Mesa Trail','mesa3',40000,'suvs'), + ('Patriot','patriot',55000,'suvs'), + ('Radius','radi',29000,'suvs'), + ('Rocoto','rocoto',45000,'suvs'), + ('Seminole','seminole',25000,'suvs'), + ('XLS','xls',32000,'suvs'), + ('Btype','btype',62000,'sportsclassics'), + ('Btype Luxe','btype3',85000,'sportsclassics'), + ('Btype Hotroad','btype2',155000,'sportsclassics'), + ('Casco','casco',30000,'sportsclassics'), + ('Coquette Classic','coquette2',40000,'sportsclassics'), + ('Manana','manana',12800,'sportsclassics'), + ('Monroe','monroe',55000,'sportsclassics'), + ('Pigalle','pigalle',20000,'sportsclassics'), + ('Stinger','stinger',80000,'sportsclassics'), + ('Stinger GT','stingergt',75000,'sportsclassics'), + ('Stirling GT','feltzer3',65000,'sportsclassics'), + ('Z-Type','ztype',220000,'sportsclassics'), + ('Bifta','bifta',12000,'offroad'), + ('Bf Injection','bfinjection',16000,'offroad'), + ('Blazer','blazer',6500,'offroad'), + ('Blazer Sport','blazer4',8500,'offroad'), + ('Brawler','brawler',45000,'offroad'), + ('Bubsta 6x6','dubsta3',120000,'offroad'), + ('Dune Buggy','dune',8000,'offroad'), + ('Guardian','guardian',45000,'offroad'), + ('Rebel','rebel2',35000,'offroad'), + ('Sandking','sandking',55000,'offroad'), + ('The Liberator','monster',210000,'offroad'), + ('Trophy Truck','trophytruck',60000,'offroad'), + ('Trophy Truck Limited','trophytruck2',80000,'offroad'), + ('Cognoscenti Cabrio','cogcabrio',55000,'coupes'), + ('Exemplar','exemplar',32000,'coupes'), + ('F620','f620',40000,'coupes'), + ('Felon','felon',42000,'coupes'), + ('Felon GT','felon2',55000,'coupes'), + ('Jackal','jackal',38000,'coupes'), + ('Oracle XS','oracle2',35000,'coupes'), + ('Sentinel','sentinel',32000,'coupes'), + ('Sentinel XS','sentinel2',40000,'coupes'), + ('Windsor','windsor',95000,'coupes'), + ('Windsor Drop','windsor2',125000,'coupes'), + ('Zion','zion',36000,'coupes'), + ('Zion Cabrio','zion2',45000,'coupes'), + ('9F','ninef',65000,'sports'), + ('9F Cabrio','ninef2',80000,'sports'), + ('Alpha','alpha',60000,'sports'), + ('Banshee','banshee',70000,'sports'), + ('Bestia GTS','bestiagts',55000,'sports'), + ('Buffalo','buffalo',12000,'sports'), + ('Buffalo S','buffalo2',20000,'sports'), + ('Carbonizzare','carbonizzare',75000,'sports'), + ('Comet','comet2',65000,'sports'), + ('Coquette','coquette',65000,'sports'), + ('Drift Tampa','tampa2',80000,'sports'), + ('Elegy','elegy2',38500,'sports'), + ('Feltzer','feltzer2',55000,'sports'), + ('Furore GT','furoregt',45000,'sports'), + ('Fusilade','fusilade',40000,'sports'), + ('Jester','jester',65000,'sports'), + ('Jester(Racecar)','jester2',135000,'sports'), + ('Khamelion','khamelion',38000,'sports'), + ('Kuruma','kuruma',30000,'sports'), + ('Lynx','lynx',40000,'sports'), + ('Mamba','mamba',70000,'sports'), + ('Massacro','massacro',65000,'sports'), + ('Massacro(Racecar)','massacro2',130000,'sports'), + ('Omnis','omnis',35000,'sports'), + ('Penumbra','penumbra',28000,'sports'), + ('Rapid GT','rapidgt',35000,'sports'), + ('Rapid GT Convertible','rapidgt2',45000,'sports'), + ('Schafter V12','schafter3',50000,'sports'), + ('Seven 70','seven70',39500,'sports'), + ('Sultan','sultan',15000,'sports'), + ('Surano','surano',50000,'sports'), + ('Tropos','tropos',40000,'sports'), + ('Verlierer','verlierer2',70000,'sports'), + ('Adder','adder',900000,'super'), + ('Banshee 900R','banshee2',255000,'super'), + ('Bullet','bullet',90000,'super'), + ('Cheetah','cheetah',375000,'super'), + ('Entity XF','entityxf',425000,'super'), + ('ETR1','sheava',220000,'super'), + ('FMJ','fmj',185000,'super'), + ('Infernus','infernus',180000,'super'), + ('Osiris','osiris',160000,'super'), + ('Pfister','pfister811',85000,'super'), + ('RE-7B','le7b',325000,'super'), + ('Reaper','reaper',150000,'super'), + ('Sultan RS','sultanrs',65000,'super'), + ('T20','t20',300000,'super'), + ('Turismo R','turismor',350000,'super'), + ('Tyrus','tyrus',600000,'super'), + ('Vacca','vacca',120000,'super'), + ('Voltic','voltic',90000,'super'), + ('X80 Proto','prototipo',2500000,'super'), + ('Zentorno','zentorno',1500000,'super'), + ('Akuma','AKUMA',7500,'motorcycles'), + ('Avarus','avarus',18000,'motorcycles'), + ('Bagger','bagger',13500,'motorcycles'), + ('Bati 801','bati',12000,'motorcycles'), + ('Bati 801RR','bati2',19000,'motorcycles'), + ('BF400','bf400',6500,'motorcycles'), + ('BMX (velo)','bmx',160,'motorcycles'), + ('Carbon RS','carbonrs',18000,'motorcycles'), + ('Chimera','chimera',38000,'motorcycles'), + ('Cliffhanger','cliffhanger',9500,'motorcycles'), + ('Cruiser (velo)','cruiser',510,'motorcycles'), + ('Daemon','daemon',11500,'motorcycles'), + ('Daemon High','daemon2',13500,'motorcycles'), + ('Defiler','defiler',9800,'motorcycles'), + ('Double T','double',28000,'motorcycles'), + ('Enduro','enduro',5500,'motorcycles'), + ('Esskey','esskey',4200,'motorcycles'), + ('Faggio','faggio',1900,'motorcycles'), + ('Vespa','faggio2',2800,'motorcycles'), + ('Fixter (velo)','fixter',225,'motorcycles'), + ('Gargoyle','gargoyle',16500,'motorcycles'), + ('Hakuchou','hakuchou',31000,'motorcycles'), + ('Hakuchou Sport','hakuchou2',55000,'motorcycles'), + ('Hexer','hexer',12000,'motorcycles'), + ('Innovation','innovation',23500,'motorcycles'), + ('Manchez','manchez',5300,'motorcycles'), + ('Nemesis','nemesis',5800,'motorcycles'), + ('Nightblade','nightblade',35000,'motorcycles'), + ('PCJ-600','pcj',6200,'motorcycles'), + ('Ruffian','ruffian',6800,'motorcycles'), + ('Sanchez','sanchez',5300,'motorcycles'), + ('Sanchez Sport','sanchez2',5300,'motorcycles'), + ('Sanctus','sanctus',25000,'motorcycles'), + ('Scorcher (velo)','scorcher',280,'motorcycles'), + ('Sovereign','sovereign',22000,'motorcycles'), + ('Shotaro Concept','shotaro',320000,'motorcycles'), + ('Thrust','thrust',24000,'motorcycles'), + ('Tri bike (velo)','tribike3',520,'motorcycles'), + ('Vader','vader',7200,'motorcycles'), + ('Vortex','vortex',9800,'motorcycles'), + ('Woflsbane','wolfsbane',9000,'motorcycles'), + ('Zombie','zombiea',9500,'motorcycles'), + ('Zombie Luxuary','zombieb',12000,'motorcycles'), + ('blazer5', 'blazer5', 1755600, 'offroad'), + ('Ruiner 2', 'ruiner2', 5745600, 'muscle'), + ('Voltic 2', 'voltic2', 3830400, 'super'), + ('Ardent', 'ardent', 1150000, 'sportsclassics'), + ('Oppressor', 'oppressor', 3524500, 'super'), + ('Visione', 'visione', 2250000, 'super'), + ('Retinue', 'retinue', 615000, 'sportsclassics'), + ('Cyclone', 'cyclone', 1890000, 'super'), + ('Rapid GT3', 'rapidgt3', 885000, 'sportsclassics'), + ('raiden', 'raiden', 1375000, 'sports'), + ('Yosemite', 'yosemite', 485000, 'muscle'), + ('Deluxo', 'deluxo', 4721500, 'sportsclassics'), + ('Pariah', 'pariah', 1420000, 'sports'), + ('Stromberg', 'stromberg', 3185350, 'sports'), + ('SC 1', 'sc1', 1603000, 'super'), + ('riata', 'riata', 380000, 'offroad'), + ('Hermes', 'hermes', 535000, 'muscle'), + ('Savestra', 'savestra', 990000, 'sportsclassics'), + ('Streiter', 'streiter', 500000, 'sports'), + ('Kamacho', 'kamacho', 345000, 'offroad'), + ('GT 500', 'gt500', 785000, 'sportsclassics'), + ('Z190', 'z190', 900000, 'sportsclassics'), + ('Viseris', 'viseris', 875000, 'sportsclassics'), + ('Autarch', 'autarch', 1955000, 'super'), + ('Comet 5', 'comet5', 1145000, 'sports'), + ('Neon', 'neon', 1500000, 'sports'), + ('Revolter', 'revolter', 1610000, 'sports'), + ('Sentinel3', 'sentinel3', 650000, 'sports'), + ('Hustler', 'hustler', 625000, 'muscle') +; diff --git a/[esx_addons]/esx_vehicleshop/localization/pl_esx_vehicleshop.sql b/[esx_addons]/esx_vehicleshop/localization/pl_esx_vehicleshop.sql new file mode 100644 index 00000000..16ac26bb --- /dev/null +++ b/[esx_addons]/esx_vehicleshop/localization/pl_esx_vehicleshop.sql @@ -0,0 +1,340 @@ +USE `es_extended`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_cardealer','Sprzedawca aut',1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_cardealer','Sprzedawca aut',1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('cardealer','Sprzedawca aut') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('cardealer',0,'recruit','Praktykant',10,'{}','{}'), + ('cardealer',1,'novice','Doświadczony',25,'{}','{}'), + ('cardealer',2,'experienced','Kierownik',40,'{}','{}'), + ('cardealer',3,'boss','Szef',0,'{}','{}') +; + +CREATE TABLE `cardealer_vehicles` ( + `id` int NOT NULL AUTO_INCREMENT, + `vehicle` varchar(255) NOT NULL, + `price` int NOT NULL, + + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `vehicle_sold` ( + `client` VARCHAR(50) NOT NULL, + `model` VARCHAR(50) NOT NULL, + `plate` VARCHAR(50) NOT NULL, + `soldby` VARCHAR(50) NOT NULL, + `date` VARCHAR(50) NOT NULL, + + PRIMARY KEY (`plate`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `owned_vehicles` ( + `owner` VARCHAR(60) NOT NULL, + `plate` varchar(12) NOT NULL, + `vehicle` longtext, + `type` VARCHAR(20) NOT NULL DEFAULT 'car', + `job` VARCHAR(20) NULL DEFAULT NULL, + `stored` TINYINT(1) NOT NULL DEFAULT '0', + + PRIMARY KEY (`plate`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `rented_vehicles` ( + `vehicle` varchar(60) NOT NULL, + `plate` varchar(12) NOT NULL, + `player_name` varchar(255) NOT NULL, + `base_price` int NOT NULL, + `rent_price` int NOT NULL, + `owner` VARCHAR(60) NOT NULL, + + PRIMARY KEY (`plate`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `vehicle_categories` ( + `id` int NOT NULL AUTO_INCREMENT, + `name` varchar(60) NOT NULL, + `label` varchar(60) NOT NULL, + + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +INSERT INTO `vehicle_categories` (name, label) VALUES + ('compacts','Compacts'), + ('coupes','Coupés'), + ('sedans','Sedans'), + ('sports','Sports'), + ('sportsclassics','Sports Classics'), + ('super','Supercars'), + ('muscle','Muscle'), + ('offroad','Off Road'), + ('suvs','SUVs'), + ('vans','Vans'), + ('motorcycles','Motorcycles') +; + +CREATE TABLE `vehicles` ( + `name` varchar(60) NOT NULL, + `model` varchar(60) NOT NULL, + `price` int NOT NULL, + `category` varchar(60) DEFAULT NULL, + + PRIMARY KEY (`model`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +INSERT INTO `vehicles` (name, model, price, category) VALUES + ('Blade','blade',15000,'muscle'), + ('Buccaneer','buccaneer',18000,'muscle'), + ('Buccaneer Rider','buccaneer2',24000,'muscle'), + ('Chino','chino',15000,'muscle'), + ('Chino Luxe','chino2',19000,'muscle'), + ('Coquette BlackFin','coquette3',55000,'muscle'), + ('Dominator','dominator',35000,'muscle'), + ('Dukes','dukes',28000,'muscle'), + ('Gauntlet','gauntlet',30000,'muscle'), + ('Hotknife','hotknife',125000,'muscle'), + ('Faction','faction',20000,'muscle'), + ('Faction Rider','faction2',30000,'muscle'), + ('Faction XL','faction3',40000,'muscle'), + ('Nightshade','nightshade',65000,'muscle'), + ('Phoenix','phoenix',12500,'muscle'), + ('Picador','picador',18000,'muscle'), + ('Sabre Turbo','sabregt',20000,'muscle'), + ('Sabre GT','sabregt2',25000,'muscle'), + ('Slam Van','slamvan3',11500,'muscle'), + ('Tampa','tampa',16000,'muscle'), + ('Virgo','virgo',14000,'muscle'), + ('Vigero','vigero',12500,'muscle'), + ('Voodoo','voodoo',7200,'muscle'), + ('Blista','blista',8000,'compacts'), + ('Brioso R/A','brioso',18000,'compacts'), + ('Issi','issi2',10000,'compacts'), + ('Panto','panto',10000,'compacts'), + ('Prairie','prairie',12000,'compacts'), + ('Bison','bison',45000,'vans'), + ('Bobcat XL','bobcatxl',32000,'vans'), + ('Burrito','burrito3',19000,'vans'), + ('Burrito','gburrito2',29000,'vans'), + ('Camper','camper',42000,'vans'), + ('Gang Burrito','gburrito',45000,'vans'), + ('Journey','journey',6500,'vans'), + ('Minivan','minivan',13000,'vans'), + ('Moonbeam','moonbeam',18000,'vans'), + ('Moonbeam Rider','moonbeam2',35000,'vans'), + ('Paradise','paradise',19000,'vans'), + ('Rumpo','rumpo',15000,'vans'), + ('Rumpo Trail','rumpo3',19500,'vans'), + ('Surfer','surfer',12000,'vans'), + ('Youga','youga',10800,'vans'), + ('Youga Luxuary','youga2',14500,'vans'), + ('Asea','asea',5500,'sedans'), + ('Cognoscenti','cognoscenti',55000,'sedans'), + ('Emperor','emperor',8500,'sedans'), + ('Fugitive','fugitive',12000,'sedans'), + ('Glendale','glendale',6500,'sedans'), + ('Intruder','intruder',7500,'sedans'), + ('Premier','premier',8000,'sedans'), + ('Primo Custom','primo2',14000,'sedans'), + ('Regina','regina',5000,'sedans'), + ('Schafter','schafter2',25000,'sedans'), + ('Stretch','stretch',90000,'sedans'), + ('Super Diamond','superd',130000,'sedans'), + ('Tailgater','tailgater',30000,'sedans'), + ('Warrener','warrener',4000,'sedans'), + ('Washington','washington',9000,'sedans'), + ('Baller','baller2',40000,'suvs'), + ('Baller Sport','baller3',60000,'suvs'), + ('Cavalcade','cavalcade2',55000,'suvs'), + ('Contender','contender',70000,'suvs'), + ('Dubsta','dubsta',45000,'suvs'), + ('Dubsta Luxuary','dubsta2',60000,'suvs'), + ('Fhantom','fq2',17000,'suvs'), + ('Grabger','granger',50000,'suvs'), + ('Gresley','gresley',47500,'suvs'), + ('Huntley S','huntley',40000,'suvs'), + ('Landstalker','landstalker',35000,'suvs'), + ('Mesa','mesa',16000,'suvs'), + ('Mesa Trail','mesa3',40000,'suvs'), + ('Patriot','patriot',55000,'suvs'), + ('Radius','radi',29000,'suvs'), + ('Rocoto','rocoto',45000,'suvs'), + ('Seminole','seminole',25000,'suvs'), + ('XLS','xls',32000,'suvs'), + ('Btype','btype',62000,'sportsclassics'), + ('Btype Luxe','btype3',85000,'sportsclassics'), + ('Btype Hotroad','btype2',155000,'sportsclassics'), + ('Casco','casco',30000,'sportsclassics'), + ('Coquette Classic','coquette2',40000,'sportsclassics'), + ('Manana','manana',12800,'sportsclassics'), + ('Monroe','monroe',55000,'sportsclassics'), + ('Pigalle','pigalle',20000,'sportsclassics'), + ('Stinger','stinger',80000,'sportsclassics'), + ('Stinger GT','stingergt',75000,'sportsclassics'), + ('Stirling GT','feltzer3',65000,'sportsclassics'), + ('Z-Type','ztype',220000,'sportsclassics'), + ('Bifta','bifta',12000,'offroad'), + ('Bf Injection','bfinjection',16000,'offroad'), + ('Blazer','blazer',6500,'offroad'), + ('Blazer Sport','blazer4',8500,'offroad'), + ('Brawler','brawler',45000,'offroad'), + ('Bubsta 6x6','dubsta3',120000,'offroad'), + ('Dune Buggy','dune',8000,'offroad'), + ('Guardian','guardian',45000,'offroad'), + ('Rebel','rebel2',35000,'offroad'), + ('Sandking','sandking',55000,'offroad'), + ('The Liberator','monster',210000,'offroad'), + ('Trophy Truck','trophytruck',60000,'offroad'), + ('Trophy Truck Limited','trophytruck2',80000,'offroad'), + ('Cognoscenti Cabrio','cogcabrio',55000,'coupes'), + ('Exemplar','exemplar',32000,'coupes'), + ('F620','f620',40000,'coupes'), + ('Felon','felon',42000,'coupes'), + ('Felon GT','felon2',55000,'coupes'), + ('Jackal','jackal',38000,'coupes'), + ('Oracle XS','oracle2',35000,'coupes'), + ('Sentinel','sentinel',32000,'coupes'), + ('Sentinel XS','sentinel2',40000,'coupes'), + ('Windsor','windsor',95000,'coupes'), + ('Windsor Drop','windsor2',125000,'coupes'), + ('Zion','zion',36000,'coupes'), + ('Zion Cabrio','zion2',45000,'coupes'), + ('9F','ninef',65000,'sports'), + ('9F Cabrio','ninef2',80000,'sports'), + ('Alpha','alpha',60000,'sports'), + ('Banshee','banshee',70000,'sports'), + ('Bestia GTS','bestiagts',55000,'sports'), + ('Buffalo','buffalo',12000,'sports'), + ('Buffalo S','buffalo2',20000,'sports'), + ('Carbonizzare','carbonizzare',75000,'sports'), + ('Comet','comet2',65000,'sports'), + ('Coquette','coquette',65000,'sports'), + ('Drift Tampa','tampa2',80000,'sports'), + ('Elegy','elegy2',38500,'sports'), + ('Feltzer','feltzer2',55000,'sports'), + ('Furore GT','furoregt',45000,'sports'), + ('Fusilade','fusilade',40000,'sports'), + ('Jester','jester',65000,'sports'), + ('Jester(Racecar)','jester2',135000,'sports'), + ('Khamelion','khamelion',38000,'sports'), + ('Kuruma','kuruma',30000,'sports'), + ('Lynx','lynx',40000,'sports'), + ('Mamba','mamba',70000,'sports'), + ('Massacro','massacro',65000,'sports'), + ('Massacro(Racecar)','massacro2',130000,'sports'), + ('Omnis','omnis',35000,'sports'), + ('Penumbra','penumbra',28000,'sports'), + ('Rapid GT','rapidgt',35000,'sports'), + ('Rapid GT Convertible','rapidgt2',45000,'sports'), + ('Schafter V12','schafter3',50000,'sports'), + ('Seven 70','seven70',39500,'sports'), + ('Sultan','sultan',15000,'sports'), + ('Surano','surano',50000,'sports'), + ('Tropos','tropos',40000,'sports'), + ('Verlierer','verlierer2',70000,'sports'), + ('Adder','adder',900000,'super'), + ('Banshee 900R','banshee2',255000,'super'), + ('Bullet','bullet',90000,'super'), + ('Cheetah','cheetah',375000,'super'), + ('Entity XF','entityxf',425000,'super'), + ('ETR1','sheava',220000,'super'), + ('FMJ','fmj',185000,'super'), + ('Infernus','infernus',180000,'super'), + ('Osiris','osiris',160000,'super'), + ('Pfister','pfister811',85000,'super'), + ('RE-7B','le7b',325000,'super'), + ('Reaper','reaper',150000,'super'), + ('Sultan RS','sultanrs',65000,'super'), + ('T20','t20',300000,'super'), + ('Turismo R','turismor',350000,'super'), + ('Tyrus','tyrus',600000,'super'), + ('Vacca','vacca',120000,'super'), + ('Voltic','voltic',90000,'super'), + ('X80 Proto','prototipo',2500000,'super'), + ('Zentorno','zentorno',1500000,'super'), + ('Akuma','AKUMA',7500,'motorcycles'), + ('Avarus','avarus',18000,'motorcycles'), + ('Bagger','bagger',13500,'motorcycles'), + ('Bati 801','bati',12000,'motorcycles'), + ('Bati 801RR','bati2',19000,'motorcycles'), + ('BF400','bf400',6500,'motorcycles'), + ('BMX (velo)','bmx',160,'motorcycles'), + ('Carbon RS','carbonrs',18000,'motorcycles'), + ('Chimera','chimera',38000,'motorcycles'), + ('Cliffhanger','cliffhanger',9500,'motorcycles'), + ('Cruiser (velo)','cruiser',510,'motorcycles'), + ('Daemon','daemon',11500,'motorcycles'), + ('Daemon High','daemon2',13500,'motorcycles'), + ('Defiler','defiler',9800,'motorcycles'), + ('Double T','double',28000,'motorcycles'), + ('Enduro','enduro',5500,'motorcycles'), + ('Esskey','esskey',4200,'motorcycles'), + ('Faggio','faggio',1900,'motorcycles'), + ('Vespa','faggio2',2800,'motorcycles'), + ('Fixter (velo)','fixter',225,'motorcycles'), + ('Gargoyle','gargoyle',16500,'motorcycles'), + ('Hakuchou','hakuchou',31000,'motorcycles'), + ('Hakuchou Sport','hakuchou2',55000,'motorcycles'), + ('Hexer','hexer',12000,'motorcycles'), + ('Innovation','innovation',23500,'motorcycles'), + ('Manchez','manchez',5300,'motorcycles'), + ('Nemesis','nemesis',5800,'motorcycles'), + ('Nightblade','nightblade',35000,'motorcycles'), + ('PCJ-600','pcj',6200,'motorcycles'), + ('Ruffian','ruffian',6800,'motorcycles'), + ('Sanchez','sanchez',5300,'motorcycles'), + ('Sanchez Sport','sanchez2',5300,'motorcycles'), + ('Sanctus','sanctus',25000,'motorcycles'), + ('Scorcher (velo)','scorcher',280,'motorcycles'), + ('Sovereign','sovereign',22000,'motorcycles'), + ('Shotaro Concept','shotaro',320000,'motorcycles'), + ('Thrust','thrust',24000,'motorcycles'), + ('Tri bike (velo)','tribike3',520,'motorcycles'), + ('Vader','vader',7200,'motorcycles'), + ('Vortex','vortex',9800,'motorcycles'), + ('Woflsbane','wolfsbane',9000,'motorcycles'), + ('Zombie','zombiea',9500,'motorcycles'), + ('Zombie Luxuary','zombieb',12000,'motorcycles'), + ('blazer5', 'blazer5', 1755600, 'offroad'), + ('Ruiner 2', 'ruiner2', 5745600, 'muscle'), + ('Voltic 2', 'voltic2', 3830400, 'super'), + ('Ardent', 'ardent', 1150000, 'sportsclassics'), + ('Oppressor', 'oppressor', 3524500, 'super'), + ('Visione', 'visione', 2250000, 'super'), + ('Retinue', 'retinue', 615000, 'sportsclassics'), + ('Cyclone', 'cyclone', 1890000, 'super'), + ('Rapid GT3', 'rapidgt3', 885000, 'sportsclassics'), + ('raiden', 'raiden', 1375000, 'sports'), + ('Yosemite', 'yosemite', 485000, 'muscle'), + ('Deluxo', 'deluxo', 4721500, 'sportsclassics'), + ('Pariah', 'pariah', 1420000, 'sports'), + ('Stromberg', 'stromberg', 3185350, 'sports'), + ('SC 1', 'sc1', 1603000, 'super'), + ('riata', 'riata', 380000, 'offroad'), + ('Hermes', 'hermes', 535000, 'muscle'), + ('Savestra', 'savestra', 990000, 'sportsclassics'), + ('Streiter', 'streiter', 500000, 'sports'), + ('Kamacho', 'kamacho', 345000, 'offroad'), + ('GT 500', 'gt500', 785000, 'sportsclassics'), + ('Z190', 'z190', 900000, 'sportsclassics'), + ('Viseris', 'viseris', 875000, 'sportsclassics'), + ('Autarch', 'autarch', 1955000, 'super'), + ('Comet 5', 'comet5', 1145000, 'sports'), + ('Neon', 'neon', 1500000, 'sports'), + ('Revolter', 'revolter', 1610000, 'sports'), + ('Sentinel3', 'sentinel3', 650000, 'sports'), + ('Hustler', 'hustler', 625000, 'muscle') +; diff --git a/[esx_addons]/esx_vehicleshop/localization/sv_esx_vehicleshop.sql b/[esx_addons]/esx_vehicleshop/localization/sv_esx_vehicleshop.sql new file mode 100644 index 00000000..962edf80 --- /dev/null +++ b/[esx_addons]/esx_vehicleshop/localization/sv_esx_vehicleshop.sql @@ -0,0 +1,339 @@ +USE `es_extended`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_cardealer','Bilförsäljare',1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_cardealer','Bilförsäljare',1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('cardealer','Bilförsäljare') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('cardealer',0,'recruit','Nyanställd',10,'{}','{}'), + ('cardealer',1,'novice','Nybörjare',25,'{}','{}'), + ('cardealer',2,'experienced','Erfaren',40,'{}','{}'), + ('cardealer',3,'boss','Chef',0,'{}','{}') +; + +CREATE TABLE `cardealer_vehicles` ( + `id` int NOT NULL AUTO_INCREMENT, + `vehicle` varchar(255) NOT NULL, + `price` int NOT NULL, + + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `vehicle_sold` ( + `client` VARCHAR(50) NOT NULL, + `model` VARCHAR(50) NOT NULL, + `plate` VARCHAR(50) NOT NULL, + `soldby` VARCHAR(50) NOT NULL, + `date` VARCHAR(50) NOT NULL, + + PRIMARY KEY (`plate`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `owned_vehicles` ( + `owner` VARCHAR(60) NOT NULL, + `plate` varchar(12) NOT NULL, + `vehicle` longtext, + `type` VARCHAR(20) NOT NULL DEFAULT 'car', + `job` VARCHAR(20) NULL DEFAULT NULL, + `stored` TINYINT(1) NOT NULL DEFAULT '0', + + PRIMARY KEY (`plate`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `rented_vehicles` ( + `vehicle` varchar(60) NOT NULL, + `plate` varchar(12) NOT NULL, + `player_name` varchar(255) NOT NULL, + `base_price` int NOT NULL, + `rent_price` int NOT NULL, + `owner` VARCHAR(60) NOT NULL, + + PRIMARY KEY (`plate`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +CREATE TABLE `vehicle_categories` ( + `name` varchar(60) NOT NULL, + `label` varchar(60) NOT NULL, + + PRIMARY KEY (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +INSERT INTO `vehicle_categories` (name, label) VALUES + ('compacts','Småbil'), + ('coupes','Coupés'), + ('sedans','Sedans'), + ('sports','Sportbil'), + ('sportsclassics','Klassik sportbil'), + ('super','Super'), + ('muscle','Muskel'), + ('offroad','Off Road'), + ('suvs','SUVs'), + ('vans','Vans'), + ('motorcycles','Motorcykel') +; + +CREATE TABLE `vehicles` ( + `name` varchar(60) NOT NULL, + `model` varchar(60) NOT NULL, + `price` int NOT NULL, + `category` varchar(60) DEFAULT NULL, + + PRIMARY KEY (`model`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +INSERT INTO `vehicles` (name, model, price, category) VALUES + ('Blade','blade',15000,'muscle'), + ('Buccaneer','buccaneer',18000,'muscle'), + ('Buccaneer Rider','buccaneer2',24000,'muscle'), + ('Chino','chino',15000,'muscle'), + ('Chino Luxe','chino2',19000,'muscle'), + ('Coquette BlackFin','coquette3',55000,'muscle'), + ('Dominator','dominator',35000,'muscle'), + ('Dukes','dukes',28000,'muscle'), + ('Gauntlet','gauntlet',30000,'muscle'), + ('Hotknife','hotknife',125000,'muscle'), + ('Faction','faction',20000,'muscle'), + ('Faction Rider','faction2',30000,'muscle'), + ('Faction XL','faction3',40000,'muscle'), + ('Nightshade','nightshade',65000,'muscle'), + ('Phoenix','phoenix',12500,'muscle'), + ('Picador','picador',18000,'muscle'), + ('Sabre Turbo','sabregt',20000,'muscle'), + ('Sabre GT','sabregt2',25000,'muscle'), + ('Slam Van','slamvan3',11500,'muscle'), + ('Tampa','tampa',16000,'muscle'), + ('Virgo','virgo',14000,'muscle'), + ('Vigero','vigero',12500,'muscle'), + ('Voodoo','voodoo',7200,'muscle'), + ('Blista','blista',8000,'compacts'), + ('Brioso R/A','brioso',18000,'compacts'), + ('Issi','issi2',10000,'compacts'), + ('Panto','panto',10000,'compacts'), + ('Prairie','prairie',12000,'compacts'), + ('Bison','bison',45000,'vans'), + ('Bobcat XL','bobcatxl',32000,'vans'), + ('Burrito','burrito3',19000,'vans'), + ('Burrito','gburrito2',29000,'vans'), + ('Camper','camper',42000,'vans'), + ('Gang Burrito','gburrito',45000,'vans'), + ('Journey','journey',6500,'vans'), + ('Minivan','minivan',13000,'vans'), + ('Moonbeam','moonbeam',18000,'vans'), + ('Moonbeam Rider','moonbeam2',35000,'vans'), + ('Paradise','paradise',19000,'vans'), + ('Rumpo','rumpo',15000,'vans'), + ('Rumpo Trail','rumpo3',19500,'vans'), + ('Surfer','surfer',12000,'vans'), + ('Youga','youga',10800,'vans'), + ('Youga Luxuary','youga2',14500,'vans'), + ('Asea','asea',5500,'sedans'), + ('Cognoscenti','cognoscenti',55000,'sedans'), + ('Emperor','emperor',8500,'sedans'), + ('Fugitive','fugitive',12000,'sedans'), + ('Glendale','glendale',6500,'sedans'), + ('Intruder','intruder',7500,'sedans'), + ('Premier','premier',8000,'sedans'), + ('Primo Custom','primo2',14000,'sedans'), + ('Regina','regina',5000,'sedans'), + ('Schafter','schafter2',25000,'sedans'), + ('Stretch','stretch',90000,'sedans'), + ('Super Diamond','superd',130000,'sedans'), + ('Tailgater','tailgater',30000,'sedans'), + ('Warrener','warrener',4000,'sedans'), + ('Washington','washington',9000,'sedans'), + ('Baller','baller2',40000,'suvs'), + ('Baller Sport','baller3',60000,'suvs'), + ('Cavalcade','cavalcade2',55000,'suvs'), + ('Contender','contender',70000,'suvs'), + ('Dubsta','dubsta',45000,'suvs'), + ('Dubsta Luxuary','dubsta2',60000,'suvs'), + ('Fhantom','fq2',17000,'suvs'), + ('Grabger','granger',50000,'suvs'), + ('Gresley','gresley',47500,'suvs'), + ('Huntley S','huntley',40000,'suvs'), + ('Landstalker','landstalker',35000,'suvs'), + ('Mesa','mesa',16000,'suvs'), + ('Mesa Trail','mesa3',40000,'suvs'), + ('Patriot','patriot',55000,'suvs'), + ('Radius','radi',29000,'suvs'), + ('Rocoto','rocoto',45000,'suvs'), + ('Seminole','seminole',25000,'suvs'), + ('XLS','xls',32000,'suvs'), + ('Btype','btype',62000,'sportsclassics'), + ('Btype Luxe','btype3',85000,'sportsclassics'), + ('Btype Hotroad','btype2',155000,'sportsclassics'), + ('Casco','casco',30000,'sportsclassics'), + ('Coquette Classic','coquette2',40000,'sportsclassics'), + ('Manana','manana',12800,'sportsclassics'), + ('Monroe','monroe',55000,'sportsclassics'), + ('Pigalle','pigalle',20000,'sportsclassics'), + ('Stinger','stinger',80000,'sportsclassics'), + ('Stinger GT','stingergt',75000,'sportsclassics'), + ('Stirling GT','feltzer3',65000,'sportsclassics'), + ('Z-Type','ztype',220000,'sportsclassics'), + ('Bifta','bifta',12000,'offroad'), + ('Bf Injection','bfinjection',16000,'offroad'), + ('Blazer','blazer',6500,'offroad'), + ('Blazer Sport','blazer4',8500,'offroad'), + ('Brawler','brawler',45000,'offroad'), + ('Bubsta 6x6','dubsta3',120000,'offroad'), + ('Dune Buggy','dune',8000,'offroad'), + ('Guardian','guardian',45000,'offroad'), + ('Rebel','rebel2',35000,'offroad'), + ('Sandking','sandking',55000,'offroad'), + ('The Liberator','monster',210000,'offroad'), + ('Trophy Truck','trophytruck',60000,'offroad'), + ('Trophy Truck Limited','trophytruck2',80000,'offroad'), + ('Cognoscenti Cabrio','cogcabrio',55000,'coupes'), + ('Exemplar','exemplar',32000,'coupes'), + ('F620','f620',40000,'coupes'), + ('Felon','felon',42000,'coupes'), + ('Felon GT','felon2',55000,'coupes'), + ('Jackal','jackal',38000,'coupes'), + ('Oracle XS','oracle2',35000,'coupes'), + ('Sentinel','sentinel',32000,'coupes'), + ('Sentinel XS','sentinel2',40000,'coupes'), + ('Windsor','windsor',95000,'coupes'), + ('Windsor Drop','windsor2',125000,'coupes'), + ('Zion','zion',36000,'coupes'), + ('Zion Cabrio','zion2',45000,'coupes'), + ('9F','ninef',65000,'sports'), + ('9F Cabrio','ninef2',80000,'sports'), + ('Alpha','alpha',60000,'sports'), + ('Banshee','banshee',70000,'sports'), + ('Bestia GTS','bestiagts',55000,'sports'), + ('Buffalo','buffalo',12000,'sports'), + ('Buffalo S','buffalo2',20000,'sports'), + ('Carbonizzare','carbonizzare',75000,'sports'), + ('Comet','comet2',65000,'sports'), + ('Coquette','coquette',65000,'sports'), + ('Drift Tampa','tampa2',80000,'sports'), + ('Elegy','elegy2',38500,'sports'), + ('Feltzer','feltzer2',55000,'sports'), + ('Furore GT','furoregt',45000,'sports'), + ('Fusilade','fusilade',40000,'sports'), + ('Jester','jester',65000,'sports'), + ('Jester(Racecar)','jester2',135000,'sports'), + ('Khamelion','khamelion',38000,'sports'), + ('Kuruma','kuruma',30000,'sports'), + ('Lynx','lynx',40000,'sports'), + ('Mamba','mamba',70000,'sports'), + ('Massacro','massacro',65000,'sports'), + ('Massacro(Racecar)','massacro2',130000,'sports'), + ('Omnis','omnis',35000,'sports'), + ('Penumbra','penumbra',28000,'sports'), + ('Rapid GT','rapidgt',35000,'sports'), + ('Rapid GT Convertible','rapidgt2',45000,'sports'), + ('Schafter V12','schafter3',50000,'sports'), + ('Seven 70','seven70',39500,'sports'), + ('Sultan','sultan',15000,'sports'), + ('Surano','surano',50000,'sports'), + ('Tropos','tropos',40000,'sports'), + ('Verlierer','verlierer2',70000,'sports'), + ('Adder','adder',900000,'super'), + ('Banshee 900R','banshee2',255000,'super'), + ('Bullet','bullet',90000,'super'), + ('Cheetah','cheetah',375000,'super'), + ('Entity XF','entityxf',425000,'super'), + ('ETR1','sheava',220000,'super'), + ('FMJ','fmj',185000,'super'), + ('Infernus','infernus',180000,'super'), + ('Osiris','osiris',160000,'super'), + ('Pfister','pfister811',85000,'super'), + ('RE-7B','le7b',325000,'super'), + ('Reaper','reaper',150000,'super'), + ('Sultan RS','sultanrs',65000,'super'), + ('T20','t20',300000,'super'), + ('Turismo R','turismor',350000,'super'), + ('Tyrus','tyrus',600000,'super'), + ('Vacca','vacca',120000,'super'), + ('Voltic','voltic',90000,'super'), + ('X80 Proto','prototipo',2500000,'super'), + ('Zentorno','zentorno',1500000,'super'), + ('Akuma','AKUMA',7500,'motorcycles'), + ('Avarus','avarus',18000,'motorcycles'), + ('Bagger','bagger',13500,'motorcycles'), + ('Bati 801','bati',12000,'motorcycles'), + ('Bati 801RR','bati2',19000,'motorcycles'), + ('BF400','bf400',6500,'motorcycles'), + ('BMX (velo)','bmx',160,'motorcycles'), + ('Carbon RS','carbonrs',18000,'motorcycles'), + ('Chimera','chimera',38000,'motorcycles'), + ('Cliffhanger','cliffhanger',9500,'motorcycles'), + ('Cruiser (velo)','cruiser',510,'motorcycles'), + ('Daemon','daemon',11500,'motorcycles'), + ('Daemon High','daemon2',13500,'motorcycles'), + ('Defiler','defiler',9800,'motorcycles'), + ('Double T','double',28000,'motorcycles'), + ('Enduro','enduro',5500,'motorcycles'), + ('Esskey','esskey',4200,'motorcycles'), + ('Faggio','faggio',1900,'motorcycles'), + ('Vespa','faggio2',2800,'motorcycles'), + ('Fixter (velo)','fixter',225,'motorcycles'), + ('Gargoyle','gargoyle',16500,'motorcycles'), + ('Hakuchou','hakuchou',31000,'motorcycles'), + ('Hakuchou Sport','hakuchou2',55000,'motorcycles'), + ('Hexer','hexer',12000,'motorcycles'), + ('Innovation','innovation',23500,'motorcycles'), + ('Manchez','manchez',5300,'motorcycles'), + ('Nemesis','nemesis',5800,'motorcycles'), + ('Nightblade','nightblade',35000,'motorcycles'), + ('PCJ-600','pcj',6200,'motorcycles'), + ('Ruffian','ruffian',6800,'motorcycles'), + ('Sanchez','sanchez',5300,'motorcycles'), + ('Sanchez Sport','sanchez2',5300,'motorcycles'), + ('Sanctus','sanctus',25000,'motorcycles'), + ('Scorcher (velo)','scorcher',280,'motorcycles'), + ('Sovereign','sovereign',22000,'motorcycles'), + ('Shotaro Concept','shotaro',320000,'motorcycles'), + ('Thrust','thrust',24000,'motorcycles'), + ('Tri bike (velo)','tribike3',520,'motorcycles'), + ('Vader','vader',7200,'motorcycles'), + ('Vortex','vortex',9800,'motorcycles'), + ('Woflsbane','wolfsbane',9000,'motorcycles'), + ('Zombie','zombiea',9500,'motorcycles'), + ('Zombie Luxuary','zombieb',12000,'motorcycles'), + ('blazer5', 'blazer5', 1755600, 'offroad'), + ('Ruiner 2', 'ruiner2', 5745600, 'muscle'), + ('Voltic 2', 'voltic2', 3830400, 'super'), + ('Ardent', 'ardent', 1150000, 'sportsclassics'), + ('Oppressor', 'oppressor', 3524500, 'super'), + ('Visione', 'visione', 2250000, 'super'), + ('Retinue', 'retinue', 615000, 'sportsclassics'), + ('Cyclone', 'cyclone', 1890000, 'super'), + ('Rapid GT3', 'rapidgt3', 885000, 'sportsclassics'), + ('raiden', 'raiden', 1375000, 'sports'), + ('Yosemite', 'yosemite', 485000, 'muscle'), + ('Deluxo', 'deluxo', 4721500, 'sportsclassics'), + ('Pariah', 'pariah', 1420000, 'sports'), + ('Stromberg', 'stromberg', 3185350, 'sports'), + ('SC 1', 'sc1', 1603000, 'super'), + ('riata', 'riata', 380000, 'offroad'), + ('Hermes', 'hermes', 535000, 'muscle'), + ('Savestra', 'savestra', 990000, 'sportsclassics'), + ('Streiter', 'streiter', 500000, 'sports'), + ('Kamacho', 'kamacho', 345000, 'offroad'), + ('GT 500', 'gt500', 785000, 'sportsclassics'), + ('Z190', 'z190', 900000, 'sportsclassics'), + ('Viseris', 'viseris', 875000, 'sportsclassics'), + ('Autarch', 'autarch', 1955000, 'super'), + ('Comet 5', 'comet5', 1145000, 'sports'), + ('Neon', 'neon', 1500000, 'sports'), + ('Revolter', 'revolter', 1610000, 'sports'), + ('Sentinel3', 'sentinel3', 650000, 'sports'), + ('Hustler', 'hustler', 625000, 'muscle') +; diff --git a/[esx_addons]/esx_vehicleshop/server/main.lua b/[esx_addons]/esx_vehicleshop/server/main.lua new file mode 100644 index 00000000..1b9d5e3e --- /dev/null +++ b/[esx_addons]/esx_vehicleshop/server/main.lua @@ -0,0 +1,495 @@ +ESX = nil +local categories, vehicles = {}, {} + +TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + +TriggerEvent('esx_phone:registerNumber', 'cardealer', _U('dealer_customers'), false, false) +TriggerEvent('esx_society:registerSociety', 'cardealer', _U('car_dealer'), 'society_cardealer', 'society_cardealer', 'society_cardealer', {type = 'private'}) + +Citizen.CreateThread(function() + local char = Config.PlateLetters + char = char + Config.PlateNumbers + if Config.PlateUseSpace then char = char + 1 end + + if char > 8 then + print(('[esx_vehicleshop] [^3WARNING^7] Plate character count reached, %s/8 characters!'):format(char)) + end +end) + +function RemoveOwnedVehicle(plate) + MySQL.Async.execute('DELETE FROM owned_vehicles WHERE plate = @plate', { + ['@plate'] = plate + }) +end + +AddEventHandler('onResourceStart', function(resourceName) + if resourceName == GetCurrentResourceName() then + MySQL.ready(function() SQLVehiclesAndCategories() end) + end +end) + +function SQLVehiclesAndCategories() + MySQL.Async.fetchAll('SELECT * FROM `vehicle_categories`', {}, function(_categories) + categories = _categories + + MySQL.Async.fetchAll('SELECT * FROM `vehicles`', {}, function(_vehicles) + vehicles = _vehicles + + GetVehiclesAndCategories(categories, vehicles) + end) + + end) +end + +function GetVehiclesAndCategories(categories, vehicles) + for k,v in ipairs(vehicles) do + for k2,v2 in ipairs(categories) do + if v2.name == v.category then + vehicles[k].categoryLabel = v2.label + break + end + end + end + + -- send information after db has loaded, making sure everyone gets vehicle information + TriggerClientEvent('esx_vehicleshop:sendCategories', -1, categories) + TriggerClientEvent('esx_vehicleshop:sendVehicles', -1, vehicles) +end + +function getVehicleLabelFromModel(model) + for k,v in ipairs(vehicles) do + if v.model == model then + return v.name + end + end + + return +end + +RegisterNetEvent('esx_vehicleshop:setVehicleOwnedPlayerId') +AddEventHandler('esx_vehicleshop:setVehicleOwnedPlayerId', function(playerId, vehicleProps, model, label) + local xPlayer, xTarget = ESX.GetPlayerFromId(source), ESX.GetPlayerFromId(playerId) + + if xPlayer.job.name == 'cardealer' and xTarget then + MySQL.Async.fetchAll('SELECT id FROM cardealer_vehicles WHERE vehicle = @vehicle LIMIT 1', { + ['@vehicle'] = model + }, function(result) + if result[1] then + local id = result[1].id + + MySQL.Async.execute('DELETE FROM cardealer_vehicles WHERE id = @id', { + ['@id'] = id + }, function(rowsChanged) + if rowsChanged == 1 then + MySQL.Async.execute('INSERT INTO owned_vehicles (owner, plate, vehicle) VALUES (@owner, @plate, @vehicle)', { + ['@owner'] = xTarget.identifier, + ['@plate'] = vehicleProps.plate, + ['@vehicle'] = json.encode(vehicleProps) + }, function(rowsChanged) + xPlayer.showNotification(_U('vehicle_set_owned', vehicleProps.plate, xTarget.getName())) + xTarget.showNotification(_U('vehicle_belongs', vehicleProps.plate)) + end) + + local dateNow = os.date('%Y-%m-%d %H:%M') + + MySQL.Async.execute('INSERT INTO vehicle_sold (client, model, plate, soldby, date) VALUES (@client, @model, @plate, @soldby, @date)', { + ['@client'] = xTarget.getName(), + ['@model'] = label, + ['@plate'] = vehicleProps.plate, + ['@soldby'] = xPlayer.getName(), + ['@date'] = dateNow + }) + end + end) + end + end) + end +end) + +ESX.RegisterServerCallback('esx_vehicleshop:getSoldVehicles', function(source, cb) + MySQL.Async.fetchAll('SELECT client, model, plate, soldby, date FROM vehicle_sold', {}, function(result) + cb(result) + end) +end) + +RegisterNetEvent('esx_vehicleshop:rentVehicle') +AddEventHandler('esx_vehicleshop:rentVehicle', function(vehicle, plate, rentPrice, playerId) + local xPlayer, xTarget = ESX.GetPlayerFromId(source), ESX.GetPlayerFromId(playerId) + + if xPlayer.job.name == 'cardealer' and xTarget then + MySQL.Async.fetchAll('SELECT id, price FROM cardealer_vehicles WHERE vehicle = @vehicle LIMIT 1', { + ['@vehicle'] = vehicle + }, function(result) + if result[1] then + local price = result[1].price + + MySQL.Async.execute('DELETE FROM cardealer_vehicles WHERE id = @id', { + ['@id'] = result[1].id + }, function(rowsChanged) + if rowsChanged == 1 then + MySQL.Async.execute('INSERT INTO rented_vehicles (vehicle, plate, player_name, base_price, rent_price, owner) VALUES (@vehicle, @plate, @player_name, @base_price, @rent_price, @owner)', { + ['@vehicle'] = vehicle, + ['@plate'] = plate, + ['@player_name'] = xTarget.getName(), + ['@base_price'] = price, + ['@rent_price'] = rentPrice, + ['@owner'] = xTarget.identifier + }, function(rowsChanged2) + xPlayer.showNotification(_U('vehicle_set_rented', plate, xTarget.getName())) + end) + end + end) + end + end) + end +end) + +RegisterNetEvent('esx_vehicleshop:getStockItem') +AddEventHandler('esx_vehicleshop:getStockItem', function(itemName, count) + local _source = source + local xPlayer = ESX.GetPlayerFromId(_source) + + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_cardealer', function(inventory) + local item = inventory.getItem(itemName) + + -- is there enough in the society? + if count > 0 and item.count >= count then + + -- can the player carry the said amount of x item? + if xPlayer.canCarryItem(itemName, count) then + inventory.removeItem(itemName, count) + xPlayer.addInventoryItem(itemName, count) + xPlayer.showNotification(_U('have_withdrawn', count, item.label)) + else + xPlayer.showNotification(_U('player_cannot_hold')) + end + else + xPlayer.showNotification(_U('not_enough_in_society')) + end + end) +end) + +RegisterNetEvent('esx_vehicleshop:putStockItems') +AddEventHandler('esx_vehicleshop:putStockItems', function(itemName, count) + local _source = source + local xPlayer = ESX.GetPlayerFromId(_source) + + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_cardealer', function(inventory) + local item = inventory.getItem(itemName) + + if item.count >= 0 then + xPlayer.removeInventoryItem(itemName, count) + inventory.addItem(itemName, count) + xPlayer.showNotification(_U('have_deposited', count, item.label)) + else + xPlayer.showNotification(_U('invalid_amount')) + end + end) +end) + +ESX.RegisterServerCallback('esx_vehicleshop:getCategories', function(source, cb) + cb(categories) +end) + +ESX.RegisterServerCallback('esx_vehicleshop:getVehicles', function(source, cb) + cb(vehicles) +end) + +ESX.RegisterServerCallback('esx_vehicleshop:buyVehicle', function(source, cb, model, plate) + local xPlayer = ESX.GetPlayerFromId(source) + local modelPrice + + for k,v in ipairs(vehicles) do + if model == v.model then + modelPrice = v.price + break + end + end + + if modelPrice and xPlayer.getMoney() >= modelPrice then + xPlayer.removeMoney(modelPrice) + + MySQL.Async.execute('INSERT INTO owned_vehicles (owner, plate, vehicle) VALUES (@owner, @plate, @vehicle)', { + ['@owner'] = xPlayer.identifier, + ['@plate'] = plate, + ['@vehicle'] = json.encode({model = GetHashKey(model), plate = plate}) + }, function(rowsChanged) + xPlayer.showNotification(_U('vehicle_belongs', plate)) + cb(true) + end) + else + cb(false) + end +end) + +ESX.RegisterServerCallback('esx_vehicleshop:getCommercialVehicles', function(source, cb) + MySQL.Async.fetchAll('SELECT price, vehicle FROM cardealer_vehicles ORDER BY vehicle ASC', {}, function(result) + cb(result) + end) +end) + +ESX.RegisterServerCallback('esx_vehicleshop:buyCarDealerVehicle', function(source, cb, model) + local xPlayer = ESX.GetPlayerFromId(source) + + if xPlayer.job.name == 'cardealer' then + local modelPrice + + for k,v in ipairs(vehicles) do + if model == v.model then + modelPrice = v.price + break + end + end + + if modelPrice then + TriggerEvent('esx_addonaccount:getSharedAccount', 'society_cardealer', function(account) + if account.money >= modelPrice then + account.removeMoney(modelPrice) + + MySQL.Async.execute('INSERT INTO cardealer_vehicles (vehicle, price) VALUES (@vehicle, @price)', { + ['@vehicle'] = model, + ['@price'] = modelPrice + }, function(rowsChanged) + cb(true) + end) + else + cb(false) + end + end) + end + end +end) + +RegisterNetEvent('esx_vehicleshop:returnProvider') +AddEventHandler('esx_vehicleshop:returnProvider', function(vehicleModel) + local xPlayer = ESX.GetPlayerFromId(source) + + if xPlayer.job.name == 'cardealer' then + MySQL.Async.fetchAll('SELECT id, price FROM cardealer_vehicles WHERE vehicle = @vehicle LIMIT 1', { + ['@vehicle'] = vehicleModel + }, function(result) + if result[1] then + local id = result[1].id + + MySQL.Async.execute('DELETE FROM cardealer_vehicles WHERE id = @id', { + ['@id'] = id + }, function(rowsChanged) + if rowsChanged == 1 then + TriggerEvent('esx_addonaccount:getSharedAccount', 'society_cardealer', function(account) + local price = ESX.Math.Round(result[1].price * 0.75) + local vehicleLabel = getVehicleLabelFromModel(vehicleModel) + + account.addMoney(price) + xPlayer.showNotification(_U('vehicle_sold_for', vehicleLabel, ESX.Math.GroupDigits(price))) + end) + end + end) + else + print(('[esx_vehicleshop] [^3WARNING^7] %s attempted selling an invalid vehicle!'):format(xPlayer.identifier)) + end + end) + end +end) + +ESX.RegisterServerCallback('esx_vehicleshop:getRentedVehicles', function(source, cb) + MySQL.Async.fetchAll('SELECT * FROM rented_vehicles ORDER BY player_name ASC', {}, function(result) + local vehicles = {} + + for i=1, #result, 1 do + table.insert(vehicles, { + name = result[i].vehicle, + plate = result[i].plate, + playerName = result[i].player_name + }) + end + + cb(vehicles) + end) +end) + +ESX.RegisterServerCallback('esx_vehicleshop:giveBackVehicle', function(source, cb, plate) + MySQL.Async.fetchAll('SELECT base_price, vehicle FROM rented_vehicles WHERE plate = @plate', { + ['@plate'] = plate + }, function(result) + if result[1] then + local vehicle = result[1].vehicle + local basePrice = result[1].base_price + + MySQL.Async.execute('DELETE FROM rented_vehicles WHERE plate = @plate', { + ['@plate'] = plate + }, function(rowsChanged) + MySQL.Async.execute('INSERT INTO cardealer_vehicles (vehicle, price) VALUES (@vehicle, @price)', { + ['@vehicle'] = vehicle, + ['@price'] = basePrice + }) + + RemoveOwnedVehicle(plate) + cb(true) + end) + else + cb(false) + end + end) +end) + +ESX.RegisterServerCallback('esx_vehicleshop:resellVehicle', function(source, cb, plate, model) + local xPlayer, resellPrice = ESX.GetPlayerFromId(source) + + if xPlayer.job.name == 'cardealer' or not Config.EnablePlayerManagement then + -- calculate the resell price + for i=1, #vehicles, 1 do + if GetHashKey(vehicles[i].model) == model then + resellPrice = ESX.Math.Round(vehicles[i].price / 100 * Config.ResellPercentage) + break + end + end + + if not resellPrice then + print(('[esx_vehicleshop] [^3WARNING^7] %s attempted to sell an unknown vehicle!'):format(xPlayer.identifier)) + cb(false) + else + MySQL.Async.fetchAll('SELECT * FROM rented_vehicles WHERE plate = @plate', { + ['@plate'] = plate + }, function(result) + if result[1] then -- is it a rented vehicle? + cb(false) -- it is, don't let the player sell it since he doesn't own it + else + MySQL.Async.fetchAll('SELECT * FROM owned_vehicles WHERE owner = @owner AND @plate = plate', { + ['@owner'] = xPlayer.identifier, + ['@plate'] = plate + }, function(result) + if result[1] then -- does the owner match? + local vehicle = json.decode(result[1].vehicle) + + if vehicle.model == model then + if vehicle.plate == plate then + xPlayer.addMoney(resellPrice) + RemoveOwnedVehicle(plate) + cb(true) + else + print(('[esx_vehicleshop] [^3WARNING^7] %s attempted to sell an vehicle with plate mismatch!'):format(xPlayer.identifier)) + cb(false) + end + else + print(('[esx_vehicleshop] [^3WARNING^7] %s attempted to sell an vehicle with model mismatch!'):format(xPlayer.identifier)) + cb(false) + end + end + end) + end + end) + end + end +end) + +ESX.RegisterServerCallback('esx_vehicleshop:getStockItems', function(source, cb) + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_cardealer', function(inventory) + cb(inventory.items) + end) +end) + +ESX.RegisterServerCallback('esx_vehicleshop:getPlayerInventory', function(source, cb) + local xPlayer = ESX.GetPlayerFromId(source) + local items = xPlayer.inventory + + cb({items = items}) +end) + +ESX.RegisterServerCallback('esx_vehicleshop:isPlateTaken', function(source, cb, plate) + MySQL.Async.fetchAll('SELECT 1 FROM owned_vehicles WHERE plate = @plate', { + ['@plate'] = plate + }, function(result) + cb(result[1] ~= nil) + end) +end) + +ESX.RegisterServerCallback('esx_vehicleshop:retrieveJobVehicles', function(source, cb, type) + local xPlayer = ESX.GetPlayerFromId(source) + + MySQL.Async.fetchAll('SELECT * FROM owned_vehicles WHERE owner = @owner AND type = @type AND job = @job', { + ['@owner'] = xPlayer.identifier, + ['@type'] = type, + ['@job'] = xPlayer.job.name + }, function(result) + cb(result) + end) +end) + +RegisterNetEvent('esx_vehicleshop:setJobVehicleState') +AddEventHandler('esx_vehicleshop:setJobVehicleState', function(plate, state) + local xPlayer = ESX.GetPlayerFromId(source) + + MySQL.Async.execute('UPDATE owned_vehicles SET `stored` = @stored WHERE plate = @plate AND job = @job', { + ['@stored'] = state, + ['@plate'] = plate, + ['@job'] = xPlayer.job.name + }, function(rowsChanged) + if rowsChanged == 0 then + print(('[esx_vehicleshop] [^3WARNING^7] %s exploited the garage!'):format(xPlayer.identifier)) + end + end) +end) + +function UnrentVehicleAsync(identifier, plate) + MySQL.Async.execute('DELETE FROM rented_vehicles WHERE identifier = @identifier AND plate = @plate', { + ['@identifier'] = identifier, + ['@plate'] = plate + }) +end + +function PayRent(d, h, m) + local tasks, timeStart = {}, os.clock() + print('[esx_vehicleshop] [^2INFO^7] Paying rent cron job started') + + MySQL.Async.fetchAll('SELECT owner, rent_price, plate FROM rented_vehicles', {}, function(result) + for k,v in ipairs(result) do + table.insert(tasks, function(cb) + local xPlayer = ESX.GetPlayerFromIdentifier(v.owner) + + if xPlayer then + if xPlayer.getAccount('bank').money >= v.rent_price then + xPlayer.removeAccountMoney('bank', v.rent_price) + xPlayer.showNotification(_U('paid_rental', ESX.Math.GroupDigits(v.rent_price), v.plate)) + else + xPlayer.showNotification(_U('paid_rental_evicted', ESX.Math.GroupDigits(v.rent_price), v.plate)) + UnrentVehicleAsync(v.owner, v.plate) + end + else + MySQL.Async.fetchScalar('SELECT accounts FROM users WHERE identifier = @identifier', { + ['@identifier'] = v.owner + }, function(accounts) + if accounts then + local playerAccounts = json.decode(accounts) + + if playerAccounts and playerAccounts.bank then + if playerAccounts.bank >= v.price then + playerAccounts.bank = playerAccounts.bank - v.price + + MySQL.Async.execute('UPDATE users SET accounts = @accounts WHERE identifier = @identifier', { + ['@identifier'] = v.owner, + ['@accounts'] = json.encode(playerAccounts) + }) + else + UnrentVehicleAsync(v.owner, v.plate) + end + end + end + end) + end + + TriggerEvent('esx_addonaccount:getSharedAccount', 'society_cardealer', function(account) + account.addMoney(result[i].rent_price) + end) + + cb() + end) + end + + Async.parallelLimit(tasks, 5, function(results) end) + + local elapsedTime = os.clock() - timeStart + print(('[esx_vehicleshop] [^2INFO^7] Paying rent cron job took %s seconds'):format(elapsedTime)) + end) +end + +TriggerEvent('cron:runAt', 22, 00, PayRent) diff --git a/[esx_addons]/esx_voice/.editorconfig b/[esx_addons]/esx_voice/.editorconfig new file mode 100644 index 00000000..9b425256 --- /dev/null +++ b/[esx_addons]/esx_voice/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_size = 4 +indent_style = tab +end_of_line = crlf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/[esx_addons]/esx_voice/LICENSE b/[esx_addons]/esx_voice/LICENSE new file mode 100644 index 00000000..9cecc1d4 --- /dev/null +++ b/[esx_addons]/esx_voice/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + {one line to give the program's name and a brief idea of what it does.} + Copyright (C) {year} {name of author} + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + {project} Copyright (C) {year} {fullname} + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/[esx_addons]/esx_voice/README.md b/[esx_addons]/esx_voice/README.md new file mode 100644 index 00000000..929a4a3c --- /dev/null +++ b/[esx_addons]/esx_voice/README.md @@ -0,0 +1,41 @@ +# esx_voice +This is a proximity voice controller script. The default control for this is `Left Shift + H` (QWERTY). + +## Download & Installation + +### Using [fvm](https://github.com/qlaffont/fvm-installer) +``` +fvm install --save --folder=esx esx-org/esx_voice +``` + +### Using Git +``` +cd resources +git clone https://github.com/ESX-Org/esx_voice [esx]/esx_voice +``` + +### Manually +- Download https://github.com/ESX-Org/esx_voice/archive/master.zip +- Put it in the `[esx]` directory + +## Installation +Add this into your `server.cfg` +``` +start esx_voice +``` + +## Credits + +[aabbfive](https://github.com/aabbfive/voicecontroller) - Original author + +# Legal +### License +esx_voice + +Copyright (C) 2015-2020 Jérémie N'gadi + +This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version. + +This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details. + +You should have received a copy Of the GNU General Public License along with this program. If Not, see http://www.gnu.org/licenses/. diff --git a/[esx_addons]/esx_voice/client/main.lua b/[esx_addons]/esx_voice/client/main.lua new file mode 100644 index 00000000..a235d995 --- /dev/null +++ b/[esx_addons]/esx_voice/client/main.lua @@ -0,0 +1,76 @@ +local Keys = { + ["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57, + ["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177, + ["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18, + ["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182, + ["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81, + ["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70, + ["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178, + ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173, + ["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118 +} + +local voice = {default = 5.0, shout = 12.0, whisper = 1.0, current = 0, level = nil} + +function drawLevel(r, g, b, a) + SetTextFont(4) + SetTextProportional(1) + SetTextScale(0.5, 0.5) + SetTextColour(r, g, b, a) + SetTextDropShadow(0, 0, 0, 0, 255) + SetTextEdge(1, 0, 0, 0, 255) + SetTextDropShadow() + SetTextOutline() + + BeginTextCommandDisplayText("STRING") + AddTextComponentSubstringPlayerName(_U('voice', voice.level)) + EndTextCommandDisplayText(0.175, 0.92) +end + +AddEventHandler('onClientMapStart', function() + if voice.current == 0 then + NetworkSetTalkerProximity(voice.default) + elseif voice.current == 1 then + NetworkSetTalkerProximity(voice.shout) + elseif voice.current == 2 then + NetworkSetTalkerProximity(voice.whisper) + end +end) + +AddEventHandler('playerSpawned', function() + NetworkSetTalkerProximity(voice.default) +end) + +Citizen.CreateThread(function() + while true do + Citizen.Wait(1) + + if IsControlJustPressed(1, Keys['H']) and IsControlPressed(1, Keys['LEFTSHIFT']) then + voice.current = (voice.current + 1) % 3 + if voice.current == 0 then + NetworkSetTalkerProximity(voice.default) + voice.level = _U('normal') + elseif voice.current == 1 then + NetworkSetTalkerProximity(voice.shout) + voice.level = _U('shout') + elseif voice.current == 2 then + NetworkSetTalkerProximity(voice.whisper) + voice.level = _U('whisper') + end + end + + if voice.current == 0 then + voice.level = _U('normal') + elseif voice.current == 1 then + voice.level = _U('shout') + elseif voice.current == 2 then + voice.level = _U('whisper') + end + + if NetworkIsPlayerTalking(PlayerId()) then + drawLevel(41, 128, 185, 255) + elseif not NetworkIsPlayerTalking(PlayerId()) then + drawLevel(185, 185, 185, 255) + end + end +end) \ No newline at end of file diff --git a/[esx_addons]/esx_voice/config.lua b/[esx_addons]/esx_voice/config.lua new file mode 100644 index 00000000..a3d6aa84 --- /dev/null +++ b/[esx_addons]/esx_voice/config.lua @@ -0,0 +1,3 @@ +Config = {} + +Config.Locale = 'en' diff --git a/[esx_addons]/esx_voice/fxmanifest.lua b/[esx_addons]/esx_voice/fxmanifest.lua new file mode 100644 index 00000000..621dabd1 --- /dev/null +++ b/[esx_addons]/esx_voice/fxmanifest.lua @@ -0,0 +1,20 @@ +fx_version 'adamant' + +game 'gta5' + +description 'ESX Voice Controller' + +version '1.1.0' + +client_scripts { + '@es_extended/locale.lua', + 'locales/br.lua', + 'locales/en.lua', + 'locales/fi.lua', + 'locales/fr.lua', + 'locales/pl.lua', + 'locales/sv.lua', + 'locales/ko.lua', + 'config.lua', + 'client/main.lua' +} diff --git a/[esx_addons]/esx_voice/locales/br.lua b/[esx_addons]/esx_voice/locales/br.lua new file mode 100644 index 00000000..207f3111 --- /dev/null +++ b/[esx_addons]/esx_voice/locales/br.lua @@ -0,0 +1,6 @@ +Locales ['br'] = { + ['voice'] = '~y~Voz: ~s~%s', + ['normal'] = 'normal', + ['shout'] = 'gritar', + ['whisper'] = 'sussurro', +} diff --git a/[esx_addons]/esx_voice/locales/en.lua b/[esx_addons]/esx_voice/locales/en.lua new file mode 100644 index 00000000..6b7fc11e --- /dev/null +++ b/[esx_addons]/esx_voice/locales/en.lua @@ -0,0 +1,6 @@ +Locales ['en'] = { + ['voice'] = '~y~Voice: ~s~%s', + ['normal'] = 'normal', + ['shout'] = 'shout', + ['whisper'] = 'whisper', +} diff --git a/[esx_addons]/esx_voice/locales/fi.lua b/[esx_addons]/esx_voice/locales/fi.lua new file mode 100644 index 00000000..7550b283 --- /dev/null +++ b/[esx_addons]/esx_voice/locales/fi.lua @@ -0,0 +1,6 @@ +Locales ['fi'] = { + ['voice'] = '~y~Puhe: ~s~%s', + ['normal'] = 'normaali', + ['shout'] = 'huuto', + ['whisper'] = 'kuiskaus', +} diff --git a/[esx_addons]/esx_voice/locales/fr.lua b/[esx_addons]/esx_voice/locales/fr.lua new file mode 100644 index 00000000..e7e7bf41 --- /dev/null +++ b/[esx_addons]/esx_voice/locales/fr.lua @@ -0,0 +1,6 @@ +Locales ['fr'] = { + ['voice'] = '~y~Voix: ~s~%s', + ['normal'] = 'normal', + ['shout'] = 'crier', + ['whisper'] = 'chuchoter', +} diff --git a/[esx_addons]/esx_voice/locales/ko.lua b/[esx_addons]/esx_voice/locales/ko.lua new file mode 100644 index 00000000..c4c7fc64 --- /dev/null +++ b/[esx_addons]/esx_voice/locales/ko.lua @@ -0,0 +1,6 @@ +Locales ['ko'] = { + ['voice'] = '~y~목소리: ~s~%s', + ['normal'] = '보통', + ['shout'] = '외침', + ['whisper'] = '속삭임', +} diff --git a/[esx_addons]/esx_voice/locales/pl.lua b/[esx_addons]/esx_voice/locales/pl.lua new file mode 100644 index 00000000..7962786b --- /dev/null +++ b/[esx_addons]/esx_voice/locales/pl.lua @@ -0,0 +1,6 @@ +Locales ['pl'] = { + ['voice'] = '~y~Głos: ~s~%s', + ['normal'] = 'normalny', + ['shout'] = 'krzyk', + ['whisper'] = 'szept', +} diff --git a/[esx_addons]/esx_voice/locales/sv.lua b/[esx_addons]/esx_voice/locales/sv.lua new file mode 100644 index 00000000..c5c716e9 --- /dev/null +++ b/[esx_addons]/esx_voice/locales/sv.lua @@ -0,0 +1,6 @@ +Locales ['sv'] = { + ['voice'] = '~y~Röst: ~s~%s', + ['normal'] = 'prata', + ['shout'] = 'skrik', + ['whisper'] = 'viska', +} diff --git a/[esx_addons]/esx_weaponshop/.editorconfig b/[esx_addons]/esx_weaponshop/.editorconfig new file mode 100644 index 00000000..9b425256 --- /dev/null +++ b/[esx_addons]/esx_weaponshop/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_size = 4 +indent_style = tab +end_of_line = crlf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/[esx_addons]/esx_weaponshop/LICENSE b/[esx_addons]/esx_weaponshop/LICENSE new file mode 100644 index 00000000..fa1c8a5f --- /dev/null +++ b/[esx_addons]/esx_weaponshop/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + fxserver-esx_weashops + Copyright (C) 2015 Jérémie N'gadi + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + fxserver-esx_weashops Copyright (C) 2015 Jérémie N'gadi + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. \ No newline at end of file diff --git a/[esx_addons]/esx_weaponshop/README.md b/[esx_addons]/esx_weaponshop/README.md new file mode 100644 index 00000000..04c5b0d3 --- /dev/null +++ b/[esx_addons]/esx_weaponshop/README.md @@ -0,0 +1,40 @@ +# esx_weaponshop + +ESX Weapon Shop adds.. well you guessed it - weapon shops to the already existing shops in the world. + +## Download & Installation + +### Using [fvm](https://github.com/qlaffont/fvm-installer) +``` +fvm install --save --folder=esx esx-org/esx_weaponshop +``` + +### Using Git +``` +cd resources +git clone https://github.com/ESX-Org/esx_weaponshop.git [esx]/esx_weaponshop +``` + +### Manually +- Download https://github.com/ESX-Org/esx_weaponshop/archive/master.zip +- Put it in the `[esx]` directory + +## Installation +- Import `esx_weaponshop.sql` in your database +- Add this to your `server.cfg`: + +``` +start esx_weaponshop +``` + +# Legal +### License +esx_weaponshop - Legal and illegal weapon shops + +Copyright (C) 2015-2020 Jérémie N'gadi + +This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version. + +This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details. + +You should have received a copy Of the GNU General Public License along with this program. If Not, see http://www.gnu.org/licenses/. \ No newline at end of file diff --git a/[esx_addons]/esx_weaponshop/client/main.lua b/[esx_addons]/esx_weaponshop/client/main.lua new file mode 100644 index 00000000..b213fe8b --- /dev/null +++ b/[esx_addons]/esx_weaponshop/client/main.lua @@ -0,0 +1,234 @@ +ESX = nil +local HasAlreadyEnteredMarker = false +local LastZone = nil +local CurrentAction = nil +local CurrentActionMsg = '' +local CurrentActionData = {} +local ShopOpen = false + +Citizen.CreateThread(function() + while ESX == nil do + TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + Citizen.Wait(0) + end + + ESX.TriggerServerCallback('esx_weaponshop:getShop', function(shopItems) + for k,v in pairs(shopItems) do + Config.Zones[k].Items = v + end + end) +end) + +RegisterNetEvent('esx_weaponshop:sendShop') +AddEventHandler('esx_weaponshop:sendShop', function(shopItems) + for k,v in pairs(shopItems) do + Config.Zones[k].Items = v + end +end) + +function OpenBuyLicenseMenu(zone) + ESX.UI.Menu.CloseAll() + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'shop_license', { + title = _U('buy_license'), + align = 'top-left', + elements = { + {label = _U('no'), value = 'no'}, + {label = _U('yes', ('%s'):format((_U('shop_menu_item', ESX.Math.GroupDigits(Config.LicensePrice))))), value = 'yes'}, + } + }, function(data, menu) + if data.current.value == 'yes' then + ESX.TriggerServerCallback('esx_weaponshop:buyLicense', function(bought) + if bought then + menu.close() + OpenShopMenu(zone) + end + end) + end + end, function(data, menu) + menu.close() + end) +end + +function OpenShopMenu(zone) + local elements = {} + ShopOpen = true + + for i=1, #Config.Zones[zone].Items, 1 do + local item = Config.Zones[zone].Items[i] + + table.insert(elements, { + label = ('%s - %s'):format(item.label, _U('shop_menu_item', ESX.Math.GroupDigits(item.price))), + price = item.price, + weaponName = item.item + }) + end + + ESX.UI.Menu.CloseAll() + PlaySoundFrontend(-1, 'BACK', 'HUD_AMMO_SHOP_SOUNDSET', false) + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'shop', { + title = _U('shop_menu_title'), + align = 'top-left', + elements = elements + }, function(data, menu) + ESX.TriggerServerCallback('esx_weaponshop:buyWeapon', function(bought) + if bought then + DisplayBoughtScaleform(data.current.weaponName, data.current.price) + else + PlaySoundFrontend(-1, 'ERROR', 'HUD_AMMO_SHOP_SOUNDSET', false) + end + end, data.current.weaponName, zone) + end, function(data, menu) + PlaySoundFrontend(-1, 'BACK', 'HUD_AMMO_SHOP_SOUNDSET', false) + ShopOpen = false + menu.close() + + CurrentAction = 'shop_menu' + CurrentActionMsg = _U('shop_menu_prompt') + CurrentActionData = { zone = zone } + end, function(data, menu) + PlaySoundFrontend(-1, 'NAV', 'HUD_AMMO_SHOP_SOUNDSET', false) + end) +end + +function DisplayBoughtScaleform(weaponName, price) + local scaleform = ESX.Scaleform.Utils.RequestScaleformMovie('MP_BIG_MESSAGE_FREEMODE') + local sec = 4 + + BeginScaleformMovieMethod(scaleform, 'SHOW_WEAPON_PURCHASED') + + PushScaleformMovieMethodParameterString(_U('weapon_bought', ESX.Math.GroupDigits(price))) + PushScaleformMovieMethodParameterString(ESX.GetWeaponLabel(weaponName)) + PushScaleformMovieMethodParameterInt(GetHashKey(weaponName)) + PushScaleformMovieMethodParameterString('') + PushScaleformMovieMethodParameterInt(100) + + EndScaleformMovieMethod() + + PlaySoundFrontend(-1, 'WEAPON_PURCHASE', 'HUD_AMMO_SHOP_SOUNDSET', false) + + Citizen.CreateThread(function() + while sec > 0 do + Citizen.Wait(0) + sec = sec - 0.01 + + DrawScaleformMovieFullscreen(scaleform, 255, 255, 255, 255) + end + end) +end + +AddEventHandler('esx_weaponshop:hasEnteredMarker', function(zone) + if zone == 'GunShop' or zone == 'BlackWeashop' then + CurrentAction = 'shop_menu' + CurrentActionMsg = _U('shop_menu_prompt') + CurrentActionData = { zone = zone } + end +end) + +AddEventHandler('esx_weaponshop:hasExitedMarker', function(zone) + CurrentAction = nil + ESX.UI.Menu.CloseAll() +end) + +AddEventHandler('onResourceStop', function(resource) + if resource == GetCurrentResourceName() then + if ShopOpen then + ESX.UI.Menu.CloseAll() + end + end +end) + +-- Create Blips +Citizen.CreateThread(function() + for k,v in pairs(Config.Zones) do + if v.Legal then + for i = 1, #v.Locations, 1 do + local blip = AddBlipForCoord(v.Locations[i]) + + SetBlipSprite (blip, 110) + SetBlipDisplay(blip, 4) + SetBlipScale (blip, 1.0) + SetBlipColour (blip, 81) + SetBlipAsShortRange(blip, true) + + BeginTextCommandSetBlipName("STRING") + AddTextComponentSubstringPlayerName(_U('map_blip')) + EndTextCommandSetBlipName(blip) + end + end + end +end) + +-- Display markers +Citizen.CreateThread(function() + while true do + Citizen.Wait(0) + + local coords = GetEntityCoords(PlayerPedId()) + + for k,v in pairs(Config.Zones) do + for i = 1, #v.Locations, 1 do + if (Config.Type ~= -1 and GetDistanceBetweenCoords(coords, v.Locations[i], true) < Config.DrawDistance) then + DrawMarker(Config.Type, v.Locations[i], 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.Size.x, Config.Size.y, Config.Size.z, Config.Color.r, Config.Color.g, Config.Color.b, 100, false, true, 2, false, false, false, false) + end + end + end + end +end) + +-- Enter / Exit marker events +Citizen.CreateThread(function() + while true do + Citizen.Wait(0) + local coords = GetEntityCoords(PlayerPedId()) + local isInMarker, currentZone = false, nil + + for k,v in pairs(Config.Zones) do + for i=1, #v.Locations, 1 do + if GetDistanceBetweenCoords(coords, v.Locations[i], true) < Config.Size.x then + isInMarker, ShopItems, currentZone, LastZone = true, v.Items, k, k + end + end + end + if isInMarker and not HasAlreadyEnteredMarker then + HasAlreadyEnteredMarker = true + TriggerEvent('esx_weaponshop:hasEnteredMarker', currentZone) + end + + if not isInMarker and HasAlreadyEnteredMarker then + HasAlreadyEnteredMarker = false + TriggerEvent('esx_weaponshop:hasExitedMarker', LastZone) + end + end +end) + +-- Key Controls +Citizen.CreateThread(function() + while true do + Citizen.Wait(0) + + if CurrentAction ~= nil then + ESX.ShowHelpNotification(CurrentActionMsg) + + if IsControlJustReleased(0, 38) then + + if CurrentAction == 'shop_menu' then + if Config.LicenseEnable and Config.Zones[CurrentActionData.zone].Legal then + ESX.TriggerServerCallback('esx_license:checkLicense', function(hasWeaponLicense) + if hasWeaponLicense then + OpenShopMenu(CurrentActionData.zone) + else + OpenBuyLicenseMenu(CurrentActionData.zone) + end + end, GetPlayerServerId(PlayerId()), 'weapon') + else + OpenShopMenu(CurrentActionData.zone) + end + end + + CurrentAction = nil + end + end + end +end) diff --git a/[esx_addons]/esx_weaponshop/config.lua b/[esx_addons]/esx_weaponshop/config.lua new file mode 100644 index 00000000..a505c50b --- /dev/null +++ b/[esx_addons]/esx_weaponshop/config.lua @@ -0,0 +1,39 @@ +Config = {} + +Config.DrawDistance = 100 +Config.Size = { x = 1.5, y = 1.5, z = 0.5 } +Config.Color = { r = 0, g = 128, b = 255 } +Config.Type = 1 + +Config.Locale = 'en' + +Config.LicenseEnable = false -- only turn this on if you are using esx_license +Config.LicensePrice = 5000 + +Config.Zones = { + + GunShop = { + Legal = true, + Items = {}, + Locations = { + vector3(-662.1, -935.3, 20.8), + vector3(810.2, -2157.3, 28.6), + vector3(1693.4, 3759.5, 33.7), + vector3(-330.2, 6083.8, 30.4), + vector3(252.3, -50.0, 68.9), + vector3(22.0, -1107.2, 28.8), + vector3(2567.6, 294.3, 107.7), + vector3(-1117.5, 2698.6, 17.5), + vector3(842.4, -1033.4, 27.1) + } + }, + + BlackWeashop = { + Legal = false, + Items = {}, + Locations = { + vector3(-1306.2, -394.0, 35.6) + } + } + +} diff --git a/[esx_addons]/esx_weaponshop/esx_weaponshop.sql b/[esx_addons]/esx_weaponshop/esx_weaponshop.sql new file mode 100644 index 00000000..9f866ec5 --- /dev/null +++ b/[esx_addons]/esx_weaponshop/esx_weaponshop.sql @@ -0,0 +1,58 @@ +USE `es_extended`; + +CREATE TABLE `weashops` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `zone` varchar(255) NOT NULL, + `item` varchar(255) NOT NULL, + `price` int(11) NOT NULL, + + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +INSERT INTO `licenses` (`type`, `label`) VALUES + ('weapon', "Permis de port d'arme") +; + +INSERT INTO `weashops` (`zone`, `item`, `price`) VALUES + ('GunShop','WEAPON_PISTOL', 300), + ('BlackWeashop','WEAPON_PISTOL', 500), + ('GunShop', 'WEAPON_FLASHLIGHT', 60), + ('BlackWeashop', 'WEAPON_FLASHLIGHT', 70), + ('GunShop', 'WEAPON_MACHETE', 90), + ('BlackWeashop', 'WEAPON_MACHETE', 110), + ('GunShop', 'WEAPON_NIGHTSTICK', 150), + ('BlackWeashop', 'WEAPON_NIGHTSTICK', 150), + ('GunShop', 'WEAPON_BAT', 100), + ('BlackWeashop', 'WEAPON_BAT', 100), + ('GunShop', 'WEAPON_STUNGUN', 50), + ('BlackWeashop', 'WEAPON_STUNGUN', 50), + ('GunShop', 'WEAPON_MICROSMG', 1400), + ('BlackWeashop', 'WEAPON_MICROSMG', 1700), + ('GunShop', 'WEAPON_PUMPSHOTGUN', 3400), + ('BlackWeashop', 'WEAPON_PUMPSHOTGUN', 3500), + ('GunShop', 'WEAPON_ASSAULTRIFLE', 10000), + ('BlackWeashop', 'WEAPON_ASSAULTRIFLE', 11000), + ('GunShop', 'WEAPON_SPECIALCARBINE', 15000), + ('BlackWeashop', 'WEAPON_SPECIALCARBINE', 16500), + ('GunShop', 'WEAPON_SNIPERRIFLE', 22000), + ('BlackWeashop', 'WEAPON_SNIPERRIFLE', 24000), + ('GunShop', 'WEAPON_FIREWORK', 18000), + ('BlackWeashop', 'WEAPON_FIREWORK', 20000), + ('GunShop', 'WEAPON_GRENADE', 500), + ('BlackWeashop', 'WEAPON_GRENADE', 650), + ('GunShop', 'WEAPON_BZGAS', 200), + ('BlackWeashop', 'WEAPON_BZGAS', 350), + ('GunShop', 'WEAPON_FIREEXTINGUISHER', 100), + ('BlackWeashop', 'WEAPON_FIREEXTINGUISHER', 100), + ('GunShop', 'WEAPON_BALL', 50), + ('BlackWeashop', 'WEAPON_BALL', 50), + ('GunShop', 'WEAPON_SMOKEGRENADE', 100), + ('BlackWeashop', 'WEAPON_SMOKEGRENADE', 100), + ('BlackWeashop', 'WEAPON_APPISTOL', 1100), + ('BlackWeashop', 'WEAPON_CARBINERIFLE', 12000), + ('BlackWeashop', 'WEAPON_HEAVYSNIPER', 30000), + ('BlackWeashop', 'WEAPON_MINIGUN', 45000), + ('BlackWeashop', 'WEAPON_RAILGUN', 50000), + ('BlackWeashop', 'WEAPON_STICKYBOMB', 500) +; diff --git a/[esx_addons]/esx_weaponshop/fxmanifest.lua b/[esx_addons]/esx_weaponshop/fxmanifest.lua new file mode 100644 index 00000000..ecee11cf --- /dev/null +++ b/[esx_addons]/esx_weaponshop/fxmanifest.lua @@ -0,0 +1,40 @@ +fx_version 'adamant' + +game 'gta5' + +description 'ESX Weapon Shop' + +version '1.1.0' + +server_scripts { + '@mysql-async/lib/MySQL.lua', + '@es_extended/locale.lua', + 'locales/de.lua', + 'locales/br.lua', + 'locales/en.lua', + 'locales/fi.lua', + 'locales/fr.lua', + 'locales/es.lua', + 'locales/pl.lua', + 'locales/sv.lua', + 'locales/cs.lua', + 'config.lua', + 'server/main.lua' +} + +client_scripts { + '@es_extended/locale.lua', + 'locales/de.lua', + 'locales/br.lua', + 'locales/en.lua', + 'locales/fi.lua', + 'locales/fr.lua', + 'locales/es.lua', + 'locales/pl.lua', + 'locales/sv.lua', + 'locales/cs.lua', + 'config.lua', + 'client/main.lua' +} + +dependency 'es_extended' diff --git a/[esx_addons]/esx_weaponshop/locales/br.lua b/[esx_addons]/esx_weaponshop/locales/br.lua new file mode 100644 index 00000000..36d1414f --- /dev/null +++ b/[esx_addons]/esx_weaponshop/locales/br.lua @@ -0,0 +1,13 @@ +Locales ['br'] = { + ['buy_license'] = 'comprar licença de porte de arma?', + ['yes'] = '%s', + ['no'] = 'não', + ['weapon_bought'] = 'comprado por %s R$', + ['not_enough_black'] = 'você não tem dinheiro sujo suficiente', + ['not_enough'] = 'você não tem dinheiro suficiente', + ['already_owned'] = 'você já possui esta arma!', + ['shop_menu_title'] = 'comprar', + ['shop_menu_prompt'] = 'pressione ~INPUT_CONTEXT~ para comprar armas.', + ['shop_menu_item'] = 'R$%s', + ['map_blip'] = 'loja de Armas', +} diff --git a/[esx_addons]/esx_weaponshop/locales/cs.lua b/[esx_addons]/esx_weaponshop/locales/cs.lua new file mode 100644 index 00000000..a40074d5 --- /dev/null +++ b/[esx_addons]/esx_weaponshop/locales/cs.lua @@ -0,0 +1,13 @@ +Locales ['cs'] = { + ['buy_license'] = 'zakoupit zbrojni prukaz?', + ['yes'] = '%s', + ['no'] = 'ne', + ['weapon_bought'] = 'zakoupeno za $%s', + ['not_enough_black'] = 'nemas dostatek spinavych penez', + ['not_enough'] = 'nemas dostatek penez', + ['already_owned'] = 'tuhle zbran jiz vlastnis!', + ['shop_menu_title'] = 'ammu-Nation', + ['shop_menu_prompt'] = 'stiskni ~INPUT_CONTEXT~ pro pristup do ~y~Ammu-Nationu~s~.', + ['shop_menu_item'] = '$%s', + ['map_blip'] = 'ammu-Nation', +} diff --git a/[esx_addons]/esx_weaponshop/locales/de.lua b/[esx_addons]/esx_weaponshop/locales/de.lua new file mode 100644 index 00000000..993e871d --- /dev/null +++ b/[esx_addons]/esx_weaponshop/locales/de.lua @@ -0,0 +1,13 @@ +Locales ['de'] = { + ['buy_license'] = 'Waffenlizenz kaufen?', + ['yes'] = '%s', + ['no'] = 'Nein', + ['weapon_bought'] = 'Gekauft für %s EUR', + ['not_enough_black'] = 'Du hast nicht genug Schwarzgeld', + ['not_enough'] = 'Du hast nicht genug Geld', + ['already_owned'] = 'Du besitzt diese Waffe bereits', + ['shop_menu_title'] = 'Geschäft', + ['shop_menu_prompt'] = 'Drücke ~INPUT_CONTEXT~ um auf das Geschäft zuzugreifen.', + ['shop_menu_item'] = '%s EUR', + ['map_blip'] = 'Waffenladen', +} diff --git a/[esx_addons]/esx_weaponshop/locales/en.lua b/[esx_addons]/esx_weaponshop/locales/en.lua new file mode 100644 index 00000000..9da777e5 --- /dev/null +++ b/[esx_addons]/esx_weaponshop/locales/en.lua @@ -0,0 +1,13 @@ +Locales ['en'] = { + ['buy_license'] = 'buy weapon license?', + ['yes'] = '%s', + ['no'] = 'no', + ['weapon_bought'] = 'purchased for $%s', + ['not_enough_black'] = 'you do not have enough dirty money', + ['not_enough'] = 'you do not have enough money', + ['already_owned'] = 'you already own this weapon!', + ['shop_menu_title'] = 'ammu-Nation', + ['shop_menu_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Ammu-Nation~s~.', + ['shop_menu_item'] = '$%s', + ['map_blip'] = 'ammu-Nation', +} diff --git a/[esx_addons]/esx_weaponshop/locales/es.lua b/[esx_addons]/esx_weaponshop/locales/es.lua new file mode 100644 index 00000000..f87838e7 --- /dev/null +++ b/[esx_addons]/esx_weaponshop/locales/es.lua @@ -0,0 +1,13 @@ +Locales ['es'] = { + ['buy_license'] = '¿comprar la licencia de armas?', + ['yes'] = '%s', + ['no'] = 'no', + ['weapon_bought'] = 'comprada por $%s', + ['not_enough_black'] = 'usted no tiene ~r~suficiente~s~ dinero negro', + ['not_enough'] = 'usted no tiene ~r~suficiente~s~ dinero', + ['already_owned'] = '¡Ya dispones de esta arma!', + ['shop_menu_title'] = 'tienda', + ['shop_menu_prompt'] = 'presione ~INPUT_CONTEXT~ para acceder a la tienda.', + ['shop_menu_item'] = '$%s', + ['map_blip'] = 'ammu-Nation', +} diff --git a/[esx_addons]/esx_weaponshop/locales/fi.lua b/[esx_addons]/esx_weaponshop/locales/fi.lua new file mode 100644 index 00000000..e8b9bf68 --- /dev/null +++ b/[esx_addons]/esx_weaponshop/locales/fi.lua @@ -0,0 +1,13 @@ +Locales ['fi'] = { + ['buy_license'] = 'osta lisenssi?', + ['yes'] = '%s', + ['no'] = 'ei', + ['weapon_bought'] = 'purchased for %s EUR', + ['not_enough_black'] = 'ei tarpeeksi likaista rahaa', + ['not_enough'] = 'sinulla ei ole tarpeeksi rahaa', + ['already_owned'] = 'you already own this weapon!', + ['shop_menu_title'] = 'kauppa', + ['shop_menu_prompt'] = 'paina ~INPUT_CONTEXT~ avataksesi kauppa ikkuna.', + ['shop_menu_item'] = '%s EUR', + ['map_blip'] = 'asekauppa', +} diff --git a/[esx_addons]/esx_weaponshop/locales/fr.lua b/[esx_addons]/esx_weaponshop/locales/fr.lua new file mode 100644 index 00000000..a706c068 --- /dev/null +++ b/[esx_addons]/esx_weaponshop/locales/fr.lua @@ -0,0 +1,13 @@ +Locales ['fr'] = { + ['buy_license'] = 'acheter une license?', + ['yes'] = '%s', + ['no'] = 'non', + ['weapon_bought'] = 'acheté pour %s EUR', + ['not_enough_black'] = 'Vous n\'avez ~r~pas assez~s~ d\'argent sale', + ['not_enough'] = 'vous n\'avez ~r~pas assez~s~ d\'argent', + ['already_owned'] = 'vous possédez déjà cette arme!', + ['shop_menu_title'] = 'magasin', + ['shop_menu_prompt'] = 'appuyez sur ~INPUT_CONTEXT~ pour accéder au magasin.', + ['shop_menu_item'] = '%s EUR', + ['map_blip'] = 'armurerie', +} diff --git a/[esx_addons]/esx_weaponshop/locales/pl.lua b/[esx_addons]/esx_weaponshop/locales/pl.lua new file mode 100644 index 00000000..8f389a72 --- /dev/null +++ b/[esx_addons]/esx_weaponshop/locales/pl.lua @@ -0,0 +1,13 @@ +Locales ['pl'] = { + ['buy_license'] = 'czy chcesz kupić licencję?', + ['yes'] = '%s', + ['no'] = 'nie', + ['weapon_bought'] = 'purchased for %s PLN', + ['not_enough_black'] = 'nie masz wystarczająco brudnej kasy', + ['not_enough'] = 'nie masz wystarczająco pieniędzy', + ['already_owned'] = 'you already own this weapon!', + ['shop_menu_title'] = 'sklep', + ['shop_menu_prompt'] = 'Wciśnij ~INPUT_CONTEXT~ aby otworzyć sklep.', + ['shop_menu_item'] = '%s PLN', + ['map_blip'] = 'sklep z bronią', +} diff --git a/[esx_addons]/esx_weaponshop/locales/sv.lua b/[esx_addons]/esx_weaponshop/locales/sv.lua new file mode 100644 index 00000000..57da682d --- /dev/null +++ b/[esx_addons]/esx_weaponshop/locales/sv.lua @@ -0,0 +1,13 @@ +Locales ['sv'] = { + ['buy_license'] = 'vill du köpa ett vapenlicens?', + ['yes'] = '%s', + ['no'] = 'nej tack', + ['weapon_bought'] = 'köpt för %s SEK', + ['not_enough_black'] = 'du har inte tillräckligt med svarta pengar', + ['not_enough'] = 'du har inte råd för detta', + ['already_owned'] = 'du äger redan detta vapen!', + ['shop_menu_title'] = 'vapenaffär', + ['shop_menu_prompt'] = 'tryck ~INPUT_CONTEXT~ för att komma åt ~y~vapenaffären~s~.', + ['shop_menu_item'] = '%s SEK', + ['map_blip'] = 'vapenaffär', +} diff --git a/[esx_addons]/esx_weaponshop/localization/en.sql b/[esx_addons]/esx_weaponshop/localization/en.sql new file mode 100644 index 00000000..8635ecc3 --- /dev/null +++ b/[esx_addons]/esx_weaponshop/localization/en.sql @@ -0,0 +1,58 @@ +USE `es_extended`; + +CREATE TABLE `weashops` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `zone` varchar(255) NOT NULL, + `item` varchar(255) NOT NULL, + `price` int(11) NOT NULL, + + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + +INSERT INTO `licenses` (`type`, `label`) VALUES + ('weapon', "Weapons license") +; + +INSERT INTO `weashops` (`zone`, `item`, `price`) VALUES + ('GunShop','WEAPON_PISTOL', 300), + ('BlackWeashop','WEAPON_PISTOL', 500), + ('GunShop', 'WEAPON_FLASHLIGHT', 60), + ('BlackWeashop', 'WEAPON_FLASHLIGHT', 70), + ('GunShop', 'WEAPON_MACHETE', 90), + ('BlackWeashop', 'WEAPON_MACHETE', 110), + ('GunShop', 'WEAPON_NIGHTSTICK', 150), + ('BlackWeashop', 'WEAPON_NIGHTSTICK', 150), + ('GunShop', 'WEAPON_BAT', 100), + ('BlackWeashop', 'WEAPON_BAT', 100), + ('GunShop', 'WEAPON_STUNGUN', 50), + ('BlackWeashop', 'WEAPON_STUNGUN', 50), + ('GunShop', 'WEAPON_MICROSMG', 1400), + ('BlackWeashop', 'WEAPON_MICROSMG', 1700), + ('GunShop', 'WEAPON_PUMPSHOTGUN', 3400), + ('BlackWeashop', 'WEAPON_PUMPSHOTGUN', 3500), + ('GunShop', 'WEAPON_ASSAULTRIFLE', 10000), + ('BlackWeashop', 'WEAPON_ASSAULTRIFLE', 11000), + ('GunShop', 'WEAPON_SPECIALCARBINE', 15000), + ('BlackWeashop', 'WEAPON_SPECIALCARBINE', 16500), + ('GunShop', 'WEAPON_SNIPERRIFLE', 22000), + ('BlackWeashop', 'WEAPON_SNIPERRIFLE', 24000), + ('GunShop', 'WEAPON_FIREWORK', 18000), + ('BlackWeashop', 'WEAPON_FIREWORK', 20000), + ('GunShop', 'WEAPON_GRENADE', 500), + ('BlackWeashop', 'WEAPON_GRENADE', 650), + ('GunShop', 'WEAPON_BZGAS', 200), + ('BlackWeashop', 'WEAPON_BZGAS', 350), + ('GunShop', 'WEAPON_FIREEXTINGUISHER', 100), + ('BlackWeashop', 'WEAPON_FIREEXTINGUISHER', 100), + ('GunShop', 'WEAPON_BALL', 50), + ('BlackWeashop', 'WEAPON_BALL', 50), + ('GunShop', 'WEAPON_SMOKEGRENADE', 100), + ('BlackWeashop', 'WEAPON_SMOKEGRENADE', 100), + ('BlackWeashop', 'WEAPON_APPISTOL', 1100), + ('BlackWeashop', 'WEAPON_CARBINERIFLE', 12000), + ('BlackWeashop', 'WEAPON_HEAVYSNIPER', 30000), + ('BlackWeashop', 'WEAPON_MINIGUN', 45000), + ('BlackWeashop', 'WEAPON_RAILGUN', 50000), + ('BlackWeashop', 'WEAPON_STICKYBOMB', 500) +; diff --git a/[esx_addons]/esx_weaponshop/server/main.lua b/[esx_addons]/esx_weaponshop/server/main.lua new file mode 100644 index 00000000..dc403f25 --- /dev/null +++ b/[esx_addons]/esx_weaponshop/server/main.lua @@ -0,0 +1,93 @@ +ESX = nil +local shopItems = {} + +TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + +MySQL.ready(function() + + MySQL.Async.fetchAll('SELECT * FROM weashops', {}, function(result) + for i=1, #result, 1 do + if shopItems[result[i].zone] == nil then + shopItems[result[i].zone] = {} + end + + table.insert(shopItems[result[i].zone], { + item = result[i].item, + price = result[i].price, + label = ESX.GetWeaponLabel(result[i].item) + }) + end + + TriggerClientEvent('esx_weaponshop:sendShop', -1, shopItems) + end) + +end) + +ESX.RegisterServerCallback('esx_weaponshop:getShop', function(source, cb) + cb(shopItems) +end) + +ESX.RegisterServerCallback('esx_weaponshop:buyLicense', function(source, cb) + local xPlayer = ESX.GetPlayerFromId(source) + + if xPlayer.getMoney() >= Config.LicensePrice then + xPlayer.removeMoney(Config.LicensePrice) + + TriggerEvent('esx_license:addLicense', source, 'weapon', function() + cb(true) + end) + else + xPlayer.showNotification(_U('not_enough')) + cb(false) + end +end) + +ESX.RegisterServerCallback('esx_weaponshop:buyWeapon', function(source, cb, weaponName, zone) + local xPlayer = ESX.GetPlayerFromId(source) + local price = GetPrice(weaponName, zone) + + if price == 0 then + print(('esx_weaponshop: %s attempted to buy a unknown weapon!'):format(xPlayer.identifier)) + cb(false) + else + if xPlayer.hasWeapon(weaponName) then + xPlayer.showNotification(_U('already_owned')) + cb(false) + else + if zone == 'BlackWeashop' then + if xPlayer.getAccount('black_money').money >= price then + xPlayer.removeAccountMoney('black_money', price) + xPlayer.addWeapon(weaponName, 42) + + cb(true) + else + xPlayer.showNotification(_U('not_enough_black')) + cb(false) + end + else + if xPlayer.getMoney() >= price then + xPlayer.removeMoney(price) + xPlayer.addWeapon(weaponName, 42) + + cb(true) + else + xPlayer.showNotification(_U('not_enough')) + cb(false) + end + end + end + end +end) + +function GetPrice(weaponName, zone) + local price = MySQL.Sync.fetchScalar('SELECT price FROM weashops WHERE zone = @zone AND item = @item', { + ['@zone'] = zone, + ['@item'] = weaponName + }) + + if price then + return price + else + return 0 + end +end diff --git a/[esx_addons]/esx_whitelist/.editorconfig b/[esx_addons]/esx_whitelist/.editorconfig new file mode 100644 index 00000000..9b425256 --- /dev/null +++ b/[esx_addons]/esx_whitelist/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_size = 4 +indent_style = tab +end_of_line = crlf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/[esx_addons]/esx_whitelist/LICENSE b/[esx_addons]/esx_whitelist/LICENSE new file mode 100644 index 00000000..9cecc1d4 --- /dev/null +++ b/[esx_addons]/esx_whitelist/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + {one line to give the program's name and a brief idea of what it does.} + Copyright (C) {year} {name of author} + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + {project} Copyright (C) {year} {fullname} + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/[esx_addons]/esx_whitelist/README.md b/[esx_addons]/esx_whitelist/README.md new file mode 100644 index 00000000..c4acb4fb --- /dev/null +++ b/[esx_addons]/esx_whitelist/README.md @@ -0,0 +1,38 @@ +# esx_whitelist + +## Download & Installation + +### Using [fvm](https://github.com/qlaffont/fvm-installer) +``` +fvm install --save --folder=esx esx-org/esx_whitelist +``` + +### Using Git +``` +cd resources +git clone https://github.com/ESX-Org/esx_whitelist [esx]/esx_whitelist +``` + +### Manually +- Download https://github.com/ESX-Org/esx_whitelist/archive/master.zip +- Put it in the `[esx]` directory + +## Installation +- Import `esx_whitelist.sql` to your database +- Add this in your `server.cfg`: + +``` +start esx_whitelist +``` + +# Legal +### License +esx_whitelist - Whitelist script + +Copyright (C) 2015-2020 Jérémie N'gadi + +This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version. + +This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details. + +You should have received a copy Of the GNU General Public License along with this program. If Not, see http://www.gnu.org/licenses/. \ No newline at end of file diff --git a/[esx_addons]/esx_whitelist/config.lua b/[esx_addons]/esx_whitelist/config.lua new file mode 100644 index 00000000..c6f51a26 --- /dev/null +++ b/[esx_addons]/esx_whitelist/config.lua @@ -0,0 +1,4 @@ +Config = {} + +Config.Locale = 'fr' +Config.MinPlayer = 0 --Set how many players need to be connect before whitelist start, 0-32 diff --git a/[esx_addons]/esx_whitelist/esx_whitelist.sql b/[esx_addons]/esx_whitelist/esx_whitelist.sql new file mode 100644 index 00000000..68bcf92a --- /dev/null +++ b/[esx_addons]/esx_whitelist/esx_whitelist.sql @@ -0,0 +1,8 @@ +USE `es_extended`; + +CREATE TABLE `whitelist` ( + `identifier` varchar(60) NOT NULL, + + PRIMARY KEY (`identifier`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + diff --git a/[esx_addons]/esx_whitelist/fxmanifest.lua b/[esx_addons]/esx_whitelist/fxmanifest.lua new file mode 100644 index 00000000..f3754627 --- /dev/null +++ b/[esx_addons]/esx_whitelist/fxmanifest.lua @@ -0,0 +1,19 @@ +fx_version 'adamant' + +game 'gta5' + +description 'ESX Whitelist' + +version '1.1.0' + +server_scripts { + '@mysql-async/lib/MySQL.lua', + '@es_extended/locale.lua', + 'config.lua', + 'locales/br.lua', + 'locales/en.lua', + 'locales/fr.lua', + 'locales/sv.lua', + 'server/main.lua', + 'server/commands.lua' +} diff --git a/[esx_addons]/esx_whitelist/locales/br.lua b/[esx_addons]/esx_whitelist/locales/br.lua new file mode 100644 index 00000000..0f442a3c --- /dev/null +++ b/[esx_addons]/esx_whitelist/locales/br.lua @@ -0,0 +1,9 @@ +Locales['br'] = { + ['whitelist_check'] = 'certificando-se de que você está na lista de permitidos(whitelist) neste servidor. . .', + ['not_whitelisted'] = 'você não está na lista de permitidos(whitelist) neste servidor', + ['steamid_error'] = 'seu ID do Steam não foi encontrado, o Steam está aberto?', + ['whitelist_empty'] = 'a lista de permitidos(whitelist) ainda não foi carregada ou ninguém foi incluído!', + ['help_whitelist_add'] = 'adicionar alguém à lista de permitidos(whitelist) no servidor', + ['help_whitelist_load'] = 'recarregar a lista de permitidos(whitelist)', +} + diff --git a/[esx_addons]/esx_whitelist/locales/en.lua b/[esx_addons]/esx_whitelist/locales/en.lua new file mode 100644 index 00000000..8b7443c6 --- /dev/null +++ b/[esx_addons]/esx_whitelist/locales/en.lua @@ -0,0 +1,8 @@ +Locales['en'] = { + ['whitelist_check'] = 'making sure you\'re whitelisted on this server . . .', + ['not_whitelisted'] = 'you are not whitelisted on this server', + ['whitelist_empty'] = 'the whitelist hasn\'t been loaded yet, or alternatively no one has been whitelisted!', + ['license_missing'] = 'your license could not be found', + ['help_whitelist_add'] = 'add someone to the whitelist', + ['help_whitelist_load'] = 'reload the whitelist', +} diff --git a/[esx_addons]/esx_whitelist/locales/fr.lua b/[esx_addons]/esx_whitelist/locales/fr.lua new file mode 100644 index 00000000..0693361f --- /dev/null +++ b/[esx_addons]/esx_whitelist/locales/fr.lua @@ -0,0 +1,8 @@ +Locales['fr'] = { + ['whitelist_check'] = 'Etes vous sûr d\'être whitelisté sur ce serveur ...', + ['not_whitelisted'] = 'Ce serveur utilise une whitelist', + ['whitelist_empty'] = 'La whitelist n\'a pas été rechargé ou vous n\'avez pas été whitelisté', + ['license_missing'] = 'Votre license est introuvable', + ['help_whitelist_add'] = 'Ajouter un joueur à la Whitelist', + ['help_whitelist_load'] = 'Recharger la Whitelist', +} diff --git a/[esx_addons]/esx_whitelist/locales/sv.lua b/[esx_addons]/esx_whitelist/locales/sv.lua new file mode 100644 index 00000000..6270ffb0 --- /dev/null +++ b/[esx_addons]/esx_whitelist/locales/sv.lua @@ -0,0 +1,8 @@ +Locales['sv'] = { + ['whitelist_check'] = 'making sure you\'re whitelisted on this server . . .', + ['not_whitelisted'] = 'du är inte whitelistad på denna server!', + ['whitelist_empty'] = 'whitelisten har ännu inte laddats in, eller så är ingen whitelitad!', + ['license_missing'] = 'din licens kunde ej hittas', + ['help_whitelist_add'] = 'lägg till någon till whitelisten', + ['help_whitelist_load'] = 'ladda om whitelist', +} diff --git a/[esx_addons]/esx_whitelist/locales/tr.lua b/[esx_addons]/esx_whitelist/locales/tr.lua new file mode 100644 index 00000000..2523fe63 --- /dev/null +++ b/[esx_addons]/esx_whitelist/locales/tr.lua @@ -0,0 +1,8 @@ +Locales['tr'] = { + ['whitelist_check'] = 'bu sunucuda beyaz listede olduğunuzdan emin olunuluyor . . .', + ['not_whitelisted'] = 'bu sunucuda beyaz listede değilsiniz', + ['whitelist_empty'] = 'beyaz liste henüz yüklenmedi yada beyaz listede kimse bulunmuyor', + ['license_missing'] = 'lisansınız bulunamadı', + ['help_whitelist_add'] = 'beyaz listeye birini ekle', + ['help_whitelist_load'] = 'beyaz listeyi tekrardan yükle', +} diff --git a/[esx_addons]/esx_whitelist/server/commands.lua b/[esx_addons]/esx_whitelist/server/commands.lua new file mode 100644 index 00000000..70bfd3e0 --- /dev/null +++ b/[esx_addons]/esx_whitelist/server/commands.lua @@ -0,0 +1,26 @@ +ESX.RegisterCommand('wlrefresh', 'admin', function(xPlayer, args, showError) + loadWhiteList(function() + showError('Whitelist reloaded') + end) +end, true, {help = _U('help_whitelist_load')}) + +ESX.RegisterCommand('wladd', 'admin', function(xPlayer, args, showError) + args.license = args.license:lower() + + if string.len(args.license) == 40 then + if WhiteList[args.license] then + showError('The player is already whitelisted on this server!') + else + MySQL.Async.execute('INSERT INTO whitelist (identifier) VALUES (@identifier)', { + ['@identifier'] = args.license + }, function(rowsChanged) + WhiteList[args.license] = true + showError('The player has been whitelisted!') + end) + end + else + showError('Invalid license ID length!') + end +end, true, {help = _U('help_whitelist_add'), validate = true, arguments = { + {name = 'license', help = 'the player license', type = 'string'} +}}) diff --git a/[esx_addons]/esx_whitelist/server/main.lua b/[esx_addons]/esx_whitelist/server/main.lua new file mode 100644 index 00000000..c7b8bda8 --- /dev/null +++ b/[esx_addons]/esx_whitelist/server/main.lua @@ -0,0 +1,62 @@ +ESX, WhiteList = nil, {} + + +TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + +function loadWhiteList(cb) + Whitelist = {} + + MySQL.Async.fetchAll('SELECT identifier FROM whitelist', {}, function(result) + for k,v in ipairs(result) do + WhiteList[v.identifier] = true + end + + if cb then + cb() + end + end) +end + +MySQL.ready(function() + loadWhiteList() +end) + +AddEventHandler('playerConnecting', function(name, setCallback, deferrals) + local xPlayers = ESX.GetPlayers() + + -- Mark this connection as deferred, this is to prevent problems while checking player identifiers. + deferrals.defer() + + local playerId, kickReason, identifier = source + + -- Letting the user know what's going on. + deferrals.update(_U('whitelist_check')) + + -- Needed, not sure why. + Citizen.Wait(100) + + for k,v in ipairs(GetPlayerIdentifiers(playerId)) do + if string.match(v, 'license:') then + identifier = string.sub(v, 9) + break + end + end + + if ESX.Table.SizeOf(WhiteList) == 0 then + kickReason = _U('whitelist_empty') + elseif not identifier then + kickReason = _U('license_missing') + elseif not WhiteList[identifier] then + kickReason = _U('not_whitelisted') + end + + if whitelisted or #xPlayers < Config.MinPlayer then + deferrals.done() + else + if kickReason then + deferrals.done(kickReason) + else + deferrals.done() + end + end +end) diff --git a/[esx_addons]/instance/.editorconfig b/[esx_addons]/instance/.editorconfig new file mode 100644 index 00000000..9b425256 --- /dev/null +++ b/[esx_addons]/instance/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_size = 4 +indent_style = tab +end_of_line = crlf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/[esx_addons]/instance/LICENSE b/[esx_addons]/instance/LICENSE new file mode 100644 index 00000000..3790339c --- /dev/null +++ b/[esx_addons]/instance/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + fxserver-instance + Copyright (C) 2015 Jérémie N'gadi + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + fxserver-instance Copyright (C) 2015 Jérémie N'gadi + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. \ No newline at end of file diff --git a/[esx_addons]/instance/README.md b/[esx_addons]/instance/README.md new file mode 100644 index 00000000..8df3fb52 --- /dev/null +++ b/[esx_addons]/instance/README.md @@ -0,0 +1,37 @@ +# instance + +## Download & Installation + +### Using [fvm](https://github.com/qlaffont/fvm-installer) +``` +fvm install --save --folder=esx esx-org/instance +``` + +### Using Git +``` +cd resources +git clone https://github.com/ESX-Org/instance [esx]/instance +``` + +### Manually +- Download https://github.com/ESX-Org/instance/archive/master.zip +- Put it in the `[esx]` directory + +## Installation +- Add this to your `server.cfg`: + +``` +start instance +``` + +# Legal +### License +instance - enter buildings! + +Copyright (C) 2015-2020 Jérémie N'gadi + +This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version. + +This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details. + +You should have received a copy Of the GNU General Public License along with this program. If Not, see http://www.gnu.org/licenses/. \ No newline at end of file diff --git a/[esx_addons]/instance/client/main.lua b/[esx_addons]/instance/client/main.lua new file mode 100644 index 00000000..94f0404b --- /dev/null +++ b/[esx_addons]/instance/client/main.lua @@ -0,0 +1,232 @@ +local instance, instancedPlayers, registeredInstanceTypes, playersToHide = {}, {}, {}, {} +local instanceInvite, insideInstance +ESX = nil + + +Citizen.CreateThread(function() + while ESX == nil do + TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + Citizen.Wait(0) + end +end) + +function GetInstance() + return instance +end + +function CreateInstance(type, data) + TriggerServerEvent('instance:create', type, data) +end + +function CloseInstance() + instance = {} + TriggerServerEvent('instance:close') + insideInstance = false +end + +function EnterInstance(instance) + insideInstance = true + -- Fix vehicles randomly spawning nearby the player inside an instance + Citizen.CreateThread(function() + while insideInstance do + Citizen.Wait(0) -- must be run every frame + + SetVehicleDensityMultiplierThisFrame(0.0) + SetParkedVehicleDensityMultiplierThisFrame(0.0) + + local pos = GetEntityCoords(PlayerPedId()) + RemoveVehiclesFromGeneratorsInArea(pos.x - 900.0, pos.y - 900.0, pos.z - 900.0, pos.x + 900.0, pos.y + 900.0, pos.z + 900.0) + end + end) + TriggerServerEvent('instance:enter', instance.host) + + if registeredInstanceTypes[instance.type].enter then + registeredInstanceTypes[instance.type].enter(instance) + end +end + +function LeaveInstance() + if instance.host then + if #instance.players > 1 then + ESX.ShowNotification(_U('left_instance')) + end + + if registeredInstanceTypes[instance.type].exit then + registeredInstanceTypes[instance.type].exit(instance) + end + + TriggerServerEvent('instance:leave', instance.host) + end + + insideInstance = false +end + +function InviteToInstance(type, player, data) + TriggerServerEvent('instance:invite', instance.host, type, player, data) +end + +function RegisterInstanceType(type, enter, exit) + registeredInstanceTypes[type] = { + enter = enter, + exit = exit + } +end + +AddEventHandler('instance:get', function(cb) + cb(GetInstance()) +end) + +AddEventHandler('instance:create', function(type, data) + CreateInstance(type, data) +end) + +AddEventHandler('instance:close', function() + CloseInstance() +end) + +AddEventHandler('instance:enter', function(_instance) + EnterInstance(_instance) +end) + +AddEventHandler('instance:leave', function() + LeaveInstance() +end) + +AddEventHandler('instance:invite', function(type, player, data) + InviteToInstance(type, player, data) +end) + +AddEventHandler('instance:registerType', function(name, enter, exit) + RegisterInstanceType(name, enter, exit) +end) + +RegisterNetEvent('instance:onInstancedPlayersData') +AddEventHandler('instance:onInstancedPlayersData', function(_instancedPlayers) + instancedPlayers = _instancedPlayers +end) + +RegisterNetEvent('instance:onCreate') +AddEventHandler('instance:onCreate', function(_instance) + instance = {} +end) + +RegisterNetEvent('instance:onEnter') +AddEventHandler('instance:onEnter', function(_instance) + instance = _instance +end) + +RegisterNetEvent('instance:onLeave') +AddEventHandler('instance:onLeave', function(_instance) + instance = {} +end) + +RegisterNetEvent('instance:onClose') +AddEventHandler('instance:onClose', function(_instance) + instance = {} +end) + +RegisterNetEvent('instance:onPlayerEntered') +AddEventHandler('instance:onPlayerEntered', function(_instance, player) + instance = _instance + local playerName = GetPlayerName(GetPlayerFromServerId(player)) + + ESX.ShowNotification(_('entered_into', playerName)) +end) + +RegisterNetEvent('instance:onPlayerLeft') +AddEventHandler('instance:onPlayerLeft', function(_instance, player) + instance = _instance + local playerName = GetPlayerName(GetPlayerFromServerId(player)) + + ESX.ShowNotification(_('left_out', playerName)) +end) + +RegisterNetEvent('instance:onInvite') +AddEventHandler('instance:onInvite', function(_instance, type, data) + instanceInvite = { + type = type, + host = _instance, + data = data + } + Citizen.CreateThread(function() + while instanceInvite do + Citizen.Wait(0) + + ESX.ShowHelpNotification(_U('press_to_enter')) + + if IsControlJustReleased(0, 38) then + EnterInstance(instanceInvite) + ESX.ShowNotification(_U('entered_instance')) + instanceInvite = nil + end + end + end) + + Citizen.CreateThread(function() + -- Controls for invite + Citizen.Wait(10000) + + if instanceInvite then + ESX.ShowNotification(_U('invite_expired')) + instanceInvite = nil + end + end) + +end) + +RegisterInstanceType('default') + +-- Instance players +Citizen.CreateThread(function() + while true do + Citizen.Wait(1000) + playersToHide = {} + + if instance.host then + -- Get players and sets them as pairs + for k,v in ipairs(GetActivePlayers()) do + playersToHide[GetPlayerServerId(v)] = true + end + + -- Dont set our instanced players invisible + for _,player in ipairs(instance.players) do + playersToHide[player] = nil + end + else + for player,_ in pairs(instancedPlayers) do + playersToHide[player] = true + end + end + end +end) + +local letSleep = true + +Citizen.CreateThread(function() + while true do + Citizen.Wait(0) + local playerPed = PlayerPedId() + letSleep = true + + -- Hide all these players + for serverId,_ in pairs(playersToHide) do + local player = GetPlayerFromServerId(serverId) + + if NetworkIsPlayerActive(player) then + local otherPlayerPed = GetPlayerPed(player) + SetEntityVisible(otherPlayerPed, false, false) + SetEntityNoCollisionEntity(otherPlayerPed, playerPed, true) + letSleep = false + end + end + + if letSleep then + Citizen.Wait(1000) + end + end +end) + +Citizen.CreateThread(function() + TriggerEvent('instance:loaded') +end) + diff --git a/[esx_addons]/instance/config.lua b/[esx_addons]/instance/config.lua new file mode 100644 index 00000000..a3d6aa84 --- /dev/null +++ b/[esx_addons]/instance/config.lua @@ -0,0 +1,3 @@ +Config = {} + +Config.Locale = 'en' diff --git a/[esx_addons]/instance/fxmanifest.lua b/[esx_addons]/instance/fxmanifest.lua new file mode 100644 index 00000000..6b03126e --- /dev/null +++ b/[esx_addons]/instance/fxmanifest.lua @@ -0,0 +1,30 @@ +fx_version 'adamant' + +game 'gta5' + +description 'Instance' + +version '1.1.0' + +server_scripts { + '@es_extended/locale.lua', + 'locales/br.lua', + 'locales/en.lua', + 'locales/fr.lua', + 'locales/sv.lua', + 'locales/pl.lua', + 'config.lua', + 'server/main.lua' +} + + +client_scripts { + '@es_extended/locale.lua', + 'locales/br.lua', + 'locales/en.lua', + 'locales/fr.lua', + 'locales/sv.lua', + 'locales/pl.lua', + 'config.lua', + 'client/main.lua' +} diff --git a/[esx_addons]/instance/locales/br.lua b/[esx_addons]/instance/locales/br.lua new file mode 100644 index 00000000..fc61fd64 --- /dev/null +++ b/[esx_addons]/instance/locales/br.lua @@ -0,0 +1,8 @@ +Locales['br'] = { + ['left_instance'] = 'você deixou a instância', + ['invite_expired'] = 'convite expirado', + ['press_to_enter'] = 'pressione ~INPUT_CONTEXT~ para entrar na instância', + ['entered_instance'] = 'você entrou na instância', + ['entered_into'] = '%s entered the instance', + ['left_out'] = '%s left the instance', +} diff --git a/[esx_addons]/instance/locales/en.lua b/[esx_addons]/instance/locales/en.lua new file mode 100644 index 00000000..0c2a0daa --- /dev/null +++ b/[esx_addons]/instance/locales/en.lua @@ -0,0 +1,8 @@ +Locales['en'] = { + ['left_instance'] = 'you have left the instance', + ['invite_expired'] = 'invite expired', + ['press_to_enter'] = 'press ~INPUT_CONTEXT~ to enter the instance', + ['entered_instance'] = 'you entered the instance', + ['entered_into'] = '%s entered the instance', + ['left_out'] = '%s left the instance', +} diff --git a/[esx_addons]/instance/locales/fr.lua b/[esx_addons]/instance/locales/fr.lua new file mode 100644 index 00000000..7b480d29 --- /dev/null +++ b/[esx_addons]/instance/locales/fr.lua @@ -0,0 +1,8 @@ +Locales['fr'] = { + ['left_instance'] = 'vous avez quitté l\'instance', + ['invite_expired'] = 'invitation expirée', + ['press_to_enter'] = 'appuyez sur ~INPUT_CONTEXT~ pour entrer dans l\'instance', + ['entered_instance'] = 'vous êtes entré dans l\'instance', + ['entered_into'] = '%s est entré dans l\'instance', + ['left_out'] = '%s est sorti dans l\'instance', +} diff --git a/[esx_addons]/instance/locales/pl.lua b/[esx_addons]/instance/locales/pl.lua new file mode 100644 index 00000000..efb78eeb --- /dev/null +++ b/[esx_addons]/instance/locales/pl.lua @@ -0,0 +1,8 @@ +Locales['pl'] = { + ['left_instance'] = 'opuszczasz instancję', + ['invite_expired'] = 'zaproszenie wygasło', + ['press_to_enter'] = 'wciśnij ~INPUT_CONTEXT~ aby wejść do instancji', + ['entered_instance'] = 'wchodzisz do instancji', + ['entered_into'] = '%s wchodzi do instancji', + ['left_out'] = '%s opuszcza instancję', +} \ No newline at end of file diff --git a/[esx_addons]/instance/locales/sv.lua b/[esx_addons]/instance/locales/sv.lua new file mode 100644 index 00000000..ae466b65 --- /dev/null +++ b/[esx_addons]/instance/locales/sv.lua @@ -0,0 +1,8 @@ +Locales['sv'] = { + ['left_instance'] = 'du har lämnat byggnaden', + ['invite_expired'] = 'din inbjudan har nekas', + ['press_to_enter'] = 'tryck ~INPUT_CONTEXT~ för att gå in i byggnaden', + ['entered_instance'] = 'du är inne i byggnaden', + ['entered_into'] = '%s gick in i byggnaden', + ['left_out'] = '%s har lämnat byggnaden', +} \ No newline at end of file diff --git a/[esx_addons]/instance/server/main.lua b/[esx_addons]/instance/server/main.lua new file mode 100644 index 00000000..3f51be44 --- /dev/null +++ b/[esx_addons]/instance/server/main.lua @@ -0,0 +1,131 @@ +local instances = {} + +function GetInstancedPlayers() + local players = {} + + for k,v in pairs(instances) do + for k2,v2 in ipairs(v.players) do + players[v2] = true + end + end + + return players +end + +AddEventHandler('playerDropped', function(reason) + if instances[source] then + CloseInstance(source) + end +end) + +function CreateInstance(type, player, data) + instances[player] = { + type = type, + host = player, + players = {}, + data = data + } + + TriggerEvent('instance:onCreate', instances[player]) + TriggerClientEvent('instance:onCreate', player, instances[player]) + TriggerClientEvent('instance:onInstancedPlayersData', -1, GetInstancedPlayers()) +end + +function CloseInstance(instance) + if instances[instance] then + + for i=1, #instances[instance].players do + TriggerClientEvent('instance:onClose', instances[instance].players[i]) + end + + instances[instance] = nil + + TriggerClientEvent('instance:onInstancedPlayersData', -1, GetInstancedPlayers()) + TriggerEvent('instance:onClose', instance) + end +end + +function AddPlayerToInstance(instance, player) + local found = false + + for i=1, #instances[instance].players do + if instances[instance].players[i] == player then + found = true + break + end + end + + if not found then + table.insert(instances[instance].players, player) + end + + TriggerClientEvent('instance:onEnter', player, instances[instance]) + + for i=1, #instances[instance].players do + if instances[instance].players[i] ~= player then + TriggerClientEvent('instance:onPlayerEntered', instances[instance].players[i], instances[instance], player) + end + end + + TriggerClientEvent('instance:onInstancedPlayersData', -1, GetInstancedPlayers()) +end + +function RemovePlayerFromInstance(instance, player) + if instances[instance] then + TriggerClientEvent('instance:onLeave', player, instances[instance]) + + if instances[instance].host == player then + for i=1, #instances[instance].players do + if instances[instance].players[i] ~= player then + TriggerClientEvent('instance:onPlayerLeft', instances[instance].players[i], instances[instance], player) + end + end + + CloseInstance(instance) + else + for i=1, #instances[instance].players do + if instances[instance].players[i] == player then + instances[instance].players[i] = nil + end + end + + for i=1, #instances[instance].players do + if instances[instance].players[i] ~= player then + TriggerClientEvent('instance:onPlayerLeft', instances[instance].players[i], instances[instance], player) + end + + end + + TriggerClientEvent('instance:onInstancedPlayersData', -1, GetInstancedPlayers()) + end + end +end + +function InvitePlayerToInstance(instance, type, player, data) + TriggerClientEvent('instance:onInvite', player, instance, type, data) +end + +RegisterServerEvent('instance:create') +AddEventHandler('instance:create', function(type, data) + CreateInstance(type, source, data) +end) + +RegisterServerEvent('instance:close') +AddEventHandler('instance:close', function() + CloseInstance(source) +end) + +RegisterServerEvent('instance:enter') +AddEventHandler('instance:enter', function(instance) + AddPlayerToInstance(instance, source) +end) + +RegisterServerEvent('instance:leave') +AddEventHandler('instance:leave', function(instance) + RemovePlayerFromInstance(instance, source) +end) + +RegisterServerEvent('instance:invite') +AddEventHandler('instance:invite', function(instance, type, player, data) + InvitePlayerToInstance(instance, type, player, data) +end) diff --git a/esx_example/client/main.lua b/esx_example/client/main.lua new file mode 100644 index 00000000..880a0fec --- /dev/null +++ b/esx_example/client/main.lua @@ -0,0 +1,43 @@ +RegisterNetEvent('esx:playerLoaded') -- Store the players data +AddEventHandler('esx:playerLoaded', function(xPlayer, isNew) + ESX.PlayerData = xPlayer + ESX.PlayerLoaded = true +end) + +RegisterNetEvent('esx:playerLogout') -- When a player logs out (multicharacter), reset their data +AddEventHandler('esx:playerLogout', function(xPlayer, isNew) + ESX.PlayerLoaded = false + ESX.PlayerData = {} +end) + + + +-- These two functions can perform the same task +RegisterNetEvent('esx:setJob') +AddEventHandler('esx:setJob', function(job) + print('PlayerData.job was set to '..job) + if ESX.PlayerData.job.name ~= job.name then + print('You are now in a different job') + end + ESX.PlayerData.job = job +end) + +OnPlayerData = function(key, val, last) + if type(val) == 'table' then val = json.encode(val) end + print('PlayerData.'..key..' was set to '..val) + if key == 'job' then + if last.name ~= val.name then + print('You are now in a different job') + end + elseif key == 'dead' then -- However, this function can be used for other PlayerData + if val == true then + print('You die too easily') + SetTimeout(2000, function() + if ESX.PlayerData.dead then + print('Why are you still dead?') + end + end) + end + end +end +----------------------------------------------- \ No newline at end of file diff --git a/esx_example/server/main.lua b/esx_example/server/main.lua new file mode 100644 index 00000000..6ee5dcdf --- /dev/null +++ b/esx_example/server/main.lua @@ -0,0 +1,32 @@ +RegisterNetEvent('esx:playerLoaded') -- When a player loads in, we can store some basic information about them locally +AddEventHandler('esx:playerLoaded', function(playerId, xPlayer, isNew) + ESX.Players[playerId] = xPlayer.job.name +end) + +RegisterNetEvent('esx:setJob') -- The stored data does not sync with the framework unless we tell it to +AddEventHandler('esx:setJob', function(playerId, job, lastJob) + ESX.Players[playerId] = job.name +end) + +AddEventHandler('esx:playerDropped', function(playerId, reason) -- Remove any cached data once the player no longer exists + ESX.Players[playerId] = nil +end) + +AddEventHandler('onResourceStart', function(resourceName) -- The resource just restarted so we actually have a fresh copy of ESX.Players from the framework + if (GetCurrentResourceName() == resourceName) then -- Useful if we need to run functions or send events after a restart + local players = {} + for _, xPlayer in pairs(ESX.Players) do + players[playerId] = xPlayer.job.name + print( ('%s %s is online with player id %s'):format(xPlayer.job.grade_label, xPlayer.name, playerId) ) + end + ESX.Players = players -- Replace the data as it is a waste of memory + end +end) + +Citizen.CreateThread(function() + Citizen.Wait(1000) + local xPlayers = ESX.GetExtendedPlayers('job', 'police') -- New hitchless xPlayer loop, with the ability to only return players with specific data + for _, xPlayer in pairs(xPlayers) do + print(xPlayer.source, xPlayer.job.grade_label, xPlayer.name) + end +end) \ No newline at end of file diff --git a/server.cfg b/server.cfg new file mode 100644 index 00000000..5cec197e --- /dev/null +++ b/server.cfg @@ -0,0 +1,67 @@ +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # +# ███████╗███████╗██╗ ██╗ ██╗ ███████╗ ██████╗ █████╗ ██████╗██╗ ██╗ # +# ██╔════╝██╔════╝╚██╗██╔╝ ██║ ██╔════╝██╔════╝ ██╔══██╗██╔════╝╚██╗ ██╔╝ # +# █████╗ ███████╗ ╚███╔╝ ██║ █████╗ ██║ ███╗███████║██║ ╚████╔╝ # +# ██╔══╝ ╚════██║ ██╔██╗ ██║ ██╔══╝ ██║ ██║██╔══██║██║ ╚██╔╝ # +# ███████╗███████║██╔╝ ██╗ ███████╗███████╗╚██████╔╝██║ ██║╚██████╗ ██║ # +# ╚══════╝╚══════╝╚═╝ ╚═╝ ╚══════╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ # +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # +# Development Discord: https://discord.gg/cNx6HF9P5J +# Support Discord: https://discord.gg/J6VqFPwvVp + +# Only change the IP if you're using a server with multiple network interfaces, otherwise change the port only. +endpoint_add_tcp "0.0.0.0:30120" +endpoint_add_udp "0.0.0.0:30120" + + +sv_hostname "Unconfigured ESX Server" +set steam_webApiKey "none" +sv_licenseKey "" +sv_maxclients 10 # Allow access to features usually locked behind a FiveM patreon key + +sets sv_projectName "ESX Legacy" +sets sv_projectDesc "" +sets locale "root-AQ" +sets tags "default, esx," + +set onesync legacy # Not recommended to use Infinity with ESX +set mysql_connection_string "mysql://user:password@localhost/es_extended?waitForConnections=true&charset=utf8mb4" + + +## These resources will start by default. +ensure mapmanager +ensure chat +ensure spawnmanager +ensure sessionmanager + +## Add system admins +add_ace group.admin command allow # allow all commands +add_ace group.admin command.quit deny # but don't allow quit +add_ace resource.es_extended command.add_ace allow +add_ace resource.es_extended command.add_principal allow +add_ace resource.es_extended command.remove_principal allow +add_ace resource.es_extended command.stop allow + +## ESX Legacy +ensure mysql-async +ensure cron +ensure instance +ensure skinchanger +ensure es_extended +ensure esx_menu_default +ensure esx_menu_dialog +ensure esx_menu_list +ensure esx_identity +ensure esx_skin + +## ESX Addons +# +# +# +# +# +# +# +# +# +#