diff --git a/qb-inventory.rar b/qb-inventory.rar
deleted file mode 100644
index 6f508ec..0000000
Binary files a/qb-inventory.rar and /dev/null differ
diff --git a/qb-inventory/!Custom Image Creator Guideline/lj-inventory Guideline.psd b/qb-inventory/!Custom Image Creator Guideline/lj-inventory Guideline.psd
new file mode 100644
index 0000000..4578c2d
Binary files /dev/null and b/qb-inventory/!Custom Image Creator Guideline/lj-inventory Guideline.psd differ
diff --git a/qb-inventory/LICENSE b/qb-inventory/LICENSE
new file mode 100644
index 0000000..f288702
--- /dev/null
+++ b/qb-inventory/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.
+
+
+ Copyright (C)
+
+ 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:
+
+ Copyright (C)
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+.
diff --git a/qb-inventory/README.md b/qb-inventory/README.md
new file mode 100644
index 0000000..7fa402a
--- /dev/null
+++ b/qb-inventory/README.md
@@ -0,0 +1,114 @@
+# PS-Inventory
+
+lj-Inventory has been fully redesigned by [OK1ez](https://github.com/OK1ez), under the name ps-inventory.
+
+Future updates will be coming and we will of course support all normal monitor sizes.
+
+# Previews
+
+### Simple item guidelines (found in main directory ps-inventory)
+
+
+
+### Full Inventory
+
+
+
+### Options Menu
+
+
+
+### Hotbar Slots
+
+
+
+### Inventory Glovebox
+
+
+
+### Inventory Trunk
+
+
+
+# Key Features
+
+* ALL IMAGES FOLLOW THE SAME DIMENSIONS
+* Easy Photoshop guideline template for creating custom images within ps-inventory
+* Custom brand logo above option buttons
+* Options menu
+* Help box
+* Custom inventory images (more always being added in each new update)
+* Default weight icon easily changeable with Font Awesome icons
+* Hotkey numbers visible in inventory and hotbar slots
+* Weight progress bar
+* Tooltip has a determined height (so it won't ever go higher than visible or cut off)
+* Text overflow ellipsis used (so your product titles with never overlap the containers and instead do "...")
+* Blurred inventory background
+* Elements of NoPixel 3.5 design ideas interwoven
+
+# How to install ps-inventory (Latest QBCore Update)
+
+* Download `ps-inventory` from our GitHub
+* Make sure you have the latest update of [qb-core](https://github.com/qbcore-framework/qb-core)
+* Make sure you have the latest update of [qb-smallresources](https://github.com/qbcore-framework/qb-smallresources)
+* Make sure you have the latest update of [qb-weapons](https://github.com/qbcore-framework/qb-weapons)
+* Drag `ps-inventory` into your resources folder or any subfolder
+* Make sure that the folder is named `ps-inventory` and **not** `ps-inventory-main`
+* Replace all occurrences of `qb-inventory` with `ps-inventory`. The example below uses Visual Studio Code to replace all instances.
+
+
+
+## Set up the decay system
+
+If you want the decay system to work, then please read the information below, otherwise it won't work.
+
+You need to add a decay value for all items in your `qb-core/shared/items.lua` file, the variable stands for the number of days it takes to decay.
+
+### Examples:
+
+#### Example of what you have to add
+
+```lua
+-- decay = The number of days it takes for an item to decay
+-- delete = If set to true, the item will be removed once it decays
+["decay"] = 28.0, ["delete"] = true
+```
+
+#### Example with the full item in QB-Core's shared file
+
+```lua
+['sandwich'] = {['name'] = 'sandwich', ['label'] = 'Sandwich', ['weight'] = 200, ['type'] = 'item', ['image'] = 'sandwich.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Nice bread for your stomach', ["decay"] = 3.0, ["delete"] = true},
+```
+
+In this example, the sandwich item would take 3 days to decay and once it does, it would be removed.
+
+# Dependencies
+
+* [qbcore framework](https://github.com/qbcore-framework)
+* [qb-target](https://github.com/BerkieBb/qb-target)
+* [qb-core](https://github.com/qbcore-framework/qb-core)
+* [qb-logs](https://github.com/qbcore-framework/qb-logs)
+* [qb-traphouse](https://github.com/qbcore-framework/qb-traphouse)
+* [qb-radio](https://github.com/qbcore-framework/qb-radio)
+* [qb-drugs](https://github.com/qbcore-framework/qb-drugs)
+* [qb-shops](https://github.com/qbcore-framework/qb-shops)
+
+## Performance
+
+Runs at ~ 0.00 to 0.01 ms if you have more optimization suggestions feel free to reach out
+
+# Credits
+
+* [OK1ez](https://github.com/OK1ez) for full redesign.
+* ihyajb (Aj) for [original version](https://github.com/ihyajb/aj-inventory)
+* Jay for [decay](https://github.com/tnj-development/inventory)
+* i-kulgu for [updated decay](https://github.com/i-kulgu/qb-inventory-decay)
+* [OnlyCats](https://github.com/onlycats) who helped reorganize and also created some custom images.
+
+# Issues and Suggestions
+
+Please use the GitHub issues system to report issues or make suggestions, when making suggestions, please keep [Suggestion] in the title to make it clear that it is a suggestion.
+
+## Connect with us
+
+Join our [**Discord**](https://discord.gg/projectsloth) for updates, support, and special early testing!
diff --git a/qb-inventory/client/main.lua b/qb-inventory/client/main.lua
new file mode 100644
index 0000000..2b225f6
--- /dev/null
+++ b/qb-inventory/client/main.lua
@@ -0,0 +1,1107 @@
+-- Variables
+local QBCore = exports['qb-core']:GetCoreObject()
+local PlayerData = QBCore.Functions.GetPlayerData()
+local inInventory = false
+local currentWeapon = nil
+local currentOtherInventory = nil
+local Drops = {}
+local CurrentDrop = nil
+local DropsNear = {}
+local CurrentVehicle = nil
+local CurrentGlovebox = nil
+local CurrentStash = nil
+local isCrafting = false
+local isHotbar = false
+local WeaponAttachments = {}
+local showBlur = true
+
+local function HasItem(items, amount)
+ local isTable = type(items) == 'table'
+ local isArray = isTable and table.type(items) == 'array' or false
+ local totalItems = #items
+ local count = 0
+ local kvIndex = 2
+ if isTable and not isArray then
+ totalItems = 0
+ for _ in pairs(items) do totalItems += 1 end
+ kvIndex = 1
+ end
+ for _, itemData in pairs(PlayerData.items) do
+ if isTable then
+ for k, v in pairs(items) do
+ local itemKV = {k, v}
+ if itemData and itemData.name == itemKV[kvIndex] and ((amount and itemData.amount >= amount) or (not isArray and itemData.amount >= v) or (not amount and isArray)) then
+ count += 1
+ end
+ end
+ if count == totalItems then
+ return true
+ end
+ else -- Single item as string
+ if itemData and itemData.name == items and (not amount or (itemData and amount and itemData.amount >= amount)) then
+ return true
+ end
+ end
+ end
+ return false
+end
+
+exports("HasItem", HasItem)
+
+RegisterNUICallback('showBlur', function()
+ Wait(50)
+ TriggerEvent("qb-inventory:client:showBlur")
+end)
+RegisterNetEvent("qb-inventory:client:showBlur", function()
+ Wait(50)
+ showBlur = not showBlur
+end)
+
+-- Functions
+
+local function GetClosestVending()
+ local ped = PlayerPedId()
+ local pos = GetEntityCoords(ped)
+ local object = nil
+ for _, machine in pairs(Config.VendingObjects) do
+ local ClosestObject = GetClosestObjectOfType(pos.x, pos.y, pos.z, 0.75, GetHashKey(machine), 0, 0, 0)
+ if ClosestObject ~= 0 then
+ if object == nil then
+ object = ClosestObject
+ end
+ end
+ end
+ return object
+end
+
+local function OpenVending()
+ local ShopItems = {}
+ ShopItems.label = "Vending Machine"
+ ShopItems.items = Config.VendingItem
+ ShopItems.slots = #Config.VendingItem
+ TriggerServerEvent("inventory:server:OpenInventory", "shop", "Vendingshop_"..math.random(1, 99), ShopItems)
+end
+
+local function DrawText3Ds(x, y, z, text)
+ SetTextScale(0.35, 0.35)
+ SetTextFont(4)
+ SetTextProportional(1)
+ SetTextColour(255, 255, 255, 215)
+ SetTextEntry("STRING")
+ SetTextCentre(true)
+ AddTextComponentString(text)
+ SetDrawOrigin(x,y,z, 0)
+ DrawText(0.0, 0.0)
+ local factor = (string.len(text)) / 370
+ DrawRect(0.0, 0.0+0.0125, 0.017+ factor, 0.03, 0, 0, 0, 75)
+ ClearDrawOrigin()
+end
+
+local function LoadAnimDict(dict)
+ if HasAnimDictLoaded(dict) then return end
+
+ RequestAnimDict(dict)
+ while not HasAnimDictLoaded(dict) do
+ Wait(10)
+ end
+end
+
+local function FormatWeaponAttachments(itemdata)
+ local attachments = {}
+ itemdata.name = itemdata.name:upper()
+ if itemdata.info.attachments ~= nil and next(itemdata.info.attachments) ~= nil then
+ for _, v in pairs(itemdata.info.attachments) do
+ attachments[#attachments+1] = {
+ attachment = v.item,
+ label = v.label,
+ image = QBCore.Shared.Items[v.item].image,
+ component = v.component
+ }
+ end
+ end
+ return attachments
+end
+
+local function IsBackEngine(vehModel)
+ return BackEngineVehicles[vehModel]
+end
+
+
+local function OpenTrunk()
+ local vehicle = QBCore.Functions.GetClosestVehicle()
+ LoadAnimDict("amb@prop_human_bum_bin@idle_b")
+ TaskPlayAnim(PlayerPedId(), "amb@prop_human_bum_bin@idle_b", "idle_d", 4.0, 4.0, -1, 50, 0, false, false, false)
+ if IsBackEngine(GetEntityModel(vehicle)) then
+ SetVehicleDoorOpen(vehicle, 4, false, false)
+ else
+ SetVehicleDoorOpen(vehicle, 5, false, false)
+ end
+end
+
+---Closes the trunk of the closest vehicle
+local function CloseTrunk()
+ local vehicle = QBCore.Functions.GetClosestVehicle()
+ LoadAnimDict("amb@prop_human_bum_bin@idle_b")
+ TaskPlayAnim(PlayerPedId(), "amb@prop_human_bum_bin@idle_b", "exit", 4.0, 4.0, -1, 50, 0, false, false, false)
+ if IsBackEngine(GetEntityModel(vehicle)) then
+ SetVehicleDoorShut(vehicle, 4, false)
+ else
+ SetVehicleDoorShut(vehicle, 5, false)
+ end
+end
+
+---Closes the inventory NUI
+local function closeInventory()
+ SendNUIMessage({
+ action = "close",
+ })
+end
+
+local function ToggleHotbar(toggle)
+ local HotbarItems = {
+ [1] = PlayerData.items[1],
+ [2] = PlayerData.items[2],
+ [3] = PlayerData.items[3],
+ [4] = PlayerData.items[4],
+ [5] = PlayerData.items[5],
+ [41] = PlayerData.items[41],
+ }
+
+ SendNUIMessage({
+ action = "toggleHotbar",
+ open = toggle,
+ items = HotbarItems
+ })
+end
+
+
+local function openAnim()
+ local ped = PlayerPedId()
+ LoadAnimDict('pickup_object')
+ TaskPlayAnim(ped,'pickup_object', 'putdown_low', 5.0, 1.5, 1.0, 48, 0.0, 0, 0, 0)
+ Wait(500)
+ StopAnimTask(ped, 'pickup_object', 'putdown_low', 1.0)
+end
+
+local function ItemsToItemInfo()
+ local item_count = 0
+ for _, _ in pairs(Config.CraftingItems) do
+ item_count = item_count + 1
+ end
+
+ local itemInfos = {}
+
+ for i = 1, item_count do
+ local ex_string = ""
+
+ for key, value in pairs(Config.CraftingItems[i].costs) do
+ ex_string = ex_string .. QBCore.Shared.Items[key]["label"] .. ": " .. value .. "x "
+ end
+
+ itemInfos[i] = { costs = ex_string }
+ end
+
+ local items = {}
+ for _, item in pairs(Config.CraftingItems) do
+ local itemInfo = QBCore.Shared.Items[item.name:lower()]
+ items[item.slot] = {
+ name = itemInfo["name"],
+ amount = tonumber(item.amount),
+ info = itemInfos[item.slot],
+ label = itemInfo["label"],
+ description = itemInfo["description"] or "",
+ weight = itemInfo["weight"],
+ type = itemInfo["type"],
+ unique = itemInfo["unique"],
+ useable = itemInfo["useable"],
+ image = itemInfo["image"],
+ slot = item.slot,
+ costs = item.costs,
+ threshold = item.threshold,
+ points = item.points,
+ }
+ end
+ Config.CraftingItems = items
+end
+
+local function SetupAttachmentItemsInfo()
+ local item_count = 0
+ for _, _ in pairs(Config.AttachmentCrafting) do
+ item_count = item_count + 1
+ end
+
+ local itemInfos = {}
+
+ for i = 1, item_count do
+ local ex_string = ""
+
+ for key, value in pairs(Config.AttachmentCrafting[i].costs) do
+ ex_string = ex_string .. QBCore.Shared.Items[key]["label"] .. ": " .. value .. "x "
+ end
+
+ itemInfos[i] = { costs = ex_string }
+ end
+
+ local items = {}
+ for _, item in pairs(Config.AttachmentCrafting) do
+ local itemInfo = QBCore.Shared.Items[item.name:lower()]
+ items[item.slot] = {
+ name = itemInfo["name"],
+ amount = tonumber(item.amount),
+ info = itemInfos[item.slot],
+ label = itemInfo["label"],
+ description = itemInfo["description"] or "",
+ weight = itemInfo["weight"],
+ unique = itemInfo["unique"],
+ useable = itemInfo["useable"],
+ image = itemInfo["image"],
+ slot = item.slot,
+ costs = item.costs,
+ threshold = item.threshold,
+ points = item.points,
+ }
+ end
+ Config.AttachmentCrafting = items
+end
+
+
+local function GetThresholdItems()
+ ItemsToItemInfo()
+ local items = {}
+ for k in pairs(Config.CraftingItems) do
+ if PlayerData.metadata["craftingrep"] >= Config.CraftingItems[k].threshold then
+ items[k] = Config.CraftingItems[k]
+ end
+ end
+ return items
+end
+
+
+local function GetAttachmentThresholdItems()
+ SetupAttachmentItemsInfo()
+ local items = {}
+ for k in pairs(Config.AttachmentCrafting) do
+ if PlayerData.metadata["attachmentcraftingrep"] >= Config.AttachmentCrafting[k].threshold then
+ items[k] = Config.AttachmentCrafting[k]
+ end
+ end
+ return items
+end
+
+local function RemoveNearbyDrop(index)
+ if not DropsNear[index] then return end
+
+ local dropItem = DropsNear[index].object
+ if DoesEntityExist(dropItem) then
+ DeleteEntity(dropItem)
+ end
+
+ DropsNear[index] = nil
+
+ if not Drops[index] then return end
+
+ Drops[index].object = nil
+ Drops[index].isDropShowing = nil
+end
+
+---Removes all drops in the area of the client
+local function RemoveAllNearbyDrops()
+ for k in pairs(DropsNear) do
+ RemoveNearbyDrop(k)
+ end
+end
+
+
+local function CreateItemDrop(index)
+ local dropItem = CreateObject(Config.ItemDropObject, DropsNear[index].coords.x, DropsNear[index].coords.y, DropsNear[index].coords.z, false, false, false)
+ DropsNear[index].object = dropItem
+ DropsNear[index].isDropShowing = true
+ PlaceObjectOnGroundProperly(dropItem)
+ FreezeEntityPosition(dropItem, true)
+ if Config.UseTarget then
+ exports['qb-target']:AddTargetEntity(dropItem, {
+ options = {
+ {
+ icon = 'fa-solid fa-bag-shopping',
+ label = "Open Bag",
+ action = function()
+ TriggerServerEvent("inventory:server:OpenInventory", "drop", index)
+ end,
+ }
+ },
+ distance = 2.5,
+ })
+ end
+end
+
+-- Events
+
+RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function()
+ LocalPlayer.state:set("inv_busy", false, true)
+ PlayerData = QBCore.Functions.GetPlayerData()
+ QBCore.Functions.TriggerCallback("inventory:server:GetCurrentDrops", function(theDrops)
+ Drops = theDrops
+ end)
+end)
+
+RegisterNetEvent('QBCore:Client:OnPlayerUnload', function()
+ LocalPlayer.state:set("inv_busy", true, true)
+ PlayerData = {}
+ RemoveAllNearbyDrops()
+end)
+
+RegisterNetEvent('QBCore:Client:UpdateObject', function()
+ QBCore = exports['qb-core']:GetCoreObject()
+end)
+
+RegisterNetEvent('QBCore:Player:SetPlayerData', function(val)
+ PlayerData = val
+end)
+
+AddEventHandler('onResourceStop', function(name)
+ if name ~= GetCurrentResourceName() then return end
+ if Config.UseItemDrop then RemoveAllNearbyDrops() end
+end)
+
+RegisterNetEvent('inventory:client:CheckOpenState', function(type, id, label)
+ local name = QBCore.Shared.SplitStr(label, "-")[2]
+ if type == "stash" then
+ if name ~= CurrentStash or CurrentStash == nil then
+ TriggerServerEvent('inventory:server:SetIsOpenState', false, type, id)
+ end
+ elseif type == "trunk" then
+ if name ~= CurrentVehicle or CurrentVehicle == nil then
+ TriggerServerEvent('inventory:server:SetIsOpenState', false, type, id)
+ end
+ elseif type == "glovebox" then
+ if name ~= CurrentGlovebox or CurrentGlovebox == nil then
+ TriggerServerEvent('inventory:server:SetIsOpenState', false, type, id)
+ end
+ elseif type == "drop" then
+ if name ~= CurrentDrop or CurrentDrop == nil then
+ TriggerServerEvent('inventory:server:SetIsOpenState', false, type, id)
+ end
+ end
+end)
+
+RegisterNetEvent('inventory:client:ItemBox', function(itemData, type, amount)
+ amount = amount or 1
+ SendNUIMessage({
+ action = "itemBox",
+ item = itemData,
+ type = type,
+ itemAmount = amount
+ })
+end)
+
+RegisterNetEvent('inventory:client:requiredItems', function(items, bool)
+ local itemTable = {}
+ if bool then
+ for k in pairs(items) do
+ itemTable[#itemTable+1] = {
+ item = items[k].name,
+ label = QBCore.Shared.Items[items[k].name]["label"],
+ image = items[k].image,
+ }
+ end
+ end
+
+ SendNUIMessage({
+ action = "requiredItem",
+ items = itemTable,
+ toggle = bool
+ })
+end)
+
+RegisterNetEvent('inventory:server:RobPlayer', function(TargetId)
+ SendNUIMessage({
+ action = "RobMoney",
+ TargetId = TargetId,
+ })
+end)
+
+RegisterNetEvent('inventory:client:OpenInventory', function(PlayerAmmo, inventory, other)
+ if not IsEntityDead(PlayerPedId()) then
+ if Config.Progressbar.Enable then
+ QBCore.Functions.Progressbar('open_inventory', 'Opening Inventory...', math.random(Config.Progressbar.minT, Config.Progressbar.maxT), false, true, { -- Name | Label | Time | useWhileDead | canCancel
+ disableMovement = false,
+ disableCarMovement = false,
+ disableMouse = false,
+ disableCombat = false,
+ }, {}, {}, {}, function() -- Play When Done
+ ToggleHotbar(false)
+ if showBlur == true then
+ TriggerScreenblurFadeIn(1000)
+ end
+ SetNuiFocus(true, true)
+ if other then
+ currentOtherInventory = other.name
+ end
+ QBCore.Functions.TriggerCallback('inventory:server:ConvertQuality', function(data)
+ inventory = data.inventory
+ other = data.other
+ SendNUIMessage({
+ action = "open",
+ inventory = inventory,
+ slots = Config.MaxInventorySlots,
+ other = other,
+ maxweight = Config.MaxInventoryWeight,
+ Ammo = PlayerAmmo,
+ maxammo = Config.MaximumAmmoValues,
+ Name = PlayerData.charinfo.firstname .." ".. PlayerData.charinfo.lastname .." - [".. GetPlayerServerId(PlayerId()) .."]",
+ })
+ inInventory = true
+ end, inventory, other)
+
+ end)
+ else
+ Wait(500)
+ ToggleHotbar(false)
+ if showBlur == true then
+ TriggerScreenblurFadeIn(1000)
+ end
+ SetNuiFocus(true, true)
+ if other then
+ currentOtherInventory = other.name
+ end
+ QBCore.Functions.TriggerCallback('inventory:server:ConvertQuality', function(data)
+ inventory = data.inventory
+ other = data.other
+ SendNUIMessage({
+ action = "open",
+ inventory = inventory,
+ slots = Config.MaxInventorySlots,
+ other = other,
+ maxweight = Config.MaxInventoryWeight,
+ Ammo = PlayerAmmo,
+ maxammo = Config.MaximumAmmoValues,
+ Name = PlayerData.charinfo.firstname .." ".. PlayerData.charinfo.lastname .." - [".. GetPlayerServerId(PlayerId()) .."]",
+ })
+ inInventory = true
+ end,inventory,other)
+ end
+ end
+end)
+
+RegisterNetEvent('inventory:client:UpdateOtherInventory', function(items, isError)
+ SendNUIMessage({
+ action = "update",
+ inventory = items,
+ maxweight = Config.MaxInventoryWeight,
+ slots = Config.MaxInventorySlots,
+ error = isError,
+ })
+end)
+
+RegisterNetEvent('inventory:client:UpdatePlayerInventory', function(isError)
+ SendNUIMessage({
+ action = "update",
+ inventory = PlayerData.items,
+ maxweight = Config.MaxInventoryWeight,
+ slots = Config.MaxInventorySlots,
+ error = isError,
+ })
+end)
+
+RegisterNetEvent('inventory:client:CraftItems', function(itemName, itemCosts, amount, toSlot, points)
+ local ped = PlayerPedId()
+ SendNUIMessage({
+ action = "close",
+ })
+ isCrafting = true
+ QBCore.Functions.Progressbar("repair_vehicle", "Crafting..", (math.random(2000, 5000) * amount), false, true, {
+ disableMovement = true,
+ disableCarMovement = true,
+ disableMouse = false,
+ disableCombat = true,
+ }, {
+ animDict = "mini@repair",
+ anim = "fixing_a_player",
+ flags = 16,
+ }, {}, {}, function() -- Done
+ StopAnimTask(ped, "mini@repair", "fixing_a_player", 1.0)
+ TriggerServerEvent("inventory:server:CraftItems", itemName, itemCosts, amount, toSlot, points)
+ TriggerEvent('inventory:client:ItemBox', QBCore.Shared.Items[itemName], 'add')
+ isCrafting = false
+ end, function() -- Cancel
+ StopAnimTask(ped, "mini@repair", "fixing_a_player", 1.0)
+ QBCore.Functions.Notify("Failed", "error")
+ isCrafting = false
+ end)
+end)
+
+RegisterNetEvent('inventory:client:CraftAttachment', function(itemName, itemCosts, amount, toSlot, points)
+ local ped = PlayerPedId()
+ SendNUIMessage({
+ action = "close",
+ })
+ isCrafting = true
+ QBCore.Functions.Progressbar("repair_vehicle", "Crafting..", (math.random(2000, 5000) * amount), false, true, {
+ disableMovement = true,
+ disableCarMovement = true,
+ disableMouse = false,
+ disableCombat = true,
+ }, {
+ animDict = "mini@repair",
+ anim = "fixing_a_player",
+ flags = 16,
+ }, {}, {}, function() -- Done
+ StopAnimTask(ped, "mini@repair", "fixing_a_player", 1.0)
+ TriggerServerEvent("inventory:server:CraftAttachment", itemName, itemCosts, amount, toSlot, points)
+ TriggerEvent('inventory:client:ItemBox', QBCore.Shared.Items[itemName], 'add')
+ isCrafting = false
+ end, function() -- Cancel
+ StopAnimTask(ped, "mini@repair", "fixing_a_player", 1.0)
+ QBCore.Functions.Notify("Failed", "error")
+ isCrafting = false
+ end)
+end)
+
+RegisterNetEvent('inventory:client:PickupSnowballs', function()
+ local ped = PlayerPedId()
+ LoadAnimDict('anim@mp_snowball')
+ TaskPlayAnim(ped, 'anim@mp_snowball', 'pickup_snowball', 3.0, 3.0, -1, 0, 1, 0, 0, 0)
+ QBCore.Functions.Progressbar("pickupsnowball", "Collecting snowballs..", 1500, false, true, {
+ disableMovement = true,
+ disableCarMovement = true,
+ disableMouse = false,
+ disableCombat = true,
+ }, {}, {}, {}, function() -- Done
+ ClearPedTasks(ped)
+ TriggerServerEvent('inventory:server:snowball', 'add')
+ TriggerEvent('inventory:client:ItemBox', QBCore.Shared.Items["snowball"], "add")
+ end, function() -- Cancel
+ ClearPedTasks(ped)
+ QBCore.Functions.Notify("Canceled", "error")
+ end)
+end)
+
+RegisterNetEvent('inventory:client:UseSnowball', function(amount)
+ local ped = PlayerPedId()
+ GiveWeaponToPed(ped, `weapon_snowball`, amount, false, false)
+ SetPedAmmo(ped, `weapon_snowball`, amount)
+ SetCurrentPedWeapon(ped, `weapon_snowball`, true)
+end)
+
+RegisterNetEvent('inventory:client:UseWeapon', function(weaponData, shootbool)
+ local ped = PlayerPedId()
+ local weaponName = tostring(weaponData.name)
+ local weaponHash = joaat(weaponData.name)
+ local weaponinhand = GetCurrentPedWeapon(PlayerPedId())
+ if currentWeapon == weaponName and weaponinhand then
+ TriggerEvent('weapons:client:DrawWeapon', nil)
+ SetCurrentPedWeapon(ped, `WEAPON_UNARMED`, true)
+ RemoveAllPedWeapons(ped, true)
+ TriggerEvent('weapons:client:SetCurrentWeapon', nil, shootbool)
+ currentWeapon = nil
+ elseif weaponName == "weapon_stickybomb" or weaponName == "weapon_pipebomb" or weaponName == "weapon_smokegrenade" or weaponName == "weapon_flare" or weaponName == "weapon_proxmine" or weaponName == "weapon_ball" or weaponName == "weapon_molotov" or weaponName == "weapon_grenade" or weaponName == "weapon_bzgas" then
+ TriggerEvent('weapons:client:DrawWeapon', weaponName)
+ GiveWeaponToPed(ped, weaponHash, 1, false, false)
+ SetPedAmmo(ped, weaponHash, 1)
+ SetCurrentPedWeapon(ped, weaponHash, true)
+ TriggerEvent('weapons:client:SetCurrentWeapon', weaponData, shootbool)
+ currentWeapon = weaponName
+ elseif weaponName == "weapon_snowball" then
+ TriggerEvent('weapons:client:DrawWeapon', weaponName)
+ GiveWeaponToPed(ped, weaponHash, 10, false, false)
+ SetPedAmmo(ped, weaponHash, 10)
+ SetCurrentPedWeapon(ped, weaponHash, true)
+ TriggerServerEvent('inventory:server:snowball', 'remove')
+ TriggerEvent('weapons:client:SetCurrentWeapon', weaponData, shootbool)
+ currentWeapon = weaponName
+ else
+ TriggerEvent('weapons:client:DrawWeapon', weaponName)
+ TriggerEvent('weapons:client:SetCurrentWeapon', weaponData, shootbool)
+ local ammo = tonumber(weaponData.info.ammo) or 0
+
+ if weaponName == "weapon_fireextinguisher" then
+ ammo = 4000
+ end
+
+ GiveWeaponToPed(ped, weaponHash, ammo, false, false)
+ SetPedAmmo(ped, weaponHash, ammo)
+ SetCurrentPedWeapon(ped, weaponHash, true)
+
+ if weaponData.info.attachments then
+ for _, attachment in pairs(weaponData.info.attachments) do
+ GiveWeaponComponentToPed(ped, weaponHash, joaat(attachment.component))
+ end
+ end
+
+ currentWeapon = weaponName
+ end
+end)
+
+RegisterNetEvent('inventory:client:CheckWeapon', function(weaponName)
+ if currentWeapon ~= weaponName:lower() then return end
+ local ped = PlayerPedId()
+ TriggerEvent('weapons:ResetHolster')
+ SetCurrentPedWeapon(ped, `WEAPON_UNARMED`, true)
+ RemoveAllPedWeapons(ped, true)
+ currentWeapon = nil
+end)
+
+RegisterNetEvent('inventory:client:AddDropItem', function(dropId, player, coords)
+ local forward = GetEntityForwardVector(GetPlayerPed(GetPlayerFromServerId(player)))
+ local x, y, z = table.unpack(coords + forward * 0.5)
+ Drops[dropId] = {
+ id = dropId,
+ coords = {
+ x = x,
+ y = y,
+ z = z - 0.3,
+ },
+ }
+end)
+
+RegisterNetEvent('inventory:client:RemoveDropItem', function(dropId)
+ Drops[dropId] = nil
+ if Config.UseItemDrop then
+ RemoveNearbyDrop(dropId)
+ else
+ DropsNear[dropId] = nil
+ end
+end)
+
+RegisterNetEvent('inventory:client:DropItemAnim', function()
+ local ped = PlayerPedId()
+ SendNUIMessage({
+ action = "close",
+ })
+ RequestAnimDict("pickup_object")
+ while not HasAnimDictLoaded("pickup_object") do
+ Wait(7)
+ end
+ TaskPlayAnim(ped, "pickup_object" ,"pickup_low" ,8.0, -8.0, -1, 1, 0, false, false, false )
+ Wait(2000)
+ ClearPedTasks(ped)
+end)
+
+RegisterNetEvent('inventory:client:SetCurrentStash', function(stash)
+ CurrentStash = stash
+end)
+
+
+RegisterNetEvent('inventory:client:craftTarget',function()
+ local crafting = {}
+ crafting.label = "Crafting"
+ crafting.items = GetThresholdItems()
+ TriggerServerEvent("inventory:server:OpenInventory", "crafting", math.random(1, 99), crafting)
+end)
+
+-- Commands
+
+RegisterCommand('closeinv', function()
+ closeInventory()
+end, false)
+
+RegisterNetEvent("qb-inventory:client:closeinv", function()
+ closeInventory()
+end)
+
+RegisterCommand('inventory', function()
+ if IsNuiFocused() then return end
+ if not isCrafting and not inInventory then
+ if not PlayerData.metadata["isdead"] and not PlayerData.metadata["inlaststand"] and not PlayerData.metadata["ishandcuffed"] and not IsPauseMenuActive() then
+ local ped = PlayerPedId()
+ local curVeh = nil
+ local VendingMachine = nil
+ if not Config.UseTarget then VendingMachine = GetClosestVending() end
+
+ if IsPedInAnyVehicle(ped, false) then -- Is Player In Vehicle
+ local vehicle = GetVehiclePedIsIn(ped, false)
+ CurrentGlovebox = QBCore.Functions.GetPlate(vehicle)
+ curVeh = vehicle
+ CurrentVehicle = nil
+ else
+ local vehicle = QBCore.Functions.GetClosestVehicle()
+ if vehicle ~= 0 and vehicle ~= nil then
+ local pos = GetEntityCoords(ped)
+ local dimensionMin, dimensionMax = GetModelDimensions(GetEntityModel(vehicle))
+ local trunkpos = GetOffsetFromEntityInWorldCoords(vehicle, 0.0, (dimensionMin.y), 0.0)
+ if (IsBackEngine(GetEntityModel(vehicle))) then
+ trunkpos = GetOffsetFromEntityInWorldCoords(vehicle, 0.0, (dimensionMax.y), 0.0)
+ end
+ if #(pos - trunkpos) < 1.5 and not IsPedInAnyVehicle(ped) then
+ if GetVehicleDoorLockStatus(vehicle) < 2 then
+ CurrentVehicle = QBCore.Functions.GetPlate(vehicle)
+ curVeh = vehicle
+ CurrentGlovebox = nil
+ else
+ QBCore.Functions.Notify("Vehicle locked.", "error")
+ return
+ end
+ else
+ CurrentVehicle = nil
+ end
+ else
+ CurrentVehicle = nil
+ end
+ end
+
+ if CurrentVehicle then -- Trunk
+ local vehicleClass = GetVehicleClass(curVeh)
+ local maxweight
+ local slots
+ if vehicleClass == 0 then
+ maxweight = 38000
+ slots = 30
+ elseif vehicleClass == 1 then
+ maxweight = 50000
+ slots = 40
+ elseif vehicleClass == 2 then
+ maxweight = 75000
+ slots = 50
+ elseif vehicleClass == 3 then
+ maxweight = 42000
+ slots = 35
+ elseif vehicleClass == 4 then
+ maxweight = 38000
+ slots = 30
+ elseif vehicleClass == 5 then
+ maxweight = 30000
+ slots = 25
+ elseif vehicleClass == 6 then
+ maxweight = 30000
+ slots = 25
+ elseif vehicleClass == 7 then
+ maxweight = 30000
+ slots = 25
+ elseif vehicleClass == 8 then
+ maxweight = 15000
+ slots = 15
+ elseif vehicleClass == 9 then
+ maxweight = 60000
+ slots = 35
+ elseif vehicleClass == 12 then
+ maxweight = 120000
+ slots = 35
+ elseif vehicleClass == 13 then
+ maxweight = 0
+ slots = 0
+ elseif vehicleClass == 14 then
+ maxweight = 120000
+ slots = 50
+ elseif vehicleClass == 15 then
+ maxweight = 120000
+ slots = 50
+ elseif vehicleClass == 16 then
+ maxweight = 120000
+ slots = 50
+ else
+ maxweight = 60000
+ slots = 35
+ end
+ local other = {
+ maxweight = maxweight,
+ slots = slots,
+ }
+ TriggerServerEvent("inventory:server:OpenInventory", "trunk", CurrentVehicle, other)
+ OpenTrunk()
+ elseif CurrentGlovebox then
+ TriggerServerEvent("inventory:server:OpenInventory", "glovebox", CurrentGlovebox)
+ elseif CurrentDrop ~= 0 then
+ TriggerServerEvent("inventory:server:OpenInventory", "drop", CurrentDrop)
+ elseif VendingMachine then
+ local ShopItems = {}
+ ShopItems.label = "Vending Machine"
+ ShopItems.items = Config.VendingItem
+ ShopItems.slots = #Config.VendingItem
+ TriggerServerEvent("inventory:server:OpenInventory", "shop", "Vendingshop_"..math.random(1, 99), ShopItems)
+ else
+ openAnim()
+ TriggerServerEvent("inventory:server:OpenInventory")
+ end
+ end
+ end
+end, false)
+
+RegisterKeyMapping('inventory', 'Open Inventory', 'keyboard', 'TAB')
+
+RegisterCommand('hotbar', function()
+ isHotbar = not isHotbar
+ if not PlayerData.metadata["isdead"] and not PlayerData.metadata["inlaststand"] and not PlayerData.metadata["ishandcuffed"] and not IsPauseMenuActive() then
+ ToggleHotbar(isHotbar)
+ end
+end)
+
+RegisterKeyMapping('hotbar', 'Toggles keybind slots', 'keyboard', 'z')
+
+for i = 1, 6 do
+ RegisterCommand('slot' .. i,function()
+ if not PlayerData.metadata["isdead"] and not PlayerData.metadata["inlaststand"] and not PlayerData.metadata["ishandcuffed"] and not IsPauseMenuActive() and not LocalPlayer.state.inv_busy then
+ if i == 6 then
+ i = Config.MaxInventorySlots
+ end
+ TriggerServerEvent("inventory:server:UseItemSlot", i)
+ end
+ end, false)
+ RegisterKeyMapping('slot' .. i, 'Uses the item in slot ' .. i, 'keyboard', i)
+end
+
+RegisterNetEvent('qb-inventory:client:giveAnim', function()
+ LoadAnimDict('mp_common')
+ TaskPlayAnim(PlayerPedId(), 'mp_common', 'givetake1_b', 8.0, 1.0, -1, 16, 0, 0, 0, 0)
+end)
+
+-- NUI
+
+RegisterNUICallback('RobMoney', function(data, cb)
+ TriggerServerEvent("police:server:RobPlayer", data.TargetId)
+ cb('ok')
+end)
+
+RegisterNUICallback('Notify', function(data, cb)
+ QBCore.Functions.Notify(data.message, data.type)
+ cb('ok')
+end)
+
+RegisterNUICallback('GetWeaponData', function(cData, cb)
+ local data = {
+ WeaponData = QBCore.Shared.Items[cData.weapon],
+ AttachmentData = FormatWeaponAttachments(cData.ItemData)
+ }
+ cb(data)
+end)
+
+RegisterNUICallback('RemoveAttachment', function(data, cb)
+ local ped = PlayerPedId()
+ local WeaponData = QBCore.Shared.Items[data.WeaponData.name]
+ print(data.AttachmentData.attachment:gsub("(.*).*_",''))
+ data.AttachmentData.attachment = data.AttachmentData.attachment:gsub("(.*).*_",'')
+ QBCore.Functions.TriggerCallback('weapons:server:RemoveAttachment', function(NewAttachments)
+ if NewAttachments ~= false then
+ local attachments = {}
+ RemoveWeaponComponentFromPed(ped, GetHashKey(data.WeaponData.name), GetHashKey(data.AttachmentData.component))
+ for _, v in pairs(NewAttachments) do
+ attachments[#attachments+1] = {
+ attachment = v.item,
+ label = v.label,
+ image = QBCore.Shared.Items[v.item].image
+ }
+ end
+ local DJATA = {
+ Attachments = attachments,
+ WeaponData = WeaponData,
+ }
+ cb(DJATA)
+ else
+ RemoveWeaponComponentFromPed(ped, GetHashKey(data.WeaponData.name), GetHashKey(data.AttachmentData.component))
+ cb({})
+ end
+ end, data.AttachmentData, data.WeaponData)
+end)
+
+RegisterNUICallback('getCombineItem', function(data, cb)
+ cb(QBCore.Shared.Items[data.item])
+end)
+
+RegisterNUICallback("CloseInventory", function()
+ if currentOtherInventory == "none-inv" then
+ CurrentDrop = nil
+ CurrentVehicle = nil
+ CurrentGlovebox = nil
+ CurrentStash = nil
+ SetNuiFocus(false, false)
+ inInventory = false
+ TriggerScreenblurFadeOut(1000)
+ ClearPedTasks(PlayerPedId())
+ return
+ end
+ if CurrentVehicle ~= nil then
+ CloseTrunk()
+ TriggerServerEvent("inventory:server:SaveInventory", "trunk", CurrentVehicle)
+ CurrentVehicle = nil
+ elseif CurrentGlovebox ~= nil then
+ TriggerServerEvent("inventory:server:SaveInventory", "glovebox", CurrentGlovebox)
+ CurrentGlovebox = nil
+ elseif CurrentStash ~= nil then
+ TriggerServerEvent("inventory:server:SaveInventory", "stash", CurrentStash)
+ CurrentStash = nil
+ else
+ TriggerServerEvent("inventory:server:SaveInventory", "drop", CurrentDrop)
+ CurrentDrop = nil
+ end
+ Wait(50)
+ TriggerScreenblurFadeOut(1000)
+ SetNuiFocus(false, false)
+ inInventory = false
+end)
+
+RegisterNUICallback("UseItem", function(data, cb)
+ TriggerServerEvent("inventory:server:UseItem", data.inventory, data.item)
+ cb('ok')
+end)
+
+RegisterNUICallback("combineItem", function(data, cb)
+ Wait(150)
+ TriggerServerEvent('inventory:server:combineItem', data.reward, data.fromItem, data.toItem)
+ cb('ok')
+end)
+
+RegisterNUICallback('combineWithAnim', function(data, cb)
+ local ped = PlayerPedId()
+ local combineData = data.combineData
+ local aDict = combineData.anim.dict
+ local aLib = combineData.anim.lib
+ local animText = combineData.anim.text
+ local animTimeout = combineData.anim.timeOut
+ QBCore.Functions.Progressbar("combine_anim", animText, animTimeout, false, true, {
+ disableMovement = false,
+ disableCarMovement = true,
+ disableMouse = false,
+ disableCombat = true,
+ }, {
+ animDict = aDict,
+ anim = aLib,
+ flags = 16,
+ }, {}, {}, function() -- Done
+ StopAnimTask(ped, aDict, aLib, 1.0)
+ TriggerServerEvent('inventory:server:combineItem', combineData.reward, data.requiredItem, data.usedItem)
+ end, function() -- Cancel
+ StopAnimTask(ped, aDict, aLib, 1.0)
+ QBCore.Functions.Notify("Failed", "error")
+ end)
+ cb('ok')
+end)
+
+RegisterNUICallback("SetInventoryData", function(data, cb)
+ TriggerServerEvent("inventory:server:SetInventoryData", data.fromInventory, data.toInventory, data.fromSlot, data.toSlot, data.fromAmount, data.toAmount)
+ cb('ok')
+end)
+
+RegisterNUICallback("PlayDropSound", function(_, cb)
+ PlaySound(-1, "CLICK_BACK", "WEB_NAVIGATION_SOUNDS_PHONE", 0, 0, 1)
+ cb('ok')
+end)
+
+RegisterNUICallback("PlayDropFail", function(_, cb)
+ PlaySound(-1, "Place_Prop_Fail", "DLC_Dmod_Prop_Editor_Sounds", 0, 0, 1)
+ cb('ok')
+end)
+
+RegisterNUICallback("GiveItem", function(data, cb)
+ local player, distance = QBCore.Functions.GetClosestPlayer(GetEntityCoords(PlayerPedId()))
+ if player ~= -1 and distance < 3 then
+ if data.inventory == 'player' then
+ local playerId = GetPlayerServerId(player)
+ SetCurrentPedWeapon(PlayerPedId(),'WEAPON_UNARMED',true)
+ TriggerServerEvent("inventory:server:GiveItem", playerId, data.item.name, data.amount, data.item.slot)
+ else
+ QBCore.Functions.Notify("You do not own this item!", "error")
+ end
+ else
+ QBCore.Functions.Notify("No one nearby!", "error")
+ end
+ cb('ok')
+end)
+
+
+-- Threads
+
+CreateThread(function()
+ while true do
+ local sleep = 100
+ if DropsNear ~= nil then
+ local ped = PlayerPedId()
+ local closestDrop = nil
+ local closestDistance = nil
+ for k, v in pairs(DropsNear) do
+
+ if DropsNear[k] ~= nil then
+ if Config.UseItemDrop then
+ if not v.isDropShowing then
+ CreateItemDrop(k)
+ end
+ else
+ sleep = 0
+ DrawMarker(20, v.coords.x, v.coords.y, v.coords.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.3, 0.3, 0.15, 120, 10, 20, 155, false, false, false, 1, false, false, false)
+ end
+
+ local coords = (v.object ~= nil and GetEntityCoords(v.object)) or vector3(v.coords.x, v.coords.y, v.coords.z)
+ local distance = #(GetEntityCoords(ped) - coords)
+ if distance < 2 and (not closestDistance or distance < closestDistance) then
+ closestDrop = k
+ closestDistance = distance
+ end
+ end
+ end
+
+
+ if not closestDrop then
+ CurrentDrop = 0
+ else
+ CurrentDrop = closestDrop
+ end
+ end
+ Wait(sleep)
+ end
+end)
+
+CreateThread(function()
+ while true do
+ if Drops ~= nil and next(Drops) ~= nil then
+ local pos = GetEntityCoords(PlayerPedId(), true)
+ for k, v in pairs(Drops) do
+ if Drops[k] ~= nil then
+ local dist = #(pos - vector3(v.coords.x, v.coords.y, v.coords.z))
+ if dist < Config.MaxDropViewDistance then
+ DropsNear[k] = v
+ else
+ if Config.UseItemDrop and DropsNear[k] then
+ RemoveNearbyDrop(k)
+ else
+ DropsNear[k] = nil
+ end
+ end
+ end
+ end
+ else
+ DropsNear = {}
+ end
+ Wait(500)
+ end
+end)
+
+
+ --qb-target
+ RegisterNetEvent("inventory:client:Crafting", function(dropId)
+ local crafting = {}
+ crafting.label = "Crafting"
+ crafting.items = GetThresholdItems()
+ TriggerServerEvent("inventory:server:OpenInventory", "crafting", math.random(1, 99), crafting)
+ end)
+
+
+ RegisterNetEvent("inventory:client:WeaponAttachmentCrafting", function(dropId)
+ local crafting = {}
+ crafting.label = "Attachment Crafting"
+ crafting.items = GetAttachmentThresholdItems()
+ TriggerServerEvent("inventory:server:OpenInventory", "attachment_crafting", math.random(1, 99), crafting)
+ end)
+
+ local toolBoxModels = {
+ `prop_toolchest_05`,
+ `prop_tool_bench02_ld`,
+ `prop_tool_bench02`,
+ `prop_toolchest_02`,
+ `prop_toolchest_03`,
+ `prop_toolchest_03_l2`,
+ `prop_toolchest_05`,
+ `prop_toolchest_04`,
+ }
+ exports['qb-target']:AddTargetModel(toolBoxModels, {
+ options = {
+ {
+ event = "inventory:client:WeaponAttachmentCrafting",
+ icon = "fas fa-wrench",
+ label = "Weapon Attachment Crafting",
+ },
+ {
+ event = "inventory:client:Crafting",
+ icon = "fas fa-wrench",
+ label = "Item Crafting",
+ },
+ },
+ distance = 1.0
+ })
diff --git a/qb-inventory/config.lua b/qb-inventory/config.lua
new file mode 100644
index 0000000..64cd1ac
--- /dev/null
+++ b/qb-inventory/config.lua
@@ -0,0 +1,386 @@
+Config = {}
+
+Config.UseTarget = GetConvar('UseTarget', 'false') == 'true' -- Use qb-target interactions (don't change this, go to your server.cfg and add `setr UseTarget true` to use this and just that from true to false or the other way around)
+
+Config.MaxInventoryWeight = 250000 -- Max weight a player can carry (default 250kg, written in grams)
+Config.MaxInventorySlots = 41 -- Max inventory slots for a player
+
+Config.CleanupDropTime = 15 * 60 -- How many seconds it takes for drops to be untouched before being deleted
+Config.MaxDropViewDistance = 12.5 -- The distance in GTA Units that a drop can be seen
+Config.UseItemDrop = false -- This will enable item object to spawn on drops instead of markers
+Config.ItemDropObject = `sf_prop_sf_backpack_01a` -- if Config.UseItemDrop is true, this will be the prop that spawns for the item
+
+Config.Progressbar = {
+ Enable = false, -- True to Enable the progressbar while opening inventory
+ minT = 350, -- Min Time for Inventory to open
+ maxT = 500 -- Max Time for Inventory to open
+}
+
+Config.VendingObjects = {
+ "prop_vend_soda_01",
+ "prop_vend_soda_02",
+ "prop_vend_water_01"
+}
+
+Config.BinObjects = {
+ "prop_bin_05a",
+}
+
+Config.CraftingObject = `prop_toolchest_05` -- Only needed if not using target | Line 928 to change Target Models
+
+Config.VendingItem = {
+ [1] = {
+ name = "kurkakola",
+ price = 4,
+ amount = 50,
+ info = {},
+ type = "item",
+ slot = 1,
+ },
+ [2] = {
+ name = "water_bottle",
+ price = 4,
+ amount = 50,
+ info = {},
+ type = "item",
+ slot = 2,
+ },
+}
+
+Config.CraftingItems = {
+ [1] = {
+ name = "lockpick",
+ amount = 50,
+ info = {},
+ costs = {
+ ["metalscrap"] = 22,
+ ["plastic"] = 32,
+ },
+ type = "item",
+ slot = 1,
+ threshold = 0,
+ points = 1,
+ },
+ [2] = {
+ name = "screwdriverset",
+ amount = 50,
+ info = {},
+ costs = {
+ ["metalscrap"] = 30,
+ ["plastic"] = 42,
+ },
+ type = "item",
+ slot = 2,
+ threshold = 0,
+ points = 2,
+ },
+ [3] = {
+ name = "electronickit",
+ amount = 50,
+ info = {},
+ costs = {
+ ["metalscrap"] = 30,
+ ["plastic"] = 45,
+ ["aluminum"] = 28,
+ },
+ type = "item",
+ slot = 3,
+ threshold = 0,
+ points = 3,
+ },
+ [4] = {
+ name = "radioscanner",
+ amount = 50,
+ info = {},
+ costs = {
+ ["electronickit"] = 2,
+ ["plastic"] = 52,
+ ["steel"] = 40,
+ },
+ type = "item",
+ slot = 4,
+ threshold = 0,
+ points = 4,
+ },
+ [5] = {
+ name = "gatecrack",
+ amount = 50,
+ info = {},
+ costs = {
+ ["metalscrap"] = 10,
+ ["plastic"] = 50,
+ ["aluminum"] = 30,
+ ["iron"] = 17,
+ ["electronickit"] = 2,
+ },
+ type = "item",
+ slot = 5,
+ threshold = 110,
+ points = 5,
+ },
+ [6] = {
+ name = "handcuffs",
+ amount = 50,
+ info = {},
+ costs = {
+ ["metalscrap"] = 36,
+ ["steel"] = 24,
+ ["aluminum"] = 28,
+ },
+ type = "item",
+ slot = 6,
+ threshold = 160,
+ points = 6,
+ },
+ [7] = {
+ name = "repairkit",
+ amount = 50,
+ info = {},
+ costs = {
+ ["metalscrap"] = 32,
+ ["steel"] = 43,
+ ["plastic"] = 61,
+ },
+ type = "item",
+ slot = 7,
+ threshold = 200,
+ points = 7,
+ },
+ [8] = {
+ name = "pistol_ammo",
+ amount = 50,
+ info = {},
+ costs = {
+ ["metalscrap"] = 50,
+ ["steel"] = 37,
+ ["copper"] = 26,
+ },
+ type = "item",
+ slot = 8,
+ threshold = 250,
+ points = 8,
+ },
+ [9] = {
+ name = "ironoxide",
+ amount = 50,
+ info = {},
+ costs = {
+ ["iron"] = 60,
+ ["glass"] = 30,
+ },
+ type = "item",
+ slot = 9,
+ threshold = 300,
+ points = 9,
+ },
+ [10] = {
+ name = "aluminumoxide",
+ amount = 50,
+ info = {},
+ costs = {
+ ["aluminum"] = 60,
+ ["glass"] = 30,
+ },
+ type = "item",
+ slot = 10,
+ threshold = 300,
+ points = 10,
+ },
+ [11] = {
+ name = "armor",
+ amount = 50,
+ info = {},
+ costs = {
+ ["iron"] = 33,
+ ["steel"] = 44,
+ ["plastic"] = 55,
+ ["aluminum"] = 22,
+ },
+ type = "item",
+ slot = 11,
+ threshold = 350,
+ points = 11,
+ },
+ [12] = {
+ name = "drill",
+ amount = 50,
+ info = {},
+ costs = {
+ ["iron"] = 50,
+ ["steel"] = 50,
+ ["screwdriverset"] = 3,
+ ["advancedlockpick"] = 2,
+ },
+ type = "item",
+ slot = 12,
+ threshold = 1750,
+ points = 12,
+ },
+}
+
+Config.AttachmentCraftingLocation = vector3(88.91, 3743.88, 40.77) -- Only needed if not using target
+
+Config.AttachmentCrafting = {
+ [1] = {
+ name = "pistol_extendedclip",
+ amount = 50,
+ info = {},
+ costs = {
+ ["metalscrap"] = 140,
+ ["steel"] = 250,
+ ["rubber"] = 60,
+ },
+ type = "item",
+ slot = 1,
+ threshold = 0,
+ points = 1,
+ },
+ [2] = {
+ name = "pistol_suppressor",
+ amount = 50,
+ info = {},
+ costs = {
+ ["metalscrap"] = 165,
+ ["steel"] = 285,
+ ["rubber"] = 75,
+ },
+ type = "item",
+ slot = 2,
+ threshold = 10,
+ points = 2,
+ },
+ [3] = {
+ name = "smg_extendedclip",
+ amount = 50,
+ info = {},
+ costs = {
+ ["metalscrap"] = 190,
+ ["steel"] = 305,
+ ["rubber"] = 85,
+ },
+ type = "item",
+ slot = 3,
+ threshold = 25,
+ points = 3,
+ },
+ [4] = {
+ name = "microsmg_extendedclip",
+ amount = 50,
+ info = {},
+ costs = {
+ ["metalscrap"] = 205,
+ ["steel"] = 340,
+ ["rubber"] = 110,
+ },
+ type = "item",
+ slot = 4,
+ threshold = 50,
+ points = 4,
+ },
+ [5] = {
+ name = "smg_drum",
+ amount = 50,
+ info = {},
+ costs = {
+ ["metalscrap"] = 230,
+ ["steel"] = 365,
+ ["rubber"] = 130,
+ },
+ type = "item",
+ slot = 5,
+ threshold = 75,
+ points = 5,
+ },
+ [6] = {
+ name = "smg_scope",
+ amount = 50,
+ info = {},
+ costs = {
+ ["metalscrap"] = 255,
+ ["steel"] = 390,
+ ["rubber"] = 145,
+ },
+ type = "item",
+ slot = 6,
+ threshold = 100,
+ points = 6,
+ },
+ [7] = {
+ name = "assaultrifle_extendedclip",
+ amount = 50,
+ info = {},
+ costs = {
+ ["metalscrap"] = 270,
+ ["steel"] = 435,
+ ["rubber"] = 155,
+ ["smg_extendedclip"] = 1,
+ },
+ type = "item",
+ slot = 7,
+ threshold = 150,
+ points = 7,
+ },
+ [8] = {
+ name = "assaultrifle_drum",
+ amount = 50,
+ info = {},
+ costs = {
+ ["metalscrap"] = 300,
+ ["steel"] = 469,
+ ["rubber"] = 170,
+ ["smg_extendedclip"] = 2,
+ },
+ type = "item",
+ slot = 8,
+ threshold = 200,
+ points = 8,
+ },
+}
+
+BackEngineVehicles = {
+ [`ninef`] = true,
+ [`adder`] = true,
+ [`vagner`] = true,
+ [`t20`] = true,
+ [`infernus`] = true,
+ [`zentorno`] = true,
+ [`reaper`] = true,
+ [`comet2`] = true,
+ [`comet3`] = true,
+ [`jester`] = true,
+ [`jester2`] = true,
+ [`cheetah`] = true,
+ [`cheetah2`] = true,
+ [`prototipo`] = true,
+ [`turismor`] = true,
+ [`pfister811`] = true,
+ [`ardent`] = true,
+ [`nero`] = true,
+ [`nero2`] = true,
+ [`tempesta`] = true,
+ [`vacca`] = true,
+ [`bullet`] = true,
+ [`osiris`] = true,
+ [`entityxf`] = true,
+ [`turismo2`] = true,
+ [`fmj`] = true,
+ [`re7b`] = true,
+ [`tyrus`] = true,
+ [`italigtb`] = true,
+ [`penetrator`] = true,
+ [`monroe`] = true,
+ [`ninef2`] = true,
+ [`stingergt`] = true,
+ [`surfer`] = true,
+ [`surfer2`] = true,
+ [`gp1`] = true,
+ [`autarch`] = true,
+ [`tyrant`] = true
+}
+
+Config.MaximumAmmoValues = {
+ ["pistol"] = 250,
+ ["smg"] = 250,
+ ["shotgun"] = 200,
+ ["rifle"] = 250,
+}
\ No newline at end of file
diff --git a/qb-inventory/fxmanifest.lua b/qb-inventory/fxmanifest.lua
new file mode 100644
index 0000000..0742137
--- /dev/null
+++ b/qb-inventory/fxmanifest.lua
@@ -0,0 +1,36 @@
+fx_version 'cerulean'
+game 'gta5'
+
+description 'qb-inventory'
+version '1.0.3'
+
+shared_scripts {
+ 'config.lua',
+ '@qb-weapons/config.lua'
+}
+
+server_scripts {
+ '@oxmysql/lib/MySQL.lua',
+ 'server/main.lua'
+}
+
+client_script 'client/main.lua'
+
+ui_page {
+ 'html/ui.html'
+}
+
+files {
+ 'html/ui.html',
+ 'html/css/main.css',
+ 'html/js/app.js',
+ 'html/inventory_images/body.png',
+ 'html/images/*.svg',
+ 'html/images/*.png',
+ 'html/images/*.jpg',
+ 'html/ammo_images/*.png',
+ 'html/attachment_images/*.png',
+ 'html/*.ttf'
+}
+
+lua54 'yes'
diff --git a/qb-inventory/html/ammo_images/pistol_ammo.png b/qb-inventory/html/ammo_images/pistol_ammo.png
new file mode 100644
index 0000000..12766a5
Binary files /dev/null and b/qb-inventory/html/ammo_images/pistol_ammo.png differ
diff --git a/qb-inventory/html/ammo_images/rifle_ammo.png b/qb-inventory/html/ammo_images/rifle_ammo.png
new file mode 100644
index 0000000..f71fd3d
Binary files /dev/null and b/qb-inventory/html/ammo_images/rifle_ammo.png differ
diff --git a/qb-inventory/html/ammo_images/shotgun_ammo.png b/qb-inventory/html/ammo_images/shotgun_ammo.png
new file mode 100644
index 0000000..f33ea22
Binary files /dev/null and b/qb-inventory/html/ammo_images/shotgun_ammo.png differ
diff --git a/qb-inventory/html/ammo_images/smg_ammo.png b/qb-inventory/html/ammo_images/smg_ammo.png
new file mode 100644
index 0000000..12786ba
Binary files /dev/null and b/qb-inventory/html/ammo_images/smg_ammo.png differ
diff --git a/qb-inventory/html/attachment_images/weapon_assaultrifle.png b/qb-inventory/html/attachment_images/weapon_assaultrifle.png
new file mode 100644
index 0000000..1bbccca
Binary files /dev/null and b/qb-inventory/html/attachment_images/weapon_assaultrifle.png differ
diff --git a/qb-inventory/html/attachment_images/weapon_carbinerifle.png b/qb-inventory/html/attachment_images/weapon_carbinerifle.png
new file mode 100644
index 0000000..a220b95
Binary files /dev/null and b/qb-inventory/html/attachment_images/weapon_carbinerifle.png differ
diff --git a/qb-inventory/html/attachment_images/weapon_compactrifle.png b/qb-inventory/html/attachment_images/weapon_compactrifle.png
new file mode 100644
index 0000000..48f57a4
Binary files /dev/null and b/qb-inventory/html/attachment_images/weapon_compactrifle.png differ
diff --git a/qb-inventory/html/attachment_images/weapon_microsmg.png b/qb-inventory/html/attachment_images/weapon_microsmg.png
new file mode 100644
index 0000000..2ac3868
Binary files /dev/null and b/qb-inventory/html/attachment_images/weapon_microsmg.png differ
diff --git a/qb-inventory/html/attachment_images/weapon_minismg.png b/qb-inventory/html/attachment_images/weapon_minismg.png
new file mode 100644
index 0000000..4a93078
Binary files /dev/null and b/qb-inventory/html/attachment_images/weapon_minismg.png differ
diff --git a/qb-inventory/html/attachment_images/weapon_pistol.png b/qb-inventory/html/attachment_images/weapon_pistol.png
new file mode 100644
index 0000000..4d69e62
Binary files /dev/null and b/qb-inventory/html/attachment_images/weapon_pistol.png differ
diff --git a/qb-inventory/html/attachment_images/weapon_pistol_mk2.png b/qb-inventory/html/attachment_images/weapon_pistol_mk2.png
new file mode 100644
index 0000000..1900441
Binary files /dev/null and b/qb-inventory/html/attachment_images/weapon_pistol_mk2.png differ
diff --git a/qb-inventory/html/attachment_images/weapon_pumpshotgun.png b/qb-inventory/html/attachment_images/weapon_pumpshotgun.png
new file mode 100644
index 0000000..6f1f3b4
Binary files /dev/null and b/qb-inventory/html/attachment_images/weapon_pumpshotgun.png differ
diff --git a/qb-inventory/html/attachment_images/weapon_smg.png b/qb-inventory/html/attachment_images/weapon_smg.png
new file mode 100644
index 0000000..6a4c57f
Binary files /dev/null and b/qb-inventory/html/attachment_images/weapon_smg.png differ
diff --git a/qb-inventory/html/attachment_images/weapon_snspistol.png b/qb-inventory/html/attachment_images/weapon_snspistol.png
new file mode 100644
index 0000000..1e5d477
Binary files /dev/null and b/qb-inventory/html/attachment_images/weapon_snspistol.png differ
diff --git a/qb-inventory/html/attachment_images/weapon_stungun.png b/qb-inventory/html/attachment_images/weapon_stungun.png
new file mode 100644
index 0000000..86a5210
Binary files /dev/null and b/qb-inventory/html/attachment_images/weapon_stungun.png differ
diff --git a/qb-inventory/html/attachment_images/weapon_vintagepistol.png b/qb-inventory/html/attachment_images/weapon_vintagepistol.png
new file mode 100644
index 0000000..37c14e7
Binary files /dev/null and b/qb-inventory/html/attachment_images/weapon_vintagepistol.png differ
diff --git a/qb-inventory/html/css/main.css b/qb-inventory/html/css/main.css
new file mode 100644
index 0000000..7cc73b5
--- /dev/null
+++ b/qb-inventory/html/css/main.css
@@ -0,0 +1,1468 @@
+@import url('https://fonts.googleapis.com/css2?family=Oswald:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');
+
+.bg-button { background: var(--color-primary)!important; box-shadow: none!important; }
+.text-check { color: rgba(255, 255, 255, 0.8)!important; }
+.text-checkbox { color: #0fffd5!important; }
+.q-checkbox__svg { color: #000!important; }
+div#q-loading-bar { display: none!important; }
+.q-card { background: var(--color-primary)!important; }
+p { margin: 0 !important; }
+.q-btn { align-items: center!important; box-shadow: none!important;}
+.text-h6 { color: #fff; }
+.q-card__section.q-card__section--vert.q-pt-none { color: #fff; }
+
+@media screen and (min-width: 2540px) {
+ #itembox-label {
+ min-height: 1.8vh;
+ }
+}
+
+.row {
+ display: flex;
+ flex-wrap: wrap;
+ margin-right: 0px!important;
+ margin-left: 0px!important;
+}
+
+:root {
+ --color-primary-inventory-bg: rgba(9, 9, 18, 0.8);
+ --color-primary: #23242e;
+ --color-secondary: #383942;
+ --color-accent: rgba(250, 244, 165, 1);
+}
+
+.fas.fa-lock {
+ font-size: 22px;
+ top: -82px;
+ right: 0px;
+ position: relative;
+}
+
+.brand-logo {
+ position: relative;
+ left: 50%;
+ transform: translateX(-50%);
+ padding-top: 3px;
+ padding-bottom: 10px;
+ width: 45%;
+}
+
+::placeholder {
+ color: white;
+ text-align: center;
+ line-height: 48px;
+ text-transform: normal;
+ font-size: 1.5vh;
+ font-family: 'Oswald', sans-serif !important;
+ }
+
+/* rgb() */
+
+input[type=number]::-webkit-inner-spin-button,
+input[type=number]::-webkit-outer-spin-button {
+ -webkit-appearance: none;
+ margin: 0;
+}
+
+::-webkit-scrollbar {
+ width: 12px;
+ background: var(--color-secondary);
+}
+
+::-webkit-scrollbar-thumb {
+ background: var(--color-accent);
+}
+
+#progressbar {
+ width: 112%;
+ margin-left: 109.8%;
+ margin-top: 1.8%;
+ background-color: var(--color-secondary);
+}
+
+#progressbar-other {
+ width: 77.6%;
+ margin-left: 37.2%;
+ margin-top: 1.8%;
+ background-color: var(--color-secondary);
+}
+
+.pro {
+ background: linear-gradient(to right, var(--color-accent), var(--color-accent) 500px);
+ height: 6px;
+ max-width: 100%;
+ transition: width 1s, background-color 1s;
+}
+
+.pro1 {
+ background: linear-gradient(to right, var(--color-accent), var(--color-accent) 500px);
+ height: 6px;
+ max-width: 100%;
+ transition: width 1s, background-color 1s;
+}
+
+.weight-img {
+ margin-top: 0.6%;
+ width: 4%;
+ right: -14%;
+ position: absolute;
+}
+
+.weight-img-other {
+ margin-top: 0.6%;
+ width:4%;
+ right: -12%;
+ position:absolute;
+}
+
+body {
+ overflow-x: hidden;
+}
+
+#qbcore-inventory {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ left: 0vw;
+ display: none;
+ user-select: none;
+ background-color: var(--color-primary-inventory-bg);
+}
+
+.inv-background {
+ width: 100%;
+ height: 100%;
+ position: absolute;
+ top: 0;
+ left: 0;
+ z-index: -1;
+}
+
+.inv-container {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+}
+
+.player-inventory-bg {
+ position: absolute;
+ float: left;
+ top: 15%;
+ left: 21.2%;
+ width: 45.7%;
+ max-width: 35.7%;
+ height: 64.17%;
+ max-height: 64.17%;
+ /* background: var(--color-primary); */
+}
+
+.player-inventory {
+ position: absolute;
+ top: 8%;
+ left: 38.3%;
+ width: 100.22%;
+ max-width: 102.22%;
+ height: 80%;
+ max-height: 132%;
+ float: right;
+ z-index: 100;
+}
+
+.player-inventory-first {
+ position: absolute;
+ margin-top: -0.6rem;
+ margin-left: -83%;
+ width: 19%;
+ height: 78.2%;
+ /* background: var(--color-primary); */
+ padding: 10px;
+ z-index: 10;
+}
+
+.player-inventory-second {
+ position: absolute;
+ margin-top: -0.6rem;
+ margin-left: -23%;
+ width: 19%;
+ height: 78.2%;
+ /* background: var(--color-primary); */
+ padding: 10px;
+ z-index: 10;
+}
+
+.other-inventory-bg {
+ position: absolute;
+ top: 15%;
+ float: right;
+ right: 8.2%;
+ margin: 0 auto;
+ width: 25.26%;
+ max-width: 25.26%;
+ height: 64.17%;
+ max-height: 64.17%;
+ /* background: var(--color-primary); */
+}
+
+.other-inventory {
+ position: absolute;
+ top: 8%;
+ right: 1.5%;
+ width: 89%;
+ max-width: 102.22%;
+ height: 45%;
+ max-height: 132%;
+ float: right;
+ overflow-x: hidden;
+ overflow-y: scroll;
+ z-index: 100;
+}
+
+.ply-hotbar-inventory {
+ position: absolute;
+ bottom: 10%;
+ left: 35.5%;
+ z-index: 105;
+}
+
+.player-inventory > .item-slot > .item-slot-key > p {
+ position: absolute;
+ font-weight: 400;
+ color: #20202062;
+ padding-top: 4vh;
+ padding-bottom: 0px;
+ padding-left: 2.35vh;
+ text-align: center;
+ font-size: 7vh;
+ line-height: 1.8vh;
+ font-family: 'Oswald', sans-serif !important;
+}
+
+.player-inventory-first > .item-slot > .item-slot-key > p {
+ position: absolute;
+ font-weight: 400;
+ color: #ffffff00;
+ padding-top: 4vh;
+ padding-bottom: 0px;
+ padding-left: 2.35vh;
+ text-align: center;
+ font-size: 7vh;
+ line-height: 1.8vh;
+ font-family: 'Oswald', sans-serif !important;
+}
+
+.player-inventory-second > .item-slot > .item-slot-key > p {
+ position: absolute;
+ font-weight: 400;
+ color: #ffffff00;
+ padding-top: 4vh;
+ padding-bottom: 0px;
+ padding-left: 2.35vh;
+ text-align: center;
+ font-size: 7vh;
+ line-height: 1.8vh;
+ font-family: 'Oswald', sans-serif !important;
+}
+
+.inv-options {
+ position: absolute;
+ margin: 0 auto;
+ right: 0;
+ width: 19.5%;
+ top: 75%;
+ left: -18.5%;
+ cursor: pointer; /* Can also be 'none' however, as these are the buttons I feel as the pointer fits better */
+ z-index: 200;
+}
+
+.inv-options-list {
+ display: flex;
+ justify-content: center;
+}
+
+.inv-help-options {
+ background: var(--color-primary);
+ height: 2.8rem;
+ width: 2.8rem;
+ display: flex;
+ justify-content: center;
+ flex-direction: column;
+ align-items: center;
+ cursor: pointer;
+ box-shadow: none;
+ text-shadow: none;
+ margin-left: 18%;
+ margin-top: 40%;
+ z-index: 9999;
+}
+
+.inv-help-options button {
+ background-color: transparent;
+ width: 2.8rem;
+ height: 2.8rem;
+ color: white;
+ border: none;
+ box-shadow: none;
+ text-shadow: none;
+ font-size: large;
+}
+
+.btn {
+ box-shadow: none;
+ }
+
+
+.combine-option-container {
+ display: none;
+ position: relative;
+ right: 0px;
+ width: auto;
+ left: 0vh;
+ margin: 0px auto;
+}
+
+.item-slot {
+ position: relative;
+ width: 98px;
+ height: 98px;
+ float: left;
+ background-color: rgb(89 89 98 / 30%) !important;
+ border: 1px solid rgba(59, 59, 68, 1);
+ margin: 3px;
+ transition: opacity 0.2s ease 0s;
+ opacity: 90%;
+}
+
+.item-slot:hover {
+ background-color: rgb(189 189 198 / 30%) !important;
+ opacity: 90%;
+}
+
+.inv-option-item {
+ margin-top: 10%;
+}
+
+.btn-inv {
+ width: 100%!important;
+ max-width: 100%!important;
+ padding: 10%!important;
+ background-color: var(--color-secondary);
+}
+
+#item-amount {
+ color: white;
+ text-align: center;
+ font-size: 1.5vh;
+ font-weight: 300;
+ font-family: 'Oswald', sans-serif !important;
+ outline: none;
+}
+
+.ammo-info-block {
+ position: absolute;
+ margin: 0 auto;
+ left: 0;
+ right: 0;
+ width: 22vh;
+ height: 11vh;
+ background-color: rgba(235, 235, 235, 0.08);
+ border: 1px solid rgba(255, 255, 255, 0.01);
+ top: 2vh;
+}
+.ammo-info-header {
+ /* background-color: rgba(5, 5, 5, 0.5); */
+ width: 100%;
+ color: white;
+ font-family: 'Oswald', sans-serif !important;
+ background-color: rgba(0, 0, 0, 0.192);
+ font-size: 1.vh;
+ padding: .4vh;
+ text-align: center;
+}
+.ammo-info {
+ position: relative;
+ color: white;
+ font-family: 'Oswald', sans-serif !important;
+ font-weight: 200;
+ font-size: 1.vh;
+ margin-left: .8vh;
+ margin-top: .4vh;
+ margin-bottom: .25vh;
+ top: .6vh;
+}
+.ammo-info span {
+ margin-right: 1vh;
+ float: right;
+}
+
+.inv-option-item > p {
+ color: white;
+ text-align: center;
+ line-height: 48px;
+ text-transform: normal;
+ font-size: 1.5vh;
+ font-weight: 300;
+ font-family: 'Oswald', sans-serif !important;
+}
+.inv-option-item > label {
+ color: white;
+ text-align: center;
+ line-height: 48px;
+ text-transform: normal;
+ font-size: 1.5vh;
+ font-weight: 300;
+ font-family: 'Oswald', sans-serif !important;
+ margin-right: 10px;
+ margin-bottom: auto;
+ margin-top: auto;
+}
+
+.inv-option-item {
+ margin-top: 10%;
+ height: 3rem;
+ width: 4.5rem;
+ margin-left: 0%;
+ background-color: rgb(89 89 98 / 30%) !important;
+ border: 2px solid rgba(59, 59, 68, 1);
+ border: none;
+ color: white;
+ transition: background-color .1s linear;
+ opacity: 70%;
+}
+
+.inv-option-hand {
+ margin-top: 20%;
+/* width: 80%; */
+ height: 100px;
+ margin-left: 10%;
+ transition: background-color .1s linear;
+}
+
+.inv-option-item:hover {
+ background-color: rgb(189 189 198 / 30%) !important;
+ border: 2px solid rgba(59, 59, 68, 1);
+}
+
+.btn-combine {
+ position: relative;
+ margin-top: 6px;
+ height: 3rem;
+ width: 4.5rem;
+ top: 0px;
+ left: 0px;
+ background: var(--color-secondary)!important;
+ text-align: center;
+ line-height: 48px;
+ font-size: 1.1vh;
+ font-weight: 900;
+ font-family: Oswald, sans-serif !important;
+ border-width: 1px;
+ border-style: solid;
+ border-image: initial;
+ transition: background-color 0.1s linear 0s;
+ opacity: 70%;
+}
+
+.btn-combine > p {
+ color: white;
+ text-align: center;
+ font-size: 1.5vh;
+ font-weight: 300;
+ font-family: 'Oswald', sans-serif !important;
+ outline: none;
+
+}
+
+.item-slot-amount {
+ position: absolute;
+ top: 0.3%;
+ left: 0.15vw;
+ background-color: #41414b00;
+ padding-right: 4px;
+ padding-left: 4px;
+}
+
+.item-slot-amount > p {
+ color: #ffffff;
+ text-align: right;
+ font-size: 1.25vh;
+ font-weight: 400;
+ cursor: none;
+}
+
+.item-slot-name {
+ position: absolute;
+ top: 1.3%;
+ right: 0.15vw;
+ background-color: #41414b00;
+ padding-right: 4px;
+ padding-left: 4px;
+}
+
+.item-slot-name > p {
+ color: #ffffff;
+ text-align: right;
+ font-size: 1.25vh;
+ font-weight: 400;
+ cursor: none;
+}
+
+.item-slot-label {
+ position: absolute;
+ bottom: 0.5vh;
+ width: 100%;
+ background-color: transparent;
+}
+
+.item-slot-label > p {
+ font-weight: 400;
+ padding: 2.5px;
+ padding-left: 5px;
+ color: white;
+ font-size: 1.25vh;
+ text-align: center;
+ letter-spacing: 0px;
+ font-family: 'Oswald', sans-serif !important;
+ white-space: pre;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ cursor: none;
+}
+
+.item-slot-quality {
+ position: absolute;
+ bottom: 0.2vh;
+ width: 100%;
+ height: 0.4vh;
+ background-color: rgba(32, 6, 6, 0.15);
+}
+
+.item-slot-quality-bar {
+ position: absolute;
+ width: 0%;
+ height: 150%;
+ background-color: var(--color-accent);
+ z-index: 1;
+}
+
+.item-slot-quality p {
+ color: transparent;
+}
+
+.item-slot-img {
+ max-width: 100%;
+ max-height: 100%;
+ padding: 0.5vw;
+}
+
+.item-slot-img img {
+ display: block;
+ position: relative;
+ margin: 0 auto;
+ margin-top: 9%;
+ width: auto;
+ height: auto;
+ max-width: 92%;
+ max-height: 100%;
+}
+
+.item-slot-img-itembox img {
+ display: block;
+ position: relative;
+ margin: 0 auto;
+ margin-top: 2vh;
+ width: auto;
+ height: auto;
+ max-width: 75%;
+ max-height: 100%;
+}
+
+.item-slot-img2 img {
+ display:block;
+}
+
+.ui-draggable-dragging {
+ background: rgba(0, 0, 0, 0.3);
+ z-index: 9999;
+}
+
+.player-inv-info {
+ position: absolute;
+ left: 3.3%;
+ top: 15.6%;
+ width: 28.8%;
+ z-index: 1000;
+ cursor: none;
+}
+
+#player-inv-label {
+ position: relative;
+ color: white;
+ font-size: 20px;
+ font-family: 'Oswald', sans-serif !important;
+ font-weight: 300;
+ letter-spacing: 0.01vh;
+ left: 122%;
+ bottom: 21.5px;
+ float: left;
+ text-transform: normal;
+ cursor: none;
+}
+
+#player-inv-weight {
+ position: relative;
+ color: rgb(255, 255, 255);
+ font-size: 16px;
+ font-weight: 900;
+ font-family: 'Oswald', sans-serif !important;
+ letter-spacing: 0.1vh;
+ bottom: 30px;
+ right: -77%;
+ float: right;
+}
+
+#other-inv-label {
+ position: relative;
+ color: white;
+ font-size: 20px;
+ font-family: 'Oswald', sans-serif !important;
+ font-weight: 300;
+ letter-spacing: 0.01vh;
+ left: 49%;
+ bottom: 21.5px;
+ float: left;
+ text-transform: normal;
+ cursor: none;
+}
+
+
+#other-inv-weight {
+ position: relative;
+ color: rgb(255, 255, 255);
+ font-size: 16px;
+ font-weight: 900;
+ font-family: 'Oswald', sans-serif !important;
+ letter-spacing: 0.1vh;
+ bottom: 30px;
+ right: 20.5%;
+ float: right;
+ cursor: none;
+}
+
+.player-inv-weight {
+ position: absolute;
+ left: 38%;
+ top: 10%;
+}
+
+.player-inv-weight > p {
+ color: white;
+ font-size: 12px;
+ font-family: 'Oswald', sans-serif !important;
+}
+
+.other-inv-info {
+ position: absolute;
+ left: 58.3%;
+ top: 15.6%;
+ width: 28.8%;
+ z-index: 1000;
+}
+
+.ply-iteminfo-container {
+ font-family: 'Oswald', sans-serif;
+ display: none;
+ position: absolute;
+ bottom: 34%;
+ margin: 0 auto;
+ left: 60%;
+ right: 0;
+ text-align: center;
+ width: 38.4vh;
+ height: 15vh;
+ background-color: rgb(89 89 98 / 30%) !important;
+ border: 1px solid rgba(59, 59, 68, 1);
+}
+
+.item-info-title {
+ text-transform: capitalize;
+ font-weight: 300;
+ font-family: 'Oswald', sans-serif;
+ font-size: 1.9vh;
+ color: white;
+ padding-top: 1px;
+}
+
+.item-info-line {
+ position: absolute;
+ font-family: 'Oswald', sans-serif;
+ width: 100%;
+ background-color: white;
+ height: 0vh;
+}
+
+.item-info-description {
+ text-transform: capitalize;
+ font-size: 1.4vh;
+ font-family: 'Oswald', sans-serif;
+ color: white;
+ padding-top: .5vh;
+}
+
+.itemboxes-container {
+ height: 7.5rem;
+ min-width: 90rem;
+ max-width: 90rem;
+ width: fit-content;
+ position: absolute;
+ left: 47%;
+ bottom: 18%;
+ overflow: hidden;
+}
+
+.template {
+ display: none;
+}
+
+.itembox-container {
+ display: none;
+ position: relative;
+ float: left;
+ margin: 0 auto;
+ margin-right: 1vh;
+ width: 10vh;
+ height: 11vh;
+ border: 2px solid #41414b;
+ background-color: #33343d !important;
+}
+
+#itembox-action {
+ position: absolute;
+ color: white;
+ border-top-left-radius: 1px;
+ padding: 4px;
+ top: 0;
+ left: 0;
+}
+
+#itembox-action > p {
+ font-size: 14px;
+ font-weight: 400;
+ font-family: 'Oswald', sans-serif !important;
+ white-space: pre;
+ text-overflow: ellipsis;
+ overflow: hidden;
+}
+
+#itembox-label {
+ position: absolute;
+ bottom: 0;
+ width: 100%;
+ height: 5%;
+}
+
+.itembox-image {
+ max-width: 10%;
+ max-height: 100%;
+ padding: 0.10vw;
+}
+
+#itembox-label > p {
+ padding-left: 15px;
+ padding-right: 15px;
+ color: #ffffff;
+ font-size: 14px;
+ text-align: center;
+ top: -1.6rem;
+ position: relative;
+ left: 50%;
+ transform: translateX(-50%);
+ white-space: pre;
+ text-overflow: ellipsis;
+ overflow: hidden;
+}
+
+.requiredItem-container {
+ display: none;
+ position: absolute;
+ height: 100vh;
+ width: 100vw;
+ display: flex;
+}
+
+.requiredItem-box {
+ position: relative;
+ top: 79%;
+ left: 42%;
+ width: 10vh;
+ height: 11vh;
+ float: left;
+ margin-left: 20px;
+ background: rgba(54, 54, 54, 0.233);
+}
+
+#requiredItem-action {
+ position: absolute;
+ left: 0;
+ top: 0;
+ color: white;
+ padding: 3px;
+ font-size: 14px;
+ font-family: 'Oswald', sans-serif !important;
+}
+
+#requiredItem-label {
+ position: absolute;
+ bottom: 0;
+ width: 100%;
+ height: 0.3vh;
+}
+
+#requiredItem-label > p {
+ color: #ffffff;
+ font-size: 14px;
+ text-align: center;
+ top: -25px;
+ position: relative;
+ left: 50%;
+ transform: translateX(-50%);
+ white-space: pre;
+ text-overflow: ellipsis;
+ overflow: hidden;
+}
+
+.item-slot-img-itembox-test img {
+ display: block;
+ position: relative;
+ margin: 0 auto;
+ margin-top: 1.3vh;
+ width: 80px;
+ height: 80px;
+ max-width: 100%;
+ max-height: 100%;
+}
+
+.z-hotbar-inventory {
+ display: none;
+ position: absolute;
+ bottom: 1%;
+ margin: 0 auto;
+ left: 0;
+ right: 0;
+ width: fit-content;
+ z-index: 105;
+ padding: 4px;
+ background-color: var(--color-primary);
+}
+
+.z-hotbar-inventory > .z-hotbar-item-slot > .z-hotbar-item-slot-key > p {
+ position: absolute;
+ font-weight: 400;
+ color: #20202062;
+ padding-top: 42%;
+ padding-bottom: 0px;
+ padding-left: 29%;
+ text-align: center;
+ font-size: 4rem;
+ line-height: 1.8vh;
+ font-family: 'Oswald', sans-serif !important;
+ z-index: -1;
+}
+
+.z-hotbar-item-slot {
+ margin-left: 2px;
+ margin-bottom: 2px;
+ position: relative;
+ width: 6.15rem;
+ height: 6.15rem;
+ float: left;
+ border: 2px solid #41414b;
+ background-color: rgb(89 89 98 / 30%) !important;
+ margin: 3px;
+ transition: opacity 0.2s ease 0s;
+ opacity: 90%;
+ z-index: 9999;
+}
+
+.z-hotbar-item-slot-amount {
+ position: absolute;
+ top: 0.5%;
+ left: 0.15vw;
+ background-color: #41414b;
+ padding-right: 4px;
+ padding-left: 4px;
+}
+
+.z-hotbar-item-slot-amount > p {
+ color: #ffffff;
+ text-align: right;
+ font-size: 1.25vh;
+ font-weight: 400;
+ cursor: none;
+}
+
+.z-hotbar-item-slot-amount-name {
+ position: absolute;
+ top: 0.5%;
+ right: 0.15vw;
+ background-color: #41414b;
+ padding-right: 4px;
+ padding-left: 4px;
+}
+
+.z-hotbar-item-slot-amount-name > p {
+ color: #ffffff;
+ text-align: right;
+ font-size: 1.25vh;
+ font-weight: 400;
+ cursor: none;
+}
+
+.z-hotbar-item-slot-label {
+ position: absolute;
+ bottom: 0vh;
+ width: 100%;
+ background-color: transparent;
+}
+
+.z-hotbar-item-slot-label > p {
+ font-weight: 400;
+ padding: 2.5px;
+ padding-left: 5px;
+ color: white;
+ font-size: 1.15vh;
+ text-align: left;
+ letter-spacing: 0px;
+ font-family: 'Oswald', sans-serif !important;
+ white-space: pre;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ cursor: none;
+}
+
+.z-hotbar-item-slot-img {
+ max-width: 100%;
+ max-height: 100%;
+ padding: 0.8vw;
+}
+
+.z-hotbar-item-slot-img img {
+ display: block;
+ position: relative;
+ margin: 0 auto;
+ margin-top: -12%;
+ left: -18%;
+ width: auto;
+ height: auto;
+ max-width: 120%;
+ max-height: 120%;
+}
+
+.ammo-container {
+ position: absolute;
+ background-color: rgba(20, 18, 32, 0.2);
+ width: 3.25%;
+ height: 44.16%;
+ top: 26%;
+ left: 6%;
+}
+
+.ammo-container-header {
+ position: absolute;
+ top: 0;
+ width: 100%;
+ height: 5vh;
+ background-color: rgba(120, 10, 20, 0.5);
+ text-align: center;
+ color: rgba(216, 216, 216, 0.897);
+}
+
+.ammo-container-header > i {
+ line-height: 5vh;
+ font-size: 1.8vh;
+}
+
+.ammo-box {
+ position: relative;
+ width: 100%;
+ height: 6vh;
+ top: 5vh;
+ background-color: rgba(0, 0, 0, .4);
+ margin-bottom: .5vh;
+ margin-top: .5vh;
+}
+
+.ammo-box > img {
+ position: absolute;
+ top: .15vh;
+ left: .2vh;
+ width: 5.25vh;
+ opacity: .25;
+}
+
+.ammo-box > span {
+ position: absolute;
+ color: rgba(255, 255, 255, 0.95);
+ font-size: .93vh;
+ bottom: 0;
+ right: 0;
+ margin: .3vh;
+ font-family: 'Oswald', sans-serif !important;
+}
+
+.ammo-box-amount {
+ position: absolute;
+ width: 100%;
+ background-color: rgba(36, 36, 36, 0.4);
+ bottom: 0;
+ max-height: 100%;
+}
+
+#pistol_ammo > .ammo-box-amount {
+ height: 0%;
+}
+
+#smg_ammo > .ammo-box-amount {
+ height: 0%;
+}
+
+#shotgun_ammo > .ammo-box-amount {
+ height: 0%;
+}
+
+#rifle_ammo > .ammo-box-amount {
+ height: 0%;
+}
+
+/* Weapon Attachments */
+
+.weapon-attachments-container {
+ position: absolute;
+ left: -100vw;
+ width: 100%;
+ height: 100%;
+ background-color: rgba(0, 0, 0, 0.5);
+}
+
+.weapon-attachments-container-title {
+ position: absolute;
+ margin: 5vh;
+ font-size: 3vh;
+ color: rgb(255, 255, 255);
+ font-family: 'Oswald', sans-serif !important;
+}
+
+.weapon-attachments-container-description {
+ position: absolute;
+ margin: 5vh;
+ top: 5vh;
+ font-size: 1.7vh;
+ color: rgba(255, 255, 255, 0.8);
+ font-family: 'Oswald', sans-serif !important;
+}
+
+.weapon-attachments-container-details {
+ position: absolute;
+ margin: 5vh;
+ top: 9vh;
+ font-size: 1.4vh;
+ color: rgba(255, 255, 255, 0.8);
+ font-family: 'Oswald', sans-serif !important;
+}
+
+.weapon-attachments-container-detail-durability {
+ height: 1.5vh;
+ width: 10vh;
+ background-color: rgba(0, 0, 0, 0.3);
+}
+
+.weapon-attachments-container-detail-durability-total {
+ height: 100%;
+ width: 50%;
+ background-color: var(--color-accent);
+}
+
+.weapon-attachments-container-image {
+ position: absolute;
+ margin: 0 auto;
+ left: 0;
+ right: 0;
+ top: 32%;
+ width: 30%;
+}
+
+.weapon-attachments {
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ margin: 5vh;
+ width: 50vh;
+ height: 12.5vh;
+}
+
+.weapon-attachments-title {
+ position: absolute;
+ bottom: 14vh;
+ left: 0;
+ margin: 5vh;
+ color: rgba(255, 255, 255, 0.8);
+ font-family: 'Oswald', sans-serif !important;
+ font-size: 1.4vh
+}
+
+.weapon-attachment {
+ position: relative;
+ height: 12.5vh;
+ width: 10.5vh;
+ background-color: rgba(0, 0, 0, 0.3);
+ border: 1px solid rgb(75, 75, 75);
+ margin-right: 1vh;
+ float: left;
+ transition: .05s linear;
+ z-index: 9888;
+}
+
+.weapon-attachment:hover {
+ background-color: rgba(0, 0, 0, 0.4);
+ border: 1px solid rgb(29, 29, 29);
+ transition: .05s linear;
+}
+
+.weapon-attachment-label {
+ position: absolute;
+ bottom: 0;
+ width: 100%;
+ background-color: rgba(38, 41, 60, 0.3);
+ padding: 2.1%;
+}
+
+.weapon-attachment-label > p {
+ color: #ffffff;
+ font-size: 1.1vh;
+ text-align: center;
+ text-transform: capitalize;
+ line-height: 1.9vh;
+ font-family: 'Oswald', sans-serif !important;
+ font-weight: 100;
+}
+
+.weapon-attachment-img {
+ max-width: 100%;
+ max-height: 100%;
+ padding: 0.5vw;
+}
+
+.weapon-attachment-img > img {
+ display:block;
+ position: relative;
+ margin: 0 auto;
+ margin-top: 10%;
+ width: auto;
+ height: auto;
+ max-width: 100%;
+ max-height: 100%;
+}
+
+.weapon-attachments-remove {
+ position: absolute;
+ width: 6.5vh;
+ height: 6.5vh;
+ background-color: rgb(15, 15, 15);
+ margin: 0 auto;
+ left: 0;
+ right: 0;
+ bottom: 20vh;
+ text-align: center;
+ color: white;
+ font-size: 2vh;
+ transition: background-color .05s linear;
+ z-index: 9888;
+}
+
+.weapon-attachments-remove:hover {
+ background-color: rgb(18, 18, 18);
+}
+
+.weapon-attachments-remove > i {
+ line-height: 6.5vh;
+}
+
+.weapon-attachments-remove-hover {
+ background-color: var(--color-accent);
+}
+
+.weapon-dragging-class {
+ animation: ShakeEffect .75s;
+ animation-iteration-count: infinite;
+}
+
+@keyframes ShakeEffect {
+ 0% { transform: translate(1px, 1px) rotate(0deg); }
+ 10% { transform: translate(-1px, -2px) rotate(-1deg); }
+ 20% { transform: translate(-3px, 0px) rotate(1deg); }
+ 30% { transform: translate(3px, 2px) rotate(0deg); }
+ 40% { transform: translate(1px, -1px) rotate(1deg); }
+ 50% { transform: translate(-1px, 2px) rotate(-1deg); }
+ 60% { transform: translate(-3px, 1px) rotate(0deg); }
+ 70% { transform: translate(3px, 1px) rotate(-1deg); }
+ 80% { transform: translate(-1px, -1px) rotate(1deg); }
+ 90% { transform: translate(1px, 2px) rotate(0deg); }
+ 100% { transform: translate(1px, -2px) rotate(-1deg); }
+}
+
+.weapon-attachments-back {
+ position: absolute;
+ bottom: 0;
+ right: 0;
+ width: 10vh;
+ height: 6vh;
+ margin: 5vh;
+ background-color: rgb(15, 15, 15);
+ text-align: center;
+ line-height: 6vh;
+ color: white;
+ font-family: 'Oswald', sans-serif !important;
+ transition: .05s linear;
+ z-index: 9999;
+}
+
+.weapon-attachments-back:hover {
+ background-color: var(--color-primary);
+}
+
+.color-picker-container {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ justify-content: center;
+}
+
+@media (width: 2560px) and (height: 1440px) {
+ .item-slot {
+ position: relative;
+ width: 133px;
+ height: 133px;
+ float: left;
+ border: 2px solid #41414b;
+ background-color: #33343d !important;
+ margin: 3px;
+ transition: opacity 0.2s ease 0s;
+ opacity: 90%;
+ }
+}
+
+@media (width: 3360px) and (height: 1440px) {
+ .item-slot {
+ position: relative;
+ width: 133px;
+ height: 133px;
+ float: left;
+ border: 2px solid #41414b;
+ background-color: #33343d !important;
+ margin: 3px;
+ transition: opacity 0.2s ease 0s;
+ opacity: 90%;
+ }
+ .player-inventory-bg {
+ position: absolute;
+ float: left;
+ top: 15%;
+ left: 29.2%;
+ width: 26%;
+ max-width: 25.7%;
+ height: 64.17%;
+ max-height: 64.17%;
+ background: var(--color-primary);
+ }
+ .other-inventory-bg {
+ position: absolute;
+ top: 15%;
+ float: right;
+ right: 26%;
+ margin: 0 auto;
+ width: 19.26%;
+ max-width: 19.26%;
+ height: 64.17%;
+ max-height: 64.17%;
+ background: var(--color-primary);
+ }
+
+ #progressbar {
+ width: 85%;
+ margin-left: 92.8%;
+ margin-top: 1.8%;
+ background-color: var(--color-secondary);
+ }
+
+ #progressbar-other {
+ width: 57.2%;
+ margin-left: -6.2%;
+ margin-top: 1.8%;
+ background-color: var(--color-secondary);
+ }
+
+ .inv-options {
+ position: absolute;
+ margin: 8.7% auto;
+ right: -10.6%;
+ height: 4rem;
+ width: 4.3rem;
+ left: 1vh;
+ cursor: pointer; /* Can also be 'none' however, as these are the buttons I feel as the pointer fits better */
+ z-index: 200;
+ }
+
+ .inv-option-item {
+ margin-top: 10%;
+ height: 3rem;
+ width: 4rem;
+ margin-left: 6%;
+ background: var(--color-secondary)!important;
+ border: none;
+ color: white;
+ transition: background-color .1s linear;
+ opacity: 70%;
+ }
+
+ #player-inv-label {
+ position: relative;
+ color: white;
+ font-size: 20px;
+ font-family: 'Oswald', sans-serif !important;
+ font-weight: 300;
+ letter-spacing: 0.01vh;
+ right: -93%;
+ float: left;
+ text-transform: normal;
+ cursor: none;
+ }
+
+ #other-inv-label {
+ position: relative;
+ color: white;
+ font-size: 20px;
+ font-family: 'Oswald', sans-serif !important;
+ font-weight: 300;
+ letter-spacing: 0.01vh;
+ left: 13%;
+ bottom: 21.5px;
+ float: left;
+ text-transform: normal;
+ cursor: none;
+ }
+
+ #other-inv-weight {
+ position: relative;
+ color: rgb(255, 255, 255);
+ font-size: 16px;
+ font-weight: 900;
+ font-family: 'Oswald', sans-serif !important;
+ letter-spacing: 0.1vh;
+ bottom: 30px;
+ right: 49.5%;
+ float: right;
+ cursor: none;
+ }
+
+}
+
+.craft-item-slot {
+ width: 30%;
+ height: 30%;
+ background: #0fffd5;
+}
+
+/* PROJECT CYPHER CHANGES */
+
+/* Icons */
+.player-inventory-icon {
+ position: absolute;
+ width: 2.5%;
+ height: 4.5%;
+ padding: 9.5px;
+ left: 35.2%;
+ top: 12.5%;
+ text-align: center;
+ font-size: 23px;
+ color: #fff89a;
+ background-color: rgba(250, 244, 165, 0.3);
+ box-shadow: 0 0 1vh #fff89a;
+ border: 1px solid #fff89a;
+}
+
+.other-inventory-icon {
+ position: absolute;
+ width: 2.5%;
+ height: 4.5%;
+ padding: 9.5px;
+ right: 28.2%;
+ top: 12.5%;
+ text-align: center;
+ font-size: 23px;
+ color: #fff89a;
+ background-color: rgba(250, 244, 165, 0.3);
+ box-shadow: 0 0 1vh #fff89a;
+ border: 1px solid #fff89a;
+}
+
+.pocket-inventory-icon {
+ position: absolute;
+ width: 2.5%;
+ height: 4.5%;
+ padding: 9.5px;
+ left: 6.2%;
+ top: 12.5%;
+ text-align: center;
+ font-size: 23px;
+ color: #fff89a;
+ background-color: rgba(250, 244, 165, 0.3);
+ box-shadow: 0 0 1vh #fff89a;
+ border: 1px solid #fff89a;
+}
+
+/* Pockets */
+.pocket-inv-info {
+ position: absolute;
+ left: 3.3%;
+ top: 15.6%;
+ width: 28.8%;
+ z-index: 1000;
+ cursor: none;
+}
+
+#pocket-inv-label {
+ position: relative;
+ color: white;
+ font-size: 20px;
+ font-family: 'Oswald', sans-serif !important;
+ font-weight: 300;
+ letter-spacing: 0.01vh;
+ left: 9.5%;
+ bottom: -145px;
+ float: left;
+ text-transform: normal;
+ cursor: none;
+}
+
+/* Player Body */
+.player-body-container {
+ position: absolute;
+ bottom: 27.8%;
+ margin: 0 auto;
+ left: -65%;
+ right: 0;
+ text-align: center;
+ width: 15%;
+ height: 55%;
+ padding: 10%;
+}
+
+.player-body {
+ position: absolute;
+ bottom: 48%;
+ margin: 0 auto;
+ left: -23%;
+ right: 0;
+ text-align: center;
+ width: 15%;
+ height: 45%;
+}
\ No newline at end of file
diff --git a/qb-inventory/html/images/10kgoldchain.png b/qb-inventory/html/images/10kgoldchain.png
new file mode 100644
index 0000000..a025951
Binary files /dev/null and b/qb-inventory/html/images/10kgoldchain.png differ
diff --git a/qb-inventory/html/images/advancedkit.png b/qb-inventory/html/images/advancedkit.png
new file mode 100644
index 0000000..25f3c5f
Binary files /dev/null and b/qb-inventory/html/images/advancedkit.png differ
diff --git a/qb-inventory/html/images/advancedlockpick.png b/qb-inventory/html/images/advancedlockpick.png
new file mode 100644
index 0000000..4a0839f
Binary files /dev/null and b/qb-inventory/html/images/advancedlockpick.png differ
diff --git a/qb-inventory/html/images/aluminum.png b/qb-inventory/html/images/aluminum.png
new file mode 100644
index 0000000..ef58170
Binary files /dev/null and b/qb-inventory/html/images/aluminum.png differ
diff --git a/qb-inventory/html/images/aluminumoxide.png b/qb-inventory/html/images/aluminumoxide.png
new file mode 100644
index 0000000..f71cde0
Binary files /dev/null and b/qb-inventory/html/images/aluminumoxide.png differ
diff --git a/qb-inventory/html/images/antipatharia_coral.png b/qb-inventory/html/images/antipatharia_coral.png
new file mode 100644
index 0000000..6a9559c
Binary files /dev/null and b/qb-inventory/html/images/antipatharia_coral.png differ
diff --git a/qb-inventory/html/images/armor.png b/qb-inventory/html/images/armor.png
new file mode 100644
index 0000000..723d8ba
Binary files /dev/null and b/qb-inventory/html/images/armor.png differ
diff --git a/qb-inventory/html/images/bandage.png b/qb-inventory/html/images/bandage.png
new file mode 100644
index 0000000..8ee0e0b
Binary files /dev/null and b/qb-inventory/html/images/bandage.png differ
diff --git a/qb-inventory/html/images/baquette.png b/qb-inventory/html/images/baquette.png
new file mode 100644
index 0000000..d93dca2
Binary files /dev/null and b/qb-inventory/html/images/baquette.png differ
diff --git a/qb-inventory/html/images/beer.png b/qb-inventory/html/images/beer.png
new file mode 100644
index 0000000..f2c4f84
Binary files /dev/null and b/qb-inventory/html/images/beer.png differ
diff --git a/qb-inventory/html/images/binoculars.png b/qb-inventory/html/images/binoculars.png
new file mode 100644
index 0000000..fec6935
Binary files /dev/null and b/qb-inventory/html/images/binoculars.png differ
diff --git a/qb-inventory/html/images/cash.png b/qb-inventory/html/images/cash.png
new file mode 100644
index 0000000..ab725a2
Binary files /dev/null and b/qb-inventory/html/images/cash.png differ
diff --git a/qb-inventory/html/images/casinochips.png b/qb-inventory/html/images/casinochips.png
new file mode 100644
index 0000000..2742358
Binary files /dev/null and b/qb-inventory/html/images/casinochips.png differ
diff --git a/qb-inventory/html/images/certificate.png b/qb-inventory/html/images/certificate.png
new file mode 100644
index 0000000..27af9ea
Binary files /dev/null and b/qb-inventory/html/images/certificate.png differ
diff --git a/qb-inventory/html/images/cleaningkit.png b/qb-inventory/html/images/cleaningkit.png
new file mode 100644
index 0000000..833631e
Binary files /dev/null and b/qb-inventory/html/images/cleaningkit.png differ
diff --git a/qb-inventory/html/images/cocaine_baggy.png b/qb-inventory/html/images/cocaine_baggy.png
new file mode 100644
index 0000000..1c9dd3a
Binary files /dev/null and b/qb-inventory/html/images/cocaine_baggy.png differ
diff --git a/qb-inventory/html/images/coffee.png b/qb-inventory/html/images/coffee.png
new file mode 100644
index 0000000..f04e3dc
Binary files /dev/null and b/qb-inventory/html/images/coffee.png differ
diff --git a/qb-inventory/html/images/coke_brick.png b/qb-inventory/html/images/coke_brick.png
new file mode 100644
index 0000000..25d0616
Binary files /dev/null and b/qb-inventory/html/images/coke_brick.png differ
diff --git a/qb-inventory/html/images/coke_small_brick.png b/qb-inventory/html/images/coke_small_brick.png
new file mode 100644
index 0000000..58570b2
Binary files /dev/null and b/qb-inventory/html/images/coke_small_brick.png differ
diff --git a/qb-inventory/html/images/cola.png b/qb-inventory/html/images/cola.png
new file mode 100644
index 0000000..472a045
Binary files /dev/null and b/qb-inventory/html/images/cola.png differ
diff --git a/qb-inventory/html/images/copper.png b/qb-inventory/html/images/copper.png
new file mode 100644
index 0000000..60b6c27
Binary files /dev/null and b/qb-inventory/html/images/copper.png differ
diff --git a/qb-inventory/html/images/crack_baggy.png b/qb-inventory/html/images/crack_baggy.png
new file mode 100644
index 0000000..34d2ee7
Binary files /dev/null and b/qb-inventory/html/images/crack_baggy.png differ
diff --git a/qb-inventory/html/images/cryptostick.png b/qb-inventory/html/images/cryptostick.png
new file mode 100644
index 0000000..58c90b2
Binary files /dev/null and b/qb-inventory/html/images/cryptostick.png differ
diff --git a/qb-inventory/html/images/dendrogyra_coral.png b/qb-inventory/html/images/dendrogyra_coral.png
new file mode 100644
index 0000000..f282161
Binary files /dev/null and b/qb-inventory/html/images/dendrogyra_coral.png differ
diff --git a/qb-inventory/html/images/diamond_ring.png b/qb-inventory/html/images/diamond_ring.png
new file mode 100644
index 0000000..fff3e9a
Binary files /dev/null and b/qb-inventory/html/images/diamond_ring.png differ
diff --git a/qb-inventory/html/images/diving_gear.png b/qb-inventory/html/images/diving_gear.png
new file mode 100644
index 0000000..b4c21ce
Binary files /dev/null and b/qb-inventory/html/images/diving_gear.png differ
diff --git a/qb-inventory/html/images/drill.png b/qb-inventory/html/images/drill.png
new file mode 100644
index 0000000..0a63288
Binary files /dev/null and b/qb-inventory/html/images/drill.png differ
diff --git a/qb-inventory/html/images/driver_license.png b/qb-inventory/html/images/driver_license.png
new file mode 100644
index 0000000..3c1f882
Binary files /dev/null and b/qb-inventory/html/images/driver_license.png differ
diff --git a/qb-inventory/html/images/electronickit.png b/qb-inventory/html/images/electronickit.png
new file mode 100644
index 0000000..534cd0d
Binary files /dev/null and b/qb-inventory/html/images/electronickit.png differ
diff --git a/qb-inventory/html/images/evidence.png b/qb-inventory/html/images/evidence.png
new file mode 100644
index 0000000..80194b8
Binary files /dev/null and b/qb-inventory/html/images/evidence.png differ
diff --git a/qb-inventory/html/images/firework1.png b/qb-inventory/html/images/firework1.png
new file mode 100644
index 0000000..2fe945c
Binary files /dev/null and b/qb-inventory/html/images/firework1.png differ
diff --git a/qb-inventory/html/images/firework2.png b/qb-inventory/html/images/firework2.png
new file mode 100644
index 0000000..9ef591b
Binary files /dev/null and b/qb-inventory/html/images/firework2.png differ
diff --git a/qb-inventory/html/images/firework3.png b/qb-inventory/html/images/firework3.png
new file mode 100644
index 0000000..4f061a3
Binary files /dev/null and b/qb-inventory/html/images/firework3.png differ
diff --git a/qb-inventory/html/images/firework4.png b/qb-inventory/html/images/firework4.png
new file mode 100644
index 0000000..5aef862
Binary files /dev/null and b/qb-inventory/html/images/firework4.png differ
diff --git a/qb-inventory/html/images/firstaid.png b/qb-inventory/html/images/firstaid.png
new file mode 100644
index 0000000..38ffe8b
Binary files /dev/null and b/qb-inventory/html/images/firstaid.png differ
diff --git a/qb-inventory/html/images/fitbit.png b/qb-inventory/html/images/fitbit.png
new file mode 100644
index 0000000..81c619c
Binary files /dev/null and b/qb-inventory/html/images/fitbit.png differ
diff --git a/qb-inventory/html/images/glass.png b/qb-inventory/html/images/glass.png
new file mode 100644
index 0000000..94e1107
Binary files /dev/null and b/qb-inventory/html/images/glass.png differ
diff --git a/qb-inventory/html/images/goldbar.png b/qb-inventory/html/images/goldbar.png
new file mode 100644
index 0000000..da348e4
Binary files /dev/null and b/qb-inventory/html/images/goldbar.png differ
diff --git a/qb-inventory/html/images/goldchain.png b/qb-inventory/html/images/goldchain.png
new file mode 100644
index 0000000..4ae2735
Binary files /dev/null and b/qb-inventory/html/images/goldchain.png differ
diff --git a/qb-inventory/html/images/grape.png b/qb-inventory/html/images/grape.png
new file mode 100644
index 0000000..583e3e1
Binary files /dev/null and b/qb-inventory/html/images/grape.png differ
diff --git a/qb-inventory/html/images/grapejuice.png b/qb-inventory/html/images/grapejuice.png
new file mode 100644
index 0000000..63d6705
Binary files /dev/null and b/qb-inventory/html/images/grapejuice.png differ
diff --git a/qb-inventory/html/images/handcuffs.png b/qb-inventory/html/images/handcuffs.png
new file mode 100644
index 0000000..5dbc4d3
Binary files /dev/null and b/qb-inventory/html/images/handcuffs.png differ
diff --git a/qb-inventory/html/images/harness.png b/qb-inventory/html/images/harness.png
new file mode 100644
index 0000000..6e7b053
Binary files /dev/null and b/qb-inventory/html/images/harness.png differ
diff --git a/qb-inventory/html/images/id_card.png b/qb-inventory/html/images/id_card.png
new file mode 100644
index 0000000..3c1f882
Binary files /dev/null and b/qb-inventory/html/images/id_card.png differ
diff --git a/qb-inventory/html/images/iphone.png b/qb-inventory/html/images/iphone.png
new file mode 100644
index 0000000..539f9f6
Binary files /dev/null and b/qb-inventory/html/images/iphone.png differ
diff --git a/qb-inventory/html/images/iron.png b/qb-inventory/html/images/iron.png
new file mode 100644
index 0000000..fadee8b
Binary files /dev/null and b/qb-inventory/html/images/iron.png differ
diff --git a/qb-inventory/html/images/ironoxide.png b/qb-inventory/html/images/ironoxide.png
new file mode 100644
index 0000000..4dde030
Binary files /dev/null and b/qb-inventory/html/images/ironoxide.png differ
diff --git a/qb-inventory/html/images/jerry_can.png b/qb-inventory/html/images/jerry_can.png
new file mode 100644
index 0000000..d1340c1
Binary files /dev/null and b/qb-inventory/html/images/jerry_can.png differ
diff --git a/qb-inventory/html/images/joint.png b/qb-inventory/html/images/joint.png
new file mode 100644
index 0000000..54220ca
Binary files /dev/null and b/qb-inventory/html/images/joint.png differ
diff --git a/qb-inventory/html/images/labkey.png b/qb-inventory/html/images/labkey.png
new file mode 100644
index 0000000..83a48c2
Binary files /dev/null and b/qb-inventory/html/images/labkey.png differ
diff --git a/qb-inventory/html/images/laptop.png b/qb-inventory/html/images/laptop.png
new file mode 100644
index 0000000..f7d2ecc
Binary files /dev/null and b/qb-inventory/html/images/laptop.png differ
diff --git a/qb-inventory/html/images/lawyerpass.png b/qb-inventory/html/images/lawyerpass.png
new file mode 100644
index 0000000..ec9d4fe
Binary files /dev/null and b/qb-inventory/html/images/lawyerpass.png differ
diff --git a/qb-inventory/html/images/lighter.png b/qb-inventory/html/images/lighter.png
new file mode 100644
index 0000000..e3ed728
Binary files /dev/null and b/qb-inventory/html/images/lighter.png differ
diff --git a/qb-inventory/html/images/lj-symbol.svg b/qb-inventory/html/images/lj-symbol.svg
new file mode 100644
index 0000000..68db80b
--- /dev/null
+++ b/qb-inventory/html/images/lj-symbol.svg
@@ -0,0 +1,39 @@
+
+
+
diff --git a/qb-inventory/html/images/lockpick.png b/qb-inventory/html/images/lockpick.png
new file mode 100644
index 0000000..e5fa79a
Binary files /dev/null and b/qb-inventory/html/images/lockpick.png differ
diff --git a/qb-inventory/html/images/markedbills.png b/qb-inventory/html/images/markedbills.png
new file mode 100644
index 0000000..e0db69f
Binary files /dev/null and b/qb-inventory/html/images/markedbills.png differ
diff --git a/qb-inventory/html/images/mastercard.png b/qb-inventory/html/images/mastercard.png
new file mode 100644
index 0000000..98f6630
Binary files /dev/null and b/qb-inventory/html/images/mastercard.png differ
diff --git a/qb-inventory/html/images/metalscrap.png b/qb-inventory/html/images/metalscrap.png
new file mode 100644
index 0000000..72b9093
Binary files /dev/null and b/qb-inventory/html/images/metalscrap.png differ
diff --git a/qb-inventory/html/images/meth_baggy.png b/qb-inventory/html/images/meth_baggy.png
new file mode 100644
index 0000000..80cc0ba
Binary files /dev/null and b/qb-inventory/html/images/meth_baggy.png differ
diff --git a/qb-inventory/html/images/mg_ammo.png b/qb-inventory/html/images/mg_ammo.png
new file mode 100644
index 0000000..5b5fece
Binary files /dev/null and b/qb-inventory/html/images/mg_ammo.png differ
diff --git a/qb-inventory/html/images/moneybag.png b/qb-inventory/html/images/moneybag.png
new file mode 100644
index 0000000..1a197ff
Binary files /dev/null and b/qb-inventory/html/images/moneybag.png differ
diff --git a/qb-inventory/html/images/nitrous.png b/qb-inventory/html/images/nitrous.png
new file mode 100644
index 0000000..7743d45
Binary files /dev/null and b/qb-inventory/html/images/nitrous.png differ
diff --git a/qb-inventory/html/images/oxy.png b/qb-inventory/html/images/oxy.png
new file mode 100644
index 0000000..e1ab28c
Binary files /dev/null and b/qb-inventory/html/images/oxy.png differ
diff --git a/qb-inventory/html/images/painkillers.png b/qb-inventory/html/images/painkillers.png
new file mode 100644
index 0000000..14f5ffb
Binary files /dev/null and b/qb-inventory/html/images/painkillers.png differ
diff --git a/qb-inventory/html/images/parachute.png b/qb-inventory/html/images/parachute.png
new file mode 100644
index 0000000..f055866
Binary files /dev/null and b/qb-inventory/html/images/parachute.png differ
diff --git a/qb-inventory/html/images/phone.png b/qb-inventory/html/images/phone.png
new file mode 100644
index 0000000..83678f8
Binary files /dev/null and b/qb-inventory/html/images/phone.png differ
diff --git a/qb-inventory/html/images/pinger.png b/qb-inventory/html/images/pinger.png
new file mode 100644
index 0000000..2b0a3c4
Binary files /dev/null and b/qb-inventory/html/images/pinger.png differ
diff --git a/qb-inventory/html/images/pistol_ammo.png b/qb-inventory/html/images/pistol_ammo.png
new file mode 100644
index 0000000..f6d1ee6
Binary files /dev/null and b/qb-inventory/html/images/pistol_ammo.png differ
diff --git a/qb-inventory/html/images/pistol_extendedclip.png b/qb-inventory/html/images/pistol_extendedclip.png
new file mode 100644
index 0000000..298e133
Binary files /dev/null and b/qb-inventory/html/images/pistol_extendedclip.png differ
diff --git a/qb-inventory/html/images/pistol_suppressor.png b/qb-inventory/html/images/pistol_suppressor.png
new file mode 100644
index 0000000..5149912
Binary files /dev/null and b/qb-inventory/html/images/pistol_suppressor.png differ
diff --git a/qb-inventory/html/images/plastic.png b/qb-inventory/html/images/plastic.png
new file mode 100644
index 0000000..85314ff
Binary files /dev/null and b/qb-inventory/html/images/plastic.png differ
diff --git a/qb-inventory/html/images/police_stormram.png b/qb-inventory/html/images/police_stormram.png
new file mode 100644
index 0000000..c94515f
Binary files /dev/null and b/qb-inventory/html/images/police_stormram.png differ
diff --git a/qb-inventory/html/images/printerdocument.png b/qb-inventory/html/images/printerdocument.png
new file mode 100644
index 0000000..b1cee31
Binary files /dev/null and b/qb-inventory/html/images/printerdocument.png differ
diff --git a/qb-inventory/html/images/ps-symbol.svg b/qb-inventory/html/images/ps-symbol.svg
new file mode 100644
index 0000000..fc9bb1c
--- /dev/null
+++ b/qb-inventory/html/images/ps-symbol.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/qb-inventory/html/images/radio.png b/qb-inventory/html/images/radio.png
new file mode 100644
index 0000000..b723021
Binary files /dev/null and b/qb-inventory/html/images/radio.png differ
diff --git a/qb-inventory/html/images/radioscanner.png b/qb-inventory/html/images/radioscanner.png
new file mode 100644
index 0000000..74ca400
Binary files /dev/null and b/qb-inventory/html/images/radioscanner.png differ
diff --git a/qb-inventory/html/images/repairkit.png b/qb-inventory/html/images/repairkit.png
new file mode 100644
index 0000000..a40caca
Binary files /dev/null and b/qb-inventory/html/images/repairkit.png differ
diff --git a/qb-inventory/html/images/rifle_ammo.png b/qb-inventory/html/images/rifle_ammo.png
new file mode 100644
index 0000000..d40bed3
Binary files /dev/null and b/qb-inventory/html/images/rifle_ammo.png differ
diff --git a/qb-inventory/html/images/rifle_drummag.png b/qb-inventory/html/images/rifle_drummag.png
new file mode 100644
index 0000000..36bed74
Binary files /dev/null and b/qb-inventory/html/images/rifle_drummag.png differ
diff --git a/qb-inventory/html/images/rolex.png b/qb-inventory/html/images/rolex.png
new file mode 100644
index 0000000..9538aff
Binary files /dev/null and b/qb-inventory/html/images/rolex.png differ
diff --git a/qb-inventory/html/images/rolling_paper.png b/qb-inventory/html/images/rolling_paper.png
new file mode 100644
index 0000000..e5f644e
Binary files /dev/null and b/qb-inventory/html/images/rolling_paper.png differ
diff --git a/qb-inventory/html/images/rubber.png b/qb-inventory/html/images/rubber.png
new file mode 100644
index 0000000..ec31f6a
Binary files /dev/null and b/qb-inventory/html/images/rubber.png differ
diff --git a/qb-inventory/html/images/samsungphone.png b/qb-inventory/html/images/samsungphone.png
new file mode 100644
index 0000000..d535728
Binary files /dev/null and b/qb-inventory/html/images/samsungphone.png differ
diff --git a/qb-inventory/html/images/sandwich.png b/qb-inventory/html/images/sandwich.png
new file mode 100644
index 0000000..fd66359
Binary files /dev/null and b/qb-inventory/html/images/sandwich.png differ
diff --git a/qb-inventory/html/images/screwdriverset.png b/qb-inventory/html/images/screwdriverset.png
new file mode 100644
index 0000000..5e3d9b0
Binary files /dev/null and b/qb-inventory/html/images/screwdriverset.png differ
diff --git a/qb-inventory/html/images/security_card_01.png b/qb-inventory/html/images/security_card_01.png
new file mode 100644
index 0000000..5f0cd85
Binary files /dev/null and b/qb-inventory/html/images/security_card_01.png differ
diff --git a/qb-inventory/html/images/security_card_02.png b/qb-inventory/html/images/security_card_02.png
new file mode 100644
index 0000000..ca107a5
Binary files /dev/null and b/qb-inventory/html/images/security_card_02.png differ
diff --git a/qb-inventory/html/images/shotgun_ammo.png b/qb-inventory/html/images/shotgun_ammo.png
new file mode 100644
index 0000000..d8de03c
Binary files /dev/null and b/qb-inventory/html/images/shotgun_ammo.png differ
diff --git a/qb-inventory/html/images/smg_ammo.png b/qb-inventory/html/images/smg_ammo.png
new file mode 100644
index 0000000..d728e22
Binary files /dev/null and b/qb-inventory/html/images/smg_ammo.png differ
diff --git a/qb-inventory/html/images/smg_flashlight.png b/qb-inventory/html/images/smg_flashlight.png
new file mode 100644
index 0000000..139ae7a
Binary files /dev/null and b/qb-inventory/html/images/smg_flashlight.png differ
diff --git a/qb-inventory/html/images/smg_scope.png b/qb-inventory/html/images/smg_scope.png
new file mode 100644
index 0000000..14946ea
Binary files /dev/null and b/qb-inventory/html/images/smg_scope.png differ
diff --git a/qb-inventory/html/images/snikkel_candy.png b/qb-inventory/html/images/snikkel_candy.png
new file mode 100644
index 0000000..8faf916
Binary files /dev/null and b/qb-inventory/html/images/snikkel_candy.png differ
diff --git a/qb-inventory/html/images/snowball.png b/qb-inventory/html/images/snowball.png
new file mode 100644
index 0000000..dbb9376
Binary files /dev/null and b/qb-inventory/html/images/snowball.png differ
diff --git a/qb-inventory/html/images/steel.png b/qb-inventory/html/images/steel.png
new file mode 100644
index 0000000..0e16d7e
Binary files /dev/null and b/qb-inventory/html/images/steel.png differ
diff --git a/qb-inventory/html/images/stickynote.png b/qb-inventory/html/images/stickynote.png
new file mode 100644
index 0000000..eeffca1
Binary files /dev/null and b/qb-inventory/html/images/stickynote.png differ
diff --git a/qb-inventory/html/images/tablet.png b/qb-inventory/html/images/tablet.png
new file mode 100644
index 0000000..011f483
Binary files /dev/null and b/qb-inventory/html/images/tablet.png differ
diff --git a/qb-inventory/html/images/thermite.png b/qb-inventory/html/images/thermite.png
new file mode 100644
index 0000000..fe583e9
Binary files /dev/null and b/qb-inventory/html/images/thermite.png differ
diff --git a/qb-inventory/html/images/tosti.png b/qb-inventory/html/images/tosti.png
new file mode 100644
index 0000000..1118fb1
Binary files /dev/null and b/qb-inventory/html/images/tosti.png differ
diff --git a/qb-inventory/html/images/tunerchip.png b/qb-inventory/html/images/tunerchip.png
new file mode 100644
index 0000000..5e007f7
Binary files /dev/null and b/qb-inventory/html/images/tunerchip.png differ
diff --git a/qb-inventory/html/images/twerks_candy.png b/qb-inventory/html/images/twerks_candy.png
new file mode 100644
index 0000000..4c469bc
Binary files /dev/null and b/qb-inventory/html/images/twerks_candy.png differ
diff --git a/qb-inventory/html/images/usb_device.png b/qb-inventory/html/images/usb_device.png
new file mode 100644
index 0000000..a97ef24
Binary files /dev/null and b/qb-inventory/html/images/usb_device.png differ
diff --git a/qb-inventory/html/images/uwu_bubbletea.png b/qb-inventory/html/images/uwu_bubbletea.png
new file mode 100644
index 0000000..ed9381d
Binary files /dev/null and b/qb-inventory/html/images/uwu_bubbletea.png differ
diff --git a/qb-inventory/html/images/visacard.png b/qb-inventory/html/images/visacard.png
new file mode 100644
index 0000000..e0ee9f3
Binary files /dev/null and b/qb-inventory/html/images/visacard.png differ
diff --git a/qb-inventory/html/images/vodka.png b/qb-inventory/html/images/vodka.png
new file mode 100644
index 0000000..202564f
Binary files /dev/null and b/qb-inventory/html/images/vodka.png differ
diff --git a/qb-inventory/html/images/walkstick.png b/qb-inventory/html/images/walkstick.png
new file mode 100644
index 0000000..81af0ea
Binary files /dev/null and b/qb-inventory/html/images/walkstick.png differ
diff --git a/qb-inventory/html/images/wallet.png b/qb-inventory/html/images/wallet.png
new file mode 100644
index 0000000..900c575
Binary files /dev/null and b/qb-inventory/html/images/wallet.png differ
diff --git a/qb-inventory/html/images/water_bottle.png b/qb-inventory/html/images/water_bottle.png
new file mode 100644
index 0000000..5d65670
Binary files /dev/null and b/qb-inventory/html/images/water_bottle.png differ
diff --git a/qb-inventory/html/images/weapon_advancedrifle.png b/qb-inventory/html/images/weapon_advancedrifle.png
new file mode 100644
index 0000000..dd8f85f
Binary files /dev/null and b/qb-inventory/html/images/weapon_advancedrifle.png differ
diff --git a/qb-inventory/html/images/weapon_appistol.png b/qb-inventory/html/images/weapon_appistol.png
new file mode 100644
index 0000000..fba8306
Binary files /dev/null and b/qb-inventory/html/images/weapon_appistol.png differ
diff --git a/qb-inventory/html/images/weapon_assaultrifle.png b/qb-inventory/html/images/weapon_assaultrifle.png
new file mode 100644
index 0000000..8e9e89b
Binary files /dev/null and b/qb-inventory/html/images/weapon_assaultrifle.png differ
diff --git a/qb-inventory/html/images/weapon_assaultrifle_mk2.png b/qb-inventory/html/images/weapon_assaultrifle_mk2.png
new file mode 100644
index 0000000..6e1b832
Binary files /dev/null and b/qb-inventory/html/images/weapon_assaultrifle_mk2.png differ
diff --git a/qb-inventory/html/images/weapon_assaultshotgun.png b/qb-inventory/html/images/weapon_assaultshotgun.png
new file mode 100644
index 0000000..a52c213
Binary files /dev/null and b/qb-inventory/html/images/weapon_assaultshotgun.png differ
diff --git a/qb-inventory/html/images/weapon_assaultsmg.png b/qb-inventory/html/images/weapon_assaultsmg.png
new file mode 100644
index 0000000..9b2beec
Binary files /dev/null and b/qb-inventory/html/images/weapon_assaultsmg.png differ
diff --git a/qb-inventory/html/images/weapon_autoshotgun.png b/qb-inventory/html/images/weapon_autoshotgun.png
new file mode 100644
index 0000000..98170be
Binary files /dev/null and b/qb-inventory/html/images/weapon_autoshotgun.png differ
diff --git a/qb-inventory/html/images/weapon_ball.png b/qb-inventory/html/images/weapon_ball.png
new file mode 100644
index 0000000..2c90534
Binary files /dev/null and b/qb-inventory/html/images/weapon_ball.png differ
diff --git a/qb-inventory/html/images/weapon_bat.png b/qb-inventory/html/images/weapon_bat.png
new file mode 100644
index 0000000..c1e26cd
Binary files /dev/null and b/qb-inventory/html/images/weapon_bat.png differ
diff --git a/qb-inventory/html/images/weapon_battleaxe.png b/qb-inventory/html/images/weapon_battleaxe.png
new file mode 100644
index 0000000..627bb76
Binary files /dev/null and b/qb-inventory/html/images/weapon_battleaxe.png differ
diff --git a/qb-inventory/html/images/weapon_bottle.png b/qb-inventory/html/images/weapon_bottle.png
new file mode 100644
index 0000000..7130585
Binary files /dev/null and b/qb-inventory/html/images/weapon_bottle.png differ
diff --git a/qb-inventory/html/images/weapon_briefcase.png b/qb-inventory/html/images/weapon_briefcase.png
new file mode 100644
index 0000000..0528f80
Binary files /dev/null and b/qb-inventory/html/images/weapon_briefcase.png differ
diff --git a/qb-inventory/html/images/weapon_briefcase2.png b/qb-inventory/html/images/weapon_briefcase2.png
new file mode 100644
index 0000000..87f3cdd
Binary files /dev/null and b/qb-inventory/html/images/weapon_briefcase2.png differ
diff --git a/qb-inventory/html/images/weapon_bullpuprifle.png b/qb-inventory/html/images/weapon_bullpuprifle.png
new file mode 100644
index 0000000..3f8418f
Binary files /dev/null and b/qb-inventory/html/images/weapon_bullpuprifle.png differ
diff --git a/qb-inventory/html/images/weapon_bullpuprifle_mk2.png b/qb-inventory/html/images/weapon_bullpuprifle_mk2.png
new file mode 100644
index 0000000..32829ec
Binary files /dev/null and b/qb-inventory/html/images/weapon_bullpuprifle_mk2.png differ
diff --git a/qb-inventory/html/images/weapon_bullpupshotgun.png b/qb-inventory/html/images/weapon_bullpupshotgun.png
new file mode 100644
index 0000000..659a480
Binary files /dev/null and b/qb-inventory/html/images/weapon_bullpupshotgun.png differ
diff --git a/qb-inventory/html/images/weapon_bzgas.png b/qb-inventory/html/images/weapon_bzgas.png
new file mode 100644
index 0000000..9d858eb
Binary files /dev/null and b/qb-inventory/html/images/weapon_bzgas.png differ
diff --git a/qb-inventory/html/images/weapon_c4.png b/qb-inventory/html/images/weapon_c4.png
new file mode 100644
index 0000000..5066112
Binary files /dev/null and b/qb-inventory/html/images/weapon_c4.png differ
diff --git a/qb-inventory/html/images/weapon_carbinerifle.png b/qb-inventory/html/images/weapon_carbinerifle.png
new file mode 100644
index 0000000..740176d
Binary files /dev/null and b/qb-inventory/html/images/weapon_carbinerifle.png differ
diff --git a/qb-inventory/html/images/weapon_carbinerifle_mk2.png b/qb-inventory/html/images/weapon_carbinerifle_mk2.png
new file mode 100644
index 0000000..b41d7f6
Binary files /dev/null and b/qb-inventory/html/images/weapon_carbinerifle_mk2.png differ
diff --git a/qb-inventory/html/images/weapon_ceramicpistol.png b/qb-inventory/html/images/weapon_ceramicpistol.png
new file mode 100644
index 0000000..4b36caa
Binary files /dev/null and b/qb-inventory/html/images/weapon_ceramicpistol.png differ
diff --git a/qb-inventory/html/images/weapon_combatmg.png b/qb-inventory/html/images/weapon_combatmg.png
new file mode 100644
index 0000000..ad0ec14
Binary files /dev/null and b/qb-inventory/html/images/weapon_combatmg.png differ
diff --git a/qb-inventory/html/images/weapon_combatmg_mk2.png b/qb-inventory/html/images/weapon_combatmg_mk2.png
new file mode 100644
index 0000000..4693148
Binary files /dev/null and b/qb-inventory/html/images/weapon_combatmg_mk2.png differ
diff --git a/qb-inventory/html/images/weapon_combatpdw.png b/qb-inventory/html/images/weapon_combatpdw.png
new file mode 100644
index 0000000..5af1255
Binary files /dev/null and b/qb-inventory/html/images/weapon_combatpdw.png differ
diff --git a/qb-inventory/html/images/weapon_combatpistol.png b/qb-inventory/html/images/weapon_combatpistol.png
new file mode 100644
index 0000000..7175e27
Binary files /dev/null and b/qb-inventory/html/images/weapon_combatpistol.png differ
diff --git a/qb-inventory/html/images/weapon_combatshotgun.png b/qb-inventory/html/images/weapon_combatshotgun.png
new file mode 100644
index 0000000..dac547d
Binary files /dev/null and b/qb-inventory/html/images/weapon_combatshotgun.png differ
diff --git a/qb-inventory/html/images/weapon_compactlauncher.png b/qb-inventory/html/images/weapon_compactlauncher.png
new file mode 100644
index 0000000..ce438ce
Binary files /dev/null and b/qb-inventory/html/images/weapon_compactlauncher.png differ
diff --git a/qb-inventory/html/images/weapon_compactrifle.png b/qb-inventory/html/images/weapon_compactrifle.png
new file mode 100644
index 0000000..5dbdd76
Binary files /dev/null and b/qb-inventory/html/images/weapon_compactrifle.png differ
diff --git a/qb-inventory/html/images/weapon_crowbar.png b/qb-inventory/html/images/weapon_crowbar.png
new file mode 100644
index 0000000..93ca5f0
Binary files /dev/null and b/qb-inventory/html/images/weapon_crowbar.png differ
diff --git a/qb-inventory/html/images/weapon_dagger.png b/qb-inventory/html/images/weapon_dagger.png
new file mode 100644
index 0000000..81ab02e
Binary files /dev/null and b/qb-inventory/html/images/weapon_dagger.png differ
diff --git a/qb-inventory/html/images/weapon_dbshotgun.png b/qb-inventory/html/images/weapon_dbshotgun.png
new file mode 100644
index 0000000..d0ab8cd
Binary files /dev/null and b/qb-inventory/html/images/weapon_dbshotgun.png differ
diff --git a/qb-inventory/html/images/weapon_doubleaction.png b/qb-inventory/html/images/weapon_doubleaction.png
new file mode 100644
index 0000000..8a50a9c
Binary files /dev/null and b/qb-inventory/html/images/weapon_doubleaction.png differ
diff --git a/qb-inventory/html/images/weapon_fireextinguisher.png b/qb-inventory/html/images/weapon_fireextinguisher.png
new file mode 100644
index 0000000..6a40bf0
Binary files /dev/null and b/qb-inventory/html/images/weapon_fireextinguisher.png differ
diff --git a/qb-inventory/html/images/weapon_firework.png b/qb-inventory/html/images/weapon_firework.png
new file mode 100644
index 0000000..515ff7b
Binary files /dev/null and b/qb-inventory/html/images/weapon_firework.png differ
diff --git a/qb-inventory/html/images/weapon_flare.png b/qb-inventory/html/images/weapon_flare.png
new file mode 100644
index 0000000..35c6342
Binary files /dev/null and b/qb-inventory/html/images/weapon_flare.png differ
diff --git a/qb-inventory/html/images/weapon_flaregun.png b/qb-inventory/html/images/weapon_flaregun.png
new file mode 100644
index 0000000..bbcf46f
Binary files /dev/null and b/qb-inventory/html/images/weapon_flaregun.png differ
diff --git a/qb-inventory/html/images/weapon_flashlight.png b/qb-inventory/html/images/weapon_flashlight.png
new file mode 100644
index 0000000..3dcd412
Binary files /dev/null and b/qb-inventory/html/images/weapon_flashlight.png differ
diff --git a/qb-inventory/html/images/weapon_gadgetpistol.png b/qb-inventory/html/images/weapon_gadgetpistol.png
new file mode 100644
index 0000000..235b28c
Binary files /dev/null and b/qb-inventory/html/images/weapon_gadgetpistol.png differ
diff --git a/qb-inventory/html/images/weapon_garbagebag.png b/qb-inventory/html/images/weapon_garbagebag.png
new file mode 100644
index 0000000..b039613
Binary files /dev/null and b/qb-inventory/html/images/weapon_garbagebag.png differ
diff --git a/qb-inventory/html/images/weapon_golfclub.png b/qb-inventory/html/images/weapon_golfclub.png
new file mode 100644
index 0000000..6abd640
Binary files /dev/null and b/qb-inventory/html/images/weapon_golfclub.png differ
diff --git a/qb-inventory/html/images/weapon_grenade.png b/qb-inventory/html/images/weapon_grenade.png
new file mode 100644
index 0000000..1e11841
Binary files /dev/null and b/qb-inventory/html/images/weapon_grenade.png differ
diff --git a/qb-inventory/html/images/weapon_grenadelauncher.png b/qb-inventory/html/images/weapon_grenadelauncher.png
new file mode 100644
index 0000000..4aee5d6
Binary files /dev/null and b/qb-inventory/html/images/weapon_grenadelauncher.png differ
diff --git a/qb-inventory/html/images/weapon_grenadelauncher_smoke.png b/qb-inventory/html/images/weapon_grenadelauncher_smoke.png
new file mode 100644
index 0000000..f6728ef
Binary files /dev/null and b/qb-inventory/html/images/weapon_grenadelauncher_smoke.png differ
diff --git a/qb-inventory/html/images/weapon_gusenberg.png b/qb-inventory/html/images/weapon_gusenberg.png
new file mode 100644
index 0000000..bc2de61
Binary files /dev/null and b/qb-inventory/html/images/weapon_gusenberg.png differ
diff --git a/qb-inventory/html/images/weapon_hammer.png b/qb-inventory/html/images/weapon_hammer.png
new file mode 100644
index 0000000..5205d25
Binary files /dev/null and b/qb-inventory/html/images/weapon_hammer.png differ
diff --git a/qb-inventory/html/images/weapon_handcuffs.png b/qb-inventory/html/images/weapon_handcuffs.png
new file mode 100644
index 0000000..5dbc4d3
Binary files /dev/null and b/qb-inventory/html/images/weapon_handcuffs.png differ
diff --git a/qb-inventory/html/images/weapon_hatchet.png b/qb-inventory/html/images/weapon_hatchet.png
new file mode 100644
index 0000000..5e94000
Binary files /dev/null and b/qb-inventory/html/images/weapon_hatchet.png differ
diff --git a/qb-inventory/html/images/weapon_hazardcan.png b/qb-inventory/html/images/weapon_hazardcan.png
new file mode 100644
index 0000000..a409704
Binary files /dev/null and b/qb-inventory/html/images/weapon_hazardcan.png differ
diff --git a/qb-inventory/html/images/weapon_heavypistol.png b/qb-inventory/html/images/weapon_heavypistol.png
new file mode 100644
index 0000000..b68ecc9
Binary files /dev/null and b/qb-inventory/html/images/weapon_heavypistol.png differ
diff --git a/qb-inventory/html/images/weapon_heavyshotgun.png b/qb-inventory/html/images/weapon_heavyshotgun.png
new file mode 100644
index 0000000..4382e09
Binary files /dev/null and b/qb-inventory/html/images/weapon_heavyshotgun.png differ
diff --git a/qb-inventory/html/images/weapon_heavysniper.png b/qb-inventory/html/images/weapon_heavysniper.png
new file mode 100644
index 0000000..42ed77d
Binary files /dev/null and b/qb-inventory/html/images/weapon_heavysniper.png differ
diff --git a/qb-inventory/html/images/weapon_heavysniper_mk2.png b/qb-inventory/html/images/weapon_heavysniper_mk2.png
new file mode 100644
index 0000000..dcbc0c0
Binary files /dev/null and b/qb-inventory/html/images/weapon_heavysniper_mk2.png differ
diff --git a/qb-inventory/html/images/weapon_hominglauncher.png b/qb-inventory/html/images/weapon_hominglauncher.png
new file mode 100644
index 0000000..519ce0d
Binary files /dev/null and b/qb-inventory/html/images/weapon_hominglauncher.png differ
diff --git a/qb-inventory/html/images/weapon_knife.png b/qb-inventory/html/images/weapon_knife.png
new file mode 100644
index 0000000..56ee365
Binary files /dev/null and b/qb-inventory/html/images/weapon_knife.png differ
diff --git a/qb-inventory/html/images/weapon_knuckle.png b/qb-inventory/html/images/weapon_knuckle.png
new file mode 100644
index 0000000..10caa77
Binary files /dev/null and b/qb-inventory/html/images/weapon_knuckle.png differ
diff --git a/qb-inventory/html/images/weapon_license.png b/qb-inventory/html/images/weapon_license.png
new file mode 100644
index 0000000..8abae70
Binary files /dev/null and b/qb-inventory/html/images/weapon_license.png differ
diff --git a/qb-inventory/html/images/weapon_machete.png b/qb-inventory/html/images/weapon_machete.png
new file mode 100644
index 0000000..091dea1
Binary files /dev/null and b/qb-inventory/html/images/weapon_machete.png differ
diff --git a/qb-inventory/html/images/weapon_machinepistol.png b/qb-inventory/html/images/weapon_machinepistol.png
new file mode 100644
index 0000000..01ee725
Binary files /dev/null and b/qb-inventory/html/images/weapon_machinepistol.png differ
diff --git a/qb-inventory/html/images/weapon_marksmanpistol.png b/qb-inventory/html/images/weapon_marksmanpistol.png
new file mode 100644
index 0000000..bb42b54
Binary files /dev/null and b/qb-inventory/html/images/weapon_marksmanpistol.png differ
diff --git a/qb-inventory/html/images/weapon_marksmanrifle.png b/qb-inventory/html/images/weapon_marksmanrifle.png
new file mode 100644
index 0000000..35de615
Binary files /dev/null and b/qb-inventory/html/images/weapon_marksmanrifle.png differ
diff --git a/qb-inventory/html/images/weapon_marksmanrifle_mk2.png b/qb-inventory/html/images/weapon_marksmanrifle_mk2.png
new file mode 100644
index 0000000..a18ef99
Binary files /dev/null and b/qb-inventory/html/images/weapon_marksmanrifle_mk2.png differ
diff --git a/qb-inventory/html/images/weapon_mg.png b/qb-inventory/html/images/weapon_mg.png
new file mode 100644
index 0000000..6a9d267
Binary files /dev/null and b/qb-inventory/html/images/weapon_mg.png differ
diff --git a/qb-inventory/html/images/weapon_microsmg.png b/qb-inventory/html/images/weapon_microsmg.png
new file mode 100644
index 0000000..8a03314
Binary files /dev/null and b/qb-inventory/html/images/weapon_microsmg.png differ
diff --git a/qb-inventory/html/images/weapon_militaryrifle.png b/qb-inventory/html/images/weapon_militaryrifle.png
new file mode 100644
index 0000000..3fa01c9
Binary files /dev/null and b/qb-inventory/html/images/weapon_militaryrifle.png differ
diff --git a/qb-inventory/html/images/weapon_minigun.png b/qb-inventory/html/images/weapon_minigun.png
new file mode 100644
index 0000000..6f7b3c4
Binary files /dev/null and b/qb-inventory/html/images/weapon_minigun.png differ
diff --git a/qb-inventory/html/images/weapon_minismg.png b/qb-inventory/html/images/weapon_minismg.png
new file mode 100644
index 0000000..e11b22f
Binary files /dev/null and b/qb-inventory/html/images/weapon_minismg.png differ
diff --git a/qb-inventory/html/images/weapon_molotov.png b/qb-inventory/html/images/weapon_molotov.png
new file mode 100644
index 0000000..a28ac65
Binary files /dev/null and b/qb-inventory/html/images/weapon_molotov.png differ
diff --git a/qb-inventory/html/images/weapon_musket.png b/qb-inventory/html/images/weapon_musket.png
new file mode 100644
index 0000000..b5f7ae8
Binary files /dev/null and b/qb-inventory/html/images/weapon_musket.png differ
diff --git a/qb-inventory/html/images/weapon_navyrevolver.png b/qb-inventory/html/images/weapon_navyrevolver.png
new file mode 100644
index 0000000..cbd2d8b
Binary files /dev/null and b/qb-inventory/html/images/weapon_navyrevolver.png differ
diff --git a/qb-inventory/html/images/weapon_nightstick.png b/qb-inventory/html/images/weapon_nightstick.png
new file mode 100644
index 0000000..3d43cec
Binary files /dev/null and b/qb-inventory/html/images/weapon_nightstick.png differ
diff --git a/qb-inventory/html/images/weapon_petrolcan.png b/qb-inventory/html/images/weapon_petrolcan.png
new file mode 100644
index 0000000..1545a6d
Binary files /dev/null and b/qb-inventory/html/images/weapon_petrolcan.png differ
diff --git a/qb-inventory/html/images/weapon_pipebomb.png b/qb-inventory/html/images/weapon_pipebomb.png
new file mode 100644
index 0000000..a2f0ffd
Binary files /dev/null and b/qb-inventory/html/images/weapon_pipebomb.png differ
diff --git a/qb-inventory/html/images/weapon_pistol.png b/qb-inventory/html/images/weapon_pistol.png
new file mode 100644
index 0000000..ced5c99
Binary files /dev/null and b/qb-inventory/html/images/weapon_pistol.png differ
diff --git a/qb-inventory/html/images/weapon_pistol50.png b/qb-inventory/html/images/weapon_pistol50.png
new file mode 100644
index 0000000..be537aa
Binary files /dev/null and b/qb-inventory/html/images/weapon_pistol50.png differ
diff --git a/qb-inventory/html/images/weapon_pistol_mk2.png b/qb-inventory/html/images/weapon_pistol_mk2.png
new file mode 100644
index 0000000..b3d387b
Binary files /dev/null and b/qb-inventory/html/images/weapon_pistol_mk2.png differ
diff --git a/qb-inventory/html/images/weapon_poolcue.png b/qb-inventory/html/images/weapon_poolcue.png
new file mode 100644
index 0000000..d4434b5
Binary files /dev/null and b/qb-inventory/html/images/weapon_poolcue.png differ
diff --git a/qb-inventory/html/images/weapon_proximitymine.png b/qb-inventory/html/images/weapon_proximitymine.png
new file mode 100644
index 0000000..7091af2
Binary files /dev/null and b/qb-inventory/html/images/weapon_proximitymine.png differ
diff --git a/qb-inventory/html/images/weapon_pumpshotgun.png b/qb-inventory/html/images/weapon_pumpshotgun.png
new file mode 100644
index 0000000..37efdb8
Binary files /dev/null and b/qb-inventory/html/images/weapon_pumpshotgun.png differ
diff --git a/qb-inventory/html/images/weapon_pumpshotgun_mk2.png b/qb-inventory/html/images/weapon_pumpshotgun_mk2.png
new file mode 100644
index 0000000..d34d4be
Binary files /dev/null and b/qb-inventory/html/images/weapon_pumpshotgun_mk2.png differ
diff --git a/qb-inventory/html/images/weapon_railgun.png b/qb-inventory/html/images/weapon_railgun.png
new file mode 100644
index 0000000..29171c2
Binary files /dev/null and b/qb-inventory/html/images/weapon_railgun.png differ
diff --git a/qb-inventory/html/images/weapon_raycarbine.png b/qb-inventory/html/images/weapon_raycarbine.png
new file mode 100644
index 0000000..1f7185f
Binary files /dev/null and b/qb-inventory/html/images/weapon_raycarbine.png differ
diff --git a/qb-inventory/html/images/weapon_rayminigun.png b/qb-inventory/html/images/weapon_rayminigun.png
new file mode 100644
index 0000000..ed7cbeb
Binary files /dev/null and b/qb-inventory/html/images/weapon_rayminigun.png differ
diff --git a/qb-inventory/html/images/weapon_raypistol.png b/qb-inventory/html/images/weapon_raypistol.png
new file mode 100644
index 0000000..d2a9110
Binary files /dev/null and b/qb-inventory/html/images/weapon_raypistol.png differ
diff --git a/qb-inventory/html/images/weapon_remotesniper.png b/qb-inventory/html/images/weapon_remotesniper.png
new file mode 100644
index 0000000..8d93079
Binary files /dev/null and b/qb-inventory/html/images/weapon_remotesniper.png differ
diff --git a/qb-inventory/html/images/weapon_revolver.png b/qb-inventory/html/images/weapon_revolver.png
new file mode 100644
index 0000000..c8910ae
Binary files /dev/null and b/qb-inventory/html/images/weapon_revolver.png differ
diff --git a/qb-inventory/html/images/weapon_revolver_mk2.png b/qb-inventory/html/images/weapon_revolver_mk2.png
new file mode 100644
index 0000000..ee5de57
Binary files /dev/null and b/qb-inventory/html/images/weapon_revolver_mk2.png differ
diff --git a/qb-inventory/html/images/weapon_rpg.png b/qb-inventory/html/images/weapon_rpg.png
new file mode 100644
index 0000000..20c5e42
Binary files /dev/null and b/qb-inventory/html/images/weapon_rpg.png differ
diff --git a/qb-inventory/html/images/weapon_sawnoffshotgun.png b/qb-inventory/html/images/weapon_sawnoffshotgun.png
new file mode 100644
index 0000000..3de22de
Binary files /dev/null and b/qb-inventory/html/images/weapon_sawnoffshotgun.png differ
diff --git a/qb-inventory/html/images/weapon_smg.png b/qb-inventory/html/images/weapon_smg.png
new file mode 100644
index 0000000..45dcc61
Binary files /dev/null and b/qb-inventory/html/images/weapon_smg.png differ
diff --git a/qb-inventory/html/images/weapon_smg_mk2.png b/qb-inventory/html/images/weapon_smg_mk2.png
new file mode 100644
index 0000000..ce049a7
Binary files /dev/null and b/qb-inventory/html/images/weapon_smg_mk2.png differ
diff --git a/qb-inventory/html/images/weapon_sniperrifle.png b/qb-inventory/html/images/weapon_sniperrifle.png
new file mode 100644
index 0000000..527c066
Binary files /dev/null and b/qb-inventory/html/images/weapon_sniperrifle.png differ
diff --git a/qb-inventory/html/images/weapon_snowball.png b/qb-inventory/html/images/weapon_snowball.png
new file mode 100644
index 0000000..43251d8
Binary files /dev/null and b/qb-inventory/html/images/weapon_snowball.png differ
diff --git a/qb-inventory/html/images/weapon_snspistol.png b/qb-inventory/html/images/weapon_snspistol.png
new file mode 100644
index 0000000..57873c6
Binary files /dev/null and b/qb-inventory/html/images/weapon_snspistol.png differ
diff --git a/qb-inventory/html/images/weapon_snspistol_mk2.png b/qb-inventory/html/images/weapon_snspistol_mk2.png
new file mode 100644
index 0000000..a8dde8c
Binary files /dev/null and b/qb-inventory/html/images/weapon_snspistol_mk2.png differ
diff --git a/qb-inventory/html/images/weapon_specialcarbine.png b/qb-inventory/html/images/weapon_specialcarbine.png
new file mode 100644
index 0000000..fd51e71
Binary files /dev/null and b/qb-inventory/html/images/weapon_specialcarbine.png differ
diff --git a/qb-inventory/html/images/weapon_specialcarbine_mk2.png b/qb-inventory/html/images/weapon_specialcarbine_mk2.png
new file mode 100644
index 0000000..a8b3331
Binary files /dev/null and b/qb-inventory/html/images/weapon_specialcarbine_mk2.png differ
diff --git a/qb-inventory/html/images/weapon_stickybomb.png b/qb-inventory/html/images/weapon_stickybomb.png
new file mode 100644
index 0000000..5194bfe
Binary files /dev/null and b/qb-inventory/html/images/weapon_stickybomb.png differ
diff --git a/qb-inventory/html/images/weapon_stone_hatchet.png b/qb-inventory/html/images/weapon_stone_hatchet.png
new file mode 100644
index 0000000..5d5dce4
Binary files /dev/null and b/qb-inventory/html/images/weapon_stone_hatchet.png differ
diff --git a/qb-inventory/html/images/weapon_stungun.png b/qb-inventory/html/images/weapon_stungun.png
new file mode 100644
index 0000000..bc30712
Binary files /dev/null and b/qb-inventory/html/images/weapon_stungun.png differ
diff --git a/qb-inventory/html/images/weapon_switchblade.png b/qb-inventory/html/images/weapon_switchblade.png
new file mode 100644
index 0000000..aa692c8
Binary files /dev/null and b/qb-inventory/html/images/weapon_switchblade.png differ
diff --git a/qb-inventory/html/images/weapon_vintagepistol.png b/qb-inventory/html/images/weapon_vintagepistol.png
new file mode 100644
index 0000000..3863458
Binary files /dev/null and b/qb-inventory/html/images/weapon_vintagepistol.png differ
diff --git a/qb-inventory/html/images/weapon_wrench.png b/qb-inventory/html/images/weapon_wrench.png
new file mode 100644
index 0000000..c9668fc
Binary files /dev/null and b/qb-inventory/html/images/weapon_wrench.png differ
diff --git a/qb-inventory/html/images/weapontint_army.png b/qb-inventory/html/images/weapontint_army.png
new file mode 100644
index 0000000..c0cfb98
Binary files /dev/null and b/qb-inventory/html/images/weapontint_army.png differ
diff --git a/qb-inventory/html/images/weapontint_black.png b/qb-inventory/html/images/weapontint_black.png
new file mode 100644
index 0000000..130bccf
Binary files /dev/null and b/qb-inventory/html/images/weapontint_black.png differ
diff --git a/qb-inventory/html/images/weapontint_gold.png b/qb-inventory/html/images/weapontint_gold.png
new file mode 100644
index 0000000..b1dddee
Binary files /dev/null and b/qb-inventory/html/images/weapontint_gold.png differ
diff --git a/qb-inventory/html/images/weapontint_green.png b/qb-inventory/html/images/weapontint_green.png
new file mode 100644
index 0000000..2218ed6
Binary files /dev/null and b/qb-inventory/html/images/weapontint_green.png differ
diff --git a/qb-inventory/html/images/weapontint_lspd.png b/qb-inventory/html/images/weapontint_lspd.png
new file mode 100644
index 0000000..90493ad
Binary files /dev/null and b/qb-inventory/html/images/weapontint_lspd.png differ
diff --git a/qb-inventory/html/images/weapontint_orange.png b/qb-inventory/html/images/weapontint_orange.png
new file mode 100644
index 0000000..377020f
Binary files /dev/null and b/qb-inventory/html/images/weapontint_orange.png differ
diff --git a/qb-inventory/html/images/weapontint_pink.png b/qb-inventory/html/images/weapontint_pink.png
new file mode 100644
index 0000000..80818a3
Binary files /dev/null and b/qb-inventory/html/images/weapontint_pink.png differ
diff --git a/qb-inventory/html/images/weapontint_plat.png b/qb-inventory/html/images/weapontint_plat.png
new file mode 100644
index 0000000..20e17f3
Binary files /dev/null and b/qb-inventory/html/images/weapontint_plat.png differ
diff --git a/qb-inventory/html/images/weed_baggy.png b/qb-inventory/html/images/weed_baggy.png
new file mode 100644
index 0000000..dbcaee3
Binary files /dev/null and b/qb-inventory/html/images/weed_baggy.png differ
diff --git a/qb-inventory/html/images/weed_baggy_empty.png b/qb-inventory/html/images/weed_baggy_empty.png
new file mode 100644
index 0000000..ace41c1
Binary files /dev/null and b/qb-inventory/html/images/weed_baggy_empty.png differ
diff --git a/qb-inventory/html/images/weed_brick.png b/qb-inventory/html/images/weed_brick.png
new file mode 100644
index 0000000..48b879e
Binary files /dev/null and b/qb-inventory/html/images/weed_brick.png differ
diff --git a/qb-inventory/html/images/weed_nutrition.png b/qb-inventory/html/images/weed_nutrition.png
new file mode 100644
index 0000000..a64d40a
Binary files /dev/null and b/qb-inventory/html/images/weed_nutrition.png differ
diff --git a/qb-inventory/html/images/weed_seed.png b/qb-inventory/html/images/weed_seed.png
new file mode 100644
index 0000000..d57081d
Binary files /dev/null and b/qb-inventory/html/images/weed_seed.png differ
diff --git a/qb-inventory/html/images/whiskey.png b/qb-inventory/html/images/whiskey.png
new file mode 100644
index 0000000..d8a2009
Binary files /dev/null and b/qb-inventory/html/images/whiskey.png differ
diff --git a/qb-inventory/html/images/wine.png b/qb-inventory/html/images/wine.png
new file mode 100644
index 0000000..156c493
Binary files /dev/null and b/qb-inventory/html/images/wine.png differ
diff --git a/qb-inventory/html/images/xtc_baggy.png b/qb-inventory/html/images/xtc_baggy.png
new file mode 100644
index 0000000..6551339
Binary files /dev/null and b/qb-inventory/html/images/xtc_baggy.png differ
diff --git a/qb-inventory/html/inventory_images/body.png b/qb-inventory/html/inventory_images/body.png
new file mode 100644
index 0000000..8d10eff
Binary files /dev/null and b/qb-inventory/html/inventory_images/body.png differ
diff --git a/qb-inventory/html/js/app.js b/qb-inventory/html/js/app.js
new file mode 100644
index 0000000..b96573e
--- /dev/null
+++ b/qb-inventory/html/js/app.js
@@ -0,0 +1,3118 @@
+const { useQuasar } = Quasar
+const { ref } = Vue
+
+const app = Vue.createApp({
+ setup () {
+ return {
+ options: ref(false),
+ help: ref(false),
+ showblur: ref(true),
+ }
+ },
+ methods: {
+ select: function(event) {
+ targetId = event.currentTarget.id;
+ showBlur()
+ }
+}
+})
+
+app.use(Quasar, { config: {} })
+app.mount('#inventory-menus')
+
+function showBlur() {
+ $.post('https://qb-inventory/showBlur');
+}
+
+var InventoryOption = "0, 0, 0";
+
+var totalWeight = 0;
+var totalWeightOther = 0;
+
+var playerMaxWeight = 0;
+var otherMaxWeight = 0;
+
+var otherLabel = "";
+
+var ClickedItemData = {};
+
+var SelectedAttachment = null;
+var AttachmentScreenActive = false;
+var ControlPressed = false;
+var disableRightMouse = false;
+var selectedItem = null;
+
+var IsDragging = false;
+
+$(document).on("keydown", function() {
+ if (event.repeat) {
+ return;
+ }
+ switch (event.keyCode) {
+ case 27: // ESC
+ Inventory.Close();
+ break;
+ case 9: // TAB
+ Inventory.Close();
+ break;
+ case 17: // TAB
+ ControlPressed = true;
+ break;
+ }
+});
+
+$(document).on("dblclick", ".item-slot", function(e) {
+ var ItemData = $(this).data("item");
+ var ItemInventory = $(this).parent().attr("data-inventory");
+ if (ItemData) {
+ Inventory.Close();
+ $.post(
+ "https://qb-inventory/UseItem",
+ JSON.stringify({
+ inventory: ItemInventory,
+ item: ItemData,
+ })
+ );
+ }
+});
+
+$(document).on("keyup", function() {
+ switch (event.keyCode) {
+ case 17: // TAB
+ ControlPressed = false;
+ break;
+ }
+});
+
+$(document).on("mouseenter", ".item-slot", function(e) {
+ e.preventDefault();
+ $(".ply-iteminfo-container").css("opacity", "0.0");
+ if ($(this).data("item") != null) {
+ $(".ply-iteminfo-container").css("opacity", "1.0");
+ $(".ply-iteminfo-container").fadeIn(150);
+ // FormatItemInfo($(this).data("item"));
+ FormatItemInfo($(this).data("item"), $(this));
+ } else {
+ $(".ply-iteminfo-container").fadeOut(100);
+ }
+});
+
+$(document).on("mouseleave", ".item-slot", function (e) {
+ $(".ply-iteminfo-container").css("opacity", "0.0");
+});
+
+// Autostack Quickmove
+function GetFirstFreeSlot($toInv, $fromSlot) {
+ var retval = null;
+ $.each($toInv.find(".item-slot"), function(i, slot) {
+ if ($(slot).data("item") === undefined) {
+ if (retval === null) {
+ retval = i + 1;
+ }
+ }
+ });
+ return retval;
+}
+
+function CanQuickMove() {
+ var otherinventory = otherLabel.toLowerCase();
+ var retval = true;
+ // if (otherinventory == "grond") {
+ // retval = false
+ // } else if (otherinventory.split("-")[0] == "dropped") {
+ // retval = false;
+ // }
+ if (otherinventory.split("-")[0] == "player") {
+ retval = false;
+ }
+ return retval;
+}
+
+$(document).on("mousedown", ".item-slot", function(event) {
+ switch (event.which) {
+ case 3:
+ fromSlot = $(this).attr("data-slot");
+ fromInventory = $(this).parent();
+
+ if ($(fromInventory).attr("data-inventory") == "player") {
+ toInventory = $(".other-inventory");
+ } else {
+ toInventory = $(".player-inventory");
+ }
+ toSlot = GetFirstFreeSlot(toInventory, $(this));
+ if ($(this).data("item") === undefined) {
+ return;
+ }
+ toAmount = $(this).data("item").amount;
+ if (toAmount > 1) {
+ toAmount = 1;
+ }
+ if (CanQuickMove()) {
+ if (toSlot === null) {
+ InventoryError(fromInventory, fromSlot);
+ return;
+ }
+ if (fromSlot == toSlot && fromInventory == toInventory) {
+ return;
+ }
+ if (toAmount >= 0) {
+ if (
+ updateweights(
+ fromSlot,
+ toSlot,
+ fromInventory,
+ toInventory,
+ toAmount
+ )
+ ) {
+ swap(fromSlot, toSlot, fromInventory, toInventory, toAmount);
+ }
+ }
+ } else {
+ InventoryError(fromInventory, fromSlot);
+ }
+ break;
+ }
+});
+
+$(document).on("click", ".item-slot", function(e) {
+ e.preventDefault();
+ var ItemData = $(this).data("item");
+
+ if (ItemData !== null && ItemData !== undefined) {
+ if (ItemData.name !== undefined) {
+ if (ItemData.name.split("_")[0] == "weapon") {
+ if (!$("#weapon-attachments").length) {
+ // if (ItemData.info.attachments !== null && ItemData.info.attachments !== undefined && ItemData.info.attachments.length > 0) {
+ $(".inv-options-list").append(
+ '
+
+
+
+
+
+ Show Background Blur
+ Disabling this will remove the background blur effect while inside your inventory.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Help:
+
+
+
+ To move a full stack make sure the AMOUNT FIELD is empty. You can type the specific NUMBER AMOUNT for how much you would like to move. To USE an item, drag it into the middle option titled "USE" or you can DOUBLE CLICK. The AMOUNT FIELD will NOT reset when you close your inventory, so make sure you get in the habit of clearing the number!
+
+
+
+
Middle Options:
+
+
+
+
+
Use: Drag item to this button to use that item
+
Give: Give item to other citizens around you
+
Combine: Combine certain items together
+
Switch: Switch current item
+
Attachments: When you have items you can attach to your weapons
+
Close: Another way to close the inventory
+
+
+
+
+
Keybinds (default):
+
+
+
+
+
Left Click: Normal drag
+
Right Click: Drop item or move single item storage
+
Double Click: Use Item
+
Number 0-9: Will input the typed number
+
BACKSPACE Key: Will set AMOUNT to blank/move entire item stack
+
+
+
+
+
Shops:
+
+
+
+ Put in the AMOUNT you want to buy in the AMOUNT FIELD and then drag the shop item into your inventory
+
+
+
+
+
+
+
+
+
Pistol | 9mm
+
This is a water gun yaay ...
+
Serial Number 12345678
Durability
+
+
+
Attachments
+
+
+
+
+
+
RETURN
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/qb-inventory/ps-inventory.sql b/qb-inventory/ps-inventory.sql
new file mode 100644
index 0000000..bc17a66
--- /dev/null
+++ b/qb-inventory/ps-inventory.sql
@@ -0,0 +1,50 @@
+CREATE TABLE IF NOT EXISTS `gloveboxitems` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `plate` varchar(255) DEFAULT NULL,
+ `items` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
+ PRIMARY KEY (`plate`),
+ KEY `id` (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
+
+CREATE TABLE IF NOT EXISTS `stashitems` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `stash` varchar(255) DEFAULT NULL,
+ `items` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
+ PRIMARY KEY (`stash`),
+ KEY `id` (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
+
+CREATE TABLE IF NOT EXISTS `trunkitems` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `plate` varchar(255) DEFAULT NULL,
+ `items` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
+ PRIMARY KEY (`plate`),
+ KEY `id` (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
+
+CREATE TABLE IF NOT EXISTS `player_vehicles` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `license` varchar(50) DEFAULT NULL,
+ `citizenid` varchar(50) DEFAULT NULL,
+ `vehicle` varchar(50) DEFAULT NULL,
+ `hash` varchar(50) DEFAULT NULL,
+ `mods` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
+ `plate` varchar(50) NOT NULL,
+ `fakeplate` varchar(50) DEFAULT NULL,
+ `garage` varchar(50) DEFAULT NULL,
+ `fuel` int(11) DEFAULT 100,
+ `engine` float DEFAULT 1000,
+ `body` float DEFAULT 1000,
+ `state` int(11) DEFAULT 1,
+ `depotprice` int(11) NOT NULL DEFAULT 0,
+ `drivingdistance` int(50) DEFAULT NULL,
+ `status` text DEFAULT NULL,
+ `balance` int(11) NOT NULL DEFAULT 0,
+ `paymentamount` int(11) NOT NULL DEFAULT 0,
+ `paymentsleft` int(11) NOT NULL DEFAULT 0,
+ `financetime` int(11) NOT NULL DEFAULT 0,
+ PRIMARY KEY (`id`),
+ KEY `plate` (`plate`),
+ KEY `citizenid` (`citizenid`),
+ KEY `license` (`license`)
+) ENGINE=InnoDB AUTO_INCREMENT=1;
diff --git a/qb-inventory/server/main.lua b/qb-inventory/server/main.lua
new file mode 100644
index 0000000..a5a3665
--- /dev/null
+++ b/qb-inventory/server/main.lua
@@ -0,0 +1,2711 @@
+-- Variables
+
+local QBCore = exports['qb-core']:GetCoreObject()
+local Drops = {}
+local Trunks = {}
+local Gloveboxes = {}
+local Stashes = {}
+local ShopItems = {}
+
+-- Functions
+
+---Loads the inventory for the player with the citizenid that is provided
+
+local function LoadInventory(source, citizenid)
+ local inventory = MySQL.prepare.await('SELECT inventory FROM players WHERE citizenid = ?', { citizenid })
+ local loadedInventory = {}
+ local missingItems = {}
+
+ if not inventory then return loadedInventory end
+
+ inventory = json.decode(inventory)
+ if table.type(inventory) == "empty" then return loadedInventory end
+
+ for _, item in pairs(inventory) do
+ if item then
+ local itemInfo = QBCore.Shared.Items[item.name:lower()]
+ if itemInfo then
+ loadedInventory[item.slot] = {
+ name = itemInfo['name'],
+ amount = item.amount,
+ info = item.info or '',
+ label = itemInfo['label'],
+ description = itemInfo['description'] or '',
+ weight = itemInfo['weight'],
+ type = itemInfo['type'],
+ unique = itemInfo['unique'],
+ useable = itemInfo['useable'],
+ image = itemInfo['image'],
+ shouldClose = itemInfo['shouldClose'],
+ slot = item.slot,
+ combinable = itemInfo['combinable'],
+ created = item.created,
+ }
+ else
+ missingItems[#missingItems + 1] = item.name:lower()
+ end
+ end
+ end
+
+ if #missingItems > 0 then
+ print(("The following items were removed for player %s as they no longer exist"):format(GetPlayerName(source)))
+ QBCore.Debug(missingItems)
+ end
+
+ return loadedInventory
+end
+
+exports("LoadInventory", LoadInventory)
+
+---Saves the inventory for the player with the provided source or PlayerData is they're offline
+
+local function SaveInventory(source, offline)
+ local PlayerData
+ if not offline then
+ local Player = QBCore.Functions.GetPlayer(source)
+
+ if not Player then return end
+
+ PlayerData = Player.PlayerData
+ else
+ PlayerData = source -- for offline users, the playerdata gets sent over the source variable
+ end
+
+ local items = PlayerData.items
+ local ItemsJson = {}
+ if items and table.type(items) ~= "empty" then
+ for slot, item in pairs(items) do
+ if items[slot] then
+ ItemsJson[#ItemsJson+1] = {
+ name = item.name,
+ amount = item.amount,
+ info = item.info,
+ type = item.type,
+ slot = slot,
+ created = item.created
+ }
+ end
+ end
+ MySQL.prepare('UPDATE players SET inventory = ? WHERE citizenid = ?', { json.encode(ItemsJson), PlayerData.citizenid })
+ else
+ MySQL.prepare('UPDATE players SET inventory = ? WHERE citizenid = ?', { '[]', PlayerData.citizenid })
+ end
+end
+
+exports("SaveInventory", SaveInventory)
+
+---Gets the totalweight of the items provided
+
+local function GetTotalWeight(items)
+ local weight = 0
+ if not items then return 0 end
+ for _, item in pairs(items) do
+ weight += item.weight * item.amount
+ end
+ return tonumber(weight)
+end
+
+exports("GetTotalWeight", GetTotalWeight)
+
+---Gets the slots that the provided item is in
+
+local function GetSlotsByItem(items, itemName)
+ local slotsFound = {}
+ if not items then return slotsFound end
+ for slot, item in pairs(items) do
+ if item.name:lower() == itemName:lower() then
+ slotsFound[#slotsFound+1] = slot
+ end
+ end
+ return slotsFound
+end
+
+exports("GetSlotsByItem", GetSlotsByItem)
+
+---Get the first slot where the item is located
+
+local function GetFirstSlotByItem(items, itemName)
+ if not items then return nil end
+ for slot, item in pairs(items) do
+ if item.name:lower() == itemName:lower() then
+ return tonumber(slot)
+ end
+ end
+ return nil
+end
+
+exports("GetFirstSlotByItem", GetFirstSlotByItem)
+
+---Add an item to the inventory of the player
+
+local function AddItem(source, item, amount, slot, info, created)
+ local Player = QBCore.Functions.GetPlayer(source)
+
+ if not Player then return false end
+
+ local totalWeight = GetTotalWeight(Player.PlayerData.items)
+ local itemInfo = QBCore.Shared.Items[item:lower()]
+ local time = os.time()
+ if not created then
+ itemInfo['created'] = time
+ else
+ itemInfo['created'] = created
+ end
+ if not itemInfo and not Player.Offline then
+ QBCore.Functions.Notify(source, "Item does not exist", 'error')
+ return false
+ end
+
+ amount = tonumber(amount) or 1
+ slot = tonumber(slot) or GetFirstSlotByItem(Player.PlayerData.items, item)
+ info = info or {}
+ itemInfo['created'] = created or time
+ info.quality = info.quality or 100
+
+ if itemInfo['type'] == 'weapon' then
+ info.serie = info.serie or tostring(QBCore.Shared.RandomInt(2) .. QBCore.Shared.RandomStr(3) .. QBCore.Shared.RandomInt(1) .. QBCore.Shared.RandomStr(2) .. QBCore.Shared.RandomInt(3) .. QBCore.Shared.RandomStr(4))
+ info.quality = info.quality or 100
+ end
+ if (totalWeight + (itemInfo['weight'] * amount)) <= Config.MaxInventoryWeight then
+ if (slot and Player.PlayerData.items[slot]) and (Player.PlayerData.items[slot].name:lower() == item:lower()) and (itemInfo['type'] == 'item' and not itemInfo['unique']) then
+ if Player.PlayerData.items[slot].info.quality == info.quality then
+ Player.PlayerData.items[slot].amount = Player.PlayerData.items[slot].amount + amount
+ Player.Functions.SetPlayerData("items", Player.PlayerData.items)
+ if Player.Offline then return true end
+ TriggerEvent('qb-log:server:CreateLog', 'playerinventory', 'AddItem', 'green', '**' .. GetPlayerName(source) .. ' (citizenid: ' .. Player.PlayerData.citizenid .. ' | id: ' .. source .. ')** got item: [slot:' .. slot .. '], itemname: ' .. Player.PlayerData.items[slot].name .. ', added amount: ' .. amount .. ', new total amount: ' .. Player.PlayerData.items[slot].amount)
+ return true
+ else
+ for i = 1, Config.MaxInventorySlots, 1 do
+ if Player.PlayerData.items[i] == nil then
+ Player.PlayerData.items[i] = { name = itemInfo['name'], amount = amount, info = info or '', label = itemInfo['label'], description = itemInfo['description'] or '', weight = itemInfo['weight'], type = itemInfo['type'], unique = itemInfo['unique'], useable = itemInfo['useable'], image = itemInfo['image'], shouldClose = itemInfo['shouldClose'], slot = i, combinable = itemInfo['combinable'], created = itemInfo['created'] }
+ Player.Functions.SetPlayerData("items", Player.PlayerData.items)
+ if Player.Offline then return true end
+ TriggerEvent('qb-log:server:CreateLog', 'playerinventory', 'AddItem', 'green', '**' .. GetPlayerName(source) .. ' (citizenid: ' .. Player.PlayerData.citizenid .. ' | id: ' .. source .. ')** got item: [slot:' .. i .. '], itemname: ' .. Player.PlayerData.items[i].name .. ', added amount: ' .. amount .. ', new total amount: ' .. Player.PlayerData.items[i].amount)
+ return true
+ end
+ end
+ end
+ elseif not itemInfo['unique'] and slot or slot and Player.PlayerData.items[slot] == nil then
+ Player.PlayerData.items[slot] = { name = itemInfo['name'], amount = amount, info = info or '', label = itemInfo['label'], description = itemInfo['description'] or '', weight = itemInfo['weight'], type = itemInfo['type'], unique = itemInfo['unique'], useable = itemInfo['useable'], image = itemInfo['image'], shouldClose = itemInfo['shouldClose'], slot = slot, combinable = itemInfo['combinable'], created = itemInfo['created'] }
+ Player.Functions.SetPlayerData("items", Player.PlayerData.items)
+
+ if Player.Offline then return true end
+
+ TriggerEvent('qb-log:server:CreateLog', 'playerinventory', 'AddItem', 'green', '**' .. GetPlayerName(source) .. ' (citizenid: ' .. Player.PlayerData.citizenid .. ' | id: ' .. source .. ')** got item: [slot:' .. slot .. '], itemname: ' .. Player.PlayerData.items[slot].name .. ', added amount: ' .. amount .. ', new total amount: ' .. Player.PlayerData.items[slot].amount)
+
+ return true
+ elseif itemInfo['unique'] or (not slot or slot == nil) or itemInfo['type'] == 'weapon' then
+ for i = 1, Config.MaxInventorySlots, 1 do
+ if Player.PlayerData.items[i] == nil then
+ Player.PlayerData.items[i] = { name = itemInfo['name'], amount = amount, info = info or '', label = itemInfo['label'], description = itemInfo['description'] or '', weight = itemInfo['weight'], type = itemInfo['type'], unique = itemInfo['unique'], useable = itemInfo['useable'], image = itemInfo['image'], shouldClose = itemInfo['shouldClose'], slot = i, combinable = itemInfo['combinable'], created = itemInfo['created'] }
+ Player.Functions.SetPlayerData("items", Player.PlayerData.items)
+
+ if Player.Offline then return true end
+
+ TriggerEvent('qb-log:server:CreateLog', 'playerinventory', 'AddItem', 'green', '**' .. GetPlayerName(source) .. ' (citizenid: ' .. Player.PlayerData.citizenid .. ' | id: ' .. source .. ')** got item: [slot:' .. i .. '], itemname: ' .. Player.PlayerData.items[i].name .. ', added amount: ' .. amount .. ', new total amount: ' .. Player.PlayerData.items[i].amount)
+
+ return true
+ end
+ end
+ end
+ elseif not Player.Offline then
+ QBCore.Functions.Notify(source, "Inventory too full", 'error')
+ end
+ return false
+end
+
+exports("AddItem", AddItem)
+
+---Remove an item from the inventory of the player
+
+local function RemoveItem(source, item, amount, slot)
+ local Player = QBCore.Functions.GetPlayer(source)
+
+ if not Player then return false end
+
+ amount = tonumber(amount) or 1
+ slot = tonumber(slot)
+
+ if slot then
+ if Player.PlayerData.items[slot].amount > amount then
+ Player.PlayerData.items[slot].amount = Player.PlayerData.items[slot].amount - amount
+ Player.Functions.SetPlayerData("items", Player.PlayerData.items)
+
+ if not Player.Offline then
+ TriggerEvent('qb-log:server:CreateLog', 'playerinventory', 'RemoveItem', 'red', '**' .. GetPlayerName(source) .. ' (citizenid: ' .. Player.PlayerData.citizenid .. ' | id: ' .. source .. ')** lost item: [slot:' .. slot .. '], itemname: ' .. Player.PlayerData.items[slot].name .. ', removed amount: ' .. amount .. ', new total amount: ' .. Player.PlayerData.items[slot].amount)
+ end
+
+ return true
+ elseif Player.PlayerData.items[slot].amount == amount then
+ Player.PlayerData.items[slot] = nil
+ Player.Functions.SetPlayerData("items", Player.PlayerData.items)
+
+ if Player.Offline then return true end
+
+ TriggerEvent('qb-log:server:CreateLog', 'playerinventory', 'RemoveItem', 'red', '**' .. GetPlayerName(source) .. ' (citizenid: ' .. Player.PlayerData.citizenid .. ' | id: ' .. source .. ')** lost item: [slot:' .. slot .. '], itemname: ' .. item .. ', removed amount: ' .. amount .. ', item removed')
+
+ return true
+ end
+ else
+ local slots = GetSlotsByItem(Player.PlayerData.items, item)
+ local amountToRemove = amount
+
+ if not slots then return false end
+
+ for _, _slot in pairs(slots) do
+ if Player.PlayerData.items[_slot].amount > amountToRemove then
+ Player.PlayerData.items[_slot].amount = Player.PlayerData.items[_slot].amount - amountToRemove
+ Player.Functions.SetPlayerData("items", Player.PlayerData.items)
+
+ if not Player.Offline then
+ TriggerEvent('qb-log:server:CreateLog', 'playerinventory', 'RemoveItem', 'red', '**' .. GetPlayerName(source) .. ' (citizenid: ' .. Player.PlayerData.citizenid .. ' | id: ' .. source .. ')** lost item: [slot:' .. _slot .. '], itemname: ' .. Player.PlayerData.items[_slot].name .. ', removed amount: ' .. amount .. ', new total amount: ' .. Player.PlayerData.items[_slot].amount)
+ end
+
+ return true
+ elseif Player.PlayerData.items[_slot].amount == amountToRemove then
+ Player.PlayerData.items[_slot] = nil
+ Player.Functions.SetPlayerData("items", Player.PlayerData.items)
+
+ if Player.Offline then return true end
+
+ TriggerEvent('qb-log:server:CreateLog', 'playerinventory', 'RemoveItem', 'red', '**' .. GetPlayerName(source) .. ' (citizenid: ' .. Player.PlayerData.citizenid .. ' | id: ' .. source .. ')** lost item: [slot:' .. _slot .. '], itemname: ' .. item .. ', removed amount: ' .. amount .. ', item removed')
+
+ return true
+ end
+ end
+ end
+ return false
+end
+
+exports("RemoveItem", RemoveItem)
+
+---Get the item with the slot
+
+local function GetItemBySlot(source, slot)
+ local Player = QBCore.Functions.GetPlayer(source)
+ slot = tonumber(slot)
+ return Player.PlayerData.items[slot]
+end
+
+exports("GetItemBySlot", GetItemBySlot)
+
+---Get the item from the inventory of the player with the provided source by the name of the item
+
+local function GetItemByName(source, item)
+ local Player = QBCore.Functions.GetPlayer(source)
+ item = tostring(item):lower()
+ local slot = GetFirstSlotByItem(Player.PlayerData.items, item)
+ return Player.PlayerData.items[slot]
+end
+
+exports("GetItemByName", GetItemByName)
+
+---Get the item from the inventory of the player with the provided source by the name of the item in an array for all slots that the item is in
+
+local function GetItemsByName(source, item)
+ local Player = QBCore.Functions.GetPlayer(source)
+ item = tostring(item):lower()
+ local items = {}
+ local slots = GetSlotsByItem(Player.PlayerData.items, item)
+ for _, slot in pairs(slots) do
+ if slot then
+ items[#items+1] = Player.PlayerData.items[slot]
+ end
+ end
+ return items
+end
+
+exports("GetItemsByName", GetItemsByName)
+
+
+local function ClearInventory(source, filterItems)
+ local Player = QBCore.Functions.GetPlayer(source)
+ local savedItemData = {}
+
+ if filterItems then
+ local filterItemsType = type(filterItems)
+ if filterItemsType == "string" then
+ local item = GetItemByName(source, filterItems)
+
+ if item then
+ savedItemData[item.slot] = item
+ end
+ elseif filterItemsType == "table" and table.type(filterItems) == "array" then
+ for i = 1, #filterItems do
+ local item = GetItemByName(source, filterItems[i])
+
+ if item then
+ savedItemData[item.slot] = item
+ end
+ end
+ end
+ end
+
+ Player.Functions.SetPlayerData("items", savedItemData)
+
+ if Player.Offline then return end
+
+ TriggerEvent('qb-log:server:CreateLog', 'playerinventory', 'ClearInventory', 'red', '**' .. GetPlayerName(source) .. ' (citizenid: ' .. Player.PlayerData.citizenid .. ' | id: ' .. source .. ')** inventory cleared')
+end
+
+exports("ClearInventory", ClearInventory)
+
+---Sets the items playerdata to the provided items param
+
+local function SetInventory(source, items)
+ local Player = QBCore.Functions.GetPlayer(source)
+
+ Player.Functions.SetPlayerData("items", items)
+
+ if Player.Offline then return end
+
+ TriggerEvent('qb-log:server:CreateLog', 'playerinventory', 'SetInventory', 'blue', '**' .. GetPlayerName(source) .. ' (citizenid: ' .. Player.PlayerData.citizenid .. ' | id: ' .. source .. ')** items set: ' .. json.encode(items))
+end
+
+exports("SetInventory", SetInventory)
+
+---Set the data of a specific item
+
+local function SetItemData(source, itemName, key, val)
+ if not itemName or not key then return false end
+
+ local Player = QBCore.Functions.GetPlayer(source)
+
+ if not Player then return end
+
+ local item = GetItemByName(source, itemName)
+
+ if not item then return false end
+
+ item[key] = val
+ Player.PlayerData.items[item.slot] = item
+ Player.Functions.SetPlayerData("items", Player.PlayerData.items)
+
+ return true
+end
+
+exports("SetItemData", SetItemData)
+
+---Checks if you have an item or not
+local function HasItem(source, items, amount)
+ local Player = QBCore.Functions.GetPlayer(source)
+ if not Player then return false end
+ local isTable = type(items) == 'table'
+ local isArray = isTable and table.type(items) == 'array' or false
+ local totalItems = #items
+ local count = 0
+ local kvIndex = 2
+ if isTable and not isArray then
+ totalItems = 0
+ for _ in pairs(items) do totalItems += 1 end
+ kvIndex = 1
+ end
+ if isTable then
+ for k, v in pairs(items) do
+ local itemKV = {k, v}
+ local item = GetItemByName(source, itemKV[kvIndex])
+ if item and ((amount and item.amount >= amount) or (not isArray and item.amount >= v) or (not amount and isArray)) then
+ count += 1
+ end
+ end
+ if count == totalItems then
+ return true
+ end
+ else -- Single item as string
+ local item = GetItemByName(source, items)
+ if item and (not amount or (item and amount and item.amount >= amount)) then
+ return true
+ end
+ end
+ return false
+end
+
+exports("HasItem", HasItem)
+
+---Create a usable item with a callback on use
+---@param itemName string The name of the item to make usable
+---@param data any
+local function CreateUsableItem(itemName, data)
+ QBCore.Functions.CreateUseableItem(itemName, data)
+end
+
+exports("CreateUsableItem", CreateUsableItem)
+
+---Get the usable item data for the specified item
+---@param itemName string The item to get the data for
+---@return any usable_item
+local function GetUsableItem(itemName)
+ return QBCore.Functions.CanUseItem(itemName)
+end
+
+exports("GetUsableItem", GetUsableItem)
+
+---Use an item from the QBCore.UsableItems table if a callback is present
+---@param itemName string The name of the item to use
+---@param ... any Arguments for the callback, this will be sent to the callback and can be used to get certain values
+local function UseItem(itemName, ...)
+ local itemData = GetUsableItem(itemName)
+ local callback = type(itemData) == 'table' and (rawget(itemData, '__cfx_functionReference') and itemData or itemData.cb or itemData.callback) or type(itemData) == 'function' and itemData
+ if not callback then return end
+ callback(...)
+end
+
+exports("UseItem", UseItem)
+
+local function recipeContains(recipe, fromItem)
+ for _, v in pairs(recipe.accept) do
+ if v == fromItem.name then
+ return true
+ end
+ end
+
+ return false
+end
+
+
+local function hasCraftItems(source, CostItems, amount)
+ for k, v in pairs(CostItems) do
+ local item = GetItemByName(source, k)
+
+ if not item then return false end
+
+ if item.amount < (v * amount) then return false end
+ end
+ return true
+end
+
+local function IsVehicleOwned(plate)
+ local result = MySQL.scalar.await('SELECT 1 from player_vehicles WHERE plate = ?', {plate})
+ return result
+end
+
+-- Shop Items
+local function SetupShopItems(shopItems)
+ local items = {}
+ if shopItems and next(shopItems) then
+ for _, item in pairs(shopItems) do
+ local itemInfo = QBCore.Shared.Items[item.name:lower()]
+ if itemInfo then
+ items[item.slot] = {
+ name = itemInfo["name"],
+ amount = tonumber(item.amount),
+ info = item.info or "",
+ label = itemInfo["label"],
+ description = itemInfo["description"] or "",
+ weight = itemInfo["weight"],
+ type = itemInfo["type"],
+ unique = itemInfo["unique"],
+ useable = itemInfo["useable"],
+ price = item.price,
+ image = itemInfo["image"],
+ slot = item.slot,
+ }
+ end
+ end
+ end
+ return items
+end
+
+-- Stash Items
+local function GetStashItems(stashId)
+ local items = {}
+ local result = MySQL.scalar.await('SELECT items FROM stashitems WHERE stash = ?', {stashId})
+ if not result then return items end
+
+ local stashItems = json.decode(result)
+ if not stashItems then return items end
+
+ for _, item in pairs(stashItems) do
+ local itemInfo = QBCore.Shared.Items[item.name:lower()]
+ if itemInfo then
+ items[item.slot] = {
+ name = itemInfo["name"],
+ amount = tonumber(item.amount),
+ info = item.info or "",
+ label = itemInfo["label"],
+ description = itemInfo["description"] or "",
+ weight = itemInfo["weight"],
+ type = itemInfo["type"],
+ unique = itemInfo["unique"],
+ useable = itemInfo["useable"],
+ image = itemInfo["image"],
+ created = item.created,
+ slot = item.slot,
+ }
+ end
+ end
+ return items
+end
+
+local function SaveStashItems(stashId, items)
+ if Stashes[stashId].label == "Stash-None" or not items then return end
+
+ for _, item in pairs(items) do
+ item.description = nil
+ end
+
+ MySQL.insert('INSERT INTO stashitems (stash, items) VALUES (:stash, :items) ON DUPLICATE KEY UPDATE items = :items', {
+ ['stash'] = stashId,
+ ['items'] = json.encode(items)
+ })
+
+ Stashes[stashId].isOpen = false
+end
+
+local function AddToStash(stashId, slot, otherslot, itemName, amount, info, created)
+ amount = tonumber(amount) or 1
+ local ItemData = QBCore.Shared.Items[itemName]
+ if not ItemData.unique then
+ if Stashes[stashId].items[slot] and Stashes[stashId].items[slot].name == itemName then
+ Stashes[stashId].items[slot].amount = Stashes[stashId].items[slot].amount + amount
+ else
+ local itemInfo = QBCore.Shared.Items[itemName:lower()]
+ Stashes[stashId].items[slot] = {
+ name = itemInfo["name"],
+ amount = amount,
+ info = info or "",
+ label = itemInfo["label"],
+ description = itemInfo["description"] or "",
+ weight = itemInfo["weight"],
+ type = itemInfo["type"],
+ unique = itemInfo["unique"],
+ useable = itemInfo["useable"],
+ image = itemInfo["image"],
+ created = created,
+ slot = slot,
+ }
+ end
+ else
+ if Stashes[stashId].items[slot] and Stashes[stashId].items[slot].name == itemName then
+ local itemInfo = QBCore.Shared.Items[itemName:lower()]
+ Stashes[stashId].items[otherslot] = {
+ name = itemInfo["name"],
+ amount = amount,
+ info = info or "",
+ label = itemInfo["label"],
+ description = itemInfo["description"] or "",
+ weight = itemInfo["weight"],
+ type = itemInfo["type"],
+ unique = itemInfo["unique"],
+ useable = itemInfo["useable"],
+ image = itemInfo["image"],
+ created = created,
+ slot = otherslot,
+ }
+ else
+ local itemInfo = QBCore.Shared.Items[itemName:lower()]
+ Stashes[stashId].items[slot] = {
+ name = itemInfo["name"],
+ amount = amount,
+ info = info or "",
+ label = itemInfo["label"],
+ description = itemInfo["description"] or "",
+ weight = itemInfo["weight"],
+ type = itemInfo["type"],
+ unique = itemInfo["unique"],
+ useable = itemInfo["useable"],
+ image = itemInfo["image"],
+ created = created,
+ slot = slot,
+ }
+ end
+ end
+end
+
+local function RemoveFromStash(stashId, slot, itemName, amount)
+ amount = tonumber(amount) or 1
+ if Stashes[stashId].items[slot] and Stashes[stashId].items[slot].name == itemName then
+ if Stashes[stashId].items[slot].amount > amount then
+ Stashes[stashId].items[slot].amount = Stashes[stashId].items[slot].amount - amount
+ else
+ Stashes[stashId].items[slot] = nil
+ end
+ else
+ Stashes[stashId].items[slot] = nil
+ if Stashes[stashId].items == nil then
+ Stashes[stashId].items[slot] = nil
+ end
+ end
+end
+
+-- Trunk items
+local function GetOwnedVehicleItems(plate)
+ local items = {}
+ local result = MySQL.scalar.await('SELECT items FROM trunkitems WHERE plate = ?', {plate})
+ if not result then return items end
+
+ local trunkItems = json.decode(result)
+ if not trunkItems then return items end
+
+ for _, item in pairs(trunkItems) do
+ local itemInfo = QBCore.Shared.Items[item.name:lower()]
+ if itemInfo then
+ items[item.slot] = {
+ name = itemInfo["name"],
+ amount = tonumber(item.amount),
+ info = item.info or "",
+ label = itemInfo["label"],
+ description = itemInfo["description"] or "",
+ weight = itemInfo["weight"],
+ type = itemInfo["type"],
+ unique = itemInfo["unique"],
+ useable = itemInfo["useable"],
+ image = itemInfo["image"],
+ created = item.created,
+ slot = item.slot,
+ }
+ end
+ end
+ return items
+end
+
+local function SaveOwnedVehicleItems(plate, items)
+ if Trunks[plate].label == "Trunk-None" or not items then return end
+
+ for _, item in pairs(items) do
+ item.description = nil
+ end
+
+ MySQL.insert('INSERT INTO trunkitems (plate, items) VALUES (:plate, :items) ON DUPLICATE KEY UPDATE items = :items', {
+ ['plate'] = plate,
+ ['items'] = json.encode(items)
+ })
+
+ Trunks[plate].isOpen = false
+end
+
+local function AddToTrunk(plate, slot, otherslot, itemName, amount, info, created)
+ amount = tonumber(amount) or 1
+ local ItemData = QBCore.Shared.Items[itemName]
+
+ if not ItemData.unique then
+ if Trunks[plate].items[slot] and Trunks[plate].items[slot].name == itemName then
+ Trunks[plate].items[slot].amount = Trunks[plate].items[slot].amount + amount
+ else
+ local itemInfo = QBCore.Shared.Items[itemName:lower()]
+ Trunks[plate].items[slot] = {
+ name = itemInfo["name"],
+ amount = amount,
+ info = info or "",
+ label = itemInfo["label"],
+ description = itemInfo["description"] or "",
+ weight = itemInfo["weight"],
+ type = itemInfo["type"],
+ unique = itemInfo["unique"],
+ useable = itemInfo["useable"],
+ image = itemInfo["image"],
+ created = created,
+ slot = slot,
+ }
+ end
+ else
+ if Trunks[plate].items[slot] and Trunks[plate].items[slot].name == itemName then
+ local itemInfo = QBCore.Shared.Items[itemName:lower()]
+ Trunks[plate].items[otherslot] = {
+ name = itemInfo["name"],
+ amount = amount,
+ info = info or "",
+ label = itemInfo["label"],
+ description = itemInfo["description"] or "",
+ weight = itemInfo["weight"],
+ type = itemInfo["type"],
+ unique = itemInfo["unique"],
+ useable = itemInfo["useable"],
+ image = itemInfo["image"],
+ created = created,
+ slot = otherslot,
+ }
+ else
+ local itemInfo = QBCore.Shared.Items[itemName:lower()]
+ Trunks[plate].items[slot] = {
+ name = itemInfo["name"],
+ amount = amount,
+ info = info or "",
+ label = itemInfo["label"],
+ description = itemInfo["description"] or "",
+ weight = itemInfo["weight"],
+ type = itemInfo["type"],
+ unique = itemInfo["unique"],
+ useable = itemInfo["useable"],
+ image = itemInfo["image"],
+ created = created,
+ slot = slot,
+ }
+ end
+ end
+end
+
+local function RemoveFromTrunk(plate, slot, itemName, amount)
+ amount = tonumber(amount) or 1
+ if Trunks[plate].items[slot] and Trunks[plate].items[slot].name == itemName then
+ if Trunks[plate].items[slot].amount > amount then
+ Trunks[plate].items[slot].amount = Trunks[plate].items[slot].amount - amount
+ else
+ Trunks[plate].items[slot] = nil
+ end
+ else
+ Trunks[plate].items[slot] = nil
+ if Trunks[plate].items == nil then
+ Trunks[plate].items[slot] = nil
+ end
+ end
+end
+
+
+-- Glovebox items
+local function GetOwnedVehicleGloveboxItems(plate)
+ local items = {}
+ local result = MySQL.scalar.await('SELECT items FROM gloveboxitems WHERE plate = ?', {plate})
+ if not result then return items end
+
+ local gloveboxItems = json.decode(result)
+ if not gloveboxItems then return items end
+
+ for _, item in pairs(gloveboxItems) do
+ local itemInfo = QBCore.Shared.Items[item.name:lower()]
+ if itemInfo then
+ items[item.slot] = {
+ name = itemInfo["name"],
+ amount = tonumber(item.amount),
+ info = item.info or "",
+ label = itemInfo["label"],
+ description = itemInfo["description"] or "",
+ weight = itemInfo["weight"],
+ type = itemInfo["type"],
+ unique = itemInfo["unique"],
+ useable = itemInfo["useable"],
+ image = itemInfo["image"],
+ created = item.created,
+ slot = item.slot,
+ }
+ end
+ end
+ return items
+end
+
+local function SaveOwnedGloveboxItems(plate, items)
+ if Gloveboxes[plate].label == "Glovebox-None" or not items then return end
+
+ for _, item in pairs(items) do
+ item.description = nil
+ end
+
+ MySQL.insert('INSERT INTO gloveboxitems (plate, items) VALUES (:plate, :items) ON DUPLICATE KEY UPDATE items = :items', {
+ ['plate'] = plate,
+ ['items'] = json.encode(items)
+ })
+
+ Gloveboxes[plate].isOpen = false
+end
+
+local function AddToGlovebox(plate, slot, otherslot, itemName, amount, info, created)
+ amount = tonumber(amount) or 1
+ local ItemData = QBCore.Shared.Items[itemName]
+
+ if not ItemData.unique then
+ if Gloveboxes[plate].items[slot] and Gloveboxes[plate].items[slot].name == itemName then
+ Gloveboxes[plate].items[slot].amount = Gloveboxes[plate].items[slot].amount + amount
+ else
+ local itemInfo = QBCore.Shared.Items[itemName:lower()]
+ Gloveboxes[plate].items[slot] = {
+ name = itemInfo["name"],
+ amount = amount,
+ info = info or "",
+ label = itemInfo["label"],
+ description = itemInfo["description"] or "",
+ weight = itemInfo["weight"],
+ type = itemInfo["type"],
+ unique = itemInfo["unique"],
+ useable = itemInfo["useable"],
+ image = itemInfo["image"],
+ created = created,
+ slot = slot,
+ }
+ end
+ else
+ if Gloveboxes[plate].items[slot] and Gloveboxes[plate].items[slot].name == itemName then
+ local itemInfo = QBCore.Shared.Items[itemName:lower()]
+ Gloveboxes[plate].items[otherslot] = {
+ name = itemInfo["name"],
+ amount = amount,
+ info = info or "",
+ label = itemInfo["label"],
+ description = itemInfo["description"] or "",
+ weight = itemInfo["weight"],
+ type = itemInfo["type"],
+ unique = itemInfo["unique"],
+ useable = itemInfo["useable"],
+ image = itemInfo["image"],
+ created = created,
+ slot = otherslot,
+ }
+ else
+ local itemInfo = QBCore.Shared.Items[itemName:lower()]
+ Gloveboxes[plate].items[slot] = {
+ name = itemInfo["name"],
+ amount = amount,
+ info = info or "",
+ label = itemInfo["label"],
+ description = itemInfo["description"] or "",
+ weight = itemInfo["weight"],
+ type = itemInfo["type"],
+ unique = itemInfo["unique"],
+ useable = itemInfo["useable"],
+ image = itemInfo["image"],
+ created = created,
+ slot = slot,
+ }
+ end
+ end
+end
+
+local function RemoveFromGlovebox(plate, slot, itemName, amount)
+ amount = tonumber(amount) or 1
+ if Gloveboxes[plate].items[slot] and Gloveboxes[plate].items[slot].name == itemName then
+ if Gloveboxes[plate].items[slot].amount > amount then
+ Gloveboxes[plate].items[slot].amount = Gloveboxes[plate].items[slot].amount - amount
+ else
+ Gloveboxes[plate].items[slot] = nil
+ end
+ else
+ Gloveboxes[plate].items[slot] = nil
+ if Gloveboxes[plate].items == nil then
+ Gloveboxes[plate].items[slot] = nil
+ end
+ end
+end
+
+---Add an item to a drop
+---@param dropId integer The id of the drop
+---@param slot number The slot of the drop inventory to add the item to
+---@param itemName string Name of the item to add
+---@param amount? number The amount of the item to add
+---@param info? table Extra info to add to the item
+local function AddToDrop(dropId, slot, itemName, amount, info, created)
+ amount = tonumber(amount) or 1
+ Drops[dropId].createdTime = os.time()
+ if Drops[dropId].items[slot] and Drops[dropId].items[slot].name == itemName then
+ Drops[dropId].items[slot].amount = Drops[dropId].items[slot].amount + amount
+ else
+ local itemInfo = QBCore.Shared.Items[itemName:lower()]
+ Drops[dropId].items[slot] = {
+ name = itemInfo["name"],
+ amount = amount,
+ info = info or "",
+ label = itemInfo["label"],
+ description = itemInfo["description"] or "",
+ weight = itemInfo["weight"],
+ type = itemInfo["type"],
+ unique = itemInfo["unique"],
+ useable = itemInfo["useable"],
+ image = itemInfo["image"],
+ created = created,
+ slot = slot,
+ id = dropId,
+ }
+ end
+end
+
+local function RemoveFromDrop(dropId, slot, itemName, amount)
+ amount = tonumber(amount) or 1
+ Drops[dropId].createdTime = os.time()
+ if Drops[dropId].items[slot] and Drops[dropId].items[slot].name == itemName then
+ if Drops[dropId].items[slot].amount > amount then
+ Drops[dropId].items[slot].amount = Drops[dropId].items[slot].amount - amount
+ else
+ Drops[dropId].items[slot] = nil
+ end
+ else
+ Drops[dropId].items[slot] = nil
+ if Drops[dropId].items == nil then
+ Drops[dropId].items[slot] = nil
+ end
+ end
+end
+
+local function CreateDropId()
+ if Drops then
+ local id = math.random(10000, 99999)
+ local dropid = id
+ while Drops[dropid] do
+ id = math.random(10000, 99999)
+ dropid = id
+ end
+ return dropid
+ else
+ local id = math.random(10000, 99999)
+ local dropid = id
+ return dropid
+ end
+end
+
+local function CreateNewDrop(source, fromSlot, toSlot, itemAmount, created)
+ itemAmount = tonumber(itemAmount) or 1
+ local Player = QBCore.Functions.GetPlayer(source)
+ local itemData = GetItemBySlot(source, fromSlot)
+
+ if not itemData then return end
+
+ local coords = GetEntityCoords(GetPlayerPed(source))
+ if RemoveItem(source, itemData.name, itemAmount, itemData.slot) then
+ TriggerClientEvent("inventory:client:CheckWeapon", source, itemData.name)
+ local itemInfo = QBCore.Shared.Items[itemData.name:lower()]
+ local dropId = CreateDropId()
+ Drops[dropId] = {}
+ Drops[dropId].coords = coords
+ Drops[dropId].createdTime = os.time()
+
+ Drops[dropId].items = {}
+
+ Drops[dropId].items[toSlot] = {
+ name = itemInfo["name"],
+ amount = itemAmount,
+ info = itemData.info or "",
+ label = itemInfo["label"],
+ description = itemInfo["description"] or "",
+ weight = itemInfo["weight"],
+ type = itemInfo["type"],
+ unique = itemInfo["unique"],
+ useable = itemInfo["useable"],
+ image = itemInfo["image"],
+ created = created,
+ slot = toSlot,
+ id = dropId,
+ }
+ TriggerEvent("qb-log:server:CreateLog", "drop", "New Item Drop", "red", "**".. GetPlayerName(source) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | id: *"..source.."*) dropped new item; name: **"..itemData.name.."**, amount: **" .. itemAmount .. "**")
+ TriggerClientEvent("inventory:client:DropItemAnim", source)
+ TriggerClientEvent("inventory:client:AddDropItem", -1, dropId, source, coords)
+ if itemData.name:lower() == "radio" then
+ TriggerClientEvent('Radio.Set', source, false)
+ end
+ else
+ TriggerClientEvent("QBCore:Notify", source, "You don't have this item!", "error")
+ return
+ end
+end
+
+local function OpenInventory(name, id, other, origin)
+ local src = origin
+ local ply = Player(src)
+ local Player = QBCore.Functions.GetPlayer(src)
+ if ply.state.inv_busy then
+ return QBCore.Functions.Notify(src, Lang:t("notify.noaccess"), 'error')
+ end
+ if name and id then
+ local secondInv = {}
+ if name == "stash" then
+ if Stashes[id] then
+ if Stashes[id].isOpen then
+ local Target = QBCore.Functions.GetPlayer(Stashes[id].isOpen)
+ if Target then
+ TriggerClientEvent('inventory:client:CheckOpenState', Stashes[id].isOpen, name, id, Stashes[id].label)
+ else
+ Stashes[id].isOpen = false
+ end
+ end
+ end
+ local maxweight = 1000000
+ local slots = 50
+ if other then
+ maxweight = other.maxweight or 1000000
+ slots = other.slots or 50
+ end
+ secondInv.name = "stash-"..id
+ secondInv.label = "Stash-"..id
+ secondInv.maxweight = maxweight
+ secondInv.inventory = {}
+ secondInv.slots = slots
+ if Stashes[id] and Stashes[id].isOpen then
+ secondInv.name = "none-inv"
+ secondInv.label = "Stash-None"
+ secondInv.maxweight = 1000000
+ secondInv.inventory = {}
+ secondInv.slots = 0
+ else
+ local stashItems = GetStashItems(id)
+ if next(stashItems) then
+ secondInv.inventory = stashItems
+ Stashes[id] = {}
+ Stashes[id].items = stashItems
+ Stashes[id].isOpen = src
+ Stashes[id].label = secondInv.label
+ else
+ Stashes[id] = {}
+ Stashes[id].items = {}
+ Stashes[id].isOpen = src
+ Stashes[id].label = secondInv.label
+ end
+ end
+ elseif name == "trunk" then
+ if Trunks[id] then
+ if Trunks[id].isOpen then
+ local Target = QBCore.Functions.GetPlayer(Trunks[id].isOpen)
+ if Target then
+ TriggerClientEvent('inventory:client:CheckOpenState', Trunks[id].isOpen, name, id, Trunks[id].label)
+ else
+ Trunks[id].isOpen = false
+ end
+ end
+ end
+ secondInv.name = "trunk-"..id
+ secondInv.label = "Trunk-"..id
+ secondInv.maxweight = other.maxweight or 60000
+ secondInv.inventory = {}
+ secondInv.slots = other.slots or 50
+ if (Trunks[id] and Trunks[id].isOpen) or (QBCore.Shared.SplitStr(id, "PLZI")[2] and (Player.PlayerData.job.name ~= "police" or Player.PlayerData.job.type ~= "leo")) then
+ secondInv.name = "none-inv"
+ secondInv.label = "Trunk-None"
+ secondInv.maxweight = other.maxweight or 60000
+ secondInv.inventory = {}
+ secondInv.slots = 0
+ else
+ if id then
+ local ownedItems = GetOwnedVehicleItems(id)
+ if IsVehicleOwned(id) and next(ownedItems) then
+ secondInv.inventory = ownedItems
+ Trunks[id] = {}
+ Trunks[id].items = ownedItems
+ Trunks[id].isOpen = src
+ Trunks[id].label = secondInv.label
+ elseif Trunks[id] and not Trunks[id].isOpen then
+ secondInv.inventory = Trunks[id].items
+ Trunks[id].isOpen = src
+ Trunks[id].label = secondInv.label
+ else
+ Trunks[id] = {}
+ Trunks[id].items = {}
+ Trunks[id].isOpen = src
+ Trunks[id].label = secondInv.label
+ end
+ end
+ end
+ elseif name == "glovebox" then
+ if Gloveboxes[id] then
+ if Gloveboxes[id].isOpen then
+ local Target = QBCore.Functions.GetPlayer(Gloveboxes[id].isOpen)
+ if Target then
+ TriggerClientEvent('inventory:client:CheckOpenState', Gloveboxes[id].isOpen, name, id, Gloveboxes[id].label)
+ else
+ Gloveboxes[id].isOpen = false
+ end
+ end
+ end
+ secondInv.name = "glovebox-"..id
+ secondInv.label = "Glovebox-"..id
+ secondInv.maxweight = 10000
+ secondInv.inventory = {}
+ secondInv.slots = 8
+ if Gloveboxes[id] and Gloveboxes[id].isOpen then
+ secondInv.name = "none-inv"
+ secondInv.label = "Glovebox-None"
+ secondInv.maxweight = 10000
+ secondInv.inventory = {}
+ secondInv.slots = 0
+ else
+ local ownedItems = GetOwnedVehicleGloveboxItems(id)
+ if Gloveboxes[id] and not Gloveboxes[id].isOpen then
+ secondInv.inventory = Gloveboxes[id].items
+ Gloveboxes[id].isOpen = src
+ Gloveboxes[id].label = secondInv.label
+ elseif IsVehicleOwned(id) and next(ownedItems) then
+ secondInv.inventory = ownedItems
+ Gloveboxes[id] = {}
+ Gloveboxes[id].items = ownedItems
+ Gloveboxes[id].isOpen = src
+ Gloveboxes[id].label = secondInv.label
+ else
+ Gloveboxes[id] = {}
+ Gloveboxes[id].items = {}
+ Gloveboxes[id].isOpen = src
+ Gloveboxes[id].label = secondInv.label
+ end
+ end
+ elseif name == "shop" then
+ secondInv.name = "itemshop-"..id
+ secondInv.label = other.label
+ secondInv.maxweight = 900000
+ secondInv.inventory = SetupShopItems(other.items)
+ ShopItems[id] = {}
+ ShopItems[id].items = other.items
+ secondInv.slots = #other.items
+ elseif name == "traphouse" then
+ secondInv.name = "traphouse-"..id
+ secondInv.label = other.label
+ secondInv.maxweight = 900000
+ secondInv.inventory = other.items
+ secondInv.slots = other.slots
+ elseif name == "crafting" then
+ secondInv.name = "crafting"
+ secondInv.label = other.label
+ secondInv.maxweight = 900000
+ secondInv.inventory = other.items
+ secondInv.slots = #other.items
+ elseif name == "attachment_crafting" then
+ secondInv.name = "attachment_crafting"
+ secondInv.label = other.label
+ secondInv.maxweight = 900000
+ secondInv.inventory = other.items
+ secondInv.slots = #other.items
+ elseif name == "otherplayer" then
+ local OtherPlayer = QBCore.Functions.GetPlayer(tonumber(id))
+ if OtherPlayer then
+ secondInv.name = "otherplayer-"..id
+ secondInv.label = "Player-"..id
+ secondInv.maxweight = Config.MaxInventoryWeight
+ secondInv.inventory = OtherPlayer.PlayerData.items
+ if (Player.PlayerData.job.name == "police" or Player.PlayerData.job.type == "leo") and Player.PlayerData.job.onduty then
+ secondInv.slots = Config.MaxInventorySlots
+ else
+ secondInv.slots = Config.MaxInventorySlots - 1
+ end
+ Wait(250)
+ end
+ else
+ if Drops[id] then
+ if Drops[id].isOpen then
+ local Target = QBCore.Functions.GetPlayer(Drops[id].isOpen)
+ if Target then
+ TriggerClientEvent('inventory:client:CheckOpenState', Drops[id].isOpen, name, id, Drops[id].label)
+ else
+ Drops[id].isOpen = false
+ end
+ end
+ end
+ if Drops[id] and not Drops[id].isOpen then
+ secondInv.coords = Drops[id].coords
+ secondInv.name = id
+ secondInv.label = "Dropped-"..tostring(id)
+ secondInv.maxweight = 100000
+ secondInv.inventory = Drops[id].items
+ secondInv.slots = 30
+ Drops[id].isOpen = src
+ Drops[id].label = secondInv.label
+ Drops[id].createdTime = os.time()
+ else
+ secondInv.name = "none-inv"
+ secondInv.label = "Dropped-None"
+ secondInv.maxweight = 100000
+ secondInv.inventory = {}
+ secondInv.slots = 0
+ end
+ end
+ TriggerClientEvent("qb-inventory:client:closeinv", id)
+ TriggerClientEvent("inventory:client:OpenInventory", src, {}, Player.PlayerData.items, secondInv)
+ else
+ TriggerClientEvent("inventory:client:OpenInventory", src, {}, Player.PlayerData.items)
+ end
+end
+exports('OpenInventory',OpenInventory)
+
+-- Events
+
+AddEventHandler('QBCore:Server:PlayerLoaded', function(Player)
+ QBCore.Functions.AddPlayerMethod(Player.PlayerData.source, "AddItem", function(item, amount, slot, info)
+ return AddItem(Player.PlayerData.source, item, amount, slot, info)
+ end)
+
+ QBCore.Functions.AddPlayerMethod(Player.PlayerData.source, "RemoveItem", function(item, amount, slot)
+ return RemoveItem(Player.PlayerData.source, item, amount, slot)
+ end)
+
+ QBCore.Functions.AddPlayerMethod(Player.PlayerData.source, "GetItemBySlot", function(slot)
+ return GetItemBySlot(Player.PlayerData.source, slot)
+ end)
+
+ QBCore.Functions.AddPlayerMethod(Player.PlayerData.source, "GetItemByName", function(item)
+ return GetItemByName(Player.PlayerData.source, item)
+ end)
+
+ QBCore.Functions.AddPlayerMethod(Player.PlayerData.source, "GetItemsByName", function(item)
+ return GetItemsByName(Player.PlayerData.source, item)
+ end)
+
+ QBCore.Functions.AddPlayerMethod(Player.PlayerData.source, "ClearInventory", function(filterItems)
+ ClearInventory(Player.PlayerData.source, filterItems)
+ end)
+
+ QBCore.Functions.AddPlayerMethod(Player.PlayerData.source, "SetInventory", function(items)
+ SetInventory(Player.PlayerData.source, items)
+ end)
+end)
+
+AddEventHandler('onResourceStart', function(resourceName)
+ if resourceName ~= GetCurrentResourceName() then return end
+ local Players = QBCore.Functions.GetQBPlayers()
+ for k in pairs(Players) do
+ QBCore.Functions.AddPlayerMethod(k, "AddItem", function(item, amount, slot, info)
+ return AddItem(k, item, amount, slot, info)
+ end)
+
+ QBCore.Functions.AddPlayerMethod(k, "RemoveItem", function(item, amount, slot)
+ return RemoveItem(k, item, amount, slot)
+ end)
+
+ QBCore.Functions.AddPlayerMethod(k, "GetItemBySlot", function(slot)
+ return GetItemBySlot(k, slot)
+ end)
+
+ QBCore.Functions.AddPlayerMethod(k, "GetItemByName", function(item)
+ return GetItemByName(k, item)
+ end)
+
+ QBCore.Functions.AddPlayerMethod(k, "GetItemsByName", function(item)
+ return GetItemsByName(k, item)
+ end)
+
+ QBCore.Functions.AddPlayerMethod(k, "ClearInventory", function(filterItems)
+ ClearInventory(k, filterItems)
+ end)
+
+ QBCore.Functions.AddPlayerMethod(k, "SetInventory", function(items)
+ SetInventory(k, items)
+ end)
+ end
+end)
+
+RegisterNetEvent('QBCore:Server:UpdateObject', function()
+ if source ~= '' then return end -- Safety check if the event was not called from the server.
+ QBCore = exports['qb-core']:GetCoreObject()
+end)
+
+function addTrunkItems(plate, items)
+ Trunks[plate] = {}
+ Trunks[plate].items = items
+end
+
+exports('addTrunkItems',addTrunkItems)
+
+function addGloveboxItems(plate, items)
+ Gloveboxes[plate] = {}
+ Gloveboxes[plate].items = items
+end
+
+exports('addGloveboxItems',addGloveboxItems)
+
+RegisterNetEvent('inventory:server:combineItem', function(item, fromItem, toItem)
+ local src = source
+
+ -- Check that inputs are not nil
+ -- Most commonly when abusing this exploit, this values are left as
+ if fromItem == nil then return end
+ if toItem == nil then return end
+
+ -- Check that they have the items
+ fromItem = GetItemByName(src, fromItem)
+ toItem = GetItemByName(src, toItem)
+
+ if fromItem == nil then return end
+ if toItem == nil then return end
+
+ -- Check the recipe is valid
+ local recipe = QBCore.Shared.Items[toItem.name].combinable
+
+ if recipe and recipe.reward ~= item then return end
+ if not recipeContains(recipe, fromItem) then return end
+
+ TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items[item], 'add')
+ AddItem(src, item, 1)
+ RemoveItem(src, fromItem.name, 1)
+ RemoveItem(src, toItem.name, 1)
+end)
+
+RegisterNetEvent('inventory:server:CraftItems', function(itemName, itemCosts, amount, toSlot, points)
+ local src = source
+ local Player = QBCore.Functions.GetPlayer(src)
+
+ amount = tonumber(amount)
+
+ if not itemName or not itemCosts then return end
+
+ for k, v in pairs(itemCosts) do
+ RemoveItem(src, k, (v*amount))
+ end
+ AddItem(src, itemName, amount, toSlot)
+ Player.Functions.SetMetaData("craftingrep", Player.PlayerData.metadata["craftingrep"] + (points * amount))
+ TriggerClientEvent("inventory:client:UpdatePlayerInventory", src, false)
+end)
+
+RegisterNetEvent('inventory:server:CraftAttachment', function(itemName, itemCosts, amount, toSlot, points)
+ local src = source
+ local Player = QBCore.Functions.GetPlayer(src)
+
+ amount = tonumber(amount)
+
+ if not itemName or not itemCosts then return end
+
+ for k, v in pairs(itemCosts) do
+ RemoveItem(src, k, (v*amount))
+ end
+ AddItem(src, itemName, amount, toSlot)
+ Player.Functions.SetMetaData("attachmentcraftingrep", Player.PlayerData.metadata["attachmentcraftingrep"] + (points * amount))
+ TriggerClientEvent("inventory:client:UpdatePlayerInventory", src, false)
+end)
+
+RegisterNetEvent('inventory:server:SetIsOpenState', function(IsOpen, type, id)
+ if IsOpen then return end
+
+ if type == "stash" then
+ Stashes[id].isOpen = false
+ elseif type == "trunk" then
+ Trunks[id].isOpen = false
+ elseif type == "glovebox" then
+ Gloveboxes[id].isOpen = false
+ elseif type == "drop" then
+ Drops[id].isOpen = false
+ end
+end)
+
+RegisterNetEvent('inventory:server:OpenInventory', function(name, id, other)
+ local src = source
+ local ply = Player(src)
+ local Player = QBCore.Functions.GetPlayer(src)
+ if ply.state.inv_busy then
+ return QBCore.Functions.Notify(src, Lang:t("notify.noaccess"), 'error')
+ end
+ if name and id then
+ local secondInv = {}
+ if name == "stash" then
+ if Stashes[id] then
+ if Stashes[id].isOpen then
+ local Target = QBCore.Functions.GetPlayer(Stashes[id].isOpen)
+ if Target then
+ TriggerClientEvent('inventory:client:CheckOpenState', Stashes[id].isOpen, name, id, Stashes[id].label)
+ else
+ Stashes[id].isOpen = false
+ end
+ end
+ end
+ local maxweight = 1000000
+ local slots = 50
+ if other then
+ maxweight = other.maxweight or 1000000
+ slots = other.slots or 50
+ end
+ secondInv.name = "stash-"..id
+ secondInv.label = "Stash-"..id
+ secondInv.maxweight = maxweight
+ secondInv.inventory = {}
+ secondInv.slots = slots
+ if Stashes[id] and Stashes[id].isOpen then
+ secondInv.name = "none-inv"
+ secondInv.label = "Stash-None"
+ secondInv.maxweight = 1000000
+ secondInv.inventory = {}
+ secondInv.slots = 0
+ else
+ local stashItems = GetStashItems(id)
+ if next(stashItems) then
+ secondInv.inventory = stashItems
+ Stashes[id] = {}
+ Stashes[id].items = stashItems
+ Stashes[id].isOpen = src
+ Stashes[id].label = secondInv.label
+ else
+ Stashes[id] = {}
+ Stashes[id].items = {}
+ Stashes[id].isOpen = src
+ Stashes[id].label = secondInv.label
+ end
+ end
+ elseif name == "trunk" then
+ if Trunks[id] then
+ if Trunks[id].isOpen then
+ local Target = QBCore.Functions.GetPlayer(Trunks[id].isOpen)
+ if Target then
+ TriggerClientEvent('inventory:client:CheckOpenState', Trunks[id].isOpen, name, id, Trunks[id].label)
+ else
+ Trunks[id].isOpen = false
+ end
+ end
+ end
+ secondInv.name = "trunk-"..id
+ secondInv.label = "Trunk-"..id
+ secondInv.maxweight = other.maxweight or 60000
+ secondInv.inventory = {}
+ secondInv.slots = other.slots or 50
+ if (Trunks[id] and Trunks[id].isOpen) or (QBCore.Shared.SplitStr(id, "PLZI")[2] and (Player.PlayerData.job.name ~= "police" or Player.PlayerData.job.type ~= "leo")) then
+ secondInv.name = "none-inv"
+ secondInv.label = "Trunk-None"
+ secondInv.maxweight = other.maxweight or 60000
+ secondInv.inventory = {}
+ secondInv.slots = 0
+ else
+ if id then
+ local ownedItems = GetOwnedVehicleItems(id)
+ if IsVehicleOwned(id) and next(ownedItems) then
+ secondInv.inventory = ownedItems
+ Trunks[id] = {}
+ Trunks[id].items = ownedItems
+ Trunks[id].isOpen = src
+ Trunks[id].label = secondInv.label
+ elseif Trunks[id] and not Trunks[id].isOpen then
+ secondInv.inventory = Trunks[id].items
+ Trunks[id].isOpen = src
+ Trunks[id].label = secondInv.label
+ else
+ Trunks[id] = {}
+ Trunks[id].items = {}
+ Trunks[id].isOpen = src
+ Trunks[id].label = secondInv.label
+ end
+ end
+ end
+ elseif name == "glovebox" then
+ if Gloveboxes[id] then
+ if Gloveboxes[id].isOpen then
+ local Target = QBCore.Functions.GetPlayer(Gloveboxes[id].isOpen)
+ if Target then
+ TriggerClientEvent('inventory:client:CheckOpenState', Gloveboxes[id].isOpen, name, id, Gloveboxes[id].label)
+ else
+ Gloveboxes[id].isOpen = false
+ end
+ end
+ end
+ secondInv.name = "glovebox-"..id
+ secondInv.label = "Glovebox-"..id
+ secondInv.maxweight = 10000
+ secondInv.inventory = {}
+ secondInv.slots = 8
+ if Gloveboxes[id] and Gloveboxes[id].isOpen then
+ secondInv.name = "none-inv"
+ secondInv.label = "Glovebox-None"
+ secondInv.maxweight = 10000
+ secondInv.inventory = {}
+ secondInv.slots = 0
+ else
+ local ownedItems = GetOwnedVehicleGloveboxItems(id)
+ if Gloveboxes[id] and not Gloveboxes[id].isOpen then
+ secondInv.inventory = Gloveboxes[id].items
+ Gloveboxes[id].isOpen = src
+ Gloveboxes[id].label = secondInv.label
+ elseif IsVehicleOwned(id) and next(ownedItems) then
+ secondInv.inventory = ownedItems
+ Gloveboxes[id] = {}
+ Gloveboxes[id].items = ownedItems
+ Gloveboxes[id].isOpen = src
+ Gloveboxes[id].label = secondInv.label
+ else
+ Gloveboxes[id] = {}
+ Gloveboxes[id].items = {}
+ Gloveboxes[id].isOpen = src
+ Gloveboxes[id].label = secondInv.label
+ end
+ end
+ elseif name == "shop" then
+ secondInv.name = "itemshop-"..id
+ secondInv.label = other.label
+ secondInv.maxweight = 900000
+ secondInv.inventory = SetupShopItems(other.items)
+ ShopItems[id] = {}
+ ShopItems[id].items = other.items
+ secondInv.slots = #other.items
+ elseif name == "traphouse" then
+ secondInv.name = "traphouse-"..id
+ secondInv.label = other.label
+ secondInv.maxweight = 900000
+ secondInv.inventory = other.items
+ secondInv.slots = other.slots
+ elseif name == "crafting" then
+ secondInv.name = "crafting"
+ secondInv.label = other.label
+ secondInv.maxweight = 900000
+ secondInv.inventory = other.items
+ secondInv.slots = #other.items
+ elseif name == "attachment_crafting" then
+ secondInv.name = "attachment_crafting"
+ secondInv.label = other.label
+ secondInv.maxweight = 900000
+ secondInv.inventory = other.items
+ secondInv.slots = #other.items
+ elseif name == "otherplayer" then
+ local OtherPlayer = QBCore.Functions.GetPlayer(tonumber(id))
+ if OtherPlayer then
+ secondInv.name = "otherplayer-"..id
+ secondInv.label = "Player-"..id
+ secondInv.maxweight = Config.MaxInventoryWeight
+ secondInv.inventory = OtherPlayer.PlayerData.items
+ if (Player.PlayerData.job.name == "police" or Player.PlayerData.job.type == "leo") and Player.PlayerData.job.onduty then
+ secondInv.slots = Config.MaxInventorySlots
+ else
+ secondInv.slots = Config.MaxInventorySlots - 1
+ end
+ Wait(250)
+ end
+ else
+ if Drops[id] then
+ if Drops[id].isOpen then
+ local Target = QBCore.Functions.GetPlayer(Drops[id].isOpen)
+ if Target then
+ TriggerClientEvent('inventory:client:CheckOpenState', Drops[id].isOpen, name, id, Drops[id].label)
+ else
+ Drops[id].isOpen = false
+ end
+ end
+ end
+ if Drops[id] and not Drops[id].isOpen then
+ secondInv.coords = Drops[id].coords
+ secondInv.name = id
+ secondInv.label = "Dropped-"..tostring(id)
+ secondInv.maxweight = 100000
+ secondInv.inventory = Drops[id].items
+ secondInv.slots = 30
+ Drops[id].isOpen = src
+ Drops[id].label = secondInv.label
+ Drops[id].createdTime = os.time()
+ else
+ secondInv.name = "none-inv"
+ secondInv.label = "Dropped-None"
+ secondInv.maxweight = 100000
+ secondInv.inventory = {}
+ secondInv.slots = 0
+ end
+ end
+ TriggerClientEvent("qb-inventory:client:closeinv", id)
+ TriggerClientEvent("inventory:client:OpenInventory", src, {}, Player.PlayerData.items, secondInv)
+ else
+ TriggerClientEvent("inventory:client:OpenInventory", src, {}, Player.PlayerData.items)
+ end
+end)
+
+RegisterNetEvent('inventory:server:SaveInventory', function(type, id)
+ if type == "trunk" then
+ if IsVehicleOwned(id) then
+ SaveOwnedVehicleItems(id, Trunks[id].items)
+ else
+ Trunks[id].isOpen = false
+ end
+ elseif type == "glovebox" then
+ if (IsVehicleOwned(id)) then
+ SaveOwnedGloveboxItems(id, Gloveboxes[id].items)
+ else
+ Gloveboxes[id].isOpen = false
+ end
+ elseif type == "stash" then
+ SaveStashItems(id, Stashes[id].items)
+ elseif type == "drop" then
+ if Drops[id] then
+ Drops[id].isOpen = false
+ if Drops[id].items == nil or next(Drops[id].items) == nil then
+ Drops[id] = nil
+ TriggerClientEvent("inventory:client:RemoveDropItem", -1, id)
+ end
+ end
+ end
+end)
+
+RegisterNetEvent('inventory:server:UseItemSlot', function(slot)
+ local src = source
+ local Player = QBCore.Functions.GetPlayer(src)
+ local itemData = Player.Functions.GetItemBySlot(slot)
+ if itemData then
+ local itemInfo = QBCore.Shared.Items[itemData.name]
+ if itemData.type == "weapon" then
+ if itemData.info.quality then
+ if itemData.info.quality > 0 then
+ TriggerClientEvent("inventory:client:UseWeapon", src, itemData, true)
+ else
+ TriggerClientEvent("inventory:client:UseWeapon", src, itemData, false)
+ end
+ else
+ TriggerClientEvent("inventory:client:UseWeapon", src, itemData, true)
+ end
+ TriggerClientEvent('inventory:client:ItemBox', src, itemInfo, "use")
+ elseif itemData.useable then
+ if itemData.info.quality then
+ if itemData.info.quality > 0 then
+ UseItem(itemData.name, src, itemData)
+ TriggerClientEvent('inventory:client:ItemBox', src, itemInfo, "use")
+ else
+ if itemInfo['delete'] and RemoveItem(src,itemData.name,1,slot) then
+ TriggerClientEvent('inventory:client:ItemBox',src, itemInfo, "remove")
+ else
+ TriggerClientEvent("QBCore:Notify", src, "You can't use this item", "error")
+ end
+ end
+ else
+ UseItem(itemData.name, src, itemData)
+ TriggerClientEvent('inventory:client:ItemBox', src, itemInfo, "use")
+ end
+ end
+ end
+end)
+
+RegisterNetEvent('inventory:server:UseItem', function(inventory, item)
+ local src = source
+ local Player = QBCore.Functions.GetPlayer(src)
+ if inventory == "player" or inventory == "hotbar" then
+ local itemData = Player.Functions.GetItemBySlot(item.slot)
+ if itemData then
+ local itemInfo = QBCore.Shared.Items[itemData.name]
+ if itemData.type ~= "weapon" then
+ if itemData.info.quality then
+ if itemData.info.quality <= 0 then
+ if itemInfo['delete'] and RemoveItem(src,itemData.name,1,item.slot) then
+ TriggerClientEvent("QBCore:Notify", src, "You can't use this item", "error")
+ TriggerClientEvent('inventory:client:ItemBox',src, itemInfo, "remove")
+ return
+ else
+ TriggerClientEvent("QBCore:Notify", src, "You can't use this item", "error")
+ return
+ end
+ end
+ end
+ end
+ UseItem(itemData.name, src, itemData)
+ TriggerClientEvent('inventory:client:ItemBox', src, itemInfo, "use")
+ end
+ end
+end)
+
+RegisterNetEvent('inventory:server:SetInventoryData', function(fromInventory, toInventory, fromSlot, toSlot, fromAmount, toAmount)
+ local src = source
+ local Player = QBCore.Functions.GetPlayer(src)
+ fromSlot = tonumber(fromSlot)
+ toSlot = tonumber(toSlot)
+
+ if (fromInventory == "player" or fromInventory == "hotbar") and (QBCore.Shared.SplitStr(toInventory, "-")[1] == "itemshop" or toInventory == "crafting") then
+ return
+ end
+
+ if fromInventory == "player" or fromInventory == "hotbar" then
+ local fromItemData = GetItemBySlot(src, fromSlot)
+ fromAmount = tonumber(fromAmount) or fromItemData.amount
+ if fromItemData and fromItemData.amount >= fromAmount then
+ if toInventory == "player" or toInventory == "hotbar" then
+ local toItemData = GetItemBySlot(src, toSlot)
+ RemoveItem(src, fromItemData.name, fromAmount, fromSlot)
+ TriggerClientEvent("inventory:client:CheckWeapon", src, fromItemData.name)
+ if toItemData ~= nil then
+ local toAmount = tonumber(toAmount) ~= nil and tonumber(toAmount) or toItemData.amount
+ if toItemData.amount >= toAmount then
+ if toItemData.name ~= fromItemData.name then
+ RemoveItem(src, toItemData.name, toAmount, toSlot)
+ AddItem(src, toItemData.name, toAmount, fromSlot, toItemData.info)
+ end
+ else
+ TriggerEvent("qb-log:server:CreateLog", "anticheat", "Dupe log", "red", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | *"..src.."*) swapped item; name: **"..toItemData.name.."**, amount: **" .. toAmount .. "** with name: **" .. fromItemData.name .. "**, amount: **" .. fromAmount.. "**")
+ end
+ end
+ AddItem(src, fromItemData.name, fromAmount, toSlot, fromItemData.info, fromItemData["created"])
+ elseif QBCore.Shared.SplitStr(toInventory, "-")[1] == "otherplayer" then
+ local playerId = tonumber(QBCore.Shared.SplitStr(toInventory, "-")[2])
+ local OtherPlayer = QBCore.Functions.GetPlayer(playerId)
+ local toItemData = OtherPlayer.PlayerData.items[toSlot]
+ local itemDataTest = OtherPlayer.Functions.GetItemBySlot(toSlot)
+ RemoveItem(src, fromItemData.name, fromAmount, fromSlot)
+ TriggerClientEvent("inventory:client:CheckWeapon", src, fromItemData.name)
+ if toItemData ~= nil then
+ local itemInfo = QBCore.Shared.Items[toItemData.name:lower()]
+ local toAmount = tonumber(toAmount) ~= nil and tonumber(toAmount) or toItemData.amount
+ if itemDataTest.amount >= toAmount then
+ if toItemData.name ~= fromItemData.name then
+ OtherPlayer.Functions.RemoveItem(itemInfo["name"], toAmount, fromSlot)
+ Player.Functions.AddItem(toItemData.name, toAmount, fromSlot, toItemData.info)
+ TriggerEvent("qb-log:server:CreateLog", "robbing", "Swapped Item", "orange", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | *"..src.."*) swapped item; name: **"..itemInfo["name"].."**, amount: **" .. toAmount .. "** with name: **" .. fromItemData.name .. "**, amount: **" .. fromAmount.. "** with player: **".. GetPlayerName(OtherPlayer.PlayerData.source) .. "** (citizenid: *"..OtherPlayer.PlayerData.citizenid.."* | id: *"..OtherPlayer.PlayerData.source.."*)")
+ end
+ else
+ TriggerEvent("qb-log:server:CreateLog", "anticheat", "Dupe log", "red", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | *"..src.."*) swapped item; name: **"..itemInfo["name"].."**, amount: **" .. toAmount .. "** with name: **" .. fromItemData.name .. "**, amount: **" .. fromAmount.. "** with player: **".. GetPlayerName(OtherPlayer.PlayerData.source) .. "** (citizenid: *"..OtherPlayer.PlayerData.citizenid.."* | id: *"..OtherPlayer.PlayerData.source.."*)")
+ end
+ else
+ local itemInfo = QBCore.Shared.Items[fromItemData.name:lower()]
+ TriggerEvent("qb-log:server:CreateLog", "robbing", "Dropped Item", "red", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | *"..src.."*) dropped new item; name: **"..itemInfo["name"].."**, amount: **" .. fromAmount .. "** to player: **".. GetPlayerName(OtherPlayer.PlayerData.source) .. "** (citizenid: *"..OtherPlayer.PlayerData.citizenid.."* | id: *"..OtherPlayer.PlayerData.source.."*)")
+ end
+ local itemInfo = QBCore.Shared.Items[fromItemData.name:lower()]
+ AddItem(playerId, itemInfo["name"], fromAmount, toSlot, fromItemData.info, itemInfo["created"])
+ elseif QBCore.Shared.SplitStr(toInventory, "-")[1] == "trunk" then
+ local plate = QBCore.Shared.SplitStr(toInventory, "-")[2]
+ local toItemData = Trunks[plate].items[toSlot]
+ RemoveItem(src, fromItemData.name, fromAmount, fromSlot)
+ TriggerClientEvent("inventory:client:CheckWeapon", src, fromItemData.name)
+ if toItemData ~= nil then
+ local itemInfo = QBCore.Shared.Items[toItemData.name:lower()]
+ local toAmount = tonumber(toAmount) ~= nil and tonumber(toAmount) or toItemData.amount
+ if toItemData.amount >= toAmount then
+ if toItemData.name ~= fromItemData.name then
+ RemoveFromTrunk(plate, fromSlot, itemInfo["name"], toAmount)
+ Player.Functions.AddItem(toItemData.name, toAmount, fromSlot, toItemData.info)
+ TriggerEvent("qb-log:server:CreateLog", "trunk", "Swapped Item", "orange", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | id: *"..src.."*) swapped item; name: **"..itemInfo["name"].."**, amount: **" .. toAmount .. "** with name: **" .. fromItemData.name .. "**, amount: **" .. fromAmount .. "** - plate: *" .. plate .. "*")
+ end
+ else
+ TriggerEvent("qb-log:server:CreateLog", "anticheat", "Dupe log", "red", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | *"..src.."*) swapped item; name: **"..itemInfo["name"].."**, amount: **" .. toAmount .. "** with name: **" .. fromItemData.name .. "**, amount: **" .. fromAmount.. "** - plate: *" .. plate .. "*")
+ end
+ else
+ local itemInfo = QBCore.Shared.Items[fromItemData.name:lower()]
+ TriggerEvent("qb-log:server:CreateLog", "trunk", "Dropped Item", "red", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | id: *"..src.."*) dropped new item; name: **"..itemInfo["name"].."**, amount: **" .. fromAmount .. "** - plate: *" .. plate .. "*")
+ end
+ local itemInfo = QBCore.Shared.Items[fromItemData.name:lower()]
+ AddToTrunk(plate, toSlot, fromSlot, itemInfo["name"], fromAmount, fromItemData.info, itemInfo["created"])
+ elseif QBCore.Shared.SplitStr(toInventory, "-")[1] == "glovebox" then
+ local plate = QBCore.Shared.SplitStr(toInventory, "-")[2]
+ local toItemData = Gloveboxes[plate].items[toSlot]
+ RemoveItem(src, fromItemData.name, fromAmount, fromSlot)
+ TriggerClientEvent("inventory:client:CheckWeapon", src, fromItemData.name)
+ if toItemData ~= nil then
+ local itemInfo = QBCore.Shared.Items[toItemData.name:lower()]
+ local toAmount = tonumber(toAmount) ~= nil and tonumber(toAmount) or toItemData.amount
+ if toItemData.amount >= toAmount then
+ if toItemData.name ~= fromItemData.name then
+ RemoveFromGlovebox(plate, fromSlot, itemInfo["name"], toAmount)
+ Player.Functions.AddItem(toItemData.name, toAmount, fromSlot, toItemData.info)
+ TriggerEvent("qb-log:server:CreateLog", "glovebox", "Swapped Item", "orange", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | id: *"..src.."*) swapped item; name: **"..itemInfo["name"].."**, amount: **" .. toAmount .. "** with name: **" .. fromItemData.name .. "**, amount: **" .. fromAmount .. "** - plate: *" .. plate .. "*")
+ end
+ else
+ TriggerEvent("qb-log:server:CreateLog", "anticheat", "Dupe log", "red", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | *"..src.."*) swapped item; name: **"..itemInfo["name"].."**, amount: **" .. toAmount .. "** with name: **" .. fromItemData.name .. "**, amount: **" .. fromAmount.. "** - plate: *" .. plate .. "*")
+ end
+ else
+ local itemInfo = QBCore.Shared.Items[fromItemData.name:lower()]
+ TriggerEvent("qb-log:server:CreateLog", "glovebox", "Dropped Item", "red", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | id: *"..src.."*) dropped new item; name: **"..itemInfo["name"].."**, amount: **" .. fromAmount .. "** - plate: *" .. plate .. "*")
+ end
+ local itemInfo = QBCore.Shared.Items[fromItemData.name:lower()]
+ AddToGlovebox(plate, toSlot, fromSlot, itemInfo["name"], fromAmount, fromItemData.info, itemInfo["created"])
+ elseif QBCore.Shared.SplitStr(toInventory, "-")[1] == "stash" then
+ local stashId = QBCore.Shared.SplitStr(toInventory, "-")[2]
+ local toItemData = Stashes[stashId].items[toSlot]
+ RemoveItem(src, fromItemData.name, fromAmount, fromSlot)
+ TriggerClientEvent("inventory:client:CheckWeapon", src, fromItemData.name)
+ if toItemData ~= nil then
+ local itemInfo = QBCore.Shared.Items[toItemData.name:lower()]
+ local toAmount = tonumber(toAmount) ~= nil and tonumber(toAmount) or toItemData.amount
+ if toItemData.amount >= toAmount then
+ if toItemData.name ~= fromItemData.name then
+ --RemoveFromStash(stashId, fromSlot, itemInfo["name"], toAmount)
+ RemoveFromStash(stashId, toSlot, itemInfo["name"], toAmount)
+ Player.Functions.AddItem(toItemData.name, toAmount, fromSlot, toItemData.info)
+ TriggerEvent("qb-log:server:CreateLog", "stash", "Swapped Item", "orange", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | id: *"..src.."*) swapped item; name: **"..itemInfo["name"].."**, amount: **" .. toAmount .. "** with name: **" .. fromItemData.name .. "**, amount: **" .. fromAmount .. "** - stash: *" .. stashId .. "*")
+ end
+ else
+ TriggerEvent("qb-log:server:CreateLog", "anticheat", "Dupe log", "red", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | *"..src.."*) swapped item; name: **"..itemInfo["name"].."**, amount: **" .. toAmount .. "** with name: **" .. fromItemData.name .. "**, amount: **" .. fromAmount.. "** - stash: *" .. stashId .. "*")
+ end
+ else
+ local itemInfo = QBCore.Shared.Items[fromItemData.name:lower()]
+ TriggerEvent("qb-log:server:CreateLog", "stash", "Dropped Item", "red", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | id: *"..src.."*) dropped new item; name: **"..itemInfo["name"].."**, amount: **" .. fromAmount .. "** - stash: *" .. stashId .. "*")
+ end
+ local itemInfo = QBCore.Shared.Items[fromItemData.name:lower()]
+ AddToStash(stashId, toSlot, fromSlot, itemInfo["name"], fromAmount, fromItemData.info, itemInfo["created"])
+ elseif QBCore.Shared.SplitStr(toInventory, "-")[1] == "traphouse" then
+ -- Traphouse
+ local traphouseId = QBCore.Shared.SplitStr(toInventory, "_")[2]
+ local toItemData = exports['qb-traphouse']:GetInventoryData(traphouseId, toSlot)
+ local IsItemValid = exports['qb-traphouse']:CanItemBeSaled(fromItemData.name:lower())
+ if IsItemValid then
+ RemoveItem(src, fromItemData.name, fromAmount, fromSlot)
+ TriggerClientEvent("inventory:client:CheckWeapon", src, fromItemData.name)
+ if toItemData ~= nil then
+ local itemInfo = QBCore.Shared.Items[toItemData.name:lower()]
+ local toAmount = tonumber(toAmount) ~= nil and tonumber(toAmount) or toItemData.amount
+ if toItemData.amount >= toAmount then
+ if toItemData.name ~= fromItemData.name then
+ exports['qb-traphouse']:RemoveHouseItem(traphouseId, fromSlot, itemInfo["name"], toAmount)
+ Player.Functions.AddItem(toItemData.name, toAmount, fromSlot, toItemData.info)
+ TriggerEvent("qb-log:server:CreateLog", "traphouse", "Swapped Item", "orange", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | id: *"..src.."*) swapped item; name: **"..itemInfo["name"].."**, amount: **" .. toAmount .. "** with name: **" .. fromItemData.name .. "**, amount: **" .. fromAmount .. "** - traphouse: *" .. traphouseId .. "*")
+ end
+ else
+ TriggerEvent("qb-log:server:CreateLog", "anticheat", "Dupe log", "red", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | *"..src.."*) swapped item; name: **"..itemInfo["name"].."**, amount: **" .. toAmount .. "** with name: **" .. fromItemData.name .. "**, amount: **" .. fromAmount.. "** - traphouse: *" .. traphouseId .. "*")
+ end
+ else
+ local itemInfo = QBCore.Shared.Items[fromItemData.name:lower()]
+ TriggerEvent("qb-log:server:CreateLog", "traphouse", "Dropped Item", "red", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | id: *"..src.."*) dropped new item; name: **"..itemInfo["name"].."**, amount: **" .. fromAmount .. "** - traphouse: *" .. traphouseId .. "*")
+ end
+ local itemInfo = QBCore.Shared.Items[fromItemData.name:lower()]
+ exports['qb-traphouse']:AddHouseItem(traphouseId, toSlot, itemInfo["name"], fromAmount, fromItemData.info, src)
+ else
+ TriggerClientEvent('QBCore:Notify', src, "You can\'t sell this item..", 'error')
+ end
+ else
+ -- drop
+ toInventory = tonumber(toInventory)
+ if toInventory == nil or toInventory == 0 then
+ CreateNewDrop(src, fromSlot, toSlot, fromAmount)
+ else
+ local toItemData = Drops[toInventory].items[toSlot]
+ RemoveItem(src, fromItemData.name, fromAmount, fromSlot)
+ TriggerClientEvent("inventory:client:CheckWeapon", src, fromItemData.name)
+ if toItemData ~= nil then
+ local itemInfo = QBCore.Shared.Items[toItemData.name:lower()]
+ local toAmount = tonumber(toAmount) ~= nil and tonumber(toAmount) or toItemData.amount
+ if toItemData.amount >= toAmount then
+ if toItemData.name ~= fromItemData.name then
+ Player.Functions.AddItem(toItemData.name, toAmount, fromSlot, toItemData.info)
+ RemoveFromDrop(toInventory, fromSlot, itemInfo["name"], toAmount)
+ TriggerEvent("qb-log:server:CreateLog", "drop", "Swapped Item", "orange", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | id: *"..src.."*) swapped item; name: **"..itemInfo["name"].."**, amount: **" .. toAmount .. "** with name: **" .. fromItemData.name .. "**, amount: **" .. fromAmount .. "** - dropid: *" .. toInventory .. "*")
+ end
+ else
+ TriggerEvent("qb-log:server:CreateLog", "anticheat", "Dupe log", "red", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | *"..src.."*) swapped item; name: **"..itemInfo["name"].."**, amount: **" .. toAmount .. "** with name: **" .. fromItemData.name .. "**, amount: **" .. fromAmount.. "** - dropid: *" .. toInventory .. "*")
+ end
+ else
+ local itemInfo = QBCore.Shared.Items[fromItemData.name:lower()]
+ TriggerEvent("qb-log:server:CreateLog", "drop", "Dropped Item", "red", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | id: *"..src.."*) dropped new item; name: **"..itemInfo["name"].."**, amount: **" .. fromAmount .. "** - dropid: *" .. toInventory .. "*")
+ end
+ local itemInfo = QBCore.Shared.Items[fromItemData.name:lower()]
+ AddToDrop(toInventory, toSlot, itemInfo["name"], fromAmount, fromItemData.info, itemInfo["created"])
+ if itemInfo["name"] == "radio" then
+ TriggerClientEvent('Radio.Set', src, false)
+ end
+ end
+ end
+ else
+ TriggerClientEvent("QBCore:Notify", src, "You don\'t have this item!", "error")
+ end
+ elseif QBCore.Shared.SplitStr(fromInventory, "-")[1] == "otherplayer" then
+ local playerId = tonumber(QBCore.Shared.SplitStr(fromInventory, "-")[2])
+ local OtherPlayer = QBCore.Functions.GetPlayer(playerId)
+ local fromItemData = OtherPlayer.PlayerData.items[fromSlot]
+ fromAmount = tonumber(fromAmount) or fromItemData.amount
+ if fromItemData and fromItemData.amount >= fromAmount then
+ local itemInfo = QBCore.Shared.Items[fromItemData.name:lower()]
+ if toInventory == "player" or toInventory == "hotbar" then
+ local toItemData = GetItemBySlot(src, toSlot)
+ RemoveItem(playerId, itemInfo["name"], fromAmount, fromSlot)
+ TriggerClientEvent("inventory:client:CheckWeapon", OtherPlayer.PlayerData.source, fromItemData.name)
+ if toItemData ~= nil then
+ itemInfo = QBCore.Shared.Items[toItemData.name:lower()]
+ local toAmount = tonumber(toAmount) ~= nil and tonumber(toAmount) or toItemData.amount
+ if toItemData.amount >= toAmount then
+ if toItemData.name ~= fromItemData.name then
+ Player.Functions.RemoveItem(toItemData.name, toAmount, toSlot)
+ OtherPlayer.Functions.AddItem(itemInfo["name"], toAmount, fromSlot, toItemData.info)
+ TriggerEvent("qb-log:server:CreateLog", "robbing", "Swapped Item", "orange", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | id: *"..src.."*) swapped item; name: **"..toItemData.name.."**, amount: **" .. toAmount .. "** with item; **"..itemInfo["name"].."**, amount: **" .. toAmount .. "** from player: **".. GetPlayerName(OtherPlayer.PlayerData.source) .. "** (citizenid: *"..OtherPlayer.PlayerData.citizenid.."* | *"..OtherPlayer.PlayerData.source.."*)")
+ end
+ else
+ TriggerEvent("qb-log:server:CreateLog", "anticheat", "Dupe log", "red", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | *"..src.."*) swapped item; name: **"..itemInfo["name"].."**, amount: **" .. toAmount .. "** with name: **" .. fromItemData.name .. "**, amount: **" .. fromAmount.. "** with player: **".. GetPlayerName(OtherPlayer.PlayerData.source) .. "** (citizenid: *"..OtherPlayer.PlayerData.citizenid.."* | id: *"..OtherPlayer.PlayerData.source.."*)")
+ end
+ else
+ TriggerEvent("qb-log:server:CreateLog", "robbing", "Retrieved Item", "green", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | id: *"..src.."*) took item; name: **"..fromItemData.name.."**, amount: **" .. fromAmount .. "** from player: **".. GetPlayerName(OtherPlayer.PlayerData.source) .. "** (citizenid: *"..OtherPlayer.PlayerData.citizenid.."* | *"..OtherPlayer.PlayerData.source.."*)")
+ end
+ AddItem(src, fromItemData.name, fromAmount, toSlot, fromItemData.info, fromItemData["created"])
+ else
+ local toItemData = OtherPlayer.PlayerData.items[toSlot]
+ local itemDataTest = OtherPlayer.Functions.GetItemBySlot(toSlot)
+ RemoveItem(playerId, itemInfo["name"], fromAmount, fromSlot)
+ if toItemData ~= nil then
+ local toAmount = tonumber(toAmount) ~= nil and tonumber(toAmount) or toItemData.amount
+ if itemDataTest.amount >= toAmount then
+ if toItemData.name ~= fromItemData.name then
+ local itemInfo = QBCore.Shared.Items[toItemData.name:lower()]
+ OtherPlayer.Functions.RemoveItem(itemInfo["name"], toAmount, toSlot)
+ OtherPlayer.Functions.AddItem(itemInfo["name"], toAmount, fromSlot, toItemData.info)
+ end
+ else
+ TriggerEvent("qb-log:server:CreateLog", "anticheat", "Dupe log", "red", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | *"..src.."*) swapped item; name: **"..itemInfo["name"].."**, amount: **" .. toAmount .. "** with name: **" .. fromItemData.name .. "**, amount: **" .. fromAmount.. "** with player: **".. GetPlayerName(OtherPlayer.PlayerData.source) .. "** (citizenid: *"..OtherPlayer.PlayerData.citizenid.."* | id: *"..OtherPlayer.PlayerData.source.."*)")
+ end
+ end
+ itemInfo = QBCore.Shared.Items[fromItemData.name:lower()]
+ AddItem(playerId, itemInfo["name"], fromAmount, toSlot, fromItemData.info, itemInfo["created"])
+ end
+ else
+ QBCore.Functions.Notify(src, "Item doesn't exist", "error")
+ end
+ elseif QBCore.Shared.SplitStr(fromInventory, "-")[1] == "trunk" then
+ local plate = QBCore.Shared.SplitStr(fromInventory, "-")[2]
+ local fromItemData = Trunks[plate].items[fromSlot]
+ fromAmount = tonumber(fromAmount) or fromItemData.amount
+ if fromItemData and fromItemData.amount >= fromAmount then
+ local itemInfo = QBCore.Shared.Items[fromItemData.name:lower()]
+ if toInventory == "player" or toInventory == "hotbar" then
+ local toItemData = GetItemBySlot(src, toSlot)
+ RemoveFromTrunk(plate, fromSlot, itemInfo["name"], fromAmount)
+ if toItemData ~= nil then
+ itemInfo = QBCore.Shared.Items[toItemData.name:lower()]
+ local toAmount = tonumber(toAmount) ~= nil and tonumber(toAmount) or toItemData.amount
+ if toItemData.amount >= toAmount then
+ if toItemData.name ~= fromItemData.name then
+ Player.Functions.RemoveItem(toItemData.name, toAmount, toSlot)
+ AddToTrunk(plate, fromSlot, toSlot, itemInfo["name"], toAmount, toItemData.info, itemInfo["created"])
+ TriggerEvent("qb-log:server:CreateLog", "trunk", "Swapped Item", "orange", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | id: *"..src.."*) swapped item; name: **"..toItemData.name.."**, amount: **" .. toAmount .. "** with item; name: **"..itemInfo["name"].."**, amount: **" .. toAmount .. "** plate: *" .. plate .. "*")
+ else
+ TriggerEvent("qb-log:server:CreateLog", "trunk", "Stacked Item", "orange", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | id: *"..src.."*) stacked item; name: **"..toItemData.name.."**, amount: **" .. toAmount .. "** from plate: *" .. plate .. "*")
+ end
+ else
+ TriggerEvent("qb-log:server:CreateLog", "anticheat", "Dupe log", "red", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | *"..src.."*) swapped item; name: **"..toItemData.name.."**, amount: **" .. toAmount .. "** with name: **" .. itemInfo["name"] .. "**, amount: **" .. toAmount.. "** plate: *" .. plate .. "*")
+ end
+ else
+ TriggerEvent("qb-log:server:CreateLog", "trunk", "Received Item", "green", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | id: *"..src.."*) received item; name: **"..fromItemData.name.."**, amount: **" .. fromAmount.. "** plate: *" .. plate .. "*")
+ end
+ AddItem(src, fromItemData.name, fromAmount, toSlot, fromItemData.info, fromItemData["created"])
+ else
+ local toItemData = Trunks[plate].items[toSlot]
+ RemoveFromTrunk(plate, fromSlot, itemInfo["name"], fromAmount)
+ if toItemData ~= nil then
+ local toAmount = tonumber(toAmount) ~= nil and tonumber(toAmount) or toItemData.amount
+ if toItemData.amount >= toAmount then
+ if toItemData.name ~= fromItemData.name then
+ local itemInfo = QBCore.Shared.Items[toItemData.name:lower()]
+ RemoveFromTrunk(plate, toSlot, itemInfo["name"], toAmount)
+ AddToTrunk(plate, fromSlot, toSlot, itemInfo["name"], toAmount, toItemData.info, itemInfo["created"])
+ end
+ else
+ TriggerEvent("qb-log:server:CreateLog", "anticheat", "Dupe log", "red", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | *"..src.."*) swapped item; name: **"..toItemData.name.."**, amount: **" .. toAmount .. "** with name: **" .. itemInfo["name"] .. "**, amount: **" .. toAmount.. "** plate: *" .. plate .. "*")
+ end
+ end
+ itemInfo = QBCore.Shared.Items[fromItemData.name:lower()]
+ AddToTrunk(plate, toSlot, fromSlot, itemInfo["name"], fromAmount, fromItemData.info, itemInfo["created"])
+ end
+ else
+ QBCore.Functions.Notify(src, Lang:t("notify.itemexist"), "error")
+ end
+ elseif QBCore.Shared.SplitStr(fromInventory, "-")[1] == "glovebox" then
+ local plate = QBCore.Shared.SplitStr(fromInventory, "-")[2]
+ local fromItemData = Gloveboxes[plate].items[fromSlot]
+ fromAmount = tonumber(fromAmount) or fromItemData.amount
+ if fromItemData and fromItemData.amount >= fromAmount then
+ local itemInfo = QBCore.Shared.Items[fromItemData.name:lower()]
+ if toInventory == "player" or toInventory == "hotbar" then
+ local toItemData = GetItemBySlot(src, toSlot)
+ RemoveFromGlovebox(plate, fromSlot, itemInfo["name"], fromAmount)
+ if toItemData ~= nil then
+ itemInfo = QBCore.Shared.Items[toItemData.name:lower()]
+ local toAmount = tonumber(toAmount) ~= nil and tonumber(toAmount) or toItemData.amount
+ if toItemData.amount >= toAmount then
+ if toItemData.name ~= fromItemData.name then
+ Player.Functions.RemoveItem(toItemData.name, toAmount, toSlot)
+ AddToGlovebox(plate, fromSlot, toSlot, itemInfo["name"], toAmount, toItemData.info, itemInfo["created"])
+ TriggerEvent("qb-log:server:CreateLog", "glovebox", "Swapped", "orange", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | id: *"..src..")* swapped item; name: **"..toItemData.name.."**, amount: **" .. toAmount .. "** with item; name: **"..itemInfo["name"].."**, amount: **" .. toAmount .. "** plate: *" .. plate .. "*")
+ else
+ TriggerEvent("qb-log:server:CreateLog", "glovebox", "Stacked Item", "orange", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | id: *"..src.."*) stacked item; name: **"..toItemData.name.."**, amount: **" .. toAmount .. "** from plate: *" .. plate .. "*")
+ end
+ else
+ TriggerEvent("qb-log:server:CreateLog", "anticheat", "Dupe log", "red", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | *"..src.."*) swapped item; name: **"..toItemData.name.."**, amount: **" .. toAmount .. "** with name: **" .. itemInfo["name"] .. "**, amount: **" .. toAmount.. "** plate: *" .. plate .. "*")
+ end
+ else
+ TriggerEvent("qb-log:server:CreateLog", "glovebox", "Received Item", "green", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | id: *"..src.."*) received item; name: **"..fromItemData.name.."**, amount: **" .. fromAmount.. "** plate: *" .. plate .. "*")
+ end
+ AddItem(src, fromItemData.name, fromAmount, toSlot, fromItemData.info, fromItemData["created"])
+ else
+ local toItemData = Gloveboxes[plate].items[toSlot]
+ RemoveFromGlovebox(plate, fromSlot, itemInfo["name"], fromAmount)
+ if toItemData ~= nil then
+ local toAmount = tonumber(toAmount) ~= nil and tonumber(toAmount) or toItemData.amount
+ if toItemData.amount >= toAmount then
+ if toItemData.name ~= fromItemData.name then
+ local itemInfo = QBCore.Shared.Items[toItemData.name:lower()]
+ RemoveFromGlovebox(plate, toSlot, itemInfo["name"], toAmount)
+ AddToGlovebox(plate, fromSlot, toSlot, itemInfo["name"], toAmount, toItemData.info, itemInfo["created"])
+ end
+ else
+ TriggerEvent("qb-log:server:CreateLog", "anticheat", "Dupe log", "red", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | *"..src.."*) swapped item; name: **"..toItemData.name.."**, amount: **" .. toAmount .. "** with name: **" .. itemInfo["name"] .. "**, amount: **" .. toAmount.. "** plate: *" .. plate .. "*")
+ end
+ end
+ itemInfo = QBCore.Shared.Items[fromItemData.name:lower()]
+ AddToGlovebox(plate, toSlot, fromSlot, itemInfo["name"], fromAmount, fromItemData.info, itemInfo["created"])
+ end
+ else
+ QBCore.Functions.Notify(src, Lang:t("notify.itemexist"), "error")
+ end
+ elseif QBCore.Shared.SplitStr(fromInventory, "-")[1] == "stash" then
+ local stashId = QBCore.Shared.SplitStr(fromInventory, "-")[2]
+ local fromItemData = Stashes[stashId].items[fromSlot]
+ fromAmount = tonumber(fromAmount) or fromItemData.amount
+ if fromItemData and fromItemData.amount >= fromAmount then
+ local itemInfo = QBCore.Shared.Items[fromItemData.name:lower()]
+ if toInventory == "player" or toInventory == "hotbar" then
+ local toItemData = GetItemBySlot(src, toSlot)
+ RemoveFromStash(stashId, fromSlot, itemInfo["name"], fromAmount)
+ if toItemData ~= nil then
+ itemInfo = QBCore.Shared.Items[toItemData.name:lower()]
+ local toAmount = tonumber(toAmount) ~= nil and tonumber(toAmount) or toItemData.amount
+ if toItemData.amount >= toAmount then
+ if toItemData.name ~= fromItemData.name then
+ Player.Functions.RemoveItem(toItemData.name, toAmount, toSlot)
+ AddToStash(stashId, fromSlot, toSlot, itemInfo["name"], toAmount, toItemData.info, itemInfo["created"])
+ TriggerEvent("qb-log:server:CreateLog", "stash", "Swapped Item", "orange", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | id: *"..src.."*) swapped item; name: **"..toItemData.name.."**, amount: **" .. toAmount .. "** with item; name: **"..fromItemData.name.."**, amount: **" .. fromAmount .. "** stash: *" .. stashId .. "*")
+ else
+ TriggerEvent("qb-log:server:CreateLog", "stash", "Stacked Item", "orange", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | id: *"..src.."*) stacked item; name: **"..toItemData.name.."**, amount: **" .. toAmount .. "** from stash: *" .. stashId .. "*")
+ end
+ else
+ TriggerEvent("qb-log:server:CreateLog", "anticheat", "Dupe log", "red", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | id: *"..src.."*) swapped item; name: **"..toItemData.name.."**, amount: **" .. toAmount .. "** with item; name: **"..fromItemData.name.."**, amount: **" .. fromAmount .. "** stash: *" .. stashId .. "*")
+ end
+ else
+ TriggerEvent("qb-log:server:CreateLog", "stash", "Received Item", "green", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | id: *"..src.."*) received item; name: **"..fromItemData.name.."**, amount: **" .. fromAmount.. "** stash: *" .. stashId .. "*")
+ end
+ SaveStashItems(stashId, Stashes[stashId].items)
+ AddItem(src, fromItemData.name, fromAmount, toSlot, fromItemData.info, fromItemData["created"])
+ else
+ local toItemData = Stashes[stashId].items[toSlot]
+ RemoveFromStash(stashId, fromSlot, itemInfo["name"], fromAmount)
+ if toItemData ~= nil then
+ local toAmount = tonumber(toAmount) ~= nil and tonumber(toAmount) or toItemData.amount
+ if toItemData.amount >= toAmount then
+ if toItemData.name ~= fromItemData.name then
+ local itemInfo = QBCore.Shared.Items[toItemData.name:lower()]
+ RemoveFromStash(stashId, toSlot, itemInfo["name"], toAmount)
+ AddToStash(stashId, fromSlot, toSlot, itemInfo["name"], toAmount, toItemData.info, itemInfo["created"])
+ end
+ else
+ TriggerEvent("qb-log:server:CreateLog", "anticheat", "Dupe log", "red", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | id: *"..src.."*) swapped item; name: **"..toItemData.name.."**, amount: **" .. toAmount .. "** with item; name: **"..fromItemData.name.."**, amount: **" .. fromAmount .. "** stash: *" .. stashId .. "*")
+ end
+ end
+ itemInfo = QBCore.Shared.Items[fromItemData.name:lower()]
+ AddToStash(stashId, toSlot, fromSlot, itemInfo["name"], fromAmount, fromItemData.info, itemInfo["created"])
+ end
+ else
+ QBCore.Functions.Notify(src, Lang:t("notify.itemexist"), "error")
+ end
+ elseif QBCore.Shared.SplitStr(fromInventory, "-")[1] == "traphouse" then
+ local traphouseId = QBCore.Shared.SplitStr(fromInventory, "_")[2]
+ local fromItemData = exports['qb-traphouse']:GetInventoryData(traphouseId, fromSlot)
+ fromAmount = tonumber(fromAmount) or fromItemData.amount
+ if fromItemData and fromItemData.amount >= fromAmount then
+ local itemInfo = QBCore.Shared.Items[fromItemData.name:lower()]
+ if toInventory == "player" or toInventory == "hotbar" then
+ local toItemData = GetItemBySlot(src, toSlot)
+ exports['qb-traphouse']:RemoveHouseItem(traphouseId, fromSlot, itemInfo["name"], fromAmount)
+ if toItemData ~= nil then
+ itemInfo = QBCore.Shared.Items[toItemData.name:lower()]
+ local toAmount = tonumber(toAmount) ~= nil and tonumber(toAmount) or toItemData.amount
+ if toItemData.amount >= toAmount then
+ if toItemData.name ~= fromItemData.name then
+ Player.Functions.RemoveItem(toItemData.name, toAmount, toSlot)
+ exports['qb-traphouse']:AddHouseItem(traphouseId, fromSlot, itemInfo["name"], toAmount, toItemData.info, src)
+ TriggerEvent("qb-log:server:CreateLog", "stash", "Swapped Item", "orange", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | id: *"..src.."*) swapped item; name: **"..toItemData.name.."**, amount: **" .. toAmount .. "** with item; name: **"..fromItemData.name.."**, amount: **" .. fromAmount .. "** stash: *" .. traphouseId .. "*")
+ else
+ TriggerEvent("qb-log:server:CreateLog", "stash", "Stacked Item", "orange", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | id: *"..src.."*) stacked item; name: **"..toItemData.name.."**, amount: **" .. toAmount .. "** from stash: *" .. traphouseId .. "*")
+ end
+ else
+ TriggerEvent("qb-log:server:CreateLog", "anticheat", "Dupe log", "red", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | id: *"..src.."*) swapped item; name: **"..toItemData.name.."**, amount: **" .. toAmount .. "** with item; name: **"..fromItemData.name.."**, amount: **" .. fromAmount .. "** stash: *" .. traphouseId .. "*")
+ end
+ else
+ TriggerEvent("qb-log:server:CreateLog", "stash", "Received Item", "green", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | id: *"..src.."*) received item; name: **"..fromItemData.name.."**, amount: **" .. fromAmount.. "** stash: *" .. traphouseId .. "*")
+ end
+ AddItem(src, fromItemData.name, fromAmount, toSlot, fromItemData.info, fromItemData["created"])
+ else
+ local toItemData = exports['qb-traphouse']:GetInventoryData(traphouseId, toSlot)
+ exports['qb-traphouse']:RemoveHouseItem(traphouseId, fromSlot, itemInfo["name"], fromAmount)
+ if toItemData ~= nil then
+ local toAmount = tonumber(toAmount) ~= nil and tonumber(toAmount) or toItemData.amount
+ if toItemData.amount >= toAmount then
+ if toItemData.name ~= fromItemData.name then
+ local itemInfo = QBCore.Shared.Items[toItemData.name:lower()]
+ exports['qb-traphouse']:RemoveHouseItem(traphouseId, toSlot, itemInfo["name"], toAmount)
+ exports['qb-traphouse']:AddHouseItem(traphouseId, fromSlot, itemInfo["name"], toAmount, toItemData.info, src)
+ end
+ else
+ TriggerEvent("qb-log:server:CreateLog", "anticheat", "Dupe log", "red", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | id: *"..src.."*) swapped item; name: **"..toItemData.name.."**, amount: **" .. toAmount .. "** with item; name: **"..fromItemData.name.."**, amount: **" .. fromAmount .. "** stash: *" .. traphouseId .. "*")
+ end
+ end
+ itemInfo = QBCore.Shared.Items[fromItemData.name:lower()]
+ exports['qb-traphouse']:AddHouseItem(traphouseId, toSlot, itemInfo["name"], fromAmount, fromItemData.info, src)
+ end
+ else
+ QBCore.Functions.Notify(src, "Item doesn't exist??", "error")
+ end
+ elseif QBCore.Shared.SplitStr(fromInventory, "-")[1] == "itemshop" then
+ local shopType = QBCore.Shared.SplitStr(fromInventory, "-")[2]
+ local itemData = ShopItems[shopType].items[fromSlot]
+ local itemInfo = QBCore.Shared.Items[itemData.name:lower()]
+ local bankBalance = Player.PlayerData.money["bank"]
+ local price = tonumber((itemData.price*fromAmount))
+
+ if QBCore.Shared.SplitStr(shopType, "_")[1] == "Dealer" then
+ if QBCore.Shared.SplitStr(itemData.name, "_")[1] == "weapon" then
+ price = tonumber(itemData.price)
+ if Player.Functions.RemoveMoney("cash", price, "dealer-item-bought") then
+ itemData.info.serie = tostring(QBCore.Shared.RandomInt(2) .. QBCore.Shared.RandomStr(3) .. QBCore.Shared.RandomInt(1) .. QBCore.Shared.RandomStr(2) .. QBCore.Shared.RandomInt(3) .. QBCore.Shared.RandomStr(4))
+ itemData.info.quality = 100
+ AddItem(src, itemData.name, 1, toSlot, itemData.info)
+ TriggerClientEvent('qb-drugs:client:updateDealerItems', src, itemData, 1)
+ QBCore.Functions.Notify(src, itemInfo["label"] .. " bought!", "success")
+ TriggerEvent("qb-log:server:CreateLog", "dealers", "Dealer item bought", "green", "**"..GetPlayerName(src) .. "** bought a " .. itemInfo["label"] .. " for $"..price)
+ else
+ QBCore.Functions.Notify(src, "You don\'t have enough cash..", "error")
+ end
+ else
+ if Player.Functions.RemoveMoney("cash", price, "dealer-item-bought") then
+ AddItem(src, itemData.name, fromAmount, toSlot, itemData.info)
+ TriggerClientEvent('qb-drugs:client:updateDealerItems', src, itemData, fromAmount)
+ QBCore.Functions.Notify(src, itemInfo["label"] .. " bought!", "success")
+ TriggerEvent("qb-log:server:CreateLog", "dealers", "Dealer item bought", "green", "**"..GetPlayerName(src) .. "** bought a " .. itemInfo["label"] .. " for $"..price)
+ else
+ QBCore.Functions.Notify(src, "You don't have enough cash..", "error")
+ end
+ end
+ elseif QBCore.Shared.SplitStr(shopType, "_")[1] == "Itemshop" then
+ if Player.Functions.RemoveMoney("cash", price, "itemshop-bought-item") then
+ if QBCore.Shared.SplitStr(itemData.name, "_")[1] == "weapon" then
+ itemData.info.serie = tostring(QBCore.Shared.RandomInt(2) .. QBCore.Shared.RandomStr(3) .. QBCore.Shared.RandomInt(1) .. QBCore.Shared.RandomStr(2) .. QBCore.Shared.RandomInt(3) .. QBCore.Shared.RandomStr(4))
+ itemData.info.quality = 100
+ end
+ local serial = itemData.info.serie
+ local imageurl = ("https://cfx-nui-qb-inventory/html/images/%s.png"):format(itemData.name)
+ local notes = "Purchased at Ammunation"
+ local owner = Player.PlayerData.charinfo.firstname .. " " .. Player.PlayerData.charinfo.lastname
+ local weapClass = 1
+ local weapModel = QBCore.Shared.Items[itemData.name].label
+ AddItem(src, itemData.name, fromAmount, toSlot, itemData.info)
+ TriggerClientEvent('qb-shops:client:UpdateShop', src, QBCore.Shared.SplitStr(shopType, "_")[2], itemData, fromAmount)
+ QBCore.Functions.Notify(src, itemInfo["label"] .. " bought!", "success")
+ exports['ps-mdt']:CreateWeaponInfo(serial, imageurl, notes, owner, weapClass, weapModel)
+ TriggerEvent("qb-log:server:CreateLog", "shops", "Shop item bought", "green", "**"..GetPlayerName(src) .. "** bought a " .. itemInfo["label"] .. " for $"..price)
+ elseif bankBalance >= price then
+ Player.Functions.RemoveMoney("bank", price, "itemshop-bought-item")
+ if QBCore.Shared.SplitStr(itemData.name, "_")[1] == "weapon" then
+ itemData.info.serie = tostring(QBCore.Shared.RandomInt(2) .. QBCore.Shared.RandomStr(3) .. QBCore.Shared.RandomInt(1) .. QBCore.Shared.RandomStr(2) .. QBCore.Shared.RandomInt(3) .. QBCore.Shared.RandomStr(4))
+ itemData.info.quality = 100
+ end
+ local serial = itemData.info.serie
+ local imageurl = ("https://cfx-nui-qb-inventory/html/images/%s.png"):format(itemData.name)
+ local notes = "Purchased at Ammunation"
+ local owner = Player.PlayerData.charinfo.firstname .. " " .. Player.PlayerData.charinfo.lastname
+ local weapClass = 1
+ local weapModel = QBCore.Shared.Items[itemData.name].label
+ AddItem(src, itemData.name, fromAmount, toSlot, itemData.info)
+ TriggerClientEvent('qb-shops:client:UpdateShop', src, QBCore.Shared.SplitStr(shopType, "_")[2], itemData, fromAmount)
+ QBCore.Functions.Notify(src, itemInfo["label"] .. " bought!", "success")
+ exports['ps-mdt']:CreateWeaponInfo(serial, imageurl, notes, owner, weapClass, weapModel)
+ TriggerEvent("qb-log:server:CreateLog", "shops", "Shop item bought", "green", "**"..GetPlayerName(src) .. "** bought a " .. itemInfo["label"] .. " for $"..price)
+ else
+ QBCore.Functions.Notify(src, "You don't have enough cash..", "error")
+ end
+ else
+ if Player.Functions.RemoveMoney("cash", price, "unkown-itemshop-bought-item") then
+ AddItem(src, itemData.name, fromAmount, toSlot, itemData.info)
+ QBCore.Functions.Notify(src, itemInfo["label"] .. " bought!", "success")
+ TriggerEvent("qb-log:server:CreateLog", "shops", "Shop item bought", "green", "**"..GetPlayerName(src) .. "** bought a " .. itemInfo["label"] .. " for $"..price)
+ elseif bankBalance >= price then
+ Player.Functions.RemoveMoney("bank", price, "unkown-itemshop-bought-item")
+ AddItem(src, itemData.name, fromAmount, toSlot, itemData.info)
+ QBCore.Functions.Notify(src, itemInfo["label"] .. " bought!", "success")
+ TriggerEvent("qb-log:server:CreateLog", "shops", "Shop item bought", "green", "**"..GetPlayerName(src) .. "** bought a " .. itemInfo["label"] .. " for $"..price)
+ else
+ TriggerClientEvent('QBCore:Notify', src, "You don\'t have enough cash..", "error")
+ end
+ end
+ elseif fromInventory == "crafting" then
+ local itemData = Config.CraftingItems[fromSlot]
+ if hasCraftItems(src, itemData.costs, fromAmount) then
+ TriggerClientEvent("inventory:client:CraftItems", src, itemData.name, itemData.costs, fromAmount, toSlot, itemData.points)
+ else
+ TriggerClientEvent("inventory:client:UpdatePlayerInventory", src, true)
+ TriggerClientEvent('QBCore:Notify', src, "You don't have the right items..", "error")
+ end
+ elseif fromInventory == "attachment_crafting" then
+ local itemData = Config.AttachmentCrafting[fromSlot]
+ if hasCraftItems(src, itemData.costs, fromAmount) then
+ TriggerClientEvent("inventory:client:CraftAttachment", src, itemData.name, itemData.costs, fromAmount, toSlot, itemData.points)
+ else
+ TriggerClientEvent("inventory:client:UpdatePlayerInventory", src, true)
+ TriggerClientEvent('QBCore:Notify', src, "You don't have the right items..", "error")
+ end
+ else
+ -- drop
+ fromInventory = tonumber(fromInventory)
+ local fromItemData = Drops[fromInventory].items[fromSlot]
+ fromAmount = tonumber(fromAmount) or fromItemData.amount
+ if fromItemData and fromItemData.amount >= fromAmount then
+ local itemInfo = QBCore.Shared.Items[fromItemData.name:lower()]
+ if toInventory == "player" or toInventory == "hotbar" then
+ local toItemData = GetItemBySlot(src, toSlot)
+ RemoveFromDrop(fromInventory, fromSlot, itemInfo["name"], fromAmount)
+ if toItemData ~= nil then
+ toAmount = tonumber(toAmount) and tonumber(toAmount) or toItemData.amount
+ if toItemData.amount >= toAmount then
+ if toItemData.name ~= fromItemData.name then
+ itemInfo = QBCore.Shared.Items[toItemData.name:lower()]
+ Player.Functions.RemoveItem(toItemData.name, toAmount, toSlot)
+ AddToDrop(fromInventory, toSlot, itemInfo["name"], toAmount, toItemData.info, itemInfo["created"])
+ if itemInfo["name"] == "radio" then
+ TriggerClientEvent('Radio.Set', src, false)
+ end
+ TriggerEvent("qb-log:server:CreateLog", "drop", "Swapped Item", "orange", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | id: *"..src.."*) swapped item; name: **"..toItemData.name.."**, amount: **" .. toAmount .. "** with item; name: **"..fromItemData.name.."**, amount: **" .. fromAmount .. "** - dropid: *" .. fromInventory .. "*")
+ else
+ TriggerEvent("qb-log:server:CreateLog", "drop", "Stacked Item", "orange", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | id: *"..src.."*) stacked item; name: **"..toItemData.name.."**, amount: **" .. toAmount .. "** - from dropid: *" .. fromInventory .. "*")
+ end
+ else
+ TriggerEvent("qb-log:server:CreateLog", "anticheat", "Dupe log", "red", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | id: *"..src.."*) swapped item; name: **"..toItemData.name.."**, amount: **" .. toAmount .. "** with item; name: **"..fromItemData.name.."**, amount: **" .. fromAmount .. "** - dropid: *" .. fromInventory .. "*")
+ end
+ else
+ TriggerEvent("qb-log:server:CreateLog", "drop", "Received Item", "green", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | id: *"..src.."*) received item; name: **"..fromItemData.name.."**, amount: **" .. fromAmount.. "** - dropid: *" .. fromInventory .. "*")
+ end
+ AddItem(src, fromItemData.name, fromAmount, toSlot, fromItemData.info, fromItemData["created"])
+ else
+ toInventory = tonumber(toInventory)
+ local toItemData = Drops[toInventory].items[toSlot]
+ RemoveFromDrop(fromInventory, fromSlot, itemInfo["name"], fromAmount)
+ if toItemData ~= nil then
+ local toAmount = tonumber(toAmount) ~= nil and tonumber(toAmount) or toItemData.amount
+ if toItemData.amount >= toAmount then
+ if toItemData.name ~= fromItemData.name then
+ local itemInfo = QBCore.Shared.Items[toItemData.name:lower()]
+ RemoveFromDrop(toInventory, toSlot, itemInfo["name"], toAmount)
+ AddToDrop(fromInventory, fromSlot, itemInfo["name"], toAmount, toItemData.info, itemInfo["created"])
+ if itemInfo["name"] == "radio" then
+ TriggerClientEvent('Radio.Set', src, false)
+ end
+ end
+ else
+ TriggerEvent("qb-log:server:CreateLog", "anticheat", "Dupe log", "red", "**".. GetPlayerName(src) .. "** (citizenid: *"..Player.PlayerData.citizenid.."* | id: *"..src.."*) swapped item; name: **"..toItemData.name.."**, amount: **" .. toAmount .. "** with item; name: **"..fromItemData.name.."**, amount: **" .. fromAmount .. "** - dropid: *" .. fromInventory .. "*")
+ end
+ end
+ itemInfo = QBCore.Shared.Items[fromItemData.name:lower()]
+ AddToDrop(toInventory, toSlot, itemInfo["name"], fromAmount, fromItemData.info, itemInfo["created"])
+ if itemInfo["name"] == "radio" then
+ TriggerClientEvent('Radio.Set', src, false)
+ end
+ end
+ else
+ QBCore.Functions.Notify(src, "Item doesn't exist??", "error")
+ end
+ end
+end)
+
+RegisterNetEvent('qb-inventory:server:SaveStashItems', function(stashId, items)
+ MySQL.Async.insert('INSERT INTO stashitems (stash, items) VALUES (:stash, :items) ON DUPLICATE KEY UPDATE items = :items', {
+ ['stash'] = stashId,
+ ['items'] = json.encode(items)
+ })
+end)
+
+RegisterServerEvent("inventory:server:GiveItem", function(target, name, amount, slot)
+ local src = source
+ local Player = QBCore.Functions.GetPlayer(src)
+ target = tonumber(target)
+ local OtherPlayer = QBCore.Functions.GetPlayer(target)
+ local dist = #(GetEntityCoords(GetPlayerPed(src))-GetEntityCoords(GetPlayerPed(target)))
+ if Player == OtherPlayer then return QBCore.Functions.Notify(src, "You can\'t give yourself an item?") end
+ if dist > 2 then return QBCore.Functions.Notify(src, "You are too far away to give items!") end
+ local item = GetItemBySlot(src, slot)
+ if not item then QBCore.Functions.Notify(src, "Item you tried giving not found!"); return end
+ if item.name ~= name then QBCore.Functions.Notify(src, "Incorrect item found try again!"); return end
+
+ if amount <= item.amount then
+ if amount == 0 then
+ amount = item.amount
+ end
+ if RemoveItem(src, item.name, amount, item.slot) then
+ if AddItem(target, item.name, amount, false, item.info, item.created) then
+ TriggerClientEvent('inventory:client:ItemBox',target, QBCore.Shared.Items[item.name], "add")
+ QBCore.Functions.Notify(target, "You Received "..amount..' '..item.label.." From "..Player.PlayerData.charinfo.firstname.." "..Player.PlayerData.charinfo.lastname)
+ TriggerClientEvent("inventory:client:UpdatePlayerInventory", target, true)
+ TriggerClientEvent('inventory:client:ItemBox',src, QBCore.Shared.Items[item.name], "remove")
+ QBCore.Functions.Notify(src, "You gave " .. OtherPlayer.PlayerData.charinfo.firstname.." "..OtherPlayer.PlayerData.charinfo.lastname.. " " .. amount .. " " .. item.label .."!")
+ TriggerClientEvent("inventory:client:UpdatePlayerInventory", src, true)
+ TriggerClientEvent('qb-inventory:client:giveAnim', src)
+ TriggerClientEvent('qb-inventory:client:giveAnim', target)
+ else
+ AddItem(src, item.name, amount, item.slot, item.info, item.created)
+ QBCore.Functions.Notify(src, "The other players inventory is full!", "error")
+ QBCore.Functions.Notify(target, "The other players inventory is full!", "error")
+ TriggerClientEvent("inventory:client:UpdatePlayerInventory", src, false)
+ TriggerClientEvent("inventory:client:UpdatePlayerInventory", target, false)
+ end
+ else
+ TriggerClientEvent('QBCore:Notify', src, "You do not have enough of the item", "error")
+ end
+ else
+ TriggerClientEvent('QBCore:Notify', src, "You do not have enough items to transfer")
+ end
+end)
+
+RegisterNetEvent('inventory:server:snowball', function(action)
+ if action == "add" then
+ AddItem(source, "weapon_snowball")
+ elseif action == "remove" then
+ RemoveItem(source, "weapon_snowball")
+ end
+end)
+
+-- callback
+
+QBCore.Functions.CreateCallback('qb-inventory:server:GetStashItems', function(source, cb, stashId)
+ cb(GetStashItems(stashId))
+end)
+
+QBCore.Functions.CreateCallback('inventory:server:GetCurrentDrops', function(_, cb)
+ cb(Drops)
+end)
+
+QBCore.Functions.CreateCallback('QBCore:HasItem', function(source, cb, items, amount)
+ print("^3QBCore:HasItem is deprecated, please use QBCore.Functions.HasItem, it can be used on both server- and client-side and uses the same arguments.^0")
+ local retval = false
+ local Player = QBCore.Functions.GetPlayer(source)
+ if not Player then return cb(false) end
+ local isTable = type(items) == 'table'
+ local isArray = isTable and table.type(items) == 'array' or false
+ local totalItems = #items
+ local count = 0
+ local kvIndex = 2
+ if isTable and not isArray then
+ totalItems = 0
+ for _ in pairs(items) do totalItems += 1 end
+ kvIndex = 1
+ end
+ if isTable then
+ for k, v in pairs(items) do
+ local itemKV = {k, v}
+ local item = GetItemByName(source, itemKV[kvIndex])
+ if item and ((amount and item.amount >= amount) or (not amount and not isArray and item.amount >= v) or (not amount and isArray)) then
+ count += 1
+ end
+ end
+ if count == totalItems then
+ retval = true
+ end
+ else -- Single item as string
+ local item = GetItemByName(source, items)
+ if item and not amount or (item and amount and item.amount >= amount) then
+ retval = true
+ end
+ end
+ cb(retval)
+end)
+
+-- command
+
+QBCore.Commands.Add("resetinv", "Reset Inventory (Admin Only)", {{name="type", help="stash/trunk/glovebox"},{name="id/plate", help="ID of stash or license plate"}}, true, function(source, args)
+ local invType = args[1]:lower()
+ table.remove(args, 1)
+ local invId = table.concat(args, " ")
+ if invType and invId then
+ if invType == "trunk" then
+ if Trunks[invId] then
+ Trunks[invId].isOpen = false
+ end
+ elseif invType == "glovebox" then
+ if Gloveboxes[invId] then
+ Gloveboxes[invId].isOpen = false
+ end
+ elseif invType == "stash" then
+ if Stashes[invId] then
+ Stashes[invId].isOpen = false
+ end
+ else
+ TriggerClientEvent('QBCore:Notify', source, "Not a valid type..", "error")
+ end
+ else
+ TriggerClientEvent('QBCore:Notify', source, "Arguments not filled out correctly..", "error")
+ end
+end, "admin")
+
+QBCore.Commands.Add("rob", "Rob Player", {}, false, function(source, args)
+ TriggerClientEvent("police:client:RobPlayer", source)
+end)
+
+QBCore.Commands.Add("giveitem", "Give An Item (Admin Only)", {{name="id", help="Player ID"},{name="item", help="Name of the item (not a label)"}, {name="amount", help="Amount of items"}}, false, function(source, args)
+ local id = tonumber(args[1])
+ local Player = QBCore.Functions.GetPlayer(id)
+ local amount = tonumber(args[3]) or 1
+ local itemData = QBCore.Shared.Items[tostring(args[2]):lower()]
+ if Player then
+ if itemData then
+ -- check iteminfo
+ local info = {}
+ if itemData["name"] == "id_card" then
+ info.citizenid = Player.PlayerData.citizenid
+ info.firstname = Player.PlayerData.charinfo.firstname
+ info.lastname = Player.PlayerData.charinfo.lastname
+ info.birthdate = Player.PlayerData.charinfo.birthdate
+ info.gender = Player.PlayerData.charinfo.gender
+ info.nationality = Player.PlayerData.charinfo.nationality
+ elseif itemData["name"] == "driver_license" then
+ info.firstname = Player.PlayerData.charinfo.firstname
+ info.lastname = Player.PlayerData.charinfo.lastname
+ info.birthdate = Player.PlayerData.charinfo.birthdate
+ info.type = "Class C Driver License"
+ elseif itemData["type"] == "weapon" then
+ amount = 1
+ info.serie = tostring(QBCore.Shared.RandomInt(2) .. QBCore.Shared.RandomStr(3) .. QBCore.Shared.RandomInt(1) .. QBCore.Shared.RandomStr(2) .. QBCore.Shared.RandomInt(3) .. QBCore.Shared.RandomStr(4))
+ info.quality = 100
+ elseif itemData["name"] == "harness" then
+ info.uses = 20
+ elseif itemData["name"] == "markedbills" then
+ info.worth = math.random(5000, 10000)
+ elseif itemData["name"] == "labkey" then
+ info.lab = exports["qb-methlab"]:GenerateRandomLab()
+ elseif itemData["name"] == "printerdocument" then
+ info.url = "https://cdn.discordapp.com/attachments/870094209783308299/870104331142189126/Logo_-_Display_Picture_-_Stylized_-_Red.png"
+ elseif QBCore.Shared.Items[itemData["name"]]["decay"] and QBCore.Shared.Items[itemData["name"]]["decay"] > 0 then
+ info.quality = 100
+ end
+
+ if AddItem(id, itemData["name"], amount, false, info) then
+ QBCore.Functions.Notify(source, "You Have Given " ..GetPlayerName(id).." "..amount.." "..itemData["name"].. "", "success")
+ else
+ QBCore.Functions.Notify(source, "Can\'t give item!", "error")
+ end
+ else
+ QBCore.Functions.Notify(source, "Item Does Not Exist", "error")
+ end
+ else
+ QBCore.Functions.Notify(source, "Player Is Not Online", "error")
+ end
+end, "admin")
+
+QBCore.Commands.Add("randomitems", "Give Random Items (God Only)", {}, false, function(source, _)
+ local filteredItems = {}
+ for k, v in pairs(QBCore.Shared.Items) do
+ if QBCore.Shared.Items[k]["type"] ~= "weapon" then
+ filteredItems[#filteredItems+1] = v
+ end
+ end
+ for _ = 1, 10, 1 do
+ local randitem = filteredItems[math.random(1, #filteredItems)]
+ local amount = math.random(1, 10)
+ if randitem["unique"] then
+ amount = 1
+ end
+ if AddItem(source, randitem["name"], amount) then
+ TriggerClientEvent('inventory:client:ItemBox', source, QBCore.Shared.Items[randitem["name"]], 'add')
+ Wait(500)
+ end
+ end
+end, "god")
+
+QBCore.Commands.Add('clearinv', 'Clear Players Inventory (Admin Only)', { { name = 'id', help = 'Player ID' } }, false, function(source, args)
+ local playerId = args[1] ~= '' and tonumber(args[1]) or source
+ local Player = QBCore.Functions.GetPlayer(playerId)
+ if Player then
+ ClearInventory(playerId)
+ else
+ QBCore.Functions.Notify(source, "Player not online", 'error')
+ end
+end, 'admin')
+
+-- item
+
+-- QBCore.Functions.CreateUseableItem("snowball", function(source, item)
+-- local Player = QBCore.Functions.GetPlayer(source)
+-- local itemData = Player.Functions.GetItemBySlot(item.slot) -- --- DID THIS GET PUT ELSEWHERE?? IDK
+-- if Player.Functions.GetItemBySlot(item.slot) then
+-- TriggerClientEvent("inventory:client:UseSnowball", source, itemData.amount)
+-- end
+-- end)
+
+CreateUsableItem("driver_license", function(source, item)
+ local playerPed = GetPlayerPed(source)
+ local playerCoords = GetEntityCoords(playerPed)
+ local players = QBCore.Functions.GetPlayers()
+ for _, v in pairs(players) do
+ local targetPed = GetPlayerPed(v)
+ local dist = #(playerCoords - GetEntityCoords(targetPed))
+ if dist < 3.0 then
+ TriggerClientEvent('chat:addMessage', v, {
+ template = '
{0}:
First Name: {1} Last Name: {2} Birth Date: {3} Licenses: {4}
',
+ args = {
+ "Drivers License",
+ item.info.firstname,
+ item.info.lastname,
+ item.info.birthdate,
+ item.info.type
+ }
+ }
+ )
+ end
+ end
+end)
+
+CreateUsableItem("id_card", function(source, item)
+ local playerPed = GetPlayerPed(source)
+ local playerCoords = GetEntityCoords(playerPed)
+ local players = QBCore.Functions.GetPlayers()
+ for _, v in pairs(players) do
+ local targetPed = GetPlayerPed(v)
+ local dist = #(playerCoords - GetEntityCoords(targetPed))
+ if dist < 3.0 then
+ local gender = "Man"
+ if item.info.gender == 1 then
+ gender = "Woman"
+ end
+ TriggerClientEvent('chat:addMessage', v, {
+ template = '
{0}:
Civ ID: {1} First Name: {2} Last Name: {3} Birthdate: {4} Gender: {5} Nationality: {6}
',
+ args = {
+ "ID Card",
+ item.info.citizenid,
+ item.info.firstname,
+ item.info.lastname,
+ item.info.birthdate,
+ gender,
+ item.info.nationality
+ }
+ }
+ )
+ end
+ end
+end)
+
+
+CreateThread(function()
+ while true do
+ for k, v in pairs(Drops) do
+ if v and (v.createdTime + Config.CleanupDropTime < os.time()) and not Drops[k].isOpen then
+ Drops[k] = nil
+ TriggerClientEvent("inventory:client:RemoveDropItem", -1, k)
+ end
+ end
+ Wait(60 * 1000)
+ end
+end)
+
+-- Decay System
+
+local TimeAllowed = 60 * 60 * 24 * 1 -- Maths for 1 day dont touch its very important and could break everything
+function ConvertQuality(item)
+ local StartDate = item.created
+ local DecayRate = QBCore.Shared.Items[item.name:lower()]["decay"] ~= nil and QBCore.Shared.Items[item.name:lower()]["decay"] or 0.0
+ if DecayRate == nil then
+ DecayRate = 0
+ end
+ local TimeExtra = math.ceil((TimeAllowed * DecayRate))
+ local percentDone = 100 - math.ceil((((os.time() - StartDate) / TimeExtra) * 100))
+ if DecayRate == 0 then
+ percentDone = 100
+ end
+ if percentDone < 0 then
+ percentDone = 0
+ end
+ return percentDone
+end
+
+QBCore.Functions.CreateCallback('inventory:server:ConvertQuality', function(source, cb, inventory, other)
+ local src = source
+ local data = {}
+ local Player = QBCore.Functions.GetPlayer(src)
+ for _, item in pairs(inventory) do
+ if item.created then
+ if QBCore.Shared.Items[item.name:lower()]["decay"] ~= nil or QBCore.Shared.Items[item.name:lower()]["decay"] ~= 0 then
+ if item.info then
+ if type(item.info) == "string" then
+ item.info = {}
+ end
+ if item.info.quality == nil then
+ item.info.quality = 100
+ end
+ else
+ local info = {quality = 100}
+ item.info = info
+ end
+ local quality = ConvertQuality(item)
+ if item.info.quality then
+ if quality < item.info.quality then
+ item.info.quality = quality
+ end
+ else
+ item.info = {quality = quality}
+ end
+ else
+ if item.info then
+ item.info.quality = 100
+ else
+ local info = {quality = 100}
+ item.info = info
+ end
+ end
+ end
+ end
+ if other then
+ local inventoryType = QBCore.Shared.SplitStr(other.name, "-")[1]
+ local uniqueId = QBCore.Shared.SplitStr(other.name, "-")[2]
+ if inventoryType == "trunk" then
+ for _, item in pairs(other.inventory) do
+ if item.created then
+ if QBCore.Shared.Items[item.name:lower()]["decay"] ~= nil or QBCore.Shared.Items[item.name:lower()]["decay"] ~= 0 then
+ if item.info then
+ if item.info.quality == nil then
+ item.info.quality = 100
+ end
+ else
+ local info = {quality = 100}
+ item.info = info
+ end
+ local quality = ConvertQuality(item)
+ if item.info.quality then
+ if quality < item.info.quality then
+ item.info.quality = quality
+ end
+ else
+ item.info = {quality = quality}
+ end
+ else
+ if item.info then
+ item.info.quality = 100
+ else
+ local info = {quality = 100}
+ item.info = info
+ end
+ end
+ end
+ end
+ Trunks[uniqueId].items = other.inventory
+ TriggerClientEvent("inventory:client:UpdateOtherInventory", Player.PlayerData.source, other.inventory, false)
+ elseif inventoryType == "glovebox" then
+ for _, item in pairs(other.inventory) do
+ if item.created then
+ if QBCore.Shared.Items[item.name:lower()]["decay"] ~= nil or QBCore.Shared.Items[item.name:lower()]["decay"] ~= 0 then
+ if item.info then
+ if item.info.quality == nil then
+ item.info.quality = 100
+ end
+ else
+ local info = {quality = 100}
+ item.info = info
+ end
+ local quality = ConvertQuality(item)
+ if item.info.quality then
+ if quality < item.info.quality then
+ item.info.quality = quality
+ end
+ else
+ item.info = {quality = quality}
+ end
+ else
+ if item.info then
+ item.info.quality = 100
+ else
+ local info = {quality = 100}
+ item.info = info
+ end
+ end
+ end
+ end
+ Gloveboxes[uniqueId].items = other.inventory
+ TriggerClientEvent("inventory:client:UpdateOtherInventory", Player.PlayerData.source, other.inventory, false)
+ elseif inventoryType == "stash" then
+ for _, item in pairs(other.inventory) do
+ if item.created then
+ if QBCore.Shared.Items[item.name:lower()]["decay"] ~= nil or QBCore.Shared.Items[item.name:lower()]["decay"] ~= 0 then
+ if item.info then
+ if type(item.info) == "string" then
+ item.info = {}
+ end
+ if item.info.quality == nil then
+ item.info.quality = 100
+ end
+ else
+ local info = {quality = 100}
+ item.info = info
+ end
+ local quality = ConvertQuality(item)
+ if item.info.quality then
+ if quality < item.info.quality then
+ item.info.quality = quality
+ end
+ else
+ item.info = {quality = quality}
+ end
+ else
+ if item.info then
+ item.info.quality = 100
+ else
+ local info = {quality = 100}
+ item.info = info
+ end
+ end
+ end
+ end
+ Stashes[uniqueId].items = other.inventory
+ TriggerClientEvent("inventory:client:UpdateOtherInventory", Player.PlayerData.source, other.inventory, false)
+ end
+ end
+ Player.Functions.SetInventory(inventory)
+ TriggerClientEvent("inventory:client:UpdatePlayerInventory", Player.PlayerData.source, false)
+ data.inventory = inventory
+ data.other = other
+ cb(data)
+end)
+
+-- Warning Messages
+
+RegisterNetEvent('inventory:server:addTrunkItems', function()
+ print('inventory:server:addTrunkItems has been deprecated please use exports[\'qb-inventory\']:addTrunkItems(plate, items)')
+end)
+RegisterNetEvent('inventory:server:addGloveboxItems', function()
+ print('inventory:server:addGloveboxItems has been deprecated please use exports[\'qb-inventory\']:addGloveboxItems(plate, items)')
+end)