diff --git a/_resources/esx_property/.editorconfig b/_resources/esx_property/.editorconfig new file mode 100644 index 00000000..9b425256 --- /dev/null +++ b/_resources/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/_resources/esx_property/LICENSE b/_resources/esx_property/LICENSE new file mode 100644 index 00000000..0bcccde6 --- /dev/null +++ b/_resources/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/_resources/esx_property/README.md b/_resources/esx_property/README.md new file mode 100644 index 00000000..8c230af9 --- /dev/null +++ b/_resources/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/_resources/esx_property/client/main.lua b/_resources/esx_property/client/main.lua new file mode 100644 index 00000000..04e00eb6 --- /dev/null +++ b/_resources/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/_resources/esx_property/config.lua b/_resources/esx_property/config.lua new file mode 100644 index 00000000..0095b791 --- /dev/null +++ b/_resources/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/_resources/esx_property/esx_property.sql b/_resources/esx_property/esx_property.sql new file mode 100644 index 00000000..5cb27c06 --- /dev/null +++ b/_resources/esx_property/esx_property.sql @@ -0,0 +1,94 @@ +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`) +); + +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`) +); + +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/_resources/esx_property/fxmanifest.lua b/_resources/esx_property/fxmanifest.lua new file mode 100644 index 00000000..e97611c2 --- /dev/null +++ b/_resources/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/_resources/esx_property/locales/br.lua b/_resources/esx_property/locales/br.lua new file mode 100644 index 00000000..0ff61d99 --- /dev/null +++ b/_resources/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/_resources/esx_property/locales/de.lua b/_resources/esx_property/locales/de.lua new file mode 100644 index 00000000..c50ebd84 --- /dev/null +++ b/_resources/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/_resources/esx_property/locales/en.lua b/_resources/esx_property/locales/en.lua new file mode 100644 index 00000000..61296a87 --- /dev/null +++ b/_resources/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/_resources/esx_property/locales/es.lua b/_resources/esx_property/locales/es.lua new file mode 100644 index 00000000..0ff5d49c --- /dev/null +++ b/_resources/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/_resources/esx_property/locales/fi.lua b/_resources/esx_property/locales/fi.lua new file mode 100644 index 00000000..e52417be --- /dev/null +++ b/_resources/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/_resources/esx_property/locales/fr.lua b/_resources/esx_property/locales/fr.lua new file mode 100644 index 00000000..ed734e23 --- /dev/null +++ b/_resources/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/_resources/esx_property/locales/pl.lua b/_resources/esx_property/locales/pl.lua new file mode 100644 index 00000000..eb9428cb --- /dev/null +++ b/_resources/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/_resources/esx_property/locales/pt.lua b/_resources/esx_property/locales/pt.lua new file mode 100644 index 00000000..c0eba25a --- /dev/null +++ b/_resources/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/_resources/esx_property/locales/sv.lua b/_resources/esx_property/locales/sv.lua new file mode 100644 index 00000000..aa609bb1 --- /dev/null +++ b/_resources/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/_resources/esx_property/locales/tr.lua b/_resources/esx_property/locales/tr.lua new file mode 100644 index 00000000..2651cc9b --- /dev/null +++ b/_resources/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/_resources/esx_property/localization/de_esx_property.sql b/_resources/esx_property/localization/de_esx_property.sql new file mode 100644 index 00000000..87ae0e3c --- /dev/null +++ b/_resources/esx_property/localization/de_esx_property.sql @@ -0,0 +1,94 @@ +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`) +); + +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`) +); + +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/_resources/esx_property/localization/en_esx_property.sql b/_resources/esx_property/localization/en_esx_property.sql new file mode 100644 index 00000000..668c39e3 --- /dev/null +++ b/_resources/esx_property/localization/en_esx_property.sql @@ -0,0 +1,94 @@ +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`) +); + +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`) +); + +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/_resources/esx_property/localization/es_esx_property.sql b/_resources/esx_property/localization/es_esx_property.sql new file mode 100644 index 00000000..d24cb0c6 --- /dev/null +++ b/_resources/esx_property/localization/es_esx_property.sql @@ -0,0 +1,94 @@ +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`) +); + +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`) +); + +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/_resources/esx_property/localization/fi_esx_property.sql b/_resources/esx_property/localization/fi_esx_property.sql new file mode 100644 index 00000000..e7b65a62 --- /dev/null +++ b/_resources/esx_property/localization/fi_esx_property.sql @@ -0,0 +1,94 @@ +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`) +); + +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`) +); + +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/_resources/esx_property/localization/pl_esx_property.sql b/_resources/esx_property/localization/pl_esx_property.sql new file mode 100644 index 00000000..3df008e1 --- /dev/null +++ b/_resources/esx_property/localization/pl_esx_property.sql @@ -0,0 +1,94 @@ +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`) +); + +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`) +); + +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/_resources/esx_property/offices.sql b/_resources/esx_property/offices.sql new file mode 100644 index 00000000..3c7ec94f --- /dev/null +++ b/_resources/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/_resources/esx_property/server/main.lua b/_resources/esx_property/server/main.lua new file mode 100644 index 00000000..ab9e1b00 --- /dev/null +++ b/_resources/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)