This commit is contained in:
Hawk 2024-12-29 21:07:50 +01:00
parent d41baff5d8
commit 79f67bb8c6
No known key found for this signature in database
GPG Key ID: 2890D5366F8BAC14
98 changed files with 9586 additions and 0 deletions

View File

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

View File

@ -0,0 +1,55 @@
# qb-camera
## Our links
- [Discord](https://discord.gg/APFHf9hhkG)
- [Tebex (Paid scripts)](https://qb-camera.tebex.io/)
## Setting up:
1. Clone the files and put it in your resources folder
2. Rename the script to qb-camera
3. Setup the webhook in server/main.lua
4. Use the camera item with the paper item in your inventory
## Items:
```lua
['polaroid_camera'] = {
['name'] = 'polaroid_camera',
['label'] = 'Polaroid camera',
['weight'] = 5000,
['type'] = 'item',
['image'] = 'polaroid.png',
['unique'] = true,
['useable'] = true,
['shouldClose'] = true,
['combinable'] = nil,
['description'] = 'Did we just go back in time?'
},
['polaroid'] = {
['name'] = 'polaroid',
['label'] = 'Polaroid image',
['weight'] = 10,
['type'] = 'item',
['image'] = 'photo.png',
['unique'] = true,
['useable'] = true,
['shouldClose'] = true,
['combinable'] = nil,
['description'] = 'Cool image bro'
},
['polaroid_paper'] = {
['name'] = 'polaroid_paper',
['label'] = 'Polaroid paper',
['weight'] = 10,
['type'] = 'item',
['image'] = 'photo.png',
['unique'] = false,
['useable'] = false,
['shouldClose'] = false,
['combinable'] = nil,
['description'] = 'Some paper'
}
```

View File

@ -0,0 +1,108 @@
local QBCore = exports['qb-core']:GetCoreObject()
local prop = nil
local cammode = 0
local function TextInput()
AddTextEntry("FMMC_KEY_TIP8", "Navn til billedet")
DisplayOnscreenKeyboard(1, "FMMC_KEY_TIP8", "", "", "", "", "", 100)
while UpdateOnscreenKeyboard() ~= 1 and UpdateOnscreenKeyboard() ~= 2 do
Citizen.Wait(0)
end
if UpdateOnscreenKeyboard() ~= 2 then
local result = GetOnscreenKeyboardResult()
return result
else
return nil
end
end
local function GetWebhook()
local promise = promise.new()
QBCore.Functions.TriggerCallback('qb-camera:server:webhook', function(webhook)
promise:resolve(webhook)
end)
return Citizen.Await(promise)
end
local function StartAnim()
local ped = PlayerPedId()
local animDict = "amb@world_human_paparazzi@male@base"
local animName = "base"
local animFlag = 49
RequestAnimDict(animDict)
while not HasAnimDictLoaded(animDict) do
Citizen.Wait(100)
end
TaskPlayAnim(ped, animDict, animName, 8.0, 8.0, -1, animFlag, 0, false, false, false)
end
local function AddProp()
local ped = PlayerPedId()
local propName = "prop_pap_camera_01"
local propFlag = 49
RequestModel(propName)
while not HasModelLoaded(propName) do
Citizen.Wait(100)
end
prop = CreateObject(GetHashKey(propName), 0, 0, 0, true, true, true)
AttachEntityToEntity(prop, ped, GetPedBoneIndex(ped, 28422), 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, true, true, false, true, 1, true)
end
local function StopAnim()
local ped = PlayerPedId()
ClearPedTasks(ped)
if prop ~= nil then
DeleteEntity(prop)
end
end
local function TakePicture()
local webhook = GetWebhook()
local title = TextInput()
if webhook == nil then
return
end
exports['screenshot-basic']:requestScreenshotUpload(webhook, 'files[]', function(data)
local image = json.decode(data)
local url = image.attachments[1].proxy_url
TriggerServerEvent("qb-camera:server:getimage", url, title)
end)
end
local function CameraLoop()
CreateThread(function()
AddProp()
StartAnim()
cammode = GetFollowPedCamViewMode()
while true do
DisablePlayerFiring(PlayerId(), true) -- Disable weapon firing
Wait(0)
SetFollowPedCamViewMode(4)
if IsControlJustPressed(0, 18) then
StopAnim()
Wait(1)
TakePicture()
Wait(1)
SetFollowPedCamViewMode(cammode)
return
end
end
end)
end
RegisterNetEvent("qb-camera:client:camera", CameraLoop)

View File

@ -0,0 +1,16 @@
local function ShowImage(url, name, date)
SendNUIMessage({
type = "image",
url = url,
name = name,
date = date
})
SetNuiFocus(true, true)
end
RegisterNuiCallback("hide", function(data, cb)
SetNuiFocus(false, false)
cb("ok")
end)
RegisterNetEvent("qb-camera:client:showImage", ShowImage)

View File

@ -0,0 +1,22 @@
fx_version 'cerulean'
games { 'gta5' }
version 'V1.0'
client_scripts {
'client/main.lua',
'client/camera.lua'
}
server_scripts {
'server/main.lua',
}
ui_page 'html/index.html'
files {
'html/*.html',
'html/*.css',
'html/*.js',
}

View File

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<title>qb-camera polaroid</title>
<link rel="stylesheet" href="style.css" />
</head>
<body id="body" style="display: none">
<div class="polaroid">
<img id="image" />
<h1 id="title"></h1>
<p id="date"></p>
</div>
<script src="script.js"></script>
</body>
</html>

View File

@ -0,0 +1,45 @@
const title = document.getElementById('title');
const datetext = document.getElementById('date');
const image = document.getElementById('image');
const callback = (route, data = {}) => {
fetch(`https://${GetParentResourceName()}/${route}`, {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(data)
});
}
const hide = () => {
document.getElementById('body').style.display = 'none';
callback('hide');
}
const show = () => {
document.getElementById('body').style.display = 'block';
}
const SetImage = ({url, name, date}) => {
title.innerHTML = name;
datetext.innerHTML = date;
image.src = url;
show();
}
window.addEventListener('message', (event) => {
const message = event.data;
switch (message.type) {
case 'image':
SetImage(message);
break;
}
});
window.onkeydown = (event) => {
if (event.key == 'Escape') {
hide();
}
}

View File

@ -0,0 +1,44 @@
@import url("https://fonts.googleapis.com/css2?family=Roboto: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");
@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");
.polaroid {
width: 400px;
background-color: white;
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.5);
position: absolute;
top: 50%;
left: 50%;
margin-right: -50%;
transform: translate(-50%, -50%);
padding: 20px;
border-radius: 2px;
text-align: center;
}
.polaroid > img {
width: 400px;
height: 400px;
object-fit: cover;
border-radius: 3px;
}
.polaroid > h1 {
font-family: "Poppins", "Roboto", sans-serif;
color: rgba(0, 0, 0, .9);
margin: 10px auto 5px auto;
font-size: 22px;
font-weight: 600;
/* overflow:hidden;
display:inline-block;
text-overflow: ellipsis;
white-space: nowrap; */
width: 400px;
}
.polaroid > p {
font-family: "Poppins", "Roboto", sans-serif;
color: rgba(0,0,0,.6);
margin: 0 auto;
padding: 0;
font-size: 14px;
}

View File

@ -0,0 +1,36 @@
local QBCore = exports['qb-core']:GetCoreObject()
local webhook = "https://discord.com/api/webhooks/1188478053144330270/pUdmQXX_GRyxUm6A7x2uGuK6COQzrgG06NwXdluYBxn9Vhmv0ohSNzHhIB96Ym8eLriJ"
RegisterNetEvent("qb-camera:server:getimage", function(url, name)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if not Player.Functions.RemoveItem("polaroid_paper", 1) then
TriggerClientEvent('QBCore:Notify', src, "Du har intet polaroid-papir", "error")
return
end
Player.Functions.AddItem("polaroid", 1, false, {url = url, name = name, date = os.date("%d-%m-%Y")})
TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["polaroid"], "add")
end)
QBCore.Functions.CreateCallback('qb-camera:server:webhook', function(source, cb, args)
cb(webhook)
end)
QBCore.Functions.CreateUseableItem('polaroid_camera', function(source, item)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if Player.Functions.GetItemByName(item.name) then
TriggerClientEvent("qb-camera:client:camera", src)
end
end)
QBCore.Functions.CreateUseableItem('polaroid', function(source, item)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if Player.Functions.GetItemByName(item.name) then
TriggerClientEvent("qb-camera:client:showImage", src, item.info.url, item.info.name, item.info.date)
end
end)

View File

@ -0,0 +1,32 @@
---
name: Bug report
about: Create a report to help us improve or fix something
title: "[BUG]"
labels: bug
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is. A stranger to qbcore should be able to read your bug report and understand how to reproduce it themselves and understand how the feature should work normally.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Use this item '....' (item's name from shared.lua if applicable)
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Questions (please complete the following information):**
- When you last updated: [e.g. last week]
- Are you using custom resource? which ones? [e.g. zdiscord, qb-target]
- Have you renamed `qb-` to something custom? [e.g. yes/no]
**Additional context**
Add any other context about the problem here.

View File

@ -0,0 +1,20 @@
---
name: Feature Request
about: Suggest an idea for QBCore
title: "[SUGGESTION]"
labels: enhancement
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is.
**Describe the feature you'd like**
A clear and concise description of what you want to happen. and with as much detail as possible how it would function in your opinion. Please try to keep it unique.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered for people to have in mind just in case the main idea isn't liked but a derivative is.
**Additional context**
Add any other context or screenshots about the feature request here.

View File

@ -0,0 +1,17 @@
# Set to true to add reviewers to pull requests
addReviewers: true
# Set to true to add assignees to pull requests
addAssignees: author
# A list of reviewers to be added to pull requests (GitHub user name)
reviewers:
- qbcore-framework/maintenance
# A list of keywords to be skipped the process that add reviewers if pull requests include it
skipKeywords:
- wip
# A number of reviewers added to the pull request
# Set 0 to add all the reviewers (default: 0)
numberOfReviewers: 0

View File

@ -0,0 +1,201 @@
# Contributing to QBCore
First of all, thank you for taking the time to contribute!
These guidelines will help you help us in the best way possible regardless of your skill level. We ask that you try to read everything related to the way you'd like to contribute and try and use your best judgement for anything not covered.
### Table of Contents
[Code of Conduct](#code-of-conduct)
[I don't want to read this whole thing, I just have a question!!!](#i-dont-want-to-read-this-whole-thing-i-just-have-a-question)
[How Can I Contribute?](#how-can-i-contribute)
* [Reporting Bugs](#reporting-bugs)
* [Suggesting Features / Enhancements](#suggesting-features--enhancements)
* [Your First Code Contribution](#your-first-code-contribution)
* [Pull Requests](#pull-requests)
[Styleguides](#styleguides)
* [Git Commit Messages](#git-commit-messages)
* [Lua Styleguide](#lua-styleguide)
* [JavaScript Styleguide](#javascript-styleguide)
## Code of Conduct
- Refrain from using languages other than English.
- Refrain from discussing any politically charged or inflammatory topics.
- Uphold mature conversations and respect each other; excessive profanity, hate speech or any kind of harassment will not be tolerated.
- No advertising of any kind.
- Follow these guidelines.
- Do not mention members of github unless a question is directed at them and can't be answered by anyone else.
- Do not mention any of the development team for any reason. We will read things as we get to them.
## I don't want to read this whole thing I just have a question!!!
> **Note:** Please don't file an issue to ask a question. You'll get faster results by using the resources below.
* [QBCore Website](https://qbcore.org)
* [QBCore Discord](https://discord.gg/qbcore)
* [FiveM Discord - #qbcore channel](https://discord.gg/fivem)
## How Can I Contribute?
### Reporting Bugs
The easiest way to contribute for most people is just to report bugs you find cause if nobody reports it there's a chance we'll never know it exists and then we'll never fix it.
Before creating bug reports, please check [this list](#before-submitting-a-bug-report) as you might find out that you don't need to create one. When you are creating a bug report, please [include as many details as possible](#how-do-i-submit-a-good-bug-report). Fill out the bug-report template with the information it asks for helps us resolve issues faster.
> **Note:** If you find a **Closed** issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one.
#### Before Submitting A Bug Report
* **Check the docs** There's a chance what you see as a bug might just work differently than you expect and if you think it could work better consider a feature enhancement report instead.
* **Search the [discord](https://discord.gg/qbcore)** to see if anyone else has run into the issue and see if it was solved through user error or code changes. (if the code change isn't pending a PR and you know what you're doing consider submitting one following [Pull Requests](#pull-requests) )
* **Determine which resource the problem should be reported in**. If the bug is related to the inventory for example report this bug under qb-inventory rather than under qb-core or some other resource.
* **Perform a [cursory search](https://github.com/search?q=+is%3Aissue+user%3Aqbcore-framework)** to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to the existing issue instead of opening a new one.
#### How Do I Submit A (Good) Bug Report?
Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/). After you've determined which resource your bug is related to, create an issue on that repository and provide the following information by filling in bug-report template.
Explain the problem and include additional details to help maintainers reproduce the problem:
* **Use a clear and descriptive title** for the issue to identify the problem.
* **Describe the exact steps which reproduce the problem** in as many details as possible.
* **Provide specific examples to demonstrate the steps**. If something happened with only a specific group or single item but not others, specify that.
* **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior.
* **Explain which behavior you expected to see instead and why.**
* **Include screenshots** which show the specific bug in action or before and after.
* **If the problem wasn't triggered by a specific action**, describe what you were doing before the problem happened and share more information using the guidelines below.
Provide more context by answering these questions if possible:
* **Did the problem start happening recently** (e.g. after updating to a new version of QBCore?) or was this always a problem?
* If the problem started happening recently, **can you reproduce the problem in an older version of QBCore?** What's the most recent commit in which the problem doesn't happen?
* **Can you reliably reproduce the issue?** If not, provide details about how often the problem happens and under which conditions it normally happens.
Include details about your setup:
* **When was your QBCore last updated?**
* **What OS is the server running on**?
* **Which *extra* resources do you have installed?**
---
### Suggesting Features / Enhancements
This section guides you through submitting an enhancement suggestion for QBCore, including completely new features and minor improvements to existing functionality. Following these guidelines helps maintainers and the community understand your suggestion.
Before creating enhancement suggestions, please check [this list](#before-submitting-an-enhancement-suggestion) as you might find out that you don't need to create one. When you are creating an enhancement suggestion, please [include as many details as possible](#how-do-i-submit-a-good-enhancement-suggestion). Fill in feature request template, including the steps that you imagine you would take if the feature you're requesting existed.
#### Before Submitting An Enhancement Suggestion
* **Make sure it doesn't already exist.** Sounds silly, but there's a lot of features built in to qbcore that people don't realize so take a look through the docs and stuff to make sure it's not already there.
* **Check if there's already PR which provides that enhancement.**
* **Determine which resource the enhancement should be suggested in.** if it fits with another resource suggest it in that resource. if it would be it's own resource suggest it in the main qb-core repository.
* **Perform a [cursory search](https://github.com/search?q=+is%3Aissue+user%3Aqbcore-framework)** to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
#### How Do I Submit A (Good) Enhancement Suggestion?
Enhancement suggestions are tracked as [GitHub issues](https://guides.github.com/features/issues/). After you've determined which resource your enhancement suggestion is related to, create an issue on that repository and provide the following information:
* **Use a clear and descriptive title** for the issue to identify the suggestion.
* **Provide a step-by-step description of the suggested enhancement** in as many details as possible.
* **Provide specific examples to demonstrate the steps**. Include copy/pasteable snippets which you use in those examples, as [Markdown code blocks](https://help.github.com/articles/markdown-basics/#multiple-lines).
* **Describe the current behavior** and **explain which behavior you expected to see instead** and why.
* **Include screenshots and animated GIFs** which help you demonstrate the steps or point out the part of QBCore which the suggestion is related to.
* **Explain why this enhancement would be useful.**
* **Be creative and unique.** Stealing ideas from popular servers 1:1 detail isn't going to get accepted.
---
### Your First Code Contribution
Unsure where to begin contributing to QBCore? You can start by looking through these `beginner` and `help-wanted` issues.
---
### Pull Requests
The process described here has several goals:
- Maintain QBCore's quality.
- Fix problems that are important to users.
- Engage the community in working toward the best possible QBCore.
- Enable a sustainable system for QBCore's maintainers to review contributions.
Please follow these steps to have your contribution considered by the maintainers:
1. Follow all instructions in The Pull Request template.
2. Follow the [styleguides](#styleguides).
3. Await review by the reviewer(s).
While the prerequisites above must be satisfied prior to having your pull request reviewed, the reviewer(s) may ask you to complete additional design work, tests, or other changes before your pull request can be ultimately accepted.
---
## Styleguides
### Git Commit Messages
* Limit the first line to 72 characters or less.
* Reference issues and pull requests liberally after the first line.
* Consider starting the commit message with an applicable emoji:
* :art: `:art:` when improving the format/structure of the code
* :racehorse: `:racehorse:` when improving performance
* :memo: `:memo:` when writing docs
* :bug: `:bug:` when fixing a bug
* :fire: `:fire:` when removing code or files
* :white_check_mark: `:white_check_mark:` when adding tests
* :lock: `:lock:` when dealing with security
* :arrow_up: `:arrow_up:` when upgrading dependencies
* :arrow_down: `:arrow_down:` when downgrading dependencies
* :shirt: `:shirt:` when removing linter warnings
### Lua Styleguide
All lua code should be done using all the best practices of proper lua using the easiest to read yet fastest/most optimized methods of execution.
- Use 4 Space indentation
- Aim for lua 5.4 (include `lua54 'yes'` in the fxmanifest.lua)
- Use `PlayerPedId()` instead of `GetPlayerPed(-1)`
- Use `#(vector3 - vector3)` instead of `GetDistanceBetweenCoords()`
- Don't create unnecessary threads. always try to find a better method of triggering events
- Don't repeat yourself.. if you're using the same operations in many different places convert them into a function with flexible variables
- For distance checking loops set longer waits if you're outside of a range
- Job specific loops should only run for players with that job, don't waste cycles
- When possible don't trust the client, esspecially with transactions
- Balance security and optimizations
- [Consider this Lua Performance guide](https://springrts.com/wiki/Lua_Performance)
- Use local varriables everywhere possible
- Make use of config options where it makes sense making features optional or customizable
- Instead of `table.insert(myTable, "Value")` use `myTable[#myTable + 1] = "Value"`
- Instead of `table.insert(ages, "bob", 30)` use `ages["bob"] = 30`
### JavaScript Styleguide
- Use 4 Space indentation
- Don't repeat yourself.. if you're using the same operations in many different places convert them into a function with flexible variables.

View File

@ -0,0 +1,11 @@
## Description
<!-- What does your pull request change? Why should it be merged? Does it fix an issue? -->
## Checklist
<!-- Put an x inside the [ ] to check an item, like so: [x] -->
- [ ] I have personally loaded this code into an updated qbcore project and checked all of its functionality.
- [ ] My code fits the style guidelines.
- [ ] My PR fits the contribution guidelines.

View File

@ -0,0 +1,23 @@
name: Lint
on: [push, pull_request_target]
jobs:
lint:
name: Lint Resource
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Lint
uses: iLLeniumStudios/fivem-lua-lint-action@v2
with:
capture: "junit.xml"
args: "-t --formatter JUnit"
extra_libs: polyzone+qblocales
- name: Generate Lint Report
if: always()
uses: mikepenz/action-junit-report@v3
with:
report_paths: "**/junit.xml"
check_name: Linting Report
fail_on_failure: false

View File

@ -0,0 +1,29 @@
# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
#
# You can adjust the behavior by modifying this file.
# For more information, see:
# https://github.com/actions/stale
name: Mark stale issues and pull requests
on:
schedule:
- cron: '41 15 * * *'
jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue has had 60 days of inactivity & will close within 7 days'
stale-pr-message: 'This PR has had 60 days of inactivity & will close within 7 days'
close-issue-label: 'Stale Closed'
close-pr-label: 'Stale Closed'
exempt-issue-labels: 'Suggestion'
exempt-pr-labels: 'Suggestion'

View File

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

View File

@ -0,0 +1,60 @@
# qb-cityhall
City Services for QB-Core Framework
## Dependencies
- [qb-core](https://github.com/qbcore-framework/qb-core)
- [PolyZone](https://github.com/mkafrin/PolyZone) - For Interaction (DrawText and qb-target both require this)
- [qb-target](https://github.com/BerkieBb/qb-target) - For Interaction (Optional)
- [qb-phone](https://github.com/qbcore-framework/qb-phone) - For E-Mail
## Features
- Ability to request birth certificate when lost
- Ability to request driver license when granted by a driving instructor
- Ability to request weapon license when granted it by the police
- Ability to apply to government jobs
- Ability to add multiple cityhall locations
- Ability to add nultiple driving school locations
- Ability to take driving lessons
- qb-target integration, this is optional
- PolyZone and qb-core DrawText integration, this is optional
## Installation
### Manual
- Download the script and put it in the `[qb]` directory.
- Add the following code to your server.cfg/resources.cfg
```
ensure qb-core
ensure qb-target # Optional
ensure qb-phone
ensure qb-cityhall
```
## Screenshots
![City Services](https://i.imgur.com/l6ZRlXP.png)
![Request Birth Certificate](https://i.imgur.com/zJRiuDI.png)
![Request Driver License](https://i.imgur.com/2scxBew.png)
![Request Weapon License](https://i.imgur.com/pSudfVl.png)
![Apply For a Job](https://i.imgur.com/26Kd0FU.png)
![Cityhall DrawText Interaction](https://i.imgur.com/Uxh2GZC.png)
![Cityhall QB-Target Interaction](https://i.imgur.com/K54cMLt.png)
![Driving School Sending And Receiving Mail](https://i.imgur.com/iJof4jI.png)
![Driving School DrawText Interaction](https://i.imgur.com/32BPp8f.png)
![Driving School QB-Target Interaction](https://i.imgur.com/P7jWBsV.png)
# License
QBCore Framework
Copyright (C) 2021 Joshua Eger
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 <https://www.gnu.org/licenses/>

View File

@ -0,0 +1,343 @@
local QBCore = exports['qb-core']:GetCoreObject()
local PlayerData = QBCore.Functions.GetPlayerData()
local isLoggedIn = LocalPlayer.state.isLoggedIn
local playerPed = PlayerPedId()
local playerCoords = GetEntityCoords(playerPed)
local closestCityhall = nil
local closestDrivingSchool = nil
local inCityhallPage = false
local inRangeCityhall = false
local inRangeDrivingSchool = false
local pedsSpawned = false
local blips = {}
-- Functions
local function getClosestHall()
local distance = #(playerCoords - Config.Cityhalls[1].coords)
local closest = 1
for i = 1, #Config.Cityhalls do
local hall = Config.Cityhalls[i]
local dist = #(playerCoords - hall.coords)
if dist < distance then
distance = dist
closest = i
end
end
return closest
end
local function getClosestSchool()
local distance = #(playerCoords - Config.DrivingSchools[1].coords)
local closest = 1
for i = 1, #Config.DrivingSchools do
local school = Config.DrivingSchools[i]
local dist = #(playerCoords - school.coords)
if dist < distance then
distance = dist
closest = i
end
end
return closest
end
local function getJobs()
QBCore.Functions.TriggerCallback('qb-cityhall:server:receiveJobs', function(result)
SendNUIMessage({
action = 'setJobs',
jobs = result
})
end)
end
local function setCityhallPageState(bool, message)
getJobs()
if message then
local action = bool and "open" or "close"
SendNUIMessage({
action = action
})
end
SetNuiFocus(bool, bool)
inCityhallPage = bool
if not Config.UseTarget or bool then return end
inRangeCityhall = false
end
local function createBlip(options)
if not options.coords or type(options.coords) ~= 'table' and type(options.coords) ~= 'vector3' then return error(('createBlip() expected coords in a vector3 or table but received %s'):format(options.coords)) end
local blip = AddBlipForCoord(options.coords.x, options.coords.y, options.coords.z)
SetBlipSprite(blip, options.sprite or 1)
SetBlipDisplay(blip, options.display or 4)
SetBlipScale(blip, options.scale or 1.0)
SetBlipColour(blip, options.colour or 1)
SetBlipAsShortRange(blip, options.shortRange or false)
BeginTextCommandSetBlipName("STRING")
AddTextComponentSubstringPlayerName(options.title or 'No Title Given')
EndTextCommandSetBlipName(blip)
return blip
end
local function deleteBlips()
if not next(blips) then return end
for i = 1, #blips do
local blip = blips[i]
if DoesBlipExist(blip) then
RemoveBlip(blip)
end
end
blips = {}
end
local function initBlips()
for i = 1, #Config.Cityhalls do
local hall = Config.Cityhalls[i]
if hall.showBlip then
blips[#blips + 1] = createBlip({
coords = hall.coords,
sprite = hall.blipData.sprite,
display = hall.blipData.display,
scale = hall.blipData.scale,
colour = hall.blipData.colour,
shortRange = true,
title = hall.blipData.title
})
end
end
for i = 1, #Config.DrivingSchools do
local school = Config.DrivingSchools[i]
if school.showBlip then
blips[#blips + 1] = createBlip({
coords = school.coords,
sprite = school.blipData.sprite,
display = school.blipData.display,
scale = school.blipData.scale,
colour = school.blipData.colour,
shortRange = true,
title = school.blipData.title
})
end
end
end
local function spawnPeds()
if not Config.Peds or not next(Config.Peds) or pedsSpawned then return end
for i = 1, #Config.Peds do
local current = Config.Peds[i]
current.model = type(current.model) == 'string' and joaat(current.model) or current.model
RequestModel(current.model)
while not HasModelLoaded(current.model) do
Wait(0)
end
local ped = CreatePed(0, current.model, current.coords.x, current.coords.y, current.coords.z, current.coords.w, false, false)
FreezeEntityPosition(ped, true)
SetEntityInvincible(ped, true)
SetBlockingOfNonTemporaryEvents(ped, true)
TaskStartScenarioInPlace(ped, current.scenario, true, true)
current.pedHandle = ped
if Config.UseTarget then
local opts = nil
if current.drivingschool then
opts = {
label = 'Tag køretimer',
icon = 'fa-solid fa-car-side',
action = function()
TriggerServerEvent('qb-cityhall:server:sendDriverTest', Config.DrivingSchools[closestDrivingSchool].instructors)
end
}
elseif current.cityhall then
opts = {
label = 'Åben borgerservice',
icon = 'fa-solid fa-city',
action = function()
inRangeCityhall = true
setCityhallPageState(true, true)
end
}
end
if opts then
exports['qb-target']:AddTargetEntity(ped, {
options = { opts },
distance = 2.0
})
end
else
local options = current.zoneOptions
if options then
local zone = BoxZone:Create(current.coords.xyz, options.length, options.width, {
name = "zone_cityhall_" .. ped,
heading = current.coords.w,
debugPoly = false,
minZ = current.coords.z - 3.0,
maxZ = current.coords.z + 2.0
})
zone:onPlayerInOut(function(inside)
if isLoggedIn and closestCityhall and closestDrivingSchool then
if inside then
if current.drivingschool then
inRangeDrivingSchool = true
exports['qb-core']:DrawText('[E] Tag køretimer', 'top')
elseif current.cityhall then
inRangeCityhall = true
exports['qb-core']:DrawText('[E] Åben borgerservice', 'top')
end
else
exports['qb-core']:HideText()
if current.drivingschool then
inRangeDrivingSchool = false
elseif current.cityhall then
inRangeCityhall = false
end
end
end
end)
end
end
end
pedsSpawned = true
end
local function deletePeds()
if not Config.Peds or not next(Config.Peds) or not pedsSpawned then return end
for i = 1, #Config.Peds do
local current = Config.Peds[i]
if current.pedHandle then
DeletePed(current.pedHandle)
end
end
pedsSpawned = false
end
-- Events
RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function()
PlayerData = QBCore.Functions.GetPlayerData()
isLoggedIn = true
spawnPeds()
end)
RegisterNetEvent('QBCore:Client:OnPlayerUnload', function()
PlayerData = {}
isLoggedIn = false
deletePeds()
end)
RegisterNetEvent('QBCore:Player:SetPlayerData', function(val)
PlayerData = val
end)
RegisterNetEvent('qb-cityhall:Client:AddCityJob', function()
getJobs()
end)
RegisterNetEvent('qb-cityhall:client:getIds', function()
TriggerServerEvent('qb-cityhall:server:getIDs')
end)
RegisterNetEvent('qb-cityhall:client:sendDriverEmail', function(charinfo)
SetTimeout(math.random(2500, 4000), function()
local gender = Lang:t('email.mr')
if PlayerData.charinfo.gender == 1 then
gender = Lang:t('email.mrs')
end
TriggerServerEvent('qb-phone:server:sendNewMail', {
sender = Lang:t('email.sender'),
subject = Lang:t('email.subject'),
message = Lang:t('email.message', { gender = gender, lastname = charinfo.lastname, firstname = charinfo.firstname, phone = charinfo.phone }),
button = {}
})
end)
end)
AddEventHandler('onResourceStop', function(resource)
if resource ~= GetCurrentResourceName() then return end
deleteBlips()
deletePeds()
end)
-- NUI Callbacks
RegisterNUICallback('close', function(_, cb)
setCityhallPageState(false, false)
if not Config.UseTarget and inRangeCityhall then exports['qb-core']:DrawText('[E] Åben borgerservice', 'top') end
cb('ok')
end)
RegisterNUICallback('requestId', function(id, cb)
local license = Config.Cityhalls[closestCityhall].licenses[id.type]
if inRangeCityhall and license and id.cost == license.cost then
TriggerServerEvent('qb-cityhall:server:requestId', id.type, closestCityhall)
QBCore.Functions.Notify(('Du har modtaget %s for $%s'):format(license.label, id.cost), 'success', 3500)
else
QBCore.Functions.Notify(Lang:t('error.not_in_range'), 'error')
end
cb('ok')
end)
RegisterNUICallback('requestLicenses', function(_, cb)
local licensesMeta = PlayerData.metadata["licences"]
local availableLicenses = Config.Cityhalls[closestCityhall].licenses
for license, data in pairs(availableLicenses) do
if data.metadata and not licensesMeta[data.metadata] then
availableLicenses[license] = nil
end
end
cb(availableLicenses)
end)
RegisterNUICallback('applyJob', function(job, cb)
if inRangeCityhall then
TriggerServerEvent('qb-cityhall:server:ApplyJob', job, Config.Cityhalls[closestCityhall].coords)
else
QBCore.Functions.Notify(Lang:t('error.not_in_range'), 'error')
end
cb('ok')
end)
-- Threads
CreateThread(function()
while true do
if isLoggedIn then
playerPed = PlayerPedId()
playerCoords = GetEntityCoords(playerPed)
closestCityhall = getClosestHall()
closestDrivingSchool = getClosestSchool()
end
Wait(1000)
end
end)
CreateThread(function()
initBlips()
spawnPeds()
if not Config.UseTarget then
while true do
local sleep = 1000
if isLoggedIn and closestCityhall and closestDrivingSchool then
if inRangeCityhall then
if not inCityhallPage then
sleep = 0
if IsControlJustPressed(0, 38) then
setCityhallPageState(true, true)
exports['qb-core']:KeyPressed()
Wait(500)
exports['qb-core']:HideText()
sleep = 1000
end
end
elseif inRangeDrivingSchool then
sleep = 0
if IsControlJustPressed(0, 38) then
TriggerServerEvent('qb-cityhall:server:sendDriverTest', Config.DrivingSchools[closestDrivingSchool].instructors)
sleep = 5000
exports['qb-core']:KeyPressed()
Wait(500)
exports['qb-core']:HideText()
end
end
end
Wait(sleep)
end
end
end)

View File

@ -0,0 +1,88 @@
Config = Config or {}
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.AvailableJobs = { -- Only used when not using qb-jobs.
-- ['trucker'] = { ['label'] = 'Trucker', ['isManaged'] = false },
-- ['taxi'] = { ['label'] = 'Taxi', ['isManaged'] = false },
-- ['tow'] = { ['label'] = 'Tow Truck', ['isManaged'] = false },
-- ['reporter'] = { ['label'] = 'News Reporter', ['isManaged'] = false },
-- ['garbage'] = { ['label'] = 'Garbage Collector', ['isManaged'] = false },
-- ['bus'] = { ['label'] = 'Bus Driver', ['isManaged'] = false },
-- ['hotdog'] = { ['label'] = 'Hot Dog Stand', ['isManaged'] = false }
}
Config.Cityhalls = {
{ -- Cityhall 1
coords = vec3(-265.0, -963.6, 31.2),
showBlip = true,
blipData = {
sprite = 487,
display = 4,
scale = 0.65,
colour = 0,
title = 'Borgerservice'
},
licenses = {
['id_card'] = {
label = 'ID Kort',
cost = 50,
},
['driver_license'] = {
label = 'Kørekort',
cost = 50,
metadata = 'driver'
},
['weaponlicense'] = {
label = 'Våben tilladelse',
cost = 50,
metadata = 'weapon'
},
}
},
}
Config.DrivingSchools = {
{ -- Driving School 1
coords = vec3(240.3, -1379.89, 33.74),
showBlip = true,
blipData = {
sprite = 225,
display = 4,
scale = 0.65,
colour = 3,
title = 'Køreskole'
},
instructors = {
'DJD56142',
'DXT09752',
'SRI85140',
}
},
}
Config.Peds = {
-- Cityhall Ped
{
model = 'a_m_m_hasjew_01',
coords = vec4(-262.79, -964.18, 30.22, 181.71),
scenario = 'WORLD_HUMAN_STAND_MOBILE',
cityhall = true,
zoneOptions = { -- Used for when UseTarget is false
length = 3.0,
width = 3.0,
debugPoly = false
}
},
-- Driving School Ped
{
model = 'a_m_m_eastsa_02',
coords = vec4(240.91, -1379.2, 32.74, 138.96),
scenario = 'WORLD_HUMAN_STAND_MOBILE',
drivingschool = true,
zoneOptions = { -- Used for when UseTarget is false
length = 3.0,
width = 3.0
}
}
}

View File

@ -0,0 +1,31 @@
fx_version 'cerulean'
game 'gta5'
description 'QB-CityHall'
version '2.1.3'
ui_page 'html/index.html'
shared_scripts {
'@qb-core/shared/locale.lua',
'locales/en.lua',
'locales/*.lua',
'config.lua'
}
server_script 'server/main.lua'
client_scripts {
'@PolyZone/client.lua',
'@PolyZone/BoxZone.lua',
'client/main.lua'
}
files {
'html/*.js',
'html/*.html',
'html/*.css'
}
lua54 'yes'
use_fxv2_oal 'yes'

View File

@ -0,0 +1,141 @@
let mouseOver = false;
let selectedIdentity = null;
let selectedIdentityType = null;
let selectedIdentityCost = null;
let selectedJob = null;
let selectedJobId = null;
Open = function (jobs) {
SetJobs(jobs);
$(".container").fadeIn(150);
};
Close = function () {
$(".container").fadeOut(150, function () {
ResetPages();
});
$.post("https://qb-cityhall/close");
$(selectedJob).removeClass("job-selected");
$(selectedIdentity).removeClass("job-selected");
};
SetJobs = function (jobs) {
$(".job-page-blocks").empty();
$.each(jobs, (job, name) => {
let html = `<div class="job-page-block" data-job="${job}"><p>${name.label}</p></div>`;
$(".job-page-blocks").append(html);
});
};
ResetPages = function () {
$(".cityhall-option-blocks").show();
$(".cityhall-identity-page").hide();
$(".cityhall-job-page").hide();
};
$(document).ready(function () {
window.addEventListener("message", function (event) {
switch (event.data.action) {
case "open":
Open(event.data.jobs);
break;
case "close":
Close();
break;
case "setJobs":
SetJobs(event.data.jobs);
break;
}
});
});
$(document).on("keydown", function () {
switch (event.keyCode) {
case 27: // ESC
Close();
break;
}
});
$(".cityhall-option-block").click(function (e) {
e.preventDefault();
let blockPage = $(this).data("page");
$(".cityhall-option-blocks").fadeOut(100, () => {
$(`.cityhall-${blockPage}-page`).fadeIn(100);
});
if (blockPage == "identity") {
$(".identity-page-blocks").html("");
$.post("https://qb-cityhall/requestLicenses", JSON.stringify({}), function (licenses) {
$.each(licenses, (i, license) => {
let elem = `<div class="identity-page-block" data-type="${i}" data-cost="${license.cost}"><p>${license.label}</p></div>`;
$(".identity-page-blocks").append(elem);
});
});
}
});
$(document).on("click", ".identity-page-block", function (e) {
e.preventDefault();
selectedIdentityType = $(this).data("type");
selectedIdentityCost = $(this).data("cost");
if (selectedIdentity == null) {
$(this).addClass("identity-selected");
$(".hover-description").fadeIn(10);
selectedIdentity = this;
$(".request-identity-button").fadeIn(100);
$(".request-identity-button").html(`<p>Buy $${selectedIdentityCost}</p>`);
} else if (selectedIdentity == this) {
$(this).removeClass("identity-selected");
selectedIdentity = null;
$(".request-identity-button").fadeOut(100);
} else {
$(selectedIdentity).removeClass("identity-selected");
$(this).addClass("identity-selected");
selectedIdentity = this;
$(".request-identity-button").html("<p>Buy</p>");
}
});
$(".request-identity-button").click(function (e) {
e.preventDefault();
$.post(
"https://qb-cityhall/requestId",
JSON.stringify({
type: selectedIdentityType,
cost: selectedIdentityCost,
})
);
ResetPages();
});
$(document).on("click", ".job-page-block", function (e) {
e.preventDefault();
selectedJobId = $(this).data("job");
// selectedJobId["application"] = $(this).data('application')
if (selectedJob == null) {
$(this).addClass("job-selected");
selectedJob = this;
$(".apply-job-button").fadeIn(100);
} else if (selectedJob == this) {
$(this).removeClass("job-selected");
selectedJob = null;
$(".apply-job-button").fadeOut(100);
} else {
$(selectedJob).removeClass("job-selected");
$(this).addClass("job-selected");
selectedJob = this;
}
});
$(document).on("click", ".apply-job-button", function (e) {
e.preventDefault();
$.post("https://qb-cityhall/applyJob", JSON.stringify(selectedJobId));
ResetPages();
});
$(document).on("click", ".back-to-main", function (e) {
e.preventDefault();
$(selectedJob).removeClass("job-selected");
$(selectedIdentity).removeClass("job-selected");
ResetPages();
});

View File

@ -0,0 +1,44 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.css" />
<link rel="stylesheet" href="./style.css" />
<title>QB Cityhall</title>
</head>
<body>
<div class="container">
<div class="cityhall-main-container">
<div class="cityhall-header">BORGERSERVICE</div>
<div class="cityhall-option-blocks" style="text-align: center">
<div class="cityhall-option-block" style="background-color: #ededed" data-page="identity">
<i class="far fa-id-card"></i>
<p>Identitet</p>
</div>
<!-- <div class="cityhall-option-block" style="background-color: #ededed" data-page="job">
<i class="fas fa-briefcase"></i>
<p>Employment</p>
</div> -->
</div>
<div class="cityhall-identity-page">
<div class="identity-page-blocks"></div>
<div class="hover-description"></div>
<div class="request-identity-button"></div>
<div class="back-to-main"><p>Tilbage</p></div>
</div>
<div class="cityhall-job-page">
<div class="job-page-blocks"></div>
<div class="apply-job-button"><p>Apply</p></div>
<div class="back-to-main"><p>Tilbage</p></div>
</div>
</div>
</div>
</body>
<script src="./app.js"></script>
</html>

View File

@ -0,0 +1,301 @@
@import url("https://fonts.googleapis.com/css?family=Montserrat&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@200&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Poppins&display=swap");
body {
overflow: hidden;
}
.container {
display: none;
height: 100vh;
}
.cityhall-main-container {
position: relative;
background-position: center center;
backface-visibility: hidden;
width: 100vh;
height: 70vh;
margin: 0 auto;
top: 15vh;
background-size: cover;
background-color: rgba(23, 23, 23, 80%);
border-radius: 4vh;
box-shadow: 0px 0px 2px 2px rgba(0, 0, 0, 0.226);
}
.cityhall-header {
position: relative;
text-align: center;
font-family: "Poppins", sans-serif;
font-weight: 400;
font-size: 6vh;
color: #ededed;
line-height: 10vh;
width: 97vh;
top: 2vh;
left: 1.5vh;
border-radius: 2vh;
height: 10vh;
background: #dc143c;
}
.cityhall-option-blocks {
position: relative;
height: 33vh;
width: 65vh;
margin: 0 auto;
top: 13vh;
border-radius: 1vh;
/*background: rgba(37, 37, 37, 0.418)*/
}
.cityhall-identity-page {
display: none;
position: relative;
height: 40vh;
width: 80vh;
margin: 0 auto;
top: 10vh;
border-radius: 1vh;
background: rgba(37, 37, 37, 0.418);
}
.cityhall-job-page {
display: none;
position: relative;
height: 40vh;
width: 80vh;
margin: 0 auto;
top: 10vh;
border-radius: 1vh;
overflow-y: auto;
background: rgba(37, 37, 37, 0.418);
}
.cityhall-job-page::-webkit-scrollbar-track {
background: #171717; /* color of the tracking area */
}
.cityhall-job-page::-webkit-scrollbar-thumb {
background-color: #dc143c; /* color of the scroll thumb */
}
.cityhall-job-page::-webkit-scrollbar {
width: 2vh;
}
.cityhall-job-page::-webkit-scrollbar-track {
border-radius: 20px;
border: 3px solid #171717;
}
.cityhall-job-page::-webkit-scrollbar-thumb {
border-radius: 20px;
border: 3px solid #171717;
}
.cityhall-option-block {
position: relative;
width: 30vh;
height: 30vh;
display: inline-block;
margin-right: 2vh;
margin-bottom: 2vh;
left: 1vh;
top: 1vh;
text-align: center;
border-bottom: 6px solid rgba(255, 255, 255, 0);
transition: all 0.2s linear;
border-radius: 1vh;
}
.cityhall-option-block:hover {
border-bottom: 9px solid #dc143c;
opacity: 0.9;
}
.cityhall-option-block > i {
font-size: 16vh;
line-height: 21vh;
color: #dc143c;
}
.cityhall-option-block > p {
color: #171717;
font-weight: 500;
text-transform: uppercase;
font-family: "Poppins", sans-serif;
letter-spacing: 0.1vh;
font-size: 2.6vh;
}
.identity-page-blocks {
position: relative;
height: 100%;
width: 25%;
padding: 1vh;
}
.identity-page-block {
width: 100%;
height: 15%;
background: #2873a7;
transition: all 0.1s ease-in-out;
border-radius: 0.5vh;
/* border-bottom: 2px solid rgba(255, 255, 255, 0); */
}
.identity-page-block:hover {
background: #ededed;
transition: ease-in 0.3s;
}
.identity-page-block > p:hover {
color: #2873a7;
transition: ease-in 0.3s;
}
.identity-page-block > p {
position: relative;
text-align: center;
line-height: 6vh;
font-family: "Poppins", sans-serif;
text-transform: uppercase;
font-weight: 400;
letter-spacing: 0.1vh;
color: #ededed;
font-size: 1.6vh;
}
.hover-description {
position: absolute;
top: 0;
right: 0;
padding: 1vh;
margin: 4vh;
background: rgba(34, 34, 34, 0.75);
border-radius: 1vh;
}
.hover-description > p {
color: white;
font-family: "Poppins", sans-serif;
font-size: 1.3vh;
}
.identity-selected {
border-bottom: 0px solid #fff;
border-left: 0.5vh solid #ededed;
}
.request-identity-button {
display: none;
position: absolute;
top: 6vh;
right: 0;
margin: 1vh;
width: 20vh;
height: 5vh;
background: #28a745;
border-radius: 0.5vh;
}
.request-identity-button > p {
color: #ededed;
text-align: center;
font-family: sans-serif;
text-transform: uppercase;
font-size: 1.6vh;
font-weight: 400;
line-height: 2vh;
letter-spacing: 0.05vh;
}
.job-page-blocks {
position: relative;
padding: 1vh;
padding-right: 2vh;
display: grid;
grid-template-columns: 23vh 23vh;
column-gap: 2vh;
row-gap: 2vh;
}
.job-page-block {
width: 100%;
background: #2873a7;
border-radius: 0.5vh;
transition: all 0.1s ease-in-out;
border-bottom: 2px solid rgba(255, 255, 255, 0);
}
.job-page-block:hover {
background: #ededed;
}
.job-page-block > p:hover {
color: #2873a7;
}
.job-page-block > p {
position: relative;
text-align: center;
line-height: 2.5vh;
font-family: "Poppins", sans-serif;
text-transform: uppercase;
font-weight: 400;
letter-spacing: 0.1vh;
color: #ededed;
font-size: 1.6vh;
}
.apply-job-button {
display: none;
position: absolute;
top: 6vh;
right: 0;
margin: 1vh;
width: 20vh;
height: 5vh;
background: #28a745;
border-radius: 0.5vh;
}
.apply-job-button:hover {
background: #28a745;
}
.apply-job-button > p {
color: #ededed;
text-align: center;
font-family: sans-serif;
text-transform: uppercase;
font-size: 2vh;
font-weight: 400;
line-height: 1vh;
letter-spacing: 0.05vh;
}
.job-selected {
border-left: 0.5vh solid #ededed;
}
.back-to-main {
position: absolute;
top: 0;
right: 0;
margin: 1vh;
width: 20vh;
height: 5vh;
background: #dc143c;
border-radius: 0.5vh;
transition: all 0.1s linear;
}
.back-to-main > p {
color: #ededed;
text-align: center;
font-family: "Poppins", sans-serif;
text-transform: uppercase;
font-size: 2vh;
font-weight: 400;
line-height: 1vh;
letter-spacing: 0.05vh;
}

View File

@ -0,0 +1,35 @@
local Translations = {
error = {
not_in_range = 'بعيدا جدا عن قاعة المدينة'
},
success = {
recived_license = '%{value} تم تحصيله مقابل $50'
},
info = {
new_job_app = 'Your application was sent to the boss of (%{job})',
bilp_text = 'ﻒﻴﻇﻮﺘﻟﺍ ﺰﻛﺮﻣ',
city_services_menu = '~g~E~w~ - ﻒﻴﻇﻮﺘﻟﺍ ﺰﻛﺮﻣ', -- you need font arabic
id_card = 'بطاقة التعريف',
driver_license = 'رخصة السائق',
weaponlicense = 'ترخيص الأسلحة النارية',
new_job = '(%{job}) مبروك الوظيفة'
},
email = {
jobAppSender = "%{job}",
jobAppSub = "Thank you for applying to %(job).",
jobAppMsg = "Hello %{gender} %{lastname}<br /><br />%{job} has received your application.<br /><br />The boss is looking into your request and will reach out to you for an interview at their earliest convienance.<br /><br />Once again, thank you for your application.",
mr = 'سيد',
mrs = 'سيدة',
sender = 'مركز التوظيف',
subject = 'طلب دروس القيادة',
message = '%{gender} %{lastname} مرحبا<br /><br />لقد تلقينا للتو رسالة أن شخصا ما يريد أن يأخذ دروس القيادة<br />إذا كنت على استعداد للتدريس، يرجى الاتصال بنا:<br /><strong>%{firstname} %{lastname}</strong><br /><strong>%{phone}</strong><br/><br/>مع احترام,<br />مركز التوظيف'
}
}
if GetConvar('qb_locale', 'en') == 'ar' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end

View File

@ -0,0 +1,35 @@
local Translations = {
error = {
not_in_range = 'Du er for langt væk fra jobcentret'
},
success = {
recived_license = 'Du modtog dit %{value} for DKK50'
},
info = {
new_job_app = 'Din ansøgning blev sendt til chefen af (%{job})',
bilp_text = 'Borger service',
city_services_menu = '~g~E~w~ -Åben borger service',
id_card = 'ID kort',
driver_license = 'Kørekort',
weaponlicense = 'Våben Licens',
new_job = 'Tillykke med dit nye job som (%{job})!'
},
email = {
jobAppSender = "%{job}",
jobAppSub = "Tak fordi du ansøgte til %(job).",
jobAppMsg = "Hej %{gender} %{lastname}<br /><br />%{job} har modtaget din ansøgning.<br /><br />Chefen er ved at undersøge din anmodning og vil kontakte dig til en samtale, så snart det passer dem.<br /><br />Endnu en gang, tak for din ansøgning.",
mr = 'Hr',
mrs = 'Frue',
sender = 'Borgerservice',
subject = 'Køretimer er påkrævet',
message = 'Hej %{gender} %{lastname}<br /><br />Vi har lige modtaget en besked om, at nogen vil tage køretimer<br />Hvis du er villig til at undervise, så kontakt os:<br />Navn: <strong>%{firstname} %{lastname}</strong><br />Telefon nummer: <strong>%{phone}</strong><br/><br/>Venlige hilsner,<br />Borgerservice'
}
}
if GetConvar('qb_locale', 'en') == 'da' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end

View File

@ -0,0 +1,35 @@
local Translations = {
error = {
not_in_range = 'Zu weit vom Rathaus entfernt'
},
success = {
recived_license = 'Du hast deinen %{value} für 50$ zurückbekommen'
},
info = {
new_job_app = 'Your application was sent to the boss of (%{job})',
bilp_text = 'Rathaus',
city_services_menu = '~g~E~w~ - Rathaus',
id_card = 'Ausweis',
driver_license = 'Führerschein',
weaponlicense = 'Waffenschein',
new_job = 'Herzlichen Glückwunsch zu deinem neuen Job! (%{job})'
},
email = {
jobAppSender = "%{job}",
jobAppSub = "Thank you for applying to %(job).",
jobAppMsg = "Hello %{gender} %{lastname}<br /><br />%{job} has received your application.<br /><br />The boss is looking into your request and will reach out to you for an interview at their earliest convienance.<br /><br />Once again, thank you for your application.",
mr = 'Sehr geehrter Herr',
mrs = 'Sehr geehrte Frau',
sender = 'Gemeinde',
subject = 'Anfrage für Fahrstunden',
message = '%{gender} %{lastname}<br /><br />Wir haben gerade eine Nachricht erhalten, dass jemand Fahrstunden nehmen möchte<br />Wenn Sie bereit sind zu unterrichten, nehmen Sie bitte Kontakt mit uns auf:<br />Name: <strong>%{firstname} %{lastname}</strong><br />Telefonnummer: <strong>%{phone}</strong><br/><br/>Mit freundlichen Grüßen<br />Gemeinde Los Santos'
}
}
if GetConvar('qb_locale', 'en') == 'de' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end

View File

@ -0,0 +1,32 @@
local Translations = {
error = {
not_in_range = 'Too far from the city hall'
},
success = {
recived_license = 'You have recived your %{value} for $50'
},
info = {
new_job_app = 'Your application was sent to the boss of (%{job})',
bilp_text = 'City Services',
city_services_menu = '~g~E~w~ - City Services Menu',
id_card = 'ID Card',
driver_license = 'Drivers License',
weaponlicense = 'Firearms License',
new_job = 'Congratulations with your new job! (%{job})',
},
email = {
jobAppSender = "%{job}",
jobAppSub = "Thank you for applying to %(job).",
jobAppMsg = "Hello %{gender} %{lastname}<br /><br />%{job} has received your application.<br /><br />The boss is looking into your request and will reach out to you for an interview at their earliest convenience.<br /><br />Once again, thank you for your application.",
mr = 'Mr',
mrs = 'Mrs',
sender = 'Township',
subject = 'Driving lessons request',
message = 'Hello %{gender} %{lastname}<br /><br />We have just received a message that someone wants to take driving lessons<br />If you are willing to teach, please contact us:<br />Name: <strong>%{firstname} %{lastname}</strong><br />Phone Number: <strong>%{phone}</strong><br/><br/>Kind regards,<br />Township Los Santos'
}
}
Lang = Lang or Locale:new({
phrases = Translations,
warnOnMissing = true
})

View File

@ -0,0 +1,35 @@
local Translations = {
error = {
not_in_range = 'Muy lejos de la municipalidad'
},
success = {
recived_license = 'Has recibido tu %{value} por $50'
},
info = {
new_job_app = 'Your application was sent to the boss of (%{job})',
bilp_text = 'Servicios municipales',
city_services_menu = '[E] - Servicios municipales',
id_card = 'DNI',
driver_license = 'Licencia de conducir',
weaponlicense = 'Licencia para portacion de armas',
new_job = 'Felicidades por tu nuevo trabajo! (%{job})'
},
email = {
jobAppSender = "%{job}",
jobAppSub = "Thank you for applying to %(job).",
jobAppMsg = "Hello %{gender} %{lastname}<br /><br />%{job} has received your application.<br /><br />The boss is looking into your request and will reach out to you for an interview at their earliest convienance.<br /><br />Once again, thank you for your application.",
mr = 'Sr',
mrs = 'Sra',
sender = 'Municipalidad',
subject = 'Solicitud de clases de conducir',
message = 'Hola %{gender} %{lastname}<br /><br />Acabamos de recibir un mensaje de que deseas clases de conducir<br />Si deseas enseñar, contactanos:<br />Nombre: <strong>%{firstname} %{lastname}</strong><br />Numero de teléfono: <strong>%{phone}</strong><br/><br/>Saludos,<br />Ayuntamiento Los Santos'
}
}
if GetConvar('qb_locale', 'en') == 'es' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end

View File

@ -0,0 +1,35 @@
local Translations = {
error = {
not_in_range = 'Oled linnahallist liiga kaugel.'
},
success = {
recived_license = 'Oled saanud oma kraami: %{value} $50 eest.'
},
info = {
new_job_app = 'Your application was sent to the boss of (%{job})',
bilp_text = 'Linna teenused',
city_services_menu = '~g~E~w~ - Teenuste menüü',
id_card = 'ID Kaart',
driver_license = 'Juhiluba',
weaponlicense = 'Relvaluba',
new_job = 'Leidsid endale uue töökoha: (%{job})'
},
email = {
jobAppSender = "%{job}",
jobAppSub = "Thank you for applying to %(job).",
jobAppMsg = "Hello %{gender} %{lastname}<br /><br />%{job} has received your application.<br /><br />The boss is looking into your request and will reach out to you for an interview at their earliest convienance.<br /><br />Once again, thank you for your application.",
mr = 'Mr',
mrs = 'Mrs',
sender = 'Kölbard',
subject = 'Sõidu tundidele registreerimine',
message = 'Tere %{gender} %{lastname}<br /><br />saime teie sõidutundide soovist kirja<br />Kui sa oled nõus õpetama kirjuta meile:<br />Nimi: <strong>%{firstname} %{lastname}</strong><br />NR: <strong>%{phone}</strong><br/><br/>Heade soovidega,<br />Kölbard'
}
}
if GetConvar('qb_locale', 'en') == 'et' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end

View File

@ -0,0 +1,35 @@
local Translations = {
error = {
not_in_range = 'Trop loin de la mairie'
},
success = {
recived_license = 'Vous avez reçu votre %{value} pour $50'
},
info = {
new_job_app = 'Your application was sent to the boss of (%{job})',
bilp_text = 'Services Publiques',
city_services_menu = '~g~E~w~ - Menu Services Pubiques',
id_card = 'Carte d\'identité',
driver_license = 'Permis de conduire',
weaponlicense = 'Permis d\'armes',
new_job = 'Bravo pour votre nouveau travail! (%{job})'
},
email = {
jobAppSender = "%{job}",
jobAppSub = "Thank you for applying to %(job).",
jobAppMsg = "Hello %{gender} %{lastname}<br /><br />%{job} has received your application.<br /><br />The boss is looking into your request and will reach out to you for an interview at their earliest convienance.<br /><br />Once again, thank you for your application.",
mr = 'Mr',
mrs = 'Mme',
sender = 'Mairie',
subject = 'Demande de cours de conduite',
message = 'Bonjour, %{gender} %{lastname}<br /><br />Nous avons reçu un message de quelqu\'un voulant passer son permis<br />Si vous souhaitez lui faire passer, Veuillez nous contacter:<br />Nom: <strong>%{firstname} %{lastname}</strong><br />Numéro de Téléphone: <strong>%{phone}</strong><br/><br/>Cordialement,<br />Mairie de Los Santos',
}
}
if GetConvar('qb_locale', 'en') == 'fr' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end

View File

@ -0,0 +1,35 @@
local Translations = {
error = {
not_in_range = 'Per toli nuo rotušės'
},
success = {
recived_license = 'Jūs gavote savo %{value} už $50'
},
info = {
new_job_app = 'Your application was sent to the boss of (%{job})',
bilp_text = 'Miesto paslaugos',
city_services_menu = '~g~E~w~ - Miesto paslaugų meniu',
id_card = 'Tapatybės kortelė',
driver_license = 'Vairuotojo pažymėjimas',
weaponlicense = 'Ginklų leidimas',
new_job = 'Sveikiname su jūsų nauju darbu! (%{job})'
},
email = {
jobAppSender = "%{job}",
jobAppSub = "Thank you for applying to %(job).",
jobAppMsg = "Hello %{gender} %{lastname}<br /><br />%{job} has received your application.<br /><br />The boss is looking into your request and will reach out to you for an interview at their earliest convienance.<br /><br />Once again, thank you for your application.",
mr = 'Pone',
mrs = 'Ponia',
sender = 'Los Santos',
subject = 'Vairavimo pamokų prašymas',
message = 'Sveiki %{gender} %{lastname}<br /><br />Mes ką tik gavome žinutę, kad kažkas nori lankyti vairavimo pamokas<br />Jeigu tu viliesi mokyti, susisiekite su mumis:<br />Vardas: <strong>%{firstname} %{lastname}</strong><br />Telefono numeris: <strong>%{phone}</strong><br/><br/>Su pagarba,<br />Los Santos'
}
}
if GetConvar('qb_locale', 'en') == 'lt' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end

View File

@ -0,0 +1,35 @@
local Translations = {
error = {
not_in_range = 'Te ver van het stadhuis'
},
success = {
recived_license = 'U heeft uw %{value} ontvangen voor $50'
},
info = {
new_job_app = 'Your application was sent to the boss of (%{job})',
bilp_text = 'Stadsdiensten',
city_services_menu = '~g~E~w~ - Stadsdiensten Menu',
id_card = 'ID Kaart',
driver_license = 'Rijbewijs',
weaponlicense = 'Vuurwapen Licentie',
new_job = 'Gefeliciteerd met je nieuwe baan! (%{job})'
},
email = {
jobAppSender = "%{job}",
jobAppSub = "Thank you for applying to %(job).",
jobAppMsg = "Hello %{gender} %{lastname}<br /><br />%{job} has received your application.<br /><br />The boss is looking into your request and will reach out to you for an interview at their earliest convienance.<br /><br />Once again, thank you for your application.",
mr = 'Dhr',
mrs = 'Mvr',
sender = 'Gemeente',
subject = 'Aanvraag Rijles',
message = 'Hallo %{gender} %{lastname}<br /><br />We hebben zojuist bericht gekregen dat iemand rijles wil gaan volgen<br />Als je bereid bent om les te geven, neem dan contact met ons op:<br />Naam: <strong>%{firstname} %{lastname}</strong><br />Telefoonnummer: <strong>%{phone}</strong><br/><br/>Vriendelijke groeten,<br />Gemeente Los Santos'
}
}
if GetConvar('qb_locale', 'en') == 'nl' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end

View File

@ -0,0 +1,35 @@
local Translations = {
error = {
not_in_range = 'Za daleko od ratusza'
},
success = {
recived_license = 'Otrzymałeś %{value} za $50'
},
info = {
new_job_app = 'Your application was sent to the boss of (%{job})',
bilp_text = 'Usługi Miejskie',
city_services_menu = '~g~E~w~ - Menu Usług Miejskich',
id_card = 'Dowód Osobisty',
driver_license = 'Prawo Jazdy',
weaponlicense = 'Licencja na Broń',
new_job = 'Gratulacje z powodu nowej pracy! (%{job})'
},
email = {
jobAppSender = "%{job}",
jobAppSub = "Thank you for applying to %(job).",
jobAppMsg = "Hello %{gender} %{lastname}<br /><br />%{job} has received your application.<br /><br />The boss is looking into your request and will reach out to you for an interview at their earliest convienance.<br /><br />Once again, thank you for your application.",
mr = 'Pan',
mrs = 'Pani',
sender = 'Ratusz',
subject = 'Prośba o lekcje jazdy',
message = 'Witaj %{gender} %{lastname}<br /><br />Właśnie otrzymaliśmy wiadomość, że ktoś chce wziąć lekcje jazdy<br />Jeśli chcesz uczyć, skontaktuj się z nami:<br />Imię: <strong>%{firstname} %{lastname}</strong><br />Numer: <strong>%{phone}</strong><br/><br/>Z poważaniem,<br />Ratusz Los Santos'
}
}
if GetConvar('qb_locale', 'en') == 'pl' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end

View File

@ -0,0 +1,35 @@
local Translations = {
error = {
not_in_range = 'Muito longe da prefeitura'
},
success = {
recived_license = 'Você recebeu sua %{value} por $50'
},
info = {
new_job_app = 'Sua candidatura foi enviada ao chefe de (%{job})',
bilp_text = 'Serviços da Cidade',
city_services_menu = '~g~E~w~ - Menu de Serviços da Cidade',
id_card = 'Cartão de Identificação',
driver_license = 'Carteira de Motorista',
weaponlicense = 'Licença de Armas de Fogo',
new_job = 'Parabéns pelo seu novo emprego! (%{job})',
},
email = {
jobAppSender = "%{job}",
jobAppSub = "Obrigado por se candidatar a %(job).",
jobAppMsg = "Olá %{gender} %{lastname},<br /><br />%{job} recebeu sua candidatura.<br /><br />O chefe está analisando sua solicitação e entrará em contato com você para uma entrevista assim que possível.<br /><br />Mais uma vez, obrigado pela sua candidatura.",
mr = 'Sr.',
mrs = 'Sra.',
sender = 'Município',
subject = 'Solicitação de aulas de direção',
message = 'Olá %{gender} %{lastname},<br /><br />Recebemos uma mensagem de alguém interessado em fazer aulas de direção.<br />Se você estiver disposto a ensinar, entre em contato conosco:<br />Nome: <strong>%{firstname} %{lastname}</strong><br />Número de telefone: <strong>%{phone}</strong><br/><br/>Atenciosamente,<br />Município de Los Santos'
}
}
if GetConvar('qb_locale', 'en') == 'pt-br' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end

View File

@ -0,0 +1,34 @@
local Translations = {
error = {
not_in_range = 'Encontra-se muito longe da camara municipal'
},
success = {
recived_license = 'Recebeu %{value} por €50'
},
info = {
new_job_app = 'Your application was sent to the boss of (%{job})',
bilp_text = 'Camâra Municipal',
city_services_menu = 'E - Menu Serviços',
id_card = 'Cartão do Cidadão',
driver_license = 'Carta de Condução',
weaponlicense = 'Licença porte de arma',
new_job = 'Parabéns! O seu novo trabalho: (%{job})'
},
email = {
jobAppSender = "%{job}",
jobAppSub = "Thank you for applying to %(job).",
jobAppMsg = "Hello %{gender} %{lastname}<br /><br />%{job} has received your application.<br /><br />The boss is looking into your request and will reach out to you for an interview at their earliest convienance.<br /><br />Once again, thank you for your application.",
mr = 'Sr',
mrs = 'Sra',
sender = 'Serviços Municipais',
subject = 'Solicitação de aulas de condução',
message = 'Olá %{gender} %{lastname}<br /><br />Acabamos de receber uma mensagem de que alguém quer fazer aulas de condução<br />Se quiser fazer de instructor por favor contacte-nos:<br />Nome: <strong>%{firstname} %{lastname}</strong><br />Telemóvel: <strong>%{phone}</strong><br/><br/>Melhores Cumprimentos,<br />Serviços Municipais'
}
}
if GetConvar('qb_locale', 'en') == 'pt' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end

View File

@ -0,0 +1,35 @@
local Translations = {
error = {
not_in_range = 'Belediye binasına çok uzak'
},
success = {
recived_license = '$50 karşılığında %{value} aldınız'
},
info = {
new_job_app = 'Your application was sent to the boss of (%{job})',
bilp_text = 'Şehir Hizmetleri',
city_services_menu = '~g~E~w~ - Şehir Hizmetleri Menüsü',
id_card = 'Kimlik kartı',
driver_license = 'Ehliyet',
weaponlicense = 'Silah Ruhsatı',
new_job = 'Yeni işin için tebrikler! (%{job})'
},
email = {
jobAppSender = "%{job}",
jobAppSub = "Thank you for applying to %(job).",
jobAppMsg = "Hello %{gender} %{lastname}<br /><br />%{job} has received your application.<br /><br />The boss is looking into your request and will reach out to you for an interview at their earliest convienance.<br /><br />Once again, thank you for your application.",
mr = 'Bay',
mrs = 'Bayan',
sender = 'Belediye',
subject = 'Sürücü kursu talebi',
message = 'Merhaba %{gender} %{lastname}<br /><br />Az önce birisinin sürüş dersi almak istediğine dair bir mesaj aldık<br />Eğer öğretmek istiyorsanız, lütfen bizimle iletişime geçin:<br />İsim: <strong>%{firstname} %{lastname}</strong><br />Telefon numarası: <strong>%{phone}</strong><br/><br/>Saygılarımla,<br />Los Santos Belediyesi'
}
}
if GetConvar('qb_locale', 'en') == 'tr' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end

View File

@ -0,0 +1,35 @@
local Translations = {
error = {
not_in_range = 'Bạn đang ở xa Tòa thị chính'
},
success = {
recived_license = 'Bạn đã nhận %{value} với giá $50'
},
info = {
new_job_app = 'Đơn xin việc của bạn đã gửi tới Tổng giám đốc (%{job})',
bilp_text = 'Dịch vụ công',
city_services_menu = '~g~E~w~ - Danh sách dịch vụ công',
id_card = 'Thẻ công dân',
driver_license = 'Bằng lái xe',
weaponlicense = 'Bằng sử dụng vũ khí',
new_job = 'Chúc mừng bạn đã nhận được công việc mới! (%{job})'
},
email = {
jobAppSender = "%{job}",
jobAppSub = "Cảm ơn bạn đã ứng tuyển vào %(job).",
jobAppMsg = "Thân chào %{gender} %{lastname}<br /><br />%{job} đã nhận được đơn xin việc của bạn.<br /><br />Tổng giám đốc đang xem xét yêu cầu của bạn và sẽ liên hệ với bạn để phỏng vấn trong thời gian sớm nhất.<br /><br />Một lần nữa, cảm ơn bạn đã nộp đơn ứng tuyển.",
mr = 'Ông',
mrs = '',
sender = 'Toàn thị chính',
subject = 'Yêu cầu học lái xe',
message = 'Xin chào %{gender} %{lastname}<br /><br />Chúng tôi vừa nhận được một tin nhắn rằng ai đó muốn tham gia các bài học lái xe<br />Nếu bạn muốn tham gia dạy học khóa học này, hãy liên hệ:<br />Tên: <strong>%{firstname} %{lastname}</strong><br />Số điện thoại: <strong>%{phone}</strong><br/><br/>Thân,<br />Tòa thị chính Los Santos',
}
}
if GetConvar('qb_locale', 'en') == 'vn' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end

View File

@ -0,0 +1,150 @@
local QBCore = exports['qb-core']:GetCoreObject()
local availableJobs = Config.AvailableJobs
-- Exports
local function AddCityJob(jobName, toCH)
if availableJobs[jobName] then return false, 'already added' end
availableJobs[jobName] = {
['label'] = toCH.label,
['isManaged'] = toCH.isManaged
}
return true, 'success'
end
exports('AddCityJob', AddCityJob)
-- Functions
local function giveStarterItems()
local Player = QBCore.Functions.GetPlayer(source)
if not Player then return end
for _, v in pairs(QBCore.Shared.StarterItems) do
local info = {}
if v.item == '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 v.item == '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'
end
Player.Functions.AddItem(v.item, 1, nil, info)
end
end
-- Callbacks
QBCore.Functions.CreateCallback('qb-cityhall:server:receiveJobs', function(_, cb)
cb(availableJobs)
end)
-- Events
RegisterNetEvent('qb-cityhall:server:requestId', function(item, hall)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if not Player then return end
local itemInfo = Config.Cityhalls[hall].licenses[item]
if not Player.Functions.RemoveMoney('cash', itemInfo.cost) then return TriggerClientEvent('QBCore:Notify', src, ('Du har ikke nok penge, du har brug for %s KR'):format(itemInfo.cost), 'error') end
local info = {}
if item == '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 item == '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 item == 'weaponlicense' then
info.firstname = Player.PlayerData.charinfo.firstname
info.lastname = Player.PlayerData.charinfo.lastname
info.birthdate = Player.PlayerData.charinfo.birthdate
else
return false -- DropPlayer(src, 'Attempted exploit abuse')
end
if not Player.Functions.AddItem(item, 1, nil, info) then return end
TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items[item], 'add')
end)
RegisterNetEvent('qb-cityhall:server:sendDriverTest', function(instructors)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if not Player then return end
for i = 1, #instructors do
local citizenid = instructors[i]
local SchoolPlayer = QBCore.Functions.GetPlayerByCitizenId(citizenid)
if SchoolPlayer then
TriggerClientEvent('qb-cityhall:client:sendDriverEmail', SchoolPlayer.PlayerData.source, Player.PlayerData.charinfo)
else
local mailData = {
sender = 'Borgerservice',
subject = 'Køretime anmodning',
message = 'Hej,<br><br>Vi har lige modtaget en besked om, at nogen gerne vil tage køretimer.<br>Hvis du er klar til at undervise, bedes du kontakte dem:<br>Navn: <strong>' .. Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. '<br />Phone Number: <strong>' .. Player.PlayerData.charinfo.phone .. '</strong><br><br>Kind regards,<br>Township Los Santos',
button = {}
}
exports['qb-phone']:sendNewMailToOffline(citizenid, mailData)
end
end
TriggerClientEvent('QBCore:Notify', src, 'En besked er blevet sendt til køreskolen - Du vil modtage en besked fra dem snarest.', 'success', 5000)
end)
RegisterNetEvent('qb-cityhall:server:ApplyJob', function(job, cityhallCoords)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if not Player then return end
local ped = GetPlayerPed(src)
local pedCoords = GetEntityCoords(ped)
local data = {
['src'] = src,
['job'] = job
}
if #(pedCoords - cityhallCoords) >= 20.0 or not availableJobs[job] then
return false -- DropPlayer(source, "Attempted exploit abuse")
end
local JobInfo = QBCore.Shared.Jobs[job]
Player.Functions.SetJob(data.job, 0)
TriggerClientEvent('QBCore:Notify', data.src, Lang:t('info.new_job', { job = JobInfo.label }))
end)
RegisterNetEvent('qb-cityhall:server:getIDs', giveStarterItems)
RegisterNetEvent('QBCore:Client:UpdateObject', function()
QBCore = exports['qb-core']:GetCoreObject()
end)
-- Commands
QBCore.Commands.Add('drivinglicense', 'Give a drivers license to someone', { { 'id', 'ID of a person' } }, true, function(source, args)
local Player = QBCore.Functions.GetPlayer(source)
local SearchedPlayer = QBCore.Functions.GetPlayer(tonumber(args[1]))
if SearchedPlayer then
if not SearchedPlayer.PlayerData.metadata['licences']['driver'] then
for i = 1, #Config.DrivingSchools do
for id = 1, #Config.DrivingSchools[i].instructors do
if Config.DrivingSchools[i].instructors[id] == Player.PlayerData.citizenid then
SearchedPlayer.PlayerData.metadata['licences']['driver'] = true
SearchedPlayer.Functions.SetMetaData('licences', SearchedPlayer.PlayerData.metadata['licences'])
TriggerClientEvent('QBCore:Notify', SearchedPlayer.PlayerData.source, 'Du har bestået! Hent dit kørekort hos borgerservice!', 'success', 5000)
TriggerClientEvent('QBCore:Notify', source, ('Spiller med ID %s har fået adgang til kørekort'):format(SearchedPlayer.PlayerData.source), 'success', 5000)
break
end
end
end
else
TriggerClientEvent('QBCore:Notify', source, "Kan ikke give adgang til kørekort - Spilleren har allerede adgang", 'error')
end
else
TriggerClientEvent('QBCore:Notify', source, 'Spiller ikke online', 'error')
end
end)

View File

@ -0,0 +1,60 @@
# qb-copper
Simple electric-box robbery, another illegal way to get materials ;)
# Change Log
- Materials can now be configured as array, user will get random items depending on config
- Police can be notifed if user steal electric box
- Server side events, 1 box can only be stolen by 1 user, other users will get already stolen notif
- new lucky item ;)
- now the quantity can be changed depending on your economy
# Config
```
Config.searchTime = 14000 -- seconds it takes to remove materials from electric-box
Config.boxDistance = 2.5 -- distance from electric-box
Config.policeCall = true -- call police set to false if you don't want it
Config.stealItem = "advancedlockpick" -- item required
Config.searchableModels = {1709954128, 1131941737, -1625667924, -2007495856, -1620823304, -2008643115} -- searchable models id in gta5 you can add your own
Config.ItemTable = { -- materials that can be robbed
[1] = "metalscrap",
[2] = "plastic",
[3] = "copper",
[4] = "iron",
[5] = "aluminum",
[6] = "steel",
[7] = "glass",
}
Config.MinItemsReceived = 2 -- min items received in a box
Config.MaxItemsReceived = 5
Config.MinItemReceivedQty = 6 -- min qty of item received
Config.MaxItemReceivedQty = 10
Config.LuckyItem = "rubber" -- lucky item to give if player has a chance
Config.MinLuckyItemReceivedQty = 2 -- min qty of lucky item
Config.MaxLuckyItemReceivedQty = 10
Config.LuckyItemChance = 5 -- lucky item chance should be between 1 and 100
```
# Dependencies:
qb-core: https://github.com/qbcore-framework/qb-core
qb-target: https://github.com/qbcore-framework/qb-target
qb-policejob: https://github.com/qbcore-framework/qb-policejob
qb-lock: qb-lock: https://github.com/M-Middy/qb-lock
# Preview (Outdated)
https://www.youtube.com/watch?v=tjS9GWmvLII
# Discord
https://discord.gg/AQHbsahZsV
# Big thanks to abdel1touimi for his rework <3

View File

@ -0,0 +1,86 @@
local QBCore = exports['qb-core']:GetCoreObject()
local function PoliceCall()
local chance = 75
if GetClockHours() >= 1 and GetClockHours() <= 6 then
chance = 50
end
if math.random(1, 100) <= chance then
TriggerServerEvent('police:server:policeAlert', Lang:t("stealboxes.police_notification"))
QBCore.Functions.Notify(Lang:t("stealboxes.police_notified"), 'error')
end
end
local function RemoveBoxFromScene(entity)
NetworkRegisterEntityAsNetworked(entity)
Wait(100)
NetworkRequestControlOfEntity(entity)
SetEntityAsMissionEntity(entity)
Wait(100)
DeleteEntity(entity)
end
local function startStealingBox(entity)
QBCore.Functions.Progressbar("stealingBox", Lang:t("stealboxes.stealing_animation_label"), Config.searchTime, false, true, {
disableMovement = true,
disableCarMovement = true,
disableMouse = true,
disableCombat = true,
}, {
animDict = "mini@repair",
anim = "fixing_a_player",
flags = 49,
}, {}, {}, function()
if DoesEntityExist(entity) then
local pos = GetEntityCoords(entity)
local objectCoords = pos.x .. pos.y .. pos.z
TriggerServerEvent("qb-copper:server:stealedbox", objectCoords)
RemoveBoxFromScene(entity)
QBCore.Functions.Notify(Lang:t("stealboxes.box_removed"), "primary")
if Config.policeCall then PoliceCall() end
end
end, function()
Lang:t("stealboxes.stealing_animation_canceled")
end)
end
CreateThread(function()
exports['qb-target']:AddTargetModel(
Config.searchableModels,
{
options = {
{
targeticon = 'fa-solid fa-screwdriver-wrench',
icon = "fas fa-mask",
type = "client",
action = function(entity)
if IsPedAPlayer(entity) then return false end
TriggerEvent('qb-copper:client:steal', entity)
end,
label = Lang:t("stealboxes.target_label"),
----item = Config.stealItem,
}
},
distance = Config.boxDistance,
}
)
end)
RegisterNetEvent("qb-copper:client:steal", function(entity)
local pos = GetEntityCoords(entity)
local objectCoords = pos.x .. pos.y .. pos.z
QBCore.Functions.TriggerCallback('qb-copper:server:getbox', function(occupied)
if occupied then
RemoveBoxFromScene(entity)
QBCore.Functions.Notify(Lang:t("stealboxes.already_stolen_error"), 'error')
else
exports['ps-ui']:Circle(function(success)
if success then
startStealingBox(entity)
else
QBCore.Functions.Notify(Lang:t("stealboxes.messed_up_error"), 'error')
end
end, 5, 7) -- NumberOfCircles, MS
end
end, objectCoords)
end)

View File

@ -0,0 +1,25 @@
Config = {}
Config.searchTime = 20000 -- seconds it takes to remove objects from box
Config.boxDistance = 2.5 -- distance from box
Config.policeCall = true -- call police
Config.stealItem = "lockpick" -- item required
Config.searchableModels = {1709954128, 1131941737, -1625667924, -2007495856, -1620823304, -2008643115, -686494084} -- searchableModels in fivem
Config.ItemTable = {
[1] = "metalscrap",
[2] = "plastic",
[3] = "copper",
[4] = "iron",
[5] = "aluminum",
[6] = "steel",
[7] = "glass",
}
Config.MinItemsReceived = 1
Config.MaxItemsReceived = 2
Config.MinItemReceivedQty = 1
Config.MaxItemReceivedQty = 2
Config.LuckyItem = "rubber"
Config.MinLuckyItemReceivedQty = 2
Config.MaxLuckyItemReceivedQty = 2
Config.LuckyItemChance = 5

View File

@ -0,0 +1,25 @@
fx_version 'cerulean'
game 'gta5'
author 'mt scripts'
description 'qb-copper'
version '0.1'
shared_scripts {
'@qb-core/shared/locale.lua',
'locales/da.lua',
'config/config.lua',
}
server_scripts{
'server/server.lua',
}
client_scripts{
'client/client.lua',
}
lua54 'yes'

View File

@ -0,0 +1,20 @@
local Translations = {
stealboxes = {
["target_label"] = "Stjæl kasse",
["stealing_animation_label"] = "STJÆLER KASSE...",
["stealing_animation_canceled"] = "Du stopppede med at sjæle",
["already_stolen_error"] = "Nogen er allerede igang med at sjæle",
["messed_up_error"] = "YOU FUCKD UP!!!",
["box_removed"] = "Du stjal kassen",
["police_notification"] = "Stjæler kassen",
["police_notified"] = "Politiet er blevet tilkaldt!",
},
}
if GetConvar('qb_locale', 'en') == 'da' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end

View File

@ -0,0 +1,31 @@
local QBCore = exports['qb-core']:GetCoreObject()
local boxStolen = {}
local function giveStealedItemsToPlayer()
local src = source
local Player = QBCore.Functions.GetPlayer(src)
for _ = 1, math.random(Config.MinItemsReceived, Config.MaxItemsReceived), 1 do
local randItem = Config.ItemTable[math.random(1, #Config.ItemTable)]
local amount = math.random(Config.MinItemReceivedQty, Config.MaxItemReceivedQty)
Player.Functions.AddItem(randItem, amount)
TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items[randItem], 'add')
Wait(500)
end
local chance = math.random(1, 100)
if chance <= Config.LuckyItemChance then
local amount = math.random(Config.MinLuckyItemReceivedQty, Config.MaxLuckyItemReceivedQty)
Player.Functions.AddItem(Config.LuckyItem, amount)
TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items[Config.LuckyItem], 'add')
end
end
RegisterServerEvent('qb-copper:server:stealedbox', function(objectCoords)
boxStolen[objectCoords] = true
giveStealedItemsToPlayer()
end)
QBCore.Functions.CreateCallback('qb-copper:server:getbox', function(source, cb, objectCoords)
local objectCoords = objectCoords
cb(boxStolen[objectCoords])
end)

View File

@ -0,0 +1,30 @@
# qb-gocart
Simple karting tickets system for QBCore
# Preivew:
- https://youtu.be/tAa4WKA4v1w
-
![image](https://user-images.githubusercontent.com/89866234/175318521-c744f071-9a81-4186-8d4e-31ae7fccb6bd.png)
# Installation:
Add to qb-core/server/events.lua:
```
RegisterNetEvent('QBCore:Server:RemoveMoney', function(acount, amount)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if not Player then return end
Player.Functions.RemoveMoney(acount, amount)
end)
RegisterNetEvent('QBCore:Server:AddMoney', function(acount, amount)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if not Player then return end
Player.Functions.AddMoney(acount, amount)
end)
```
# Map credits link:
- https://forum.cfx.re/t/map-karting-track-race/2270220

View File

@ -0,0 +1,279 @@
local QBCore = exports['qb-core']:GetCoreObject()
local Time = 0
local TicketAtivo = false
local Veiculo = nil
local KartingPoly = PolyZone:Create({
vector2(-169.23545837402, -2126.0227050781),
vector2(-103.59944915771, -2103.1733398438),
vector2(-101.42811584473, -2102.9812011719),
vector2(-102.84362030029, -2099.4099121094),
vector2(-118.13861083984, -2055.4501953125),
vector2(-120.92548370361, -2048.2705078125),
vector2(-122.6300201416, -2040.9029541016),
vector2(-122.81782531738, -2031.3441162109),
vector2(-116.01826477051, -1980.0040283203),
vector2(-114.74008178711, -1979.4429931641),
vector2(-61.650188446045, -1986.5238037109),
vector2(-53.568267822266, -1989.6710205078),
vector2(-49.210807800293, -1994.4814453125),
vector2(-39.566497802734, -2020.3823242188),
vector2(-74.735076904297, -2033.3594970703),
vector2(-104.93293762207, -2029.0303955078),
vector2(-105.09645843506, -2039.6833496094),
vector2(-101.85122680664, -2048.6860351562),
vector2(-101.7225112915, -2049.4038085938),
vector2(-85.72745513916, -2093.2482910156),
vector2(-84.908203125, -2097.1889648438),
vector2(-44.1120262146, -2082.5266113281),
vector2(-28.414522171021, -2077.0905761719),
vector2(-19.66005897522, -2081.6242675781),
vector2(-17.005525588989, -2089.7761230469),
vector2(-16.292013168335, -2095.9597167969),
vector2(-18.063987731934, -2105.0646972656),
vector2(-24.122716903687, -2113.2478027344),
vector2(-29.74503326416, -2117.0571289062),
vector2(-69.816352844238, -2131.3469238281),
vector2(-77.692192077637, -2129.7614746094),
vector2(-88.093696594238, -2133.6105957031),
vector2(-92.520805358887, -2139.3259277344),
vector2(-143.04769897461, -2157.0837402344),
vector2(-150.01580810547, -2155.7995605469),
vector2(-159.11499023438, -2158.771484375)
}, {
name="kartzone",
})
CreateThread(function()
while true do
Wait(0)
ClearAreaOfVehicles(-85.162, -2067.108, 21.797, 1000, false, false, false, false, false)
RemoveVehiclesFromGeneratorsInArea(-85.162 - 90.0, -2067.108 - 90.0, 21 - 90.0, -85.162 + 90.0, 2067.108 + 90.0, 21 + 90.0)
end
end)
CreateThread(function()
RequestModel(`hc_driver`)
while not HasModelLoaded(`hc_driver`) do
Wait(1)
end
KartingPed = CreatePed(2, `hc_driver`, Config.Locations['Ped'], false, false)
SetPedFleeAttributes(KartingPed, 0, 0)
SetPedDiesWhenInjured(KartingPed, false)
TaskStartScenarioInPlace(KartingPed, "missheistdockssetup1clipboard@base", 0, true)
SetPedKeepTask(KartingPed, true)
SetBlockingOfNonTemporaryEvents(KartingPed, true)
SetEntityInvincible(KartingPed, true)
FreezeEntityPosition(KartingPed, true)
exports['qb-target']:AddBoxZone("KartingPed", Config.Locations['PedTarget'], 1, 1, {
name="KartingPed",
heading=0,
debugpoly = false,
}, {
options = {
{
event = "qb-gocart:client:MenuAluger",
icon = "fas fa-car",
label = "Snak med personen",
}
},
distance = 2.5
})
local blip = AddBlipForCoord(Config.Locations['PedTarget'])
SetBlipSprite (blip, 38)
SetBlipDisplay(blip, 2)
SetBlipScale (blip, 0.7)
SetBlipColour (blip, 3)
SetBlipAsShortRange(blip, true)
BeginTextCommandSetBlipName("STRING")
AddTextComponentString('GoKarting')
EndTextCommandSetBlipName(blip)
end)
RegisterNetEvent('qb-gocart:client:MenuAluger', function()
if TicketAtivo == true then
exports['qb-menu']:openMenu({
{
header = Lang.MenuHeader,
isMenuHeader = true,
},
{
header = Lang.CloseMenu,
event = "qb-menu:closeMenu",
icon = "fas fa-times-circle",
},
{
header = Lang.StopTicket,
txt = "",
icon = "fas fa-ticket",
event = "qb-gocart:client:Ticket",
params = {
event = "qb-gocart:client:Ticket",
args = 5
},
},
})
else
exports['qb-menu']:openMenu({
{
header = Lang.MenuHeader,
isMenuHeader = true,
},
{
header = Lang.CloseMenu,
event = "qb-menu:closeMenu",
icon = "fas fa-times-circle",
},
{
header = Lang.Ticket1,
txt = Lang.Duration .. Config.Tickets[1].time .. Lang.Minutes .. "<br>" .. Lang.Price .. Config.Tickets[1].price .. ",- DKK",
icon = "fas fa-ticket",
event = "qb-gocart:client:Ticket1",
params = {
event = "qb-gocart:client:Ticket",
args = 1
},
},
{
header = Lang.Ticket2,
txt = Lang.Duration .. Config.Tickets[2].time .. Lang.Minutes .. "<br>" .. Lang.Price .. Config.Tickets[2].price .. ",- DKK",
icon = "fas fa-ticket",
event = "qb-gocart:client:Ticket",
params = {
event = "qb-gocart:client:Ticket",
args = 2
},
},
{
header = Lang.Ticket3,
txt = Lang.Duration .. Config.Tickets[3].time .. Lang.Minutes .. "<br>" .. Lang.Price .. Config.Tickets[3].price .. ",- DKK",
icon = "fas fa-ticket",
params = {
event = "qb-gocart:client:Ticket",
args = 3
},
},
{
header = Lang.Ticket4,
txt = Lang.Duration .. Config.Tickets[4].time .. Lang.Minutes .. "<br>" .. Lang.Price .. Config.Tickets[4].price .. ",- DKK",
icon = "fas fa-ticket",
event = "qb-gocart:client:Ticket",
params = {
event = "qb-gocart:client:Ticket",
args = 4
},
},
})
end
end)
local function drawTxt(text, font, x, y, scale, r, g, b, a)
SetTextFont(font)
SetTextScale(scale, scale)
SetTextColour(r, g, b, a)
SetTextOutline()
SetTextCentre(1)
SetTextEntry("STRING")
AddTextComponentString(text)
DrawText(x, y)
end
local function DeleteVehicle(Time, veh)
local Tempo = Time * 1000
print(Tempo)
Wait(Tempo)
DeleteEntity(Veiculo)
TicketAtivo = false
QBCore.Functions.Notify(Lang.Finished, 'primary', 7500)
end
local function startTimer(Time, veh)
local gameTimer = GetGameTimer()
local EliminarVeiculo = GetVehiclePedIsIn(PlayerPedId(), true)
CreateThread(function()
while TicketAtivo or not TicketAtivo do
Wait(1)
if TicketAtivo == true then
if GetGameTimer() < gameTimer + tonumber(1000 * Time) then
local secondsLeft = GetGameTimer() - gameTimer
drawTxt(Lang.TimeRemaning .. math.ceil(Time - secondsLeft / 1000) .. Lang.Seconds, 4, 0.5, 0.93, 0.50, 255, 255, 255, 180)
end
elseif TicketAtivo == false then
DeleteEntity(Veiculo)
gameTimer = 0
Time = 0
end
end
end)
end
local function SpawnKart(Time)
local veiculo = Config.Vehicle
local coords = Config.Locations['KartSpawn']
local EliminarVeiculo = GetVehiclePedIsIn(PlayerPedId(), true)
QBCore.Functions.SpawnVehicle(veiculo, function(veh)
Veiculo = veh
SetVehicleNumberPlateText(veh, "KART"..tostring(math.random(1000, 9999)))
exports['qb-fuel']:SetFuel(veh, 100.0)
TriggerEvent("vehiclekeys:client:SetOwner", GetVehicleNumberPlateText(veh))
SetVehicleEngineOn(veh, true, true)
startTimer(Time, veh)
DeleteVehicle(Time, veh)
end, coords, true)
end
RegisterNetEvent('qb-gocart:client:Ticket', function(args)
if args == 1 and TicketAtivo == false then
local time = Config.Tickets[1].time * 60
TriggerServerEvent('QBCore:Server:RemoveMoney', 'bank', Config.Tickets[1].price)
Time = time
TicketAtivo = true
SpawnKart(Time)
elseif args == 2 and TicketAtivo == false then
local time2 = Config.Tickets[2].time * 60
TriggerServerEvent('QBCore:Server:RemoveMoney', 'bank', Config.Tickets[2].price)
Time = time2
TicketAtivo = true
SpawnKart(Time)
elseif args == 3 and TicketAtivo == false then
local time3 = Config.Tickets[3].time * 60
TriggerServerEvent('QBCore:Server:RemoveMoney', 'bank', Config.Tickets[3].price)
Time = time3
TicketAtivo = true
SpawnKart(Time)
elseif args == 4 and TicketAtivo == false then
local time4 = Config.Tickets[4].time * 60
TriggerServerEvent('QBCore:Server:RemoveMoney', 'bank', Config.Tickets[4].price)
Time = time4
TicketAtivo = true
SpawnKart(Time)
elseif args == 5 and TicketAtivo == true then
TicketAtivo = false
Time = 0
DeleteEntity(Veiculo)
else
QBCore.Functions.Notify(Lang.ActiveTicket, 'error', 7500)
end
end)
CreateThread(function()
KartingPoly:onPlayerInOut(function(isPointOutside)
if not isPointOutside then
if TicketAtivo == true then
TicketAtivo = false
Time = 0
DeleteEntity(Veiculo)
QBCore.Functions.Notify(Lang.DeletedVehicle, 'primary', 7500)
end
end
end)
end)

View File

@ -0,0 +1,45 @@
Config = {
['Vehicle'] = 'veto',
['Locations'] = {
['Ped'] = vector4(-161.24, -2130.47, 15.71, 204.79),
['PedTarget'] = vector3(-161.24, -2130.47, 16.71),
['KartSpawn'] = vector4(-161.46, -2137.78, 16.71, 295.39),
},
['Tickets'] = {
[1] = {
time = 2,
price = 100,
},
[2] = {
time = 3,
price = 200,
},
[3] = {
time = 4,
price = 300,
},
[4] = {
time = 5,
price = 400,
},
},
}
Lang = {
['MenuHeader'] = 'GoKart menu',
['CloseMenu'] = 'Luk menu',
['Ticket1'] = 'Sølv billet',
['Ticket2'] = 'Bronze billet',
['Ticket3'] = 'Guld billet',
['Ticket4'] = 'Premium billet',
['Duration'] = 'Varighed: ',
['Minutes'] = ' minutter',
['Price'] = 'Pris ',
['TimeRemaning'] = 'Tid tilbage: ',
['Seconds'] = ' sekunder',
['StopTicket'] = 'Terminer aktive billetter',
['Finished'] = 'Din billet er udløbet! Vil du blive ved med at bruge din gokart, skal du købe en ny!',
['NoActiveTicket'] = 'Du har ikke en aktiv billet!',
['ActiveTicket'] = 'Du har allerede en aktiv billet!',
['DeletedVehicle'] = 'Du forlod gokart området og din billet er blevet annulleret!',
}

View File

@ -0,0 +1,18 @@
-- Generated automaticly by RB Generator.
fx_version('cerulean')
games({ 'gta5' })
shared_script('config.lua');
-- server_scripts({
-- 'server.lua'
-- });
client_scripts({
'@PolyZone/client.lua',
'@PolyZone/BoxZone.lua',
'@PolyZone/EntityZone.lua',
'@PolyZone/CircleZone.lua',
'@PolyZone/ComboZone.lua',
'client.lua'
});

View File

@ -0,0 +1,118 @@
local QBCore = exports['qb-core']:GetCoreObject()
FetchSkills = function()
QBCore.Functions.TriggerCallback("skillsystem:fetchStatus", function(data)
if data then
for status, value in pairs(data) do
if Config.Skills[status] then
Config.Skills[status]["Current"] = value["Current"]
else
print("Removing: " .. status)
end
end
end
RefreshSkills()
end)
end
GetCurrentSkill = function(skill)
return Config.Skills[skill]
end
--exports('GetCurrentSkill')
UpdateSkill = function(skill, amount)
if not Config.Skills[skill] then
print("Skill " .. skill .. " doesn't exist")
return
end
local SkillAmount = Config.Skills[skill]["Current"]
if SkillAmount + tonumber(amount) < 0 then
Config.Skills[skill]["Current"] = 0
elseif SkillAmount + tonumber(amount) > 100 then
Config.Skills[skill]["Current"] = 100
else
Config.Skills[skill]["Current"] = SkillAmount + tonumber(amount)
end
RefreshSkills()
if tonumber(amount) > 0 then
QBCore.Functions.Notify( Config.Skills[skill]["Local"] .. ': + ' .. amount ..'%', 'success')
end
TriggerServerEvent("skillsystem:update", json.encode(Config.Skills))
end
function round(num)
return math.floor(num+.5)
end
RefreshSkills = function()
for type, value in pairs(Config.Skills) do
if Config.Debug then
print(type .. ": " .. value['Current'])
elseif Config.Debug and not Config.Skills[skill] then
print("something went wrong")
end
if value["Stat"] then
StatSetInt(value["Stat"], round(value["Current"]), true)
end
end
end
exports('CheckSkill', function(skill, val, hasskill)
if Config.Skills[skill] then
if Config.Skills[skill]["Current"] >= tonumber(val) then
hasskill(true)
else
hasskill(false)
end
else
print("Skill " .. skill .. " doesn't exist")
hasskill(false)
end
end)
MessageBox = function(text, alpha)
if alpha > 255 then
alpha = 255
elseif alpha < 0 then
alpha = 0
end
SetTextFont(4)
SetTextProportional(1)
SetTextColour(255, 255, 255, math.floor(alpha))
SetTextEdge(2, 0, 0, 0, math.floor(alpha))
SetTextDropShadow()
SetTextEntry("STRING")
SetTextCentre(1)
SetTextScale(0.31, 0.31)
AddTextComponentString(text)
local factor = (string.len(text)) / 350
local x = 0.015
local y = 0.5
local width = 0.05
local height = 0.025
DrawText(x + (width / 2.0), y + (height / 2.0) - 0.01)
DrawRect(x + (width / 2.0), y + (height / 2.0), width, height, 25, 25, 25, math.floor(alpha))
end
Notification = function(message)
local alpha = 185
for time = 1, 250 do
Citizen.Wait(1)
if time >= 150 then
alpha = alpha - 2
if alpha <= 0 then
alpha = 0
end
end
MessageBox(message, alpha)
end
end

View File

@ -0,0 +1,34 @@
local QBCore = exports['qb-core']:GetCoreObject()
local function createSkillMenu()
skillMenu = {}
skillMenu[#skillMenu + 1] = {
isHeader = true,
header = 'Skill',
isMenuHeader = true,
icon = 'fas fa-chart-simple'
}
for k,v in pairs(Config.Skills) do
skillMenu[#skillMenu + 1] = {
header = ''..v['Local']..'',
txt = ''..v['Current']..'%',
icon = ''..v['icon']..'',
params = {
args = {
v
}
}
}
end
exports['qb-menu']:openMenu(skillMenu)
end
RegisterCommand(Config.Skillmenu, function()
createSkillMenu()
end)
--Aimgame
RegisterNetEvent("qb-gym:client:openMenu")
AddEventHandler("qb-gym:client:openMenu", function(data)
ExecuteCommand( "skills" )
end)

View File

@ -0,0 +1,366 @@
local QBCore = exports['qb-core']:GetCoreObject()
local training = false
local resting = false
local membership = false
local gotTicket = false
local minutes = 0
local seconds = 0
RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function()
Citizen.CreateThread(function()
FetchSkills()
if Config.DeleteStats == true then
while true do
local seconds = Config.UpdateFrequency * 1000
Wait(seconds)
for skill, value in pairs(Config.Skills) do
UpdateSkill(skill, value["RemoveAmount"])
end
TriggerServerEvent("qb-skills:update", json.encode(Config.Skills))
end
end
end)
end)
local function round(num)
return math.floor(num+.5)
end
function RefreshSkills()
for type, value in pairs(Config.Skills) do
if value["Stat"] then
StatSetInt(value["Stat"], round(value["Current"]), true)
end
end
end
function FetchSkills()
QBCore.Functions.TriggerCallback("qb-skills:fetchStatus", function(data)
if data then
for status, value in pairs(data) do
if Config.Skills[status] then
Config.Skills[status]["Current"] = value["Current"]
else
-- print("Removing: " .. status)
end
end
end
RefreshSkills()
end)
end
function UpdateSkill(skill, amount)
if not Config.Skills[skill] then
-- print("Skill " .. skill .. " doesn't exist")
return
end
local SkillAmount = Config.Skills[skill]["Current"]
if SkillAmount + tonumber(amount) < 0 then
Config.Skills[skill]["Current"] = 0
elseif SkillAmount + tonumber(amount) > 100 then
Config.Skills[skill]["Current"] = 100
else
Config.Skills[skill]["Current"] = SkillAmount + tonumber(amount)
end
RefreshSkills()
if tonumber(amount) > 0 then
QBCore.Functions.Notify( Config.Skills[skill]["Local"] .. ': + ' .. amount ..'%', 'success')
end
TriggerServerEvent("qb-skills:update", json.encode(Config.Skills))
end
local function CheckTraining()
if resting == true then
QBCore.Functions.Notify('Du hviler', 'primary')
resting = false
Wait(15000)
training = false
end
if resting == false then
QBCore.Functions.Notify('Du kan nu træne igen!', 'success')
end
end
function buyMember()
TriggerServerEvent('qb-gym:buyMembership')
closeMenuFull()
end
function hasPlayerRunOutOfTime()
return (minutes == 0 and seconds <= 1)
end
function playerBuyTicketMenu()
exports['qb-menu']:openMenu({
{
header = "Fitness træner",
isMenuHeader = true,
},
{
header = "Fitness medlemskab 250,-",
txt = "Køb",
params = {
event = "qb-gym:client:buyTicket",
args = '1'
}
},
{
header = "Luk",
txt = "",
params = {
event = ""
}
},
})
end
function returnTicketMenu()
exports['qb-menu']:openMenu({
{
header = "Fitness træner",
isMenuHeader = true,
},
{
header = "Stop medlemskab",
txt = "Opsig dit medlemskab",
params = {
event = "qb-gym:client:returnTicket",
}
},
{
header = "Luk",
txt = "",
params = {
event = ""
}
},
})
end
--------------------------------------------------------------------------------------------------------------------
function doesPlayerHaveTicket()
return gotTicket
end
function countTime()
seconds = seconds - 1
if seconds == 0 then
seconds = 59
minutes = minutes - 1
end
if minutes == -1 then
minutes = 0
seconds = 0
end
end
function displayTime()
TriggerEvent('cd_drawtextui:ShowUI', 'show', "Tid tilbage på medlemskab</br> "..minutes..":"..seconds)
end
RegisterNetEvent("qb-gym:client:openTicketMenu")
AddEventHandler("qb-gym:client:openTicketMenu", function()
if gotTicket == false then
playerBuyTicketMenu()
else
returnTicketMenu()
end
end)
RegisterNetEvent('qb-gym:client:buyTicket')
AddEventHandler('qb-gym:client:buyTicket', function(args)
local args = tonumber(args)
if args == 1 then
TriggerServerEvent("qb-gym:server:buyTicket", 'fitness_subscription')
else
TriggerServerEvent("qb-gym:server:buyTicket", 'fitness_subscription')
end
end)
RegisterNetEvent("qb-gym:clientticketResult")
AddEventHandler("qb-gym:clientticketResult", function(ticket)
seconds = 1
minutes = Config.ticketPrice[ticket].time
gotTicket = true
QBCore.Functions.Notify("Medlemskabs tid: "..Config.ticketPrice[ticket].time.." minutter", "primary")
end)
RegisterNetEvent('qb-gym:client:returnTicket')
AddEventHandler('qb-gym:client:returnTicket', function()
minutes = 0
seconds = 0
gotTicket = false
QBCore.Functions.Notify("Dit medlemskort er ikke aktivt mere", "primary")
TriggerEvent('cd_drawtextui:HideUI')
end)
local function DrawText3D(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)
ClearDrawOrigin()
end
--count time
CreateThread(function()
while true do
Wait(1000)
if gotTicket then
if hasPlayerRunOutOfTime() then
QBCore.Functions.Notify("Dit medlemskab er udløbet", "error", 5000)
gotTicket = false
SendNUIMessage({
type = "off",
game = "",
})
SetNuiFocus(false, false)
end
countTime()
displayTime()
if gotTicket == false then
TriggerEvent('cd_drawtextui:HideUI')
end
end
end
end)
CreateThread(function()
blip = AddBlipForCoord(Config.GymBlip)
SetBlipSprite(blip, 311)
SetBlipDisplay(blip, 4)
SetBlipScale(blip, 0.8)
SetBlipColour(blip, 7)
SetBlipAsShortRange(blip, true)
BeginTextCommandSetBlipName("STRING")
AddTextComponentString('Fitness rum')
EndTextCommandSetBlipName(blip)
end)
RegisterNetEvent('qb-gym:trueMembership', function()
membership = true
end)
RegisterNetEvent('qb-gym:falseMembership', function()
membership = false
end)
CreateThread(function()
while true do
sleep = 1000
local ped = PlayerPedId()
local pos = GetEntityCoords(ped)
for k, v in pairs(Config.Locations) do
local dist = #(pos - vector3(Config.Locations[k].coords.x, Config.Locations[k].coords.y, Config.Locations[k].coords.z))
if dist < 1.0 then
if dist < Config.Locations[k].viewDistance then
sleep = 0
DrawText3D(Config.Locations[k].coords.x, Config.Locations[k].coords.y, Config.Locations[k].coords.z, Config.Locations[k].Text3D)
if IsControlJustReleased(0, 38) then
if gotTicket then
if training == false then
TriggerServerEvent('qb-gym:checkChip')
QBCore.Functions.Notify('Starter træning', 'success')
Wait(1000)
if membership == true then
SetEntityHeading(ped, Config.Locations[k].heading)
SetEntityCoords(ped, Config.Locations[k].coords.x, Config.Locations[k].coords.y, Config.Locations[k].coords.z - 1)
TaskStartScenarioInPlace(ped, Config.Locations[k].animation, 0, true)
Wait(20000)
for k, v in pairs(GetGamePool('CObject')) do
if IsEntityAttachedToEntity(PlayerPedId(), v) then
SetEntityAsMissionEntity(v, true, true)
DeleteObject(v)
DeleteEntity(v)
end
end
ClearPedTasksImmediately(PlayerPedId())
UpdateSkill(Config.Locations[k].skill, Config.Locations[k].SkillAddQuantity)
-- print(Config.Locations[k].skill, Config.Locations[k].SkillAddQuantity)
QBCore.Functions.Notify('Du skal hvile i 10 sekunder før du kan træne igen', 'error')
training = true
resting = true
CheckTraining()
elseif membership == false then
QBCore.Functions.Notify('Du har ikke et medlemskab', 'error')
end
elseif training == true then
QBCore.Functions.Notify('Du har brug for en pause', 'primary')
resting = true
CheckTraining()
end
else
wait = 15000
QBCore.Functions.Notify("Medlemskabet er ikke gyldigt", "error")
end
end
end
end
end
Wait(sleep)
end
end)
CreateThread(function()
while true do
Wait(1000)
for k, v in pairs(Config.PedLocations) do
local pos = GetEntityCoords(PlayerPedId())
local dist = #(pos - vector3(v.coords.x, v.coords.y, v.coords.z))
if dist < 40 and not pedspawned then
TriggerEvent('qb-gym:spawn:ped', v.coords)
pedspawned = true
end
if dist >= 35 then
pedspawned = false
DeletePed(GymPed)
end
end
end
end)
RegisterNetEvent('qb-gym:spawn:ped')
AddEventHandler('qb-gym:spawn:ped',function(coords)
local hash = `a_m_y_musclbeac_01`
RequestModel(hash)
while not HasModelLoaded(hash) do
Wait(10)
end
pedspawned = true
GymPed = CreatePed(5, hash, coords.x, coords.y, coords.z - 1.0, coords.w, false, false)
FreezeEntityPosition(GymPed, true)
SetBlockingOfNonTemporaryEvents(GymPed, true)
TaskStartScenarioInPlace(GymPed, "WORLD_HUMAN_STAND_MOBILE_UPRIGHT", 0, true)
end)
--======================================== qb-target
exports['qb-target']:AddTargetModel(`a_m_y_musclbeac_01`, {
options = {
{
event = "qb-gym:client:openTicketMenu",
icon = "fab fa-speakap",
label = "Fitness rum",
},
},
distance = 2.5
})

View File

@ -0,0 +1,67 @@
local QBCore = exports['qb-core']:GetCoreObject()
RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function()
Citizen.CreateThread(function()
FetchSkills()
while true do
local seconds = Config.UpdateFrequency * 1000
Citizen.Wait(seconds)
for skill, value in pairs(Config.Skills) do
UpdateSkill(skill, value["RemoveAmount"])
end
TriggerServerEvent("skillsystem:update", json.encode(Config.Skills))
end
end)
RegisterNetEvent('QBCore:Client:OnPlayerUnload', function()
for skill, value in pairs(Config.Skills) do
Config.Skills[skill]["Current"] = 0
end
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(25000) -- the value for the test - default 60000
local ped = PlayerPedId()
local vehicle = GetVehiclePedIsUsing(ped)
local isDead = QBCore.Functions.GetPlayerData().metadata["isdead"]
local islaststand = QBCore.Functions.GetPlayerData().metadata["islaststand"]
if LocalPlayer.state.isLoggedIn and not isDead and not islaststand then
if IsPedRunning(ped) then
UpdateSkill("Stamina", 0.1)
elseif IsPedInMeleeCombat(ped) then
UpdateSkill("Strength", 0.2)
elseif IsPedSwimmingUnderWater(ped) then
UpdateSkill("LungCapacity", 0.5)
elseif IsPedShooting(ped) then
UpdateSkill("Shooting", 0.1)
elseif DoesEntityExist(vehicle) and GetPedInVehicleSeat(vehicle, -1) == ped then
local speed = GetEntitySpeed(vehicle) * 3.6
if GetVehicleClass(vehicle) == 8 or GetVehicleClass(vehicle) == 13 and speed >= 5 then
local rotation = GetEntityRotation(vehicle)
if IsControlPressed(0, 210) then
if rotation.x >= 25.0 then
UpdateSkill("Wheelie", 0.2)
end
end
end
if speed >= 80 then
UpdateSkill("Driving", 0.1)
end
end
end
end
end)
end)
AddEventHandler('onResourceStart', function(resource)
if resource == GetCurrentResourceName() then
Wait(100)
FetchSkills()
end
end)

View File

@ -0,0 +1,154 @@
Config = {}
Config.Skillmenu = "skills" -- skillmenu command
Config.Debug = false -- debug print
Config.UpdateFrequency = 3600
Config.DeleteStats = true
Config.MmbershipCardItem = 'fitness_subscription'
Config.GymBlip = vector3(258.45, -271.44, 53.96)
Config.PedLocations = {{coords = vector4(258.45, -271.44, 53.96, 344.32)}}
Config.ticketPrice = {
["fitness_subscription"] = {
price = 2500,
time = 30, -- in minutes
},
}
Config.Skills = { --you can change 'Config.Skills` only on tests! Do not make changes after adding to the main server- your players will lose experience!!!
["Stamina"] = { -- don't touch
["Current"] = 20, -- Default value
["RemoveAmount"] = -0.3, -- % to remove when updating,
["Stat"] = "MP0_STAMINA", -- GTA stat hashname
['icon'] = 'fas fa-walking',-- icon Menu
["Local"]= "Stamina", --localization- translate into your language for alerts
},
["Strength"] = {
["Current"] = 10,
["RemoveAmount"] = -0.3,
["Stat"] = "MP0_STRENGTH",
['icon'] = 'fas fa-dumbbell',
["Local"]= "Styrke",
},
["LungCapacity"] = {
["Current"] = 10,
["RemoveAmount"] = -0.1,
["Stat"] = "MP0_LUNG_CAPACITY",
['icon'] = 'fas fa-heartbeat',
["Local"]= "Lunge kapacitet",
},
["Shooting"] = {
["Current"] = 10,
["RemoveAmount"] = -0.1,
["Stat"] = "MP0_SHOOTING_ABILITY",
['icon'] = 'fas fa-bullseye',
["Local"]= "Skyde evne",
},
["Driving"] = {
["Current"] = 10,
["RemoveAmount"] = -0.5,
["Stat"] = "MP0_DRIVING_ABILITY",
['icon'] = 'fas fa-car-side',
["Local"]= "Køre evne",
},
["Wheelie"] = {
["Current"] = 10,
["RemoveAmount"] = -0.2,
["Stat"] = "MP0_WHEELIE_ABILITY",
['icon'] = 'fas fa-wheelchair',
["Local"]= "Wheelie evne",
}
}
-- SkillAddQuantity = 1-the experience gained
Config.Locations = {
[1] = {
coords = vector3(251.28, -266.92, 59.92), heading = 66.53,
animation = "prop_human_muscle_chin_ups", skill = "Strength", SkillAddQuantity = 1,
Text3D = "~b~E~w~ - [Start træning]", viewDistance = 2.5,
},
[3] = {
coords = vector3(234.4, -267.47, 60.04), heading = 335.78,
animation = "world_human_yoga", skill = "Stamina", SkillAddQuantity = 1,
Text3D = "~b~E~w~ - [Start træning]", viewDistance = 3.5,
},
[4] = {
coords = vector3(255.93, -257.85, 59.91), heading = 160.78,
animation = "world_human_muscle_free_weights", skill = "Strength", SkillAddQuantity = 1,
Text3D = "~b~E~w~ - [Start træning]", viewDistance = 3.5,
},
[5] = {
coords = vector3(236.5, -261.62, 60.07), heading = 67.92,
animation = "WORLD_HUMAN_JOG_STANDING", skill = "Stamina", SkillAddQuantity = 1,
Text3D = "~b~E~w~ - [Start træning]", viewDistance = 3.5,
},
[6] = {
coords = vector3(237.49, -259.19, 60.07), heading = 50.78,
animation = "WORLD_HUMAN_JOG_STANDING", skill = "Stamina", SkillAddQuantity = 1,
Text3D = "~b~E~w~ - [Start træning]", viewDistance = 3.5,
},
[7] = {
coords = vector3(239.21, -257.46, 60.07), heading = 46.2,
animation = "WORLD_HUMAN_JOG_STANDING", skill = "Stamina", SkillAddQuantity = 1,
Text3D = "~b~E~w~ - [Start træning]", viewDistance = 3.5,
},
[8] = {
coords = vector3(240.64, -256.34, 60.07), heading = 36.78,
animation = "WORLD_HUMAN_JOG_STANDING", skill = "Stamina", SkillAddQuantity = 1,
Text3D = "~b~E~w~ - [Start træning]", viewDistance = 3.5,
},
[9] = {
coords = vector3(242.2, -255.57, 60.07), heading = 10.78,
animation = "WORLD_HUMAN_JOG_STANDING", skill = "Stamina", SkillAddQuantity = 1,
Text3D = "~b~E~w~ - [Start træning]", viewDistance = 3.5,
},
[10] = {
coords = vector3(244.28, -255.19, 60.06), heading = 2.59,
animation = "WORLD_HUMAN_JOG_STANDING", skill = "Stamina", SkillAddQuantity = 1,
Text3D = "~b~E~w~ - [Start træning]", viewDistance = 3.5,
},
[11] = {
coords = vector3(256.45, -259.82, 59.92), heading = 69.78,
animation = "world_human_muscle_free_weights", skill = "Strength", SkillAddQuantity = 1,
Text3D = "~b~E~w~ - [Start træning]", viewDistance = 2.5,
},
[12] = {
coords = vector3(255.38, -262.54, 59.92), heading = 72.77,
animation = "world_human_muscle_free_weights", skill = "Strength", SkillAddQuantity = 1,
Text3D = "~b~E~w~ - [Start træning]", viewDistance = 2.5,
},
[13] = {
coords = vector3(240.37, -262.64, 59.92), heading = 336.53,
animation = "WORLD_HUMAN_PUSH_UPS", skill = "Strength", SkillAddQuantity = 1,
Text3D = "~b~E~w~ - [Start træning]", viewDistance = 2.5,
},
[14] = {
coords = vector3(251.77, -261.61, 59.92), heading = 130.53,
animation = "WORLD_HUMAN_PUSH_UPS", skill = "Strength", SkillAddQuantity = 1,
Text3D = "~b~E~w~ - [Start træning]", viewDistance = 2.5,
},
[15] = {
coords = vector3(246.39, -255.39, 60.06), heading = 354.15,
animation = "WORLD_HUMAN_JOG_STANDING", skill = "Stamina", SkillAddQuantity = 1,
Text3D = "~b~E~w~ - [Start træning]", viewDistance = 3.5,
},
[16] = {
coords = vector3(248.91, -255.88, 60.07), heading = 340.36,
animation = "WORLD_HUMAN_JOG_STANDING", skill = "Stamina", SkillAddQuantity = 1,
Text3D = "~b~E~w~ - [Start træning]", viewDistance = 3.5,
},
[17] = {
coords = vector3(253.18, -256.95, 59.92), heading = 167.78,
animation = "world_human_muscle_free_weights", skill = "Strength", SkillAddQuantity = 1,
Text3D = "~b~E~w~ - [Start træning]", viewDistance = 2.5,
},
[18] = {
coords = vector3(248.73, -268.38, 59.92), heading = 253.53,
animation = "prop_human_muscle_chin_ups", skill = "Strength", SkillAddQuantity = 1,
Text3D = "~b~E~w~ - [Start træning]", viewDistance = 2.5,
},
}

View File

@ -0,0 +1,26 @@
fx_version 'cerulean'
game 'gta5'
version '1.0.3'
server_scripts {
'@oxmysql/lib/MySQL.lua',
'server/server.lua'
}
client_scripts {
'client/skills.lua',
'client/gym.lua',
'client/functions.lua',
'client/gui.lua'
}
shared_script 'config.lua'
exports {
"UpdateSkill",
"GetCurrentSkill"
}
lua54 'yes'

View File

@ -0,0 +1,80 @@
local QBCore = exports['qb-core']:GetCoreObject()
QBCore.Functions.CreateCallback('skillsystem:fetchStatus', function(source, cb)
local Player = QBCore.Functions.GetPlayer(source)
if Player then
local status = MySQL.scalar.await('SELECT skills FROM players WHERE citizenid = ?', {Player.PlayerData.citizenid})
if status ~= nil then
cb(json.decode(status))
else
cb(nil)
end
else
cb()
end
end)
RegisterServerEvent('skillsystem:update')
AddEventHandler('skillsystem:update', function (data)
local Player = QBCore.Functions.GetPlayer(source)
--print(data)
MySQL.query('UPDATE players SET skills = @skills WHERE citizenid = @citizenid', {
['@skills'] = data,
['@citizenid'] = Player.PlayerData.citizenid
})
end)
RegisterServerEvent('qb-gym:checkChip', function()
local src = source
local Player = QBCore.Functions.GetPlayer(src)
local quantity = Player.Functions.GetItemByName('fitness_subscription').amount
if quantity > 0 then
TriggerClientEvent('qb-gym:trueMembership', src) -- true
else
TriggerClientEvent('qb-gym:falseMembership', src) -- false
end
end)
RegisterServerEvent('qb-gym:buyMembership', function()
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if Player.PlayerData.money.cash >= Config.MmbershipCardPrice then
Player.Functions.RemoveMoney('cash', Config.MmbershipCardPrice)
Player.Functions.AddItem(Config.MmbershipCardPrice, 1)
TriggerClientEvent('QBCore:Notify', src, 'Du betalte for et medlemskab', 'success', 3000)
TriggerClientEvent('qb-gym:trueMembership', src) -- true
else
TriggerClientEvent('QBCore:Notify', src, 'Du har ikke råd, du skal bruge '.. Config.MmbershipCardPrice..',- DKK', 'error', 3000)
end
end)
RegisterNetEvent("qb-gym:server:buyTicket")
AddEventHandler("qb-gym:server:buyTicket", function(ticket)
local src = source
local data = Config.ticketPrice[ticket]
local Player = QBCore.Functions.GetPlayer(source)
local moneyPlayer = tonumber(Player.PlayerData.money.bank)
if moneyPlayer > data.price then
Player.Functions.RemoveMoney("bank", tonumber(data.price), "gym-ticket")
if Player.Functions.GetItemByName(ticket) then
TriggerClientEvent("qb-gym:clientticketResult", source, ticket)
else
local info = {
owner = Player.PlayerData.charinfo.firstname.." "..Player.PlayerData.charinfo.lastname,
cardtime = Config.ticketPrice[ticket].time
}
Player.Functions.AddItem(ticket, 1, false, info)
TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items[ticket], "add", 1)
TriggerClientEvent("qb-gym:clientticketResult", source, ticket)
TriggerClientEvent('QBCore:Notify', source, "Du købte "..ticket.." medlemskab", "success")
end
else
TriggerClientEvent('QBCore:Notify', source, "! You dont have enough money", "error")
end
end)

View File

@ -0,0 +1,2 @@
ALTER table players
ADD COLUMN `skills` LONGTEXT;

View File

@ -0,0 +1,63 @@
local IsHacking = false
AddEventHandler('open:minigame', function(callback)
Callbackk = callback
openHack()
end)
function OpenHackingGame(puzzleDuration, puzzleLength, puzzleAmount, callback)
Callbackk = callback
openHack(puzzleDuration, puzzleLength, puzzleAmount)
end
RegisterNUICallback('callback', function(data, cb)
closeHack()
Callbackk(data.success)
cb('ok')
end)
function openHack(puzzleDuration, puzzleLength, puzzleAmount)
SetNuiFocus(true, true)
SendNUIMessage({
action = "open",
duration = puzzleDuration,
length = puzzleLength,
amount = puzzleAmount,
})
IsHacking = true
end
function closeHack()
SetNuiFocus(false, false)
IsHacking = false
end
function GetHackingStatus()
return IsHacking
end
RegisterCommand('laptopgame', function()
exports['qb-laptopgame']:OpenHackingGame(20, 4, 2, function(Success)
print(Success)
if Success then
print("1")
else
print("2")
end
end)
end)
-- Example
-- TIME = Time to failed
-- SQUARE = Amount of square (4 minimum)
-- AMOUNT = Amount of good answer to Success
-- exports['qb-laptopgame']:OpenHackingGame(TIME, SQUARE, AMOUNT, function(Success)
-- if Success then
-- CODE HERE IF SUCCESS
-- else
-- CODE HERE IF FAILED
-- end
-- end)

View File

@ -0,0 +1,22 @@
fx_version 'cerulean'
game 'gta5'
version 'V1.0'
ui_page 'html/index.html'
client_scripts {
'client/main.lua',
}
files {
'html/index.html',
'html/*.css',
'html/src/*.js',
'html/assets/*.png',
'html/assets/*.mp3'
}
exports {
'OpenHackingGame',
'GetHackingStatus',
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -0,0 +1,61 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hacking minigame</title>
<!-- load font -->
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Archivo+Black&display=swap" rel="stylesheet">
<!-- measure page views -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-FUCKGOOGLETRACKING"></script>
<!-- local css and js -->
<link rel="stylesheet" href="style.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script type="module" src="src/script.js" defer></script>
</head>
<body>
<div class="bg hidden">
<div class="center screen-square">
<div class="center text-container", id="text-container">
<img src="assets/spy-icon.png" class="spy-icon">
<h3 class="loading-text" id="loading-text"><span class="capital">O</span>PRETTER FORBINDELSE</h3>
</div>
<div class="number-container hidden" id="number-container"></div>
<div class="answer-section hidden">
<div class="answer-countdown">
<div class="answer-progress-bar"></div>
</div>
<div class="answer-question">
</div>
<div class="answer-box">
<div class="answer-box-description">answer-input-area</div>
<div class="answer-input-area">
<img src="assets/spy-icon.png" class="answer-input-icon">
<input class="answer-input" placeholder="blue square">
</div>
</div>
</div>
<div class="try-again hidden">
<div class="try-again-hint"><span id="submitted-reveal"></span> svaret var: "<span id="answer-reveal"></span>" </div><br>
</div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,15 @@
const $ = name => document.querySelector(name)
const delay = s => new Promise(res => setTimeout(res, s * 1000));
const randomInt = (max) => Math.floor(Math.random() * Math.floor(max))
const sample = (arr) => arr[randomInt(arr.length)]
const shuffleArray = (arr) => arr.map((a) => ({sort: Math.random(), value: a})).sort((a, b) => a.sort - b.sort).map((a) => a.value)
function playSound(name, volume){
const sound = new Audio(name)
sound.volume = volume || 0.15;
sound.play();
return sound
}
export { $, delay, randomInt, sample, shuffleArray, playSound }

View File

@ -0,0 +1,30 @@
export default
{
// langue française = 'FR'
// lengua española = 'ES'
// lingua italiana = 'IT'
// english language = 'EN'
// dansk sprog = 'DA'
// svenska språk = 'SE'
SELECTED_LANGUAGE : 'DA',
LANGUAGES : ['EN', 'DA', 'ES', 'IT', 'FR', 'SE'],
EN : {
COLORS : ['black', 'white', 'blue', 'red', 'yellow', 'orange', 'green', 'purple']
},
DA : {
COLORS : ['sort', 'hvid', 'blå', 'rød', 'gul', 'orange', 'grøn', 'lilla']
},
ES : {
COLORS : ['negro', 'blanco', 'azul', 'rojo', 'amarillo', 'naranja', 'verde', 'púrpura']
},
IT : {
COLORS : ['nero', 'bianco', 'blu', 'rosso', 'giallo', 'arancione', 'verde', 'viola']
},
FR : {
COLORS : ['noir', 'blanc', 'bleu', 'rouge', 'jaune', 'orange', 'vert', 'violet']
},
SE : {
COLORS : ['svart', 'vit', 'blå', 'röd', 'gul', 'orange', 'grön', 'lila']
}
}

View File

@ -0,0 +1,113 @@
import { randomInt, sample } from './helpers.js'
import TRANSLATIONS from './language.js'
const selectedLang = TRANSLATIONS.SELECTED_LANGUAGE
if(!TRANSLATIONS.LANGUAGES.includes(selectedLang)) console.log(`LANGUAGE NOT SUPPORTED\nSELECTED: ${TRANSLATIONS.SELECTED_LANGUAGE}\nAVAILABLE: ${TRANSLATIONS.LANGUAGES}`)
const LANG = TRANSLATIONS[selectedLang]
const SHAPES = ["square", "triangle", "rectangle", "circle"]
const COLORABLE = ['background', 'text', 'number', 'shape']
const COLOR_CODES = ['black', 'white','#1991F9','#8C0C00','#FFE335','#FF9900','#46A04F','#A43AB5']
const LANG_COLORS = LANG.COLORS.reduce((obj, key, i) => {obj[key] = COLOR_CODES[i]; return obj}, {})
const COLORS = {
'black' : 'black',
'white' : 'white',
'blue' : '#1991F9',
'red' : '#8C0C00',
'yellow' : '#FFE335',
'orange' : '#FF9900',
'green' : '#46A04F',
'purple' : '#A43AB5',
}
const QUESTIONS = {
'background color' : (d) => d.colors['background'],
'text background color' : (d) => d.colors['text'],
'number color' : (d) => d.colors['number'],
'shape color' : (d) => d.colors['shape'],
'color text' : (d) => d.text[0],
'shape text' : (d) => d.text[1],
'shape' : (d) => d.shape
}
class PuzzleData {
constructor(shape, number, text, colors) {
this.shape = shape
this.number = number
this.text = text
this.colors = colors
}
}
// generates a random puzzle
export function generateRandomPuzzle(){
const shape = sample(SHAPES)
const number = randomInt(9) + 1
const topText = sample(Object.keys(LANG_COLORS))
const bottomText = sample(SHAPES)
const colors = COLORABLE.reduce((obj, color) => {obj[color] = sample(Object.keys(COLORS)); return obj}, {})
// ensure shape and background don't blend
while(colors['text'] == colors['background'])
colors['text'] = sample(Object.keys(COLORS))
// ensure nothing blends with shape
while(['background', 'text', 'number'].map(i => colors[i]).includes(colors['shape']))
colors['shape'] = sample(Object.keys(COLORS))
return new PuzzleData(shape, number, [topText, bottomText], colors)
}
export function generateQuestionAndAnswer(nums, puzzles){
const positionOne = randomInt(nums.length)
let tempPosTwo
do {tempPosTwo = randomInt(nums.length)} while(positionOne == tempPosTwo)
const positionTwo = tempPosTwo
const firstQuestion = sample(Object.keys(QUESTIONS))
let tempSecondQuestion
do {tempSecondQuestion = sample(Object.keys(QUESTIONS))} while(tempSecondQuestion == firstQuestion)
const secondQuestion = tempSecondQuestion
puzzles = puzzles.map(convertPuzzleDataLang)
// this is confusing as hell, but works somehow
const question = `${firstQuestion} (${nums[positionOne]}) ET ${secondQuestion} (${nums[positionTwo]})`
const answer = QUESTIONS[firstQuestion](puzzles[positionOne]) + ' ' + QUESTIONS[secondQuestion](puzzles[positionTwo])
return [question, answer]
}
// LANGUAGE TRANSLATION FUNCTIONS
// Should implement a more robust method for all text, but this is a start
// takes in a puzzleData class and converts language of colors
function convertPuzzleDataLang(puzzle){
const result = puzzle
puzzle.colors.background = convertColor(puzzle.colors.background)
puzzle.colors.number = convertColor(puzzle.colors.number)
puzzle.colors.shape = convertColor(puzzle.colors.shape)
puzzle.colors.text = convertColor(puzzle.colors.text)
puzzle.text = puzzle.text.map(i => isColor(i) ? convertColor(i) : i)
return result
}
const isColor = (string) => TRANSLATIONS.EN.COLORS.includes(string)
function convertColor(originalColor){
const englishColors = TRANSLATIONS.EN.COLORS
const position = englishColors.indexOf(originalColor)
return LANG.COLORS[position]
}

View File

@ -0,0 +1,87 @@
import { $, shuffleArray, delay, playSound } from './helpers.js'
import { generateRandomPuzzle, generateQuestionAndAnswer } from './puzzle-factory.js'
import { getPuzzleSvg } from './svg-factory.js'
const progressBar = $('.answer-progress-bar')
const inputElement = $('.answer-input')
// handles generating puzzle and returning result
export async function doPuzzle(duration, puzzleA,dev){
const puzzleTime = duration
const puzzleAmount = puzzleA
// reset from previous run
$('.answer-section').classList.add('hidden')
$(".number-container").innerHTML = ''
//Generate squares and puzzles
const squares = [...Array(puzzleAmount).keys()].map(i => {
let square = document.createElement('div')
square.id = `square-${i+1}`
square.className = 'square'
$('#number-container').appendChild(square)
return square
})
const puzzles = [...Array(puzzleAmount)].map(_ => generateRandomPuzzle())
// generate numbers and display
const nums = shuffleArray([...Array(puzzleAmount)].map((v, i) => i+1))
await displayNumbers(nums)
const metronome = playSound('assets/metronome.mp3')
// clear and focus input window
$('.answer-section').classList.remove('hidden')
inputElement.value = ''
inputElement.focus()
// activate time remaining countdown bar
progressBar.style.transition = ``
progressBar.classList.remove('answer-progress-bar-shrink')
await delay(0.1)
progressBar.style.transition = `width ${puzzleTime*1000}ms linear`
progressBar.classList.add('answer-progress-bar-shrink')
// display puzzle in squares
squares.forEach((square, i) => square.style.backgroundColor = puzzles[i].colors['background'])
squares.forEach((square, i) => square.innerHTML = getPuzzleSvg(puzzles[i]))
// generate and display question
const [question, answer] = generateQuestionAndAnswer(nums, puzzles)
$('.answer-question').textContent = question.toUpperCase()
// for learning purposes
console.log(answer)
return new Promise(async (resolve) => {
// return written input and answer
inputElement.addEventListener("keyup", (event) => {
if (event.keyCode === 13) {
metronome.pause()
resolve([inputElement.value, answer])
}
});
// return nothing by default if puzzleTime seconds go by
await delay(puzzleTime)
metronome.pause()
resolve([null, answer])
});
}
async function displayNumbers(numbers){
numbers.forEach((n, i) => $('#square-' + (i+1)).innerHTML = `<div class="big-numbers can-shrink" id="num-${i+1}">${n}</div>`)
await delay(1.5)
numbers.forEach(n => $('#num-' + (n)).classList.add('number-shrink'))
await delay(1.5)
}
// puzzle time settins
const timeRange = 7
const puzzleRange = 4

View File

@ -0,0 +1,87 @@
"use strict"
import { $, delay, playSound } from './helpers.js'
import { doPuzzle } from './puzzle-handler.js'
// runs on site load and handles entire flow
async function start(duration,puzzlelength,amount,dev){
// reset from previous
$('.try-again').classList.add('hidden')
$('.spy-icon').src = 'assets/spy-icon.png'
playSound('assets/dialing.mp3', 0.1)
// mock loading screen
setInformationText('OPRETTER FORBINDELSE...')
await delay(0.8)
setInformationText('BYPASSER FIREWALL...')
await delay(1)
setInformationText('ADGANDSKODE FLAGGED; MENNESKELIG INPUT NØDVENDIG..')
await delay(0.8)
// hide text and show squares
$('#text-container').classList.toggle('hidden')
$('#number-container').classList.toggle('hidden')
// activate puzzle 4 times, break on fail
let submitted
let answer
let result = true
for (let i = 0; i < amount && result; i++) {
[submitted, answer] = await doPuzzle(duration,puzzlelength,dev)
result = (submitted?.toLowerCase() == answer)
}
// hide squares and show text
$('.answer-section').classList.add('hidden')
$('.number-container').classList.add('hidden')
$('#text-container').classList.remove('hidden')
// display result
setInformationText((result) ? 'system blev bypassed.' : "Systemet afviste din adgangskode.")
if(!result) {
$('.spy-icon').src = 'assets/failed.png'
$('#answer-reveal').textContent = answer
await delay(5)
}
fetch('https://qb-laptopgame/callback', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
success: result
})
});
$(".bg").classList.add('hidden');
$('#submitted-reveal').textContent = (result) ? 'Godt arbejde..' : ((submitted == null) ? "Tiden løb ud," : `Du skrev "${submitted || ' '}",`)
}
function setInformationText(text){
const capitalized = text.toUpperCase()
const infoText = `<span class="capital">${capitalized.charAt(0)}</span>${capitalized.substring(1)}`
$("#loading-text").innerHTML = infoText
}
// count visitors
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-FUCKGOOGLETRACKING');
window.addEventListener('message', function(event){
if (event.data.action == "open") {
start(event.data.duration, event.data.length,event.data.amount, event.data.dev)
$(".bg").classList.remove('hidden');
}
})

View File

@ -0,0 +1,48 @@
/**
* Generates a complete svg image from a PuzzleData object
*
* @param {PuzzleData} puzzleData
*/
export function getPuzzleSvg(puzzleData){
const textSize = 21
const textWeigth = 'normal'
const textColor = puzzleData.colors['text']
const shapeSVG = createShape(puzzleData.shape, puzzleData.colors['shape'])
const topText = createText(puzzleData.text[0].toUpperCase(), textColor, textSize, textWeigth, 31)
const bottomText = createText(puzzleData.text[1].toUpperCase(), textColor, textSize, textWeigth, 67)
const numberText = createText(puzzleData.number, puzzleData.colors['number'], 60, 100, 50, 'Arial, Helvetica')
return createSVG([shapeSVG, topText, bottomText, numberText])
}
// Takes multiple SVG strings and combines them to a svg
const createSVG = (elements) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 150 150"> ${elements.join("\n")} </svg>`
const createShape = (shape, color) => SHAPE_SVG[shape](color)
const SHAPE_SVG = {
"square" : (c) => `<rect fill=${c} stroke="#000" stroke-width="1" width="150" height="150"/>`,
"triangle": (c) => `<polygon fill=${c} stroke="#000" stroke-width="1" points="0 150 75 0 150 150 0 150"/>`,
"rectangle" : (c) =>`<rect y="30" fill=${c} stroke="#000" stroke-width="1" class="shape" width="150" height="90"/>`,
"circle" : (c) => `<circle fill=${c} stroke="#000" stroke-width="1" cx="75" cy="75" r="75"/>`,
}
const createText = (text, color, size, weight, y, font) => `
<text
stroke="black"
fill="${color}"
stroke-width="1"
style="font-size:${size}px;"
font-weight="${weight}"
font-family="${font || 'Archivo Black'}, sans-serif";
x="50%"
y="${y}%"
dominant-baseline="middle"
text-anchor="middle"
>
${text}
</text> `

View File

@ -0,0 +1,346 @@
#overlay {
position: fixed;
display: none;
width: 100%;
height: 100%;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0,0,0,0.5);
z-index: 2;
cursor: pointer;
}
#text{
width: 45em;
height: 80%;
padding: 4em;
position: absolute;
top: 50%;
left: 50%;
font-size: 1em;
color: white;
transform: translate(-50%,-50%);
-ms-transform: translate(-50%,-50%);
background-color: var(--primary);
font-family: Arial, Helvetica, sans-serif;
overflow: auto;
}
.tutorial-image{
width: 100%;
border: rgba(255, 255, 255, 0.561) solid 2px;
}
.time-display, .puzzle-display{
padding: 5px;
background-color: rgba(0, 0, 0, 0.192);
font-weight: bolder;
font-size: large;
}
.speed-control{
position:absolute;
bottom:0px;
margin: 20px;
padding: 8px;
font-size: small;
font-family: Arial, Helvetica, sans-serif;
color: white;
background-color: var(--secondary);
}
#puzzle-control, #speed-control{
margin-bottom: 8px;
}
.puzzle-control{
position:absolute;
bottom: 48px;
margin: 20px;
padding: 8px;
font-size: small;
font-family: Arial, Helvetica, sans-serif;
color: white;
background-color: var(--secondary);
}
/* make range slider fit better with style of site (rip firefox)*/
input[type=range]::-webkit-slider-runnable-track {
height: 6px;
background: var(--primary);
border-radius: 1.3px;
}
input[type=range]::-webkit-slider-thumb { margin-top: -5px; }
.speed-label{
margin-left: 10px;
vertical-align: bottom;
}
.github-link{
position:absolute;
bottom:8px;
right: 0px;
padding: 10px;
margin: 15px;
font-size: small;
}
.question-button{
position:absolute;
bottom:8px;
right: 70px;
padding: 1px 10px 2px 10px;
margin: 15px;
font-size: x-large;
font-family: 'Archivo Black', sans-serif;
}
.credits{
color: gray;
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
position:absolute;
bottom:5px;
right: 5px;
}
.try-again{
text-align: center;
padding: 20px;
margin-top: 33em;
}
.try-again-hint{
color: rgba(253, 253, 253, 0.267);
font-family: Arial, Helvetica, sans-serif;
font-size: smaller;
padding-top: 0em;
line-height: 5px;
}
button{
background-color: var(--secondary);
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
}
button:hover{
background-color: #243241;
}
.answer-input-area{
border-bottom: 2px solid rgb(255, 255, 255);
border-right: transparent;
border-top: transparent;
border-left: transparent;
background-color: rgba(0, 0, 0, 0);
}
.answer-input-icon{
margin: 0;
display: inline-block;
vertical-align: top;
width: 18px;
padding-top: 4px;
}
.answer-box-description{
text-align: left;
font-size: 12px;
margin-bottom: 5px;
color: white;
font-weight: 100;
font-family: Arial, Helvetica, sans-serif;
}
.answer-question{
text-align: center;
margin-top: 170px;
color: white;
}
.answer-input{
color: white;
border: transparent;
background-color: rgba(0, 0, 0, 0);
padding: 5px;
padding: 5px;
display: inline-block;
vertical-align: top;
font-size: 16px;
padding-top: 5px;
width: 170px;
}
::placeholder {
color: rgba(214, 215, 235, 0.507);
}
.answer-box{
margin: auto;
width: 210px;
margin-top: 20px;
text-align: center;
}
textarea:focus, input:focus{
outline: none;
}
.answer-countdown{
margin: 0;
position: absolute;
top: 70%;
left: 3%;
border: #20242E;
width: 94%;
height: 4px;
background-color: #754E2E;
}
.answer-progress-bar{
background-color: #E7A26D;
width: 100%;
height: 100%;
margin: auto;
transition: width 0ms linear;
}
.answer-progress-bar-shrink{
width: 0%;
}
.number-container{
display: flex;
justify-content: space-evenly;
padding-top: 7rem;
text-align: center;
color: white;
font-size: 10em;
line-height: 1.3;
font-family: Arial, Helvetica, sans-serif;
}
.can-shrink{
transform:scale(1);
transition: all 1500ms linear;
}
.number-shrink{
transform:scale(0);
transition: all 1500ms linear;
}
.square{
width: 200px;
height: 200px;
background-color: var(--secondary);
padding: 30px;
margin: 20px;
}
.hidden{
display:none;
}
.text-container{
width: 100%;
}
.loading-text{
text-align:center;
color: white;
}
.spy-icon{
display:block;
margin:auto;
}
.screen-square{
min-width: 1200px;
width: auto;
height: 700px;
background-color: var(--primary);
}
.center{
margin: 0;
position: absolute;
top: 50%;
left: 50%;
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
body, html {
height: 100%;
margin: 0;
padding : 0;
-webkit-font-smoothing: subpixel-antialiased;
-webkit-text-stroke:1px transparent;
}
:root{
font-family: 'Archivo Black', sans-serif;
--primary : #20242E;
--secondary : #2E4561
}
.capital{
font-size: x-large;
}
.bg {
height: 100%;
background: transparent;
}

View File

@ -0,0 +1,72 @@
WIP its not Fully finished
Original Nitrous Script from qb-tunerchip with modifications
Purge System
Purge Flow Rate with different size of Purge Effect depends of Purge Flow Rate
When nitro or purge finished give you empty bottle if you want to refill
BUG: Cant take info from database after restart server
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
Add item into shared/items.lua
```lua
['emptynitrous'] = {['name'] = 'emptynitrous', ['label'] = 'Empty Bottle', ['weight'] = 1000, ['type'] = 'item', ['image'] = 'emptynitrous.png', ['unique'] = true, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Empty bottle of nitrous. You have to Refil'},
```
Import nitrous.sql into your DataBase
Add image from inventory-image into your inventory script
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Add into qb-garages/client/main.lua on line 408 under TriggerServerEvent('qb-garage:server:updateVehicle', 1, totalFuel, engineDamage, bodyDamage, plate, indexgarage)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
```lua
TriggerEvent('nitrous:client:getNosLevel')
```
Have to Look Like this
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
```lua
local function enterVehicle(veh, indexgarage, type, garage)
local plate = QBCore.Functions.GetPlate(veh)
QBCore.Functions.TriggerCallback('qb-garage:server:checkOwnership', function(owned)
if owned then
local bodyDamage = math.ceil(GetVehicleBodyHealth(veh))
local engineDamage = math.ceil(GetVehicleEngineHealth(veh))
local totalFuel = exports['LegacyFuel']:GetFuel(veh)
local vehProperties = QBCore.Functions.GetVehicleProperties(veh)
TriggerServerEvent('qb-garage:server:updateVehicle', 1, totalFuel, engineDamage, bodyDamage, plate, indexgarage)
TriggerEvent('nitrous:client:getNosLevel')
CheckPlayers(veh, garage)
if type == "house" then
exports['qb-core']:DrawText(Lang:t("info.car_e"), 'top')
InputOut = true
InputIn = false
end
if plate then
OutsideVehicles[plate] = nil
TriggerServerEvent('qb-garages:server:UpdateOutsideVehicles', OutsideVehicles)
end
QBCore.Functions.Notify(Lang:t("success.vehicle_parked"), "primary", 4500)
else
QBCore.Functions.Notify(Lang:t("error.not_owned"), "error", 3500)
end
end, plate, type, indexgarage, PlayerGang.name)
end
```
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
in qb-garages/server/main.lua under RegisterNetEvent('qb-garage:server:updateVehicle', function(state, fuel, engine, body, plate, garage)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
```lua
RegisterNetEvent('qb-garage:server:updateVehicleNos', function(nos, plate)
MySQL.Async.execute('UPDATE player_vehicles SET nitrous = ? WHERE plate = ?', {nos, plate})
end)
```
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Big Thanks on Silent and Man1C for helping me alot with function for saving in DataBase

View File

@ -0,0 +1,397 @@
local QBCore = exports['qb-core']:GetCoreObject()
local NitrousActivated = false
local NitrousBoost = 18.0
local VehicleNitrous = {}
local Fxs = {}
local purgeflowrate = 0.1
local nitroflowrate = 1.0
local function trim(value)
if not value then return nil end
return (string.gsub(value, '^%s*(.-)%s*$', '%1'))
end
function tableHasKey(table, key)
return table[key] ~= nil
end
RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function()
QBCore.Functions.TriggerCallback('qb-nitro:GetNosLoadedVehs', function(vehs)
VehicleNitrous = vehs
while
VehicleNitrous == nil do
Wait(100)
end
end)
end)
AddEventHandler('onResourceStart', function(resource)
if GetCurrentResourceName() == resource then
QBCore.Functions.TriggerCallback('qb-nitro:GetNosLoadedVehs',
function(vehs)
VehicleNitrous = vehs
while VehicleNitrous == nil do Wait(100) end
end)
end
Wait(500)
end)
RegisterNetEvent('qb-nitro:client:ApplyNitrous', function()
local IsInVehicle = IsPedInAnyVehicle(PlayerPedId())
local ped = PlayerPedId()
local veh = GetVehiclePedIsIn(ped)
if QBCore.Functions.HasItem('nitrous') then
if IsToggleModOn(veh, 18) then
if not NitrousActivated then
if IsInVehicle and not IsThisModelABike(GetEntityModel(GetVehiclePedIsIn(ped))) then
if GetPedInVehicleSeat(veh, -1) == ped then
QBCore.Functions.Progressbar("use_nos", "Tilslutter NOS...", 1000, false, true, {
disableMovement = false,
disableCarMovement = false,
disableMouse = false,
disableCombat = true,
}, {}, {}, {}, function() -- Done
local CurrentVehicle = GetVehiclePedIsIn(PlayerPedId())
local Plate = trim(GetVehicleNumberPlateText(CurrentVehicle))
TriggerServerEvent('qb-nitro:server:LoadNitrous', Plate)
TriggerServerEvent('qb-nitro:server:AddEmptyNitrous')
end, function() -- Cancel
TriggerEvent("QBCore:Notify", "Failed", "error")
ClearPedTasks(ped)
end)
else
QBCore.Functions.Notify("Du kan ikke gøre det fra dette sæde!", "error")
end
else
QBCore.Functions.Notify('Du er ikke i en bil', 'error')
end
else
QBCore.Functions.Notify('NOS er allerede tilsluttet', 'error')
end
else
QBCore.Functions.Notify('Køretøjet skal have en turbo først!', 'error')
end
end
end)
local nosupdated = false
local PurgeMode = false
local NitroMode = true
CreateThread(function()
while true do
local IsInVehicle = IsPedInAnyVehicle(PlayerPedId())
local CurrentVehicle = GetVehiclePedIsIn(PlayerPedId())
if IsInVehicle then
local Plate = trim(GetVehicleNumberPlateText(CurrentVehicle))
if VehicleNitrous[Plate] ~= nil then
if VehicleNitrous[Plate].hasnitro then
if NitroMode then
if IsControlJustPressed(0, 21) and GetPedInVehicleSeat(CurrentVehicle, -1) == PlayerPedId() then
SetVehicleEnginePowerMultiplier(CurrentVehicle, NitrousBoost)
SetVehicleEngineTorqueMultiplier(CurrentVehicle, NitrousBoost)
SetEntityMaxSpeed(CurrentVehicle, 999.0)
NitrousActivated = true
CreateThread(function()
while NitrousActivated do
if VehicleNitrous[Plate].level > 0 then
TriggerServerEvent('qb-nitro:server:UpdateNitroLevel', Plate,
(VehicleNitrous[Plate].level - 0.5))
TriggerEvent('hud:client:UpdateNitrous', Plate, VehicleNitrous[Plate].level)
elseif VehicleNitrous[Plate].level <= 0 then
TriggerServerEvent('qb-nitro:server:UnloadNitrous', Plate)
NitrousActivated = false
SetVehicleBoostActive(CurrentVehicle, 0)
SetVehicleEnginePowerMultiplier(CurrentVehicle, LastEngineMultiplier)
SetVehicleEngineTorqueMultiplier(CurrentVehicle, 1.0)
for index, _ in pairs(Fxs) do
StopParticleFxLooped(Fxs[index], 1)
TriggerServerEvent('qb-nitro:server:StopSync',
trim(GetVehicleNumberPlateText(CurrentVehicle)))
Fxs[index] = nil
end
end
Wait(100)
end
end)
end
elseif PurgeMode then
if IsControlPressed(0, 21) and GetPedInVehicleSeat(CurrentVehicle, -1) == PlayerPedId() then
if VehicleNitrous[Plate].level - 1 >= 0 then
TriggerServerEvent('qb-nitro:server:SyncPurge', VehToNet(CurrentVehicle), true)
if purgeflowrate >= 0.1 or purgeflowrate <= 0.3 then
TriggerServerEvent('qb-nitro:server:UpdateNitroLevel', Plate,
(VehicleNitrous[Plate].level - 0.3))
TriggerEvent('hud:client:UpdateNitrous', Plate, VehicleNitrous[Plate].level)
SetVehicleBoostActive(CurrentVehicle, 1) --Boost Sound
SetVehicleNitroPurgeEnabled(CurrentVehicle, true)
elseif purgeflowrate >= 0.4 or purgeflowrate <= 0.7 then
TriggerServerEvent('qb-nitro:server:UpdateNitroLevel', Plate,
(VehicleNitrous[Plate].level - 0.9))
TriggerEvent('hud:client:UpdateNitrous', Plate, VehicleNitrous[Plate].level)
SetVehicleBoostActive(CurrentVehicle, 1) --Boost Sound
SetVehicleNitroPurgeEnabled(CurrentVehicle, true)
elseif purgeflowrate >= 0.8 or purgeflowrate <= 1.0 then
TriggerServerEvent('qb-nitro:server:UpdateNitroLevel', Plate,
(VehicleNitrous[Plate].level - 1.5))
TriggerEvent('hud:client:UpdateNitrous', Plate, VehicleNitrous[Plate].level)
SetVehicleBoostActive(CurrentVehicle, 1) --Boost Sound
SetVehicleNitroPurgeEnabled(CurrentVehicle, true)
end
elseif VehicleNitrous[Plate].level <= 0 then
TriggerServerEvent('qb-nitro:server:UnloadNitrous', Plate)
SetVehicleNitroPurgeEnabled(CurrentVehicle, false)
SetVehicleBoostActive(CurrentVehicle, false)
TriggerServerEvent('qb-nitro:server:SyncPurge', VehToNet(CurrentVehicle), false)
end
Wait(100)
elseif IsControlJustPressed(0, 10) and purgeflowrate <= 0.9 then
purgeflowrate = purgeflowrate + 0.1
QBCore.Functions.Notify('Purge Spray Flowrate: ' .. purgeflowrate)
elseif IsControlJustPressed(0, 10) and purgeflowrate >= 0.9 then
QBCore.Functions.Notify('Purge Spray is on maximum Flowrate')
elseif IsControlJustPressed(0, 11) and purgeflowrate >= 0.2 then
purgeflowrate = purgeflowrate - 0.1
QBCore.Functions.Notify('Purge Spray Flowrate: ' .. purgeflowrate)
elseif IsControlJustPressed(0, 11) and purgeflowrate <= 0.2 then
QBCore.Functions.Notify('Purge Spray is on minimum Flowrate')
else
SetVehicleNitroPurgeEnabled(CurrentVehicle, false)
TriggerEvent('hud:client:UpdateNitrous', Plate, VehicleNitrous[Plate].level)
TriggerServerEvent('qb-nitro:server:SyncPurge', VehToNet(CurrentVehicle), false)
end
end
if IsControlJustPressed(0, 73) and GetPedInVehicleSeat(CurrentVehicle, -1) == PlayerPedId() then
if not PurgeMode and NitroMode then
PurgeMode = true
NitroMode = false
QBCore.Functions.Notify('Smoke Extraction Mode')
elseif not NitroMode and PurgeMode then
NitroMode = true
PurgeMode = false
QBCore.Functions.Notify('Nitro Mode')
end
end
if IsControlJustReleased(0, 21) and GetPedInVehicleSeat(CurrentVehicle, -1) == PlayerPedId() then
if NitrousActivated then
local veh = GetVehiclePedIsIn(PlayerPedId())
SetVehicleBoostActive(veh, 0)
SetVehicleEnginePowerMultiplier(veh, LastEngineMultiplier)
SetVehicleEngineTorqueMultiplier(veh, 1.0)
for index, _ in pairs(Fxs) do
StopParticleFxLooped(Fxs[index], 1)
TriggerServerEvent('qb-nitro:server:StopSync', trim(GetVehicleNumberPlateText(veh)))
Fxs[index] = nil
end
TriggerEvent('hud:client:UpdateNitrous', Plate, VehicleNitrous[Plate].level)
TriggerServerEvent('qb-nitro:server:Update', { Plate, hasnitro, level })
TriggerServerEvent('qb-nitro:server:SyncPurge', VehToNet(CurrentVehicle), false)
NitrousActivated = false
end
end
else
TriggerServerEvent('qb-nitro:server:UnloadNitrous', Plate)
NitrousActivated = false
SetVehicleBoostActive(CurrentVehicle, 0)
SetVehicleEnginePowerMultiplier(CurrentVehicle, LastEngineMultiplier)
SetVehicleEngineTorqueMultiplier(CurrentVehicle, 1.0)
for index, _ in pairs(Fxs) do
StopParticleFxLooped(Fxs[index], 1)
TriggerServerEvent('qb-nitro:server:StopSync', trim(GetVehicleNumberPlateText(CurrentVehicle)))
Fxs[index] = nil
end
TriggerServerEvent('qb-nitro:server:SyncPurge', VehToNet(CurrentVehicle), false)
end
else
if not nosupdated then
TriggerEvent('hud:client:UpdateNitrous', Plate, 0)
nosupdated = true
end
end
else
if nosupdated then
nosupdated = true
end
Wait(1500)
end
Wait(3)
end
end)
----------PURGE--------------
local vehicles = {}
local particles = {}
function IsVehicleNitroPurgeEnabled(vehicle)
return vehicles[vehicle] == true
end
RegisterNetEvent('qb-nitro:client:SyncPurge', function(netid, enabled)
SetVehicleNitroPurgeEnabled(NetToVeh(netid), enabled)
end)
function SetVehicleNitroPurgeEnabled(vehicle, enabled)
if IsVehicleNitroPurgeEnabled(vehicle) == enabled then
return
end
if enabled then
local boneleft = GetEntityBoneIndexByName(vehicle, 'wheel_lf')
local posleft = GetWorldPositionOfEntityBone(vehicle, boneleft)
local offleft = GetOffsetFromEntityGivenWorldCoords(vehicle, posleft.x, posleft.y, posleft.z)
local boneright = GetEntityBoneIndexByName(vehicle, 'wheel_rf')
local posright = GetWorldPositionOfEntityBone(vehicle, boneright)
local offright = GetOffsetFromEntityGivenWorldCoords(vehicle, posright.x, posright.y, posright.z)
local ptfxs = {}
for i = 0, 1 do
local leftPurge = CreateVehiclePurgeSpray(vehicle, offleft.x - 0.1, offleft.y + 0.5, offleft.z + 0.05, 30.0,
-50.0, 0.5, purgeflowrate)
local rightPurge = CreateVehiclePurgeSpray(vehicle, offright.x + 0.1, offright.y + 0.5, offright.z + 0.05,
30.0, 50.0, 0.5, purgeflowrate)
table.insert(ptfxs, leftPurge)
table.insert(ptfxs, rightPurge)
end
vehicles[vehicle] = true
particles[vehicle] = ptfxs
else
if particles[vehicle] and #particles[vehicle] > 0 then
for _, particleId in ipairs(particles[vehicle]) do
StopParticleFxLooped(particleId)
end
end
vehicles[vehicle] = nil
particles[vehicle] = nil
end
end
function CreateVehiclePurgeSpray(vehicle, xOffset, yOffset, zOffset, xRot, yRot, zRot, scale)
UseParticleFxAssetNextCall('core')
return StartParticleFxLoopedOnEntity('ent_sht_steam', vehicle, xOffset, yOffset, zOffset, xRot, yRot, zRot, scale,
false, false, false)
end
p_flame_location = {
"exhaust",
"exhaust_2",
"exhaust_3",
"exhaust_4",
"exhaust_5",
"exhaust_6",
"exhaust_7",
"exhaust_8",
"exhaust_9",
"exhaust_10",
"exhaust_11",
"exhaust_12",
"exhaust_13",
"exhaust_14",
"exhaust_15",
"exhaust_16",
}
ParticleDict = "veh_xs_vehicle_mods"
ParticleFx = "veh_nitrous"
ParticleSize = 1.3
CreateThread(function()
while true do
if NitrousActivated then
local veh = GetVehiclePedIsIn(PlayerPedId())
if veh ~= 0 then
TriggerServerEvent('qb-nitro:server:SyncFlames', VehToNet(veh))
SetVehicleBoostActive(veh, 1)
for _, bones in pairs(p_flame_location) do
if GetEntityBoneIndexByName(veh, bones) ~= -1 then
if Fxs[bones] == nil then
RequestNamedPtfxAsset(ParticleDict)
while not HasNamedPtfxAssetLoaded(ParticleDict) do
Wait(0)
end
SetPtfxAssetNextCall(ParticleDict)
UseParticleFxAssetNextCall(ParticleDict)
Fxs[bones] = StartParticleFxLoopedOnEntityBone(ParticleFx, veh, 0.0, -0.02, 0.0, 0.0, 0.0,
0.0, GetEntityBoneIndexByName(veh, bones), ParticleSize, 0.0, 0.0, 0.0)
end
end
end
end
end
Wait(20)
end
end)
local NOSPFX = {}
RegisterNetEvent('qb-nitro:client:SyncFlames', function(netid, nosid)
local veh = NetToVeh(netid)
if veh ~= 0 then
local myid = GetPlayerServerId(PlayerId())
if NOSPFX[trim(GetVehicleNumberPlateText(veh))] == nil then
NOSPFX[trim(GetVehicleNumberPlateText(veh))] = {}
end
if myid ~= nosid then
for _, bones in pairs(p_flame_location) do
if NOSPFX[trim(GetVehicleNumberPlateText(veh))][bones] == nil then
NOSPFX[trim(GetVehicleNumberPlateText(veh))][bones] = {}
end
if GetEntityBoneIndexByName(veh, bones) ~= -1 then
if NOSPFX[trim(GetVehicleNumberPlateText(veh))][bones].pfx == nil then
RequestNamedPtfxAsset(ParticleDict)
while not HasNamedPtfxAssetLoaded(ParticleDict) do
Wait(0)
end
SetPtfxAssetNextCall(ParticleDict)
UseParticleFxAssetNextCall(ParticleDict)
NOSPFX[trim(GetVehicleNumberPlateText(veh))][bones].pfx = StartParticleFxLoopedOnEntityBone(
ParticleFx, veh, 0.0, -0.05, 0.0, 0.0, 0.0, 0.0, GetEntityBoneIndexByName(veh, bones),
ParticleSize, 0.0, 0.0, 0.0)
end
end
end
end
end
end)
RegisterNetEvent('qb-nitro:client:StopSync', function(plate)
if NOSPFX[plate] then
for k, v in pairs(NOSPFX[plate]) do
StopParticleFxLooped(v.pfx, 1)
NOSPFX[plate][k].pfx = nil
end
end
end)
RegisterNetEvent('qb-nitro:client:UpdateNitroLevel', function(Plate, level)
VehicleNitrous[Plate].level = level
TriggerServerEvent('qb-nitro:server:GetVehicleNos', level, Plate)
end)
RegisterNetEvent('qb-nitro:client:LoadNitrous', function(Plate)
VehicleNitrous[Plate] = {
hasnitro = true,
level = 100,
}
local CurrentVehicle = GetVehiclePedIsIn(PlayerPedId())
local CPlate = trim(GetVehicleNumberPlateText(CurrentVehicle))
if CPlate == Plate then
TriggerEvent('hud:client:UpdateNitrous', Plate, VehicleNitrous[Plate].level)
end
end)
RegisterNetEvent('qb-nitro:client:UnloadNitrous', function(Plate)
VehicleNitrous[Plate] = nil
local CurrentVehicle = GetVehiclePedIsIn(PlayerPedId())
local CPlate = trim(GetVehicleNumberPlateText(CurrentVehicle))
if CPlate == Plate then
NitrousActivated = false
TriggerEvent('hud:client:UpdateNitrous', Plate, 0)
end
end)

View File

@ -0,0 +1,12 @@
fx_version 'cerulean'
game 'gta5'
description 'QB-Nitro'
version '1.0.0'
client_script 'client/main.lua'
server_scripts {
'server/main.lua',
'@oxmysql/lib/MySQL.lua',
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1 @@
ALTER TABLE player_vehicles ADD COLUMN `nitrous` int(11) NOT NULL DEFAULT 0;

View File

@ -0,0 +1,100 @@
local QBCore = exports['qb-core']:GetCoreObject()
local VehicleNitrous = {}
local NitroVeh = {}
QBCore.Functions.CreateUseableItem("nitrous", function(source, item)
TriggerClientEvent('qb-nitro:client:ApplyNitrous', source)
end)
RegisterNetEvent('qb-nitro:server:LoadNitrous', function(Plate)
VehicleNitrous[Plate] = {
hasnitro = true,
level = 100,
}
TriggerClientEvent('qb-nitro:client:LoadNitrous', -1, Plate)
TriggerClientEvent('hud:client:UpdateNitrous', -1, Plate, VehicleNitrous[Plate].level)
TriggerEvent('qb-nitro:database:LoadNitro', Plate, 100)
end)
RegisterNetEvent('qb-nitro:server:SyncFlames', function(netId)
TriggerClientEvent('qb-nitro:client:SyncFlames', -1, netId, source)
end)
RegisterNetEvent('qb-nitro:server:AddEmptyNitrous', function()
local src = source
local Ply = QBCore.Functions.GetPlayer(src)
if not Ply then return end
Ply.Functions.RemoveItem('nitrous', 1)
Ply.Functions.AddItem('emptynitrous', 1)
end)
RegisterNetEvent('qb-nitro:server:UnloadNitrous', function(Plate)
VehicleNitrous[Plate] = nil
TriggerClientEvent('qb-nitro:client:UnloadNitrous', -1, Plate)
TriggerEvent('qb-nitro:database:UnloadNitro', Plate)
end)
RegisterNetEvent('qb-nitro:server:UpdateNitroLevel', function(Plate, level)
VehicleNitrous[Plate].level = level
TriggerClientEvent('qb-nitro:client:UpdateNitroLevel', -1, Plate, level)
TriggerEvent('qb-nitro:database:UpdateNitroLevel', Plate, level)
end)
RegisterNetEvent('qb-nitro:server:StopSync', function(plate)
TriggerClientEvent('qb-nitro:client:StopSync', -1, plate)
end)
QBCore.Functions.CreateCallback('qb-nitro:GetNosLoadedVehs', function(source, cb)
local result = MySQL.Sync.fetchAll('SELECT * FROM player_vehicles WHERE hasnitro = ?', {1})
if result[1] then
for k, v in pairs(result) do
if v["hasnitro"] == 1 then
VehicleNitrous[v["plate"]] = { hasnitro = v["hasnitro"], level = tonumber(v["noslevel"]), }
TriggerClientEvent('qb-nitro:client:LoadNitrous', -1, tostring(v["plate"]))
TriggerClientEvent('hud:client:UpdateNitrous', -1, result[k]["plate"], VehicleNitrous[result[k]["plate"]].level)
end
end
end
cb(VehicleNitrous)
end)
QBCore.Functions.CreateCallback('qb-nitro:GetNosLoaded', function(source, cb, plate)
local result = MySQL.Sync.fetchAll('SELECT * FROM player_vehicles WHERE plate = ?', {plate})
if result[1].hasnitro then
for k, v in pairs(result) do
if v["hasnitro"] == 1 then
VehicleNitrous[result[k]["plate"]] = { hasnitro = true, level = tonumber(result[k]["noslevel"]), }
TriggerClientEvent('qb-nitro:client:LoadNitrous', -1, tostring(result[k]["plate"]))
TriggerClientEvent('hud:client:UpdateNitrous', -1, result[k]["plate"], VehicleNitrous[result[k]["plate"]].level)
end
end
end
cb(VehicleNitrous)
end)
RegisterNetEvent('qb-nitro:database:LoadNitro', function(plate, level)
MySQL.Async.execute('UPDATE player_vehicles SET noslevel = ? WHERE plate = ?', {100, plate})
MySQL.Async.execute('UPDATE player_vehicles SET hasnitro = ? WHERE plate = ?', {1, plate})
end)
RegisterNetEvent('qb-nitro:database:UnloadNitro', function(plate)
MySQL.Async.execute('UPDATE player_vehicles SET noslevel = ?, hasnitro = ? WHERE plate = ?', {0, 0, plate})
end)
RegisterNetEvent('qb-nitro:database:UpdateNitroLevel', function(plate, level)
MySQL.Async.execute('UPDATE player_vehicles SET noslevel = ? WHERE plate = ?', {level, plate})
end)
RegisterNetEvent('qb-nitro:server:SyncPurge', function(netId, enabled)
for k, v in pairs(QBCore.Functions.GetPlayers()) do
local P = QBCore.Functions.GetPlayer(v)
TriggerClientEvent('qb-nitro:client:SyncPurge', P.PlayerData.source, netId, enabled)
end
end)
RegisterNetEvent('qb-nitro:server:SyncFlame', function(netId, scale)
for k, v in pairs(QBCore.Functions.GetPlayers()) do
local P = QBCore.Functions.GetPlayer(v)
TriggerClientEvent('qb-nitro:client:SyncFlame', P.PlayerData.source, netId, scale)
end
end)

Binary file not shown.

View File

@ -0,0 +1,17 @@
resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'
ui_page 'html/ui.html'
files {
'html/ui.html',
'html/pricedown.ttf',
'html/cursor.png',
'html/background.png',
'html/styles.css',
'html/scripts.js',
'html/debounce.min.js'
}
client_script 'client.lua'
server_script 'server.lua'

View File

@ -0,0 +1,179 @@
-- Settings
local guiEnabled = false
local hasOpened = false
local serverNotes = {}
local Controlkey = {["generalUse"] = {38,"E"},["generalUseSecondaryWorld"] = {47,"G"}}
function openGui()
SetPlayerControl(PlayerId(), 0, 0)
guiEnabled = true
SetNuiFocus(true)
Citizen.Trace("OPENING")
SendNUIMessage({openSection = "openNotepad"})
local inveh = IsPedSittingInAnyVehicle(PlayerPedId())
TriggerEvent("qb-notepad")
end
function openGuiRead(text)
SetPlayerControl(PlayerId(), 0, 0)
guiEnabled = true
SetNuiFocus(true)
Citizen.Trace("OPENING")
SendNUIMessage({openSection = "openNotepadRead", TextRead = text})
end
function loadAnimDict(dict)
while (not HasAnimDictLoaded(dict)) do
RequestAnimDict(dict)
Citizen.Wait(5)
end
end
function closeGui()
guiEnabled = false
ped = PlayerPedId();
ClearPedTasks(ped);
Citizen.Trace("CLOSING")
SetNuiFocus(false)
SendNUIMessage({openSection = "close"})
ClearPedSecondaryTask(PlayerPedId())
DetachEntity(prop, 1, 1)
DeleteObject(prop)
DetachEntity(secondaryprop, 1, 1)
DeleteObject(secondaryprop)
SetPlayerControl(PlayerId(), 1, 0)
end
RegisterNUICallback('close', function(data, cb)
closeGui()
cb('ok')
end)
RegisterNUICallback('drop', function(data, cb)
closeGui()
local coords = GetEntityCoords(PlayerPedId())
TriggerServerEvent("server:newNote",data.noteText,coords["x"],coords["y"],coords["z"])
end)
RegisterNetEvent('qb-notepad', function()
local player = PlayerPedId()
local ad = "missheistdockssetup1clipboard@base"
local prop_name = prop_name or 'prop_notepad_01'
local secondaryprop_name = secondaryprop_name or 'prop_pencil_01'
if ( DoesEntityExist( player ) and not IsEntityDead( player )) then
loadAnimDict( ad )
if ( IsEntityPlayingAnim( player, ad, "base", 3 ) ) then
TaskPlayAnim( player, ad, "exit", 8.0, 1.0, -1, 49, 0, 0, 0, 0 )
Citizen.Wait(100)
ClearPedSecondaryTask(PlayerPedId())
DetachEntity(prop, 1, 1)
DeleteObject(prop)
DetachEntity(secondaryprop, 1, 1)
DeleteObject(secondaryprop)
else
local x,y,z = table.unpack(GetEntityCoords(player))
prop = CreateObject(GetHashKey(prop_name), x, y, z+0.2, true, true, true)
secondaryprop = CreateObject(GetHashKey(secondaryprop_name), x, y, z+0.2, true, true, true)
AttachEntityToEntity(prop, player, GetPedBoneIndex(player, 18905), 0.1, 0.02, 0.05, 10.0, 0.0, 0.0, true, true, false, true, 1, true) -- lkrp_notepadpad
AttachEntityToEntity(secondaryprop, player, GetPedBoneIndex(player, 58866), 0.12, 0.0, 0.001, -150.0, 0.0, 0.0, true, true, false, true, 1, true) -- pencil
TaskPlayAnim( player, ad, "base", 8.0, 1.0, -1, 49, 0, 0, 0, 0 )
end
end
end)
function DrawText3Ds(x,y,z, text)
local onScreen,_x,_y=World3dToScreen2d(x,y,z)
local px,py,pz=table.unpack(GetGameplayCamCoords())
SetTextScale(0.35, 0.35)
SetTextFont(4)
SetTextProportional(1)
SetTextColour(255, 255, 255, 215)
SetTextEntry("STRING")
SetTextCentre(1)
AddTextComponentString(text)
DrawText(_x,_y)
local factor = (string.len(text)) / 370
DrawRect(_x,_y+0.0125, 0.015+ factor, 0.03, 41, 11, 41, 68)
end
Citizen.CreateThread(function()
while true do
Citizen.Wait(1)
if #serverNotes == 0 then
Citizen.Wait(1000)
else
local plyLoc = GetEntityCoords(PlayerPedId())
local closestNoteDistance = 900.0
local closestNoteId = 0
for i = 1, #serverNotes do
local distance = #(plyLoc - vector3( serverNotes[i]["x"],serverNotes[i]["y"],serverNotes[i]["z"]))
if distance < 10.0 then
DrawMarker(27, serverNotes[i]["x"],serverNotes[i]["y"],serverNotes[i]["z"]-0.8, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2, 0.2, 2.0, 255, 255,150, 75, 0, 0, 2, 0, 0, 0, 0)
end
if distance < closestNoteDistance then
closestNoteDistance = distance
closestNoteId = i
end
end
if closestNoteDistance > 100.0 then
Citizen.Wait(math.ceil(closestNoteDistance*10))
end
if serverNotes[closestNoteId] ~= nil then
local distance = #(plyLoc - vector3( serverNotes[closestNoteId]["x"],serverNotes[closestNoteId]["y"],serverNotes[closestNoteId]["z"]))
if distance < 2.0 then
DrawMarker(27, serverNotes[closestNoteId]["x"],serverNotes[closestNoteId]["y"],serverNotes[closestNoteId]["z"]-0.8, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.3, 0.3, 2.0, 255, 255, 155, 75, 0, 0, 2, 0, 0, 0, 0)
DrawText3Ds(serverNotes[closestNoteId]["x"],serverNotes[closestNoteId]["y"],serverNotes[closestNoteId]["z"]-0.4, "~g~"..Controlkey["generalUse"][2].."~s~ to read,~g~ "..Controlkey["generalUseSecondaryWorld"][2].."~s~ to destroy")
if IsControlJustReleased(0, Controlkey["generalUse"][1]) then
openGuiRead(serverNotes[closestNoteId]["text"])
end
if IsControlJustReleased(0, Controlkey["generalUseSecondaryWorld"][1]) then
TriggerServerEvent("server:destroyNote",closestNoteId)
end
end
else
if serverNotes[closestNoteId] ~= nil then
table.remove(serverNotes,closestNoteId)
end
end
end
end
end)
RegisterNetEvent('Notepad:close', function()
closeGui()
end)
RegisterNetEvent('client:updateNotes', function(serverNotesPassed)
serverNotes = serverNotesPassed
end)
RegisterNetEvent('client:updateNotesAdd', function(newNote)
serverNotes[#serverNotes+1] = newNote
end)
RegisterNetEvent('client:updateNotesRemove', function(id)
table.remove(serverNotes,id)
end)
RegisterNetEvent('Notepad:open', function()
local veh = GetVehiclePedIsUsing(PlayerPedId())
if GetPedInVehicleSeat(veh, -1) ~= PlayerPedId() then
openGui()
guiEnabled = true
end
end)
CreateThread(function()
Wait(200)
TriggerServerEvent("server:requestNotes")
end)

Binary file not shown.

After

Width:  |  Height:  |  Size: 707 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -0,0 +1,9 @@
/*
* jQuery throttle / debounce - v1.1 - 3/7/2010
* https://benalman.com/projects/jquery-throttle-debounce-plugin/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* https://benalman.com/about/license/
*/
(function(b,c){var $=b.jQuery||b.Cowboy||(b.Cowboy={}),a;$.throttle=a=function(e,f,j,i){var h,d=0;if(typeof f!=="boolean"){i=j;j=f;f=c}function g(){var o=this,m=+new Date()-d,n=arguments;function l(){d=+new Date();j.apply(o,n)}function k(){h=c}if(i&&!h){l()}h&&clearTimeout(h);if(i===c&&m>e){l()}else{if(f!==true){h=setTimeout(i?k:l,i===c?e-m:e)}}}if($.guid){g.guid=j.guid=j.guid||$.guid++}return g};$.debounce=function(d,e,f){return f===c?a(d,e,false):a(d,f,e!==false)}})(this);

View File

@ -0,0 +1,77 @@
$(document).ready(function(){
// Mouse Controls
var documentWidth = document.documentElement.clientWidth;
var documentHeight = document.documentElement.clientHeight;
var cursor = $('#cursor');
var cursorX = documentWidth / 2;
var cursorY = documentHeight / 2;
function UpdateCursorPos() {
$('#cursor').css('left', cursorX+2);
$('#cursor').css('top', cursorY+2);
}
var entityMap = {
'&': '&amp;',
'<': '&lt;',
'>': '&gt;',
'"': '&quot;',
"'": '&#39;',
'/': '&#x2F;',
'`': '&#x60;',
'=': '&#x3D;'
};
function escapeHtml (string) {
return String(string).replace(/[&<>"'`=\/]/g, function (s) {
return entityMap[s];
});
}
$(".btnDrop").click(function(){
$.post('https://qb-notepad/drop', JSON.stringify({ noteText: escapeHtml($("#notepadInfof").val()) }));
});
// Listen for NUI Events
window.addEventListener('message', function(event){
var item = event.data;
// Open sub-windows / partials
if(item.openSection == "openNotepadRead") {
$(".qb-notepad-container").fadeIn(100);
$("#Ticket-form-Jail").css("display", "none");
$("#Ticket-form-JailRead").fadeIn(100);
$("#cursor").css("display", "Block");
$("#notepadInfofRead").val(item.TextRead);
}
if(item.openSection == "openNotepad") {
$(".qb-notepad-container").fadeIn(100);
$("#Ticket-form-JailRead").css("display", "none");
$("#Ticket-form-Jail").fadeIn(100);
$("#cursor").css("display", "Block");
}
if(item.openSection == "close") {
$(".qb-notepad-container").fadeOut(100)
$("#cursor").css("display", "none");
}
});
$(document).mousemove(function(event) {
cursorX = event.pageX;
cursorY = event.pageY;
UpdateCursorPos();
});
// On 'Esc' call close method
document.onkeyup = function (data) {
if ( data.which == 27 ) {
$.post('https://qb-notepad/close', JSON.stringify({}));
}
};
});

View File

@ -0,0 +1,400 @@
html {
overflow: hidden;
}
#cursor {
position: absolute;
z-index: 99999999;
display: none;
}
h1,h2,h3,h4 {
margin: 0;
padding: 0;
}
.btn-1 {
background-color: #F27935;
}
.btn-1 .round {
background-color: #f59965;
}
.btn-2 {
background-color: #00AFD1;
}
.btn-2 .round {
background-color: #00c4eb;
}
.btn-3 {
background-color: #5A5B5E;
}
.btn-3 .round {
background-color: #737478;
}
a {
text-decoration: none;
-moz-border-radius: 30px;
-webkit-border-radius: 30px;
border-radius: 30px;
padding: 12px 53px 12px 23px;
color: #fff;
text-transform: uppercase;
font-family: sans-serif;
font-weight: bold;
position: relative;
-moz-transition: all 0.3s;
-o-transition: all 0.3s;
-webkit-transition: all 0.3s;
transition: all 0.3s;
display: inline-block;
}
a span {
position: relative;
z-index: 3;
}
a .round {
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
border-radius: 50%;
width: 38px;
height: 38px;
position: absolute;
right: 3px;
top: 3px;
-moz-transition: all 0.3s ease-out;
-o-transition: all 0.3s ease-out;
-webkit-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
z-index: 2;
}
a .round i {
position: absolute;
top: 50%;
margin-top: -6px;
left: 50%;
margin-left: -4px;
-moz-transition: all 0.3s;
-o-transition: all 0.3s;
-webkit-transition: all 0.3s;
transition: all 0.3s;
}
.txt {
font-size: 14px;
line-height: 1.45;
}
.btn-1 {
background-color: #F27935;
}
.btn-1 .round {
background-color: #f59965;
}
.btn-2 {
background-color: #00AFD1;
}
.btn-2 .round {
background-color: #00c4eb;
}
.btn-3 {
background-color: #5A5B5E;
}
.btn-3 .round {
background-color: #737478;
}
a {
text-decoration: none;
-moz-border-radius: 30px;
-webkit-border-radius: 30px;
border-radius: 30px;
padding: 12px 53px 12px 23px;
color: #fff;
text-transform: uppercase;
font-family: sans-serif;
font-weight: bold;
position: relative;
-moz-transition: all 0.3s;
-o-transition: all 0.3s;
-webkit-transition: all 0.3s;
transition: all 0.3s;
display: inline-block;
}
a span {
position: relative;
z-index: 3;
}
a .round {
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
border-radius: 50%;
width: 38px;
height: 38px;
position: absolute;
right: 3px;
top: 3px;
-moz-transition: all 0.3s ease-out;
-o-transition: all 0.3s ease-out;
-webkit-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
z-index: 2;
}
a .round i {
position: absolute;
top: 50%;
margin-top: -6px;
left: 50%;
margin-left: -4px;
-moz-transition: all 0.3s;
-o-transition: all 0.3s;
-webkit-transition: all 0.3s;
transition: all 0.3s;
}
.txt {
font-size: 14px;
line-height: 1.45;
}
.type-1 a:hover {
padding-left: 48px;
padding-right: 28px;
}
.type-1 a:hover .round {
width: calc(100% - 6px);
-moz-border-radius: 30px;
-webkit-border-radius: 30px;
border-radius: 30px;
}
.type-1 a:hover .round i {
left: 12%;
}
.type-2 a:hover .round {
background: none;
}
.type-2 a:hover .round i {
left: 70%;
}
.type-3 .round {
background: transparent;
}
.type-3 a {
position: relative;
overflow: hidden;
}
.type-3 a.btn-1:after {
background-color: #f59965;
}
.type-3 a.btn-2:after {
background-color: #00c4eb;
}
.type-3 a.btn-3:after {
background-color: #737478;
}
.type-3 a:after {
content: "";
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
border-radius: 50%;
width: 37px;
height: 38px;
position: absolute;
right: 3px;
top: 3px;
-moz-transition: all 0.3s ease-out;
-o-transition: all 0.3s ease-out;
-webkit-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
}
.type-3 a:hover:after {
right: 100%;
width: 50%;
}
.type-3 a:hover i {
margin-left: 4px;
}
.full-screen {
width: 100%;
height:100%;
display: flex;
align-items: center;
}
.qb-notepad-container {
margin-top:30%;
background-color:white;
width: 30%;
height: 50%;
border-radius-bottom: 10px;
opacity: 1;
margin-left: 60%;
overflow: hidden;
display: none;
z-index: 9999999;
padding-top:1%;
border-top:blue;
border-style:line;
}
.list li {
list-style: none;
border-bottom: 1px dotted #ccc;
text-indent: 25px;
height: 18px;
padding: 1px;
text-transform: capitalize;
}
.list {
color: #555;
font-size: 22px;
padding: 0 !important;
width: 100%;
font-family: 'Schoolbell', arial, serif;
border: 1px solid #dedede;
}
.list li:hover {
background-color: #f0f0f0;
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
-ms-transition: all 0.2s;
-o-transition: all 0.2s;
}
.lines {
border-left: 1px solid #ffaa9f;
border-right: 1px solid #ffaa9f;
width: 2px;
float: left;
height:100%;
margin-left: 33px;
}
.body {
width: 100%;
height: 60%;
padding-top: 1%;
display: none;
font-family: 'Schoolbell', arial, serif;
}
textarea {
width: 89%;
height:83%;
max-height:90%;
padding: 1% 1% 1% 1%;
font-size: 16px;
line-height:24px;
border: none;
border-radius: 4px;
box-sizing: border-box;
margin-left:5%;
opacity: 1;
margin-top:0.2%;
background:none;
border: 0 none #FFF;
overflow: hidden;
outline:none;
font-family: 'Schoolbell', arial, serif;
}
.form {
width: 100%;
margin-left: auto;
margin-right: auto;
}
#liwrap {
display:block;
width:96%;
margin-left:2%;
}
.notepadID {
display:block;
flex-grow: 0.4;
align-items: center;
text-align: left;
width: 35%;
height: 25%;
color: #515151;
opacity: 0.95;
font-size: 10px;
padding: 1% 1% 1% 1%;
margin-left:11%;
margin-top:5%;
text-decoration: none;
float:left;
overflow-y: auto;
overflow-x: hidden;
list-style-type: none;
border:1px dotted rgba(0, 0, 0, .1);
}
.notepadAmount {
border:1px dotted rgba(0, 0, 0, .1);
display:block;
flex-grow: 0.4;
align-items: center;
text-align: left;
width: 35%;
height: 25%;
color: #515151;
opacity: 0.95;
font-size: 10px;
padding: 1% 1% 1% 1%;
margin-left:4%;
margin-top:5%;
text-decoration: none;
float:left;
overflow-y: auto;
overflow-x: hidden;
list-style-type: none;
}
.notepadInfoRead {
display:block;
flex-grow: 0.4;
align-items: center;
text-align: left;
width: 100%;
height: 100%;
color: #515151;
opacity: 0.95;
font-size: 18px;
line-height:20px;
padding: 1% 1% 1% 1%;
margin-top:-90.5%;
text-decoration: none;
float:left;
overflow-y: auto;
overflow-x: hidden;
list-style-type: none;
}
.notepadInfo {
display:block;
flex-grow: 0.4;
align-items: center;
text-align: left;
width: 100%;
height: 100%;
color: #515151;
opacity: 0.95;
font-size: 18px;
line-height:20px;
padding: 1% 1% 1% 1%;
margin-top:-90.5%;
text-decoration: none;
float:left;
overflow-y: auto;
overflow-x: hidden;
list-style-type: none;
}

View File

@ -0,0 +1,80 @@
<head>
<script src="nui://game/ui/jquery.js" type="text/javascript"></script>
<script src="scripts.js" type="text/javascript"></script>
<script src="debounce.min.js" type="text/javascript"></script>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<link rel="stylesheet" href="styles.css" type="text/css">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
<link href='https://fonts.googleapis.com/css?family=Schoolbell&v1' rel='stylesheet' type='text/css'>
</head>
<div class="full-screen">
<div class="qb-notepad-container">
<img id="cursor" src="cursor.png">
<div class="lines">
</div>
<ul class="list">
</ul>
<ul class="list">
</ul>
<ul class="list">
</ul>
<ul class="list">
</ul>
<ul class="list">
</ul>
<ul class="list">
</ul>
<ul class="list">
</ul>
<ul class="list">
</ul>
<ul class="list">
</ul>
<ul class="list">
</ul>
<ul class="list">
</ul>
<ul class="list">
</ul>
<ul class="list">
</ul>
<ul class="list">
</ul>
<ul class="list">
</ul>
<ul class="list">
</ul>
<ul class="list">
</ul>
<ul class="list">
</ul>
<ul class="list">
</ul>
<ul class="list">
</ul>
<ul class="list">
</ul>
<form id="Ticket-form-Jail">
<div class="notepadInfo">
<textarea id="notepadInfof" placeholder="Notes..." class="sans" /></textarea>
<a href="" class="btn btn-1 btnDrop">
<span class="txt">Drop Note</span>
<span class="round"><i class="fa fa-chevron-right"></i></span>
</a>
</div>
</form>
<form id="Ticket-form-JailRead">
<div class="notepadInfoRead">
<textarea id="notepadInfofRead" placeholder="Notes..." class="sans" disabled="true" /></textarea>
</div>
</form>
</div>
</div>
</body>

View File

@ -0,0 +1,24 @@
local serverNotes = {}
RegisterServerEvent("server:destroyNote")
AddEventHandler("server:destroyNote", function(closestNoteId)
table.remove(serverNotes,closestNoteId)
TriggerClientEvent('client:updateNotesRemove', -1, closestNoteId)
end)
RegisterServerEvent("server:newNote")
AddEventHandler("server:newNote", function(text,x,y,z)
serverNotes[#serverNotes+1] = { text = text, x = x, y = y, z = z }
TriggerClientEvent('client:updateNotesAdd', -1, { text = text, x = x, y = y, z = z })
end)
RegisterServerEvent("server:requestNotes")
AddEventHandler("server:requestNotes", function()
local src = source
TriggerClientEvent('client:updateNotes', src, serverNotes)
end)
RegisterCommand('qb-notepad', function(source)
TriggerClientEvent('Notepad:open', source)
end)

View File

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

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,135 @@
--[[ ===================================================== ]]--
--[[ MH NPC Services Script by MaDHouSe ]]--
--[[ ===================================================== ]]--
Config = {}
Config.UseTarget = true -- Defalt false, if you want to use target for cellphones
Config.Debug = false -- Defalt false, debug in console (client/server)
Config.InteractDiustance = 2.5 -- Default 2.5, the distance when you can interact with the npc ped driver
Config.MinOnlineEMS = 1 -- Defalt 1, How many ems people have to be online, to iqnore the npc services.
Config.Cooldown = 350000 -- Defalt 25000, A cooldown, (5mins) this is so players can't spam it.
Config.AutoCallAmbulance = true -- Defalt true, if true, it calls the ambulance automatically for you.
Config.AutoCallTimer = 25000 -- Defalt 20000, A timer to call ambulance automatically after 20secs.
Config.ForceFirstperson = false -- Default false, it force firstperon when inside a job vehicle.
Config.MinDamageForFlatbed = 750 -- Defalt 750, a flatbed is comming if the vehicle damage is below this value.
Config.RadialMenuIcone = "star-of-life" -- Defalt "star-of-life", icon form the radial menu.
Config.PhoneModel = "prop_amb_phone" -- Default prop_amb_phone, hand phone, if you have a other phone model, you can use it here
Config.StuckTimerCheck = 15 -- Default 15, a stuck timer check.
Config.StuckResetTimer = 15 -- Default 15, reset stuck time.
Config.UseUnlimitHealth = true -- if true, all service peds and vehicles will have inlimit health.
Config.UseCallForOtherPlayers = false -- if false, players can't call the service for other players
Config.UseServicesForJobs = true -- if true, your are able to call a police service for your self (normal you can't do this)
Config.UsePoliceAssist = false -- if true, a police player can let a police ped drive the player to the HQ
Config.UseAutoJail = false -- Default false, if you dont have police you can set this true
Config.MinJailTime = 120 -- 2 min min jail time (Default: 120)
Config.MaxJailTime = 250 -- 5 min max jail time (Default: 350)
Config.JobPeds = {
['police'] = {models = {"mp_m_fibsec_01"}},
['ambulance'] = {models = {"s_m_m_doctor_01"}},
['mechanic'] = {models = {"S_M_M_TRUCKER_01"}},
['taxi'] = {models = {"a_m_y_stlat_01"}},
['limousine'] = {models = {"cs_solomon"}},
}
Config.Vehicles = { -- Job Vehicles
['police'] = {models = {"riot"}},
['ambulance'] = {models = {"ambulance"}},
['mechanic'] = {models = {"flatbed", "towtruck"}},-- dont change the order, you can change the model but keep it as it is.(flatbed/towtruck)
['taxi'] = {models = {"taxi"}},
['limousine'] = {models = {"stretch", "patriot2"}},
}
Config.CallAnimation = { -- Call Aminations
call = {dictionary = "cellphone@", animation = "cellphone_call_listen_base"},
jobcall = {dictionary = "random@arrests", animation = "generic_radio_enter"}
}
-- Cop Weapons
Config.Weapons = {"WEAPON_PISTOL", "WEAPON_PISTOL_MK2", "WEAPON_COMBATPISTOL", "WEAPON_APPISTOL", "WEAPON_STUNGUN"}
-- Job Service data.
Config.Service = {
['ambulance'] = {
name = "Ambulance", -- name of the company
job = "ambulance", -- the job name.
plate = "NPC-AMBU", -- vehicle plate.
color = 3, -- blip color
speed = 29.0, -- drive speed.
price = 500, -- cost..
spawnRadius = 250, -- spawn Radius around the player
spotRadius = 50, -- the radius a ped spots a player
driveStyle = 831, -- if you want to chang this go to: https://www.vespura.com/fivem/drivingstyle/ or try 524863 - 537133628 - 262447 - 262204
walkStyle = 786603, -- walk style (running)
passengerSeat = 1, -- -1 is the driver
home = vector3(351.8928, -541.3893, 28.7438), -- home location for the company (you may need to need to adjust this)
checkin = vector3(309.94, -582.68, 43.27), -- checkin for hospital (you may need to need to adjust this)
},
['police'] = {
name = "Police",
job = "police",
plate = "NPC-POLI",
color = 38,
speed = 29.0,
price = 0,
spawnRadius = 250,
spotRadius = 50,
driveStyle = 447,
walkStyle = 786603,
passengerSeat = 2, -- -1 is the driver
home = vector3(437.3315, -1022.2286, 28.6478), -- home location for the company (you may need to need to adjust this)
checkin = vector3(459.7083, -994.9054, 24.9149), -- checkin police hq jail (you may need to need to adjust this)
checkout = vector4(437.3625, -978.5160, 30.6896, 181.8552), -- checkout after jail
},
['mechanic'] = {
name = "Mechanic",
job = "mechanic",
plate = "NPC-MECH",
color = 81,
speed = 29.0,
price = 1000,
spawnRadius = 250,
spotRadius = 10,
driveStyle = 447, --525119, --524863,
walkStyle = 786603,
passengerSeat = 0, -- -1 is the driver
home = vector3(127.6150, -1133.2461, 28.5707), -- home location for the company (you may need to need to adjust this)
vehicleDrop = vector4(115.2420, -1138.1442, 28.6723, 336.7379), -- drop location for the player vehicle. (you may need to need to adjust this)
truck_offset = { -- for the vehicle position on the flatbed
x = -0.5, -- left/right
y = -5.0, -- front/back
z = 1.0, -- up/down
},
},
['taxi'] = {
name = "Taxi",
job = "taxi",
plate = "NPC-TAXI",
color = 46,
speed = 29.0,
price = 10,
spawnRadius = 250,
spotRadius = 15,
driveStyle = 447,
walkStyle = 786603,
passengerSeat = 2, -- -1 is the driver
home = vector3(915.7531, -163.6132, 74.6438), -- (you may need to need to adjust this)
},
['limousine'] = {
name = "limousine",
job = "limousine",
plate = "NPC-LIMO",
color = 25,
speed = 29.0,
price = 100,
spawnRadius = 250,
spotRadius = 15,
driveStyle = 447,
walkStyle = 786603,
passengerSeat = 1, -- -1 is the driver
home = vector3(915.7531, -163.6132, 74.6438), -- (you may need to need to adjust this)
}
}

View File

@ -0,0 +1,31 @@
--[[ ===================================================== ]]--
--[[ MH NPC Services Script by MaDHouSe ]]--
--[[ ===================================================== ]]--
fx_version 'cerulean'
game 'gta5'
version 'V1.0'
shared_scripts {
'@qb-core/shared/locale.lua',
'locales/en.lua', -- change en to your language
'config.lua',
}
client_scripts {
'client/main.lua',
}
server_scripts {
'@oxmysql/lib/MySQL.lua',
'server/main.lua',
}
dependencies {
'oxmysql',
'qb-core',
}
lua54 'yes'

View File

@ -0,0 +1,57 @@
--[[ ===================================================== ]]--
--[[ MH NPC Services Script by MaDHouSe ]]--
--[[ ===================================================== ]]--
local Translations = {
target = {
['use_cell_phone'] = "Brug telefon",
['get_in'] = "Stig ind",
},
notify = {
['only_when_badly_injured'] = "Du kan kun bruge dette, hvis du er alvorligt såret",
['to_much_ems_online'] = "Der er for mange EMS-spillere online.",
['cant_pay'] = "Du kan ikke betale beløbet på $%{price}, du har ikke nok penge.",
['cooldown'] = "r%{job}s cooldown aktiv g%{cooldownTime}s sekunder",
['call_company'] = "%{company} er blevet kaldt",
['jail_free_time'] = 'GRATIS OM: r%{freetime}s SEKUNDER',
['press_e_to_enter'] = "Tryk g[E]s om %{waitTime} sekunder eller forlader %{job}",
['you_are_calling'] = "Du ringer til %{job}",
['not_the_owner'] = 'Du ejer ikke dette køretøj!',
['left_vehicle'] = "Du forlod køretøjet",
['can_not_use_services'] = "Du kan ikke bruge disse tjenester, hvis der er en spiller i byen med dette job",
},
menu = {
['title'] = "Kald tjenester",
['select_company'] = "Vælg en service",
['select_player'] = "Vælg en spiller",
['for_your_self'] = "For dig selv",
},
error = {
['none_nearby'] = "Ingen i nærheden!",
['not_the_owner'] = 'Du ejer ikke dette køretøj!',
},
job = {
['police'] = {
['label'] = "NPC Politi",
},
['ambulance'] = {
['label'] = "NPC Ambulance",
},
['mechanic'] = {
['label'] = "NPC Mekaniker",
},
['taxi'] = {
['label'] = "NPC Taxa",
['missing_waypoint'] = "Du skal sætte et waypoint, før du kan kalde en taxa",
},
['limousine'] = {
['label'] = "NPC LIMO",
['missing_waypoint'] = "Du skal sætte et waypoint, før du kan kalde en limousine",
}
},
}
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true
})

View File

@ -0,0 +1,57 @@
--[[ ===================================================== ]]--
--[[ MH NPC Services Script by MaDHouSe ]]--
--[[ ===================================================== ]]--
local Translations = {
target = {
['use_cell_phone'] = "Gebruik telefoon",
['get_in'] = "Stap in",
},
notify = {
['only_when_badly_injured'] = "Je kunt dit alleen gebruiken als je zwaargewond bent",
['to_much_ems_online'] = "Er zijn teveel %{job} spelers online.",
['cant_pay'] = "Je kunt het bedrag van €%{price} niet betalen, je hebt te weinig geld.",
['cooldown'] = "~r~%{job}~s~ cooldown actief ~g~%{cooldownTime}~s~ seconden",
['call_company'] = "De %{company} is gebeld",
['jail_free_time'] = 'Vrij IN: ~r~%{freetime}~s~ SECONDES',
['press_e_to_enter'] = "Druk ~g~[E]~s~ binnen %{waitTime} seconde anders vertrek de %{job}",
['you_are_calling'] = "Je bent de %{job} aan het bellen",
['not_the_owner'] = 'Je bent geen eigenaar van dit voertuig!',
['left_vehicle'] = "Je bent uitgestapt",
['can_not_use_services'] = "Je kunt deze services niet gebruiken als er een speler in de stad is met deze job",
},
menu = {
['title'] = "Bel Services",
['select_company'] = "Selecteer een Services",
['select_player'] = "Selecteer een speler",
['for_your_self'] = "Voor je zelf",
},
error = {
['none_nearby'] = "Er is niemand in de buurt!",
['not_the_owner'] = 'Je bent niet de eigenaar van het voertuig!',
},
job = {
['police'] = {
['label'] = "NPC Politie",
},
['ambulance'] = {
['label'] = "NPC Ziekenwagen",
},
['mechanic'] = {
['label'] = "NPC Monteur",
},
['taxi'] = {
['label'] = "NPC Taxi",
['missing_waypoint'] = "Je moet een waypoint zetten voor je een taxi kunt bellen",
},
['limousine'] = {
['label'] = "NPC LIMO",
['missing_waypoint'] = "Je moet een waypoint zetten voor je een limousine kunt bellen",
}
},
}
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true
})

View File

@ -0,0 +1,83 @@
<p align="center">
<img width="140" src="https://icons.iconarchive.com/icons/iconarchive/red-orb-alphabet/128/Letter-M-icon.png" />
<h1 align="center">Hi 👋, I'm MaDHouSe</h1>
<h3 align="center">A passionate allround developer </h3>
</p>
<p align="center">
<a href="https://github.com/MaDHouSe79/qb-npcservices/issues">
<img src="https://img.shields.io/github/issues/MaDHouSe79/qb-npcservices"/>
</a>
<a href="https://github.com/MaDHouSe79/qb-npcservices/watchers">
<img src="https://img.shields.io/github/watchers/MaDHouSe79/qb-npcservices"/>
</a>
<a href="https://github.com/MaDHouSe79/qb-npcservices/network/members">
<img src="https://img.shields.io/github/forks/MaDHouSe79/qb-npcservices"/>
</a>
<a href="https://github.com/MaDHouSe79/qb-npcservices/stargazers">
<img src="https://img.shields.io/github/stars/MaDHouSe79/qb-npcservices?color=white"/>
</a>
<a href="https://github.com/MaDHouSe79/qb-npcservices/blob/main/LICENSE">
<img src="https://img.shields.io/github/license/MaDHouSe79/qb-npcservices?color=black"/>
</a>
</p>
<p align="center">
<img alig src="https://github-profile-trophy.vercel.app/?username=MaDHouSe79&margin-w=15&column=6" />
</p>
<p align="center">
<img alig src="https://raw.githubusercontent.com/kamranahmedse/driver.js/master/demo/images/split.png" />
</p>
# qb-npcservices (BETA)
### MH 6 in 1 NPC Services Script by MaDHouSe
- NPC Police - Transport you to police HQ jail, this with 2 agent peds with a riot vehicle.
- NPC Ambulance - Transport you to the hospital, this with 2 ambulance peds.
- NPC Mechanic - Repare your vehicle on location, this with 1 mechanic ped.
- NPC Towtruck - Transport your vehicle and your self, to the mechanic shop, this with 1 ped. (depending on vehicle damage)
- NPC Taxi - Take you where ever you want on the map.(just set a waypoint and call a taxi)
- NPC Limo - Take you where ever you want on the map in style .(just set a waypoint and call a limo)
<p align="center">
<img alig src="https://raw.githubusercontent.com/kamranahmedse/driver.js/master/demo/images/split.png" />
</p>
### Dont forget to edit the qb-smallresources/config.lua
- Go to resources/[qb]/qb-smallresources/config.lua look for (Config.BlacklistedVehs)
- Set vehicles in to false so it can spawn in.
<p align="center">
<img alig src="https://raw.githubusercontent.com/kamranahmedse/driver.js/master/demo/images/split.png" />
</p>
## How it works
- If you want to use the taxi, you need to add a waypoint first cause it will not show in the menu if you dont have a waypoint.
- If you want to use the mechanic or towtruck you need to sit in your vehicle when you call.
- If you want to use the ambulance, it calls automatic, but you can alse call for other players aswell.
- if you want to use the police, you can call at any point where you are.
<p align="center">
<img alig src="https://raw.githubusercontent.com/kamranahmedse/driver.js/master/demo/images/split.png" />
</p>
## NOTE Open Source, at least give me the credit for making this script.
- Don't act if you created this script, you can change stuff or use stuff, i don't care.
- But give me atleast the credits for making it, and give it for free to everyone.
- if you have paid for this script, you have been scammed, this script is free to everyone.
- not encrypted, not ip blocked.
<p align="center">
<img alig src="https://raw.githubusercontent.com/kamranahmedse/driver.js/master/demo/images/split.png" />
</p>
### 🐞 Any bugs, let my know. 👊😎
### 🙈 Youtube & Discord
- [Youtube](https://www.youtube.com/@MaDHouSe79)
- [Discord](https://discord.gg/cEMSeE9dgS)
# LICENSE
[GPL LICENSE](./LICENSE)<br />
&copy; [MaDHouSe79](https://www.youtube.com/@MaDHouSe79)

View File

@ -0,0 +1,153 @@
local QBCore = exports['qb-core']:GetCoreObject()
local passengers = {}
local function GetUsername(id)
return QBCore.Functions.GetPlayer(id).PlayerData.charinfo.firstname ..' '.. QBCore.Functions.GetPlayer(id).PlayerData.charinfo.lastname
end
local function comma_value(amount)
local formatted = tostring(amount)
while true do
formatted, k = string.gsub(formatted, '^(-?%d+)(%d%d%d)', '%1,%2')
if (k==0) then
break
end
end
return formatted
end
local function isEMSService(id)
local isAllowed = false
local Player = QBCore.Functions.GetPlayer(id)
if Player then
if Player.PlayerData.job.name == "police" or Player.PlayerData.job.name == "ambulance" or Player.PlayerData.job.name == "mechanic" or Player.PlayerData.job.name == "taxi" and Player.PlayerData.job.onduty then
isAllowed = true
end
end
return isAllowed
end
local function GetOnlinePlayers()
local sources = {}
for k, id in pairs(QBCore.Functions.GetPlayers()) do
local target = QBCore.Functions.GetPlayer(id)
if target then
sources[#sources + 1] = {
source = target.PlayerData.source,
fullname = target.PlayerData.charinfo.firstname.." "..target.PlayerData.charinfo.lastname
}
end
end
return sources
end
local function CanIPayTheBill(id, company, price)
local Player = QBCore.Functions.GetPlayer(id)
local topay = math.floor(price)
if Player then
if Player.PlayerData.money["cash"] >= topay then
return true
else
if Player.PlayerData.money["bank"] >= topay then
return true
end
end
end
return false
end
QBCore.Functions.CreateCallback('qb-npcservices:server:isEMSServices', function(source, cb)
local src = source
cb(isEMSService(src))
end)
QBCore.Functions.CreateCallback('qb-npcservices:server:emsOnline', function(source, cb, job)
local count = QBCore.Functions.GetDutyCount(job)
cb(count)
end)
QBCore.Functions.CreateCallback("qb-npcservices:server:GetOnlinePlayers", function(source, cb)
cb(GetOnlinePlayers())
end)
QBCore.Functions.CreateCallback("qb-npcservices:server:CanIPayTheBill", function(source, cb, company, price)
local src = source
cb(CanIPayTheBill(src, company, price))
end)
QBCore.Functions.CreateCallback('qb-npcservices:server:IsVehicleOwner', function(source, cb, plate)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
local citizenid = Player.PlayerData.citizenid
MySQL.Async.fetchAll('SELECT * FROM player_vehicles WHERE plate = ? AND citizenid = ?', {plate, citizenid}, function(result)
if result[1] ~= nil then
cb(true)
else
cb(false)
end
end)
end)
RegisterServerEvent('qb-npcservices:server:sendService', function(callData)
local src = source
local num = nil
if not id then id = src end
if src == callData.targetId then num = src else num = callData.targetId end
local caller = QBCore.Functions.GetPlayer(callData.callerId)
if isEMSService(callData.callerId) then
if callData.targetId == callData.callerId then
if Config.UseServicesForJobs then
TriggerClientEvent("qb-npcservices:client:sendService", callData.targetId, callData)
else
TriggerClientEvent('QBCore:Notify', num, Lang:t('notify.can_not_use_services_on_your_seld'), "error", 10000)
end
else
TriggerClientEvent("qb-npcservices:client:sendService", callData.targetId, callData)
end
else
local count = QBCore.Functions.GetDutyCount(callData.job)
if count >= Config.MinOnlineEMS then
TriggerClientEvent('QBCore:Notify', num, Lang:t('notify.can_not_use_services'), "error", 10000)
else
if CanIPayTheBill(num, callData.job, callData.price) then
TriggerClientEvent("qb-npcservices:client:sendService", num, callData)
else
TriggerClientEvent('QBCore:Notify', num, Lang:t('notify.cant_pay',{price = callData.price}), "error", 10000)
end
end
end
end)
RegisterServerEvent('qb-npcservices:server:getin', function(job, vehicle)
local src = source
passengers[#passengers + 1] = {company = job, vehicle = vehicle, passenger = src}
TriggerClientEvent('qb-npcservices:client:getinvehicle', src, vehicle)
end)
RegisterServerEvent('qb-npcservices:server:leavevehicle', function(vehicle)
for i = 0, #passengers do
if passengers[i] then
if passengers[i].passenger ~= nil then
local Player = QBCore.Functions.GetPlayer(passengers[i].passenger)
if Player then
local fullname = Player.PlayerData.charinfo.firstname ..' '.. Player.PlayerData.charinfo.lastname
TriggerClientEvent('qb-npcservices:client:leavevehicle', passengers[i].passenger)
TriggerClientEvent('QBCore:Notify', passengers[i].passenger, Lang:t('notify.left_vehicle'), "success")
passengers[i].passenger = nil
end
end
end
end
end)
RegisterServerEvent('qb-npcservices:server:pay', function(company, price)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if Player.PlayerData.money["cash"] >= price then
Player.Functions.RemoveMoney("cash", price, "pay-"..company)
else
if Player.PlayerData.money["bank"] >= price then
Player.Functions.RemoveMoney("bank", price, "pay-"..company)
end
end
end)

View File

@ -0,0 +1 @@
3