forked from Simnation/Main
ADD
This commit is contained in:
parent
d58e87474f
commit
a474caf290
17 changed files with 2643 additions and 0 deletions
674
resources/[jobs]/[crime]/lation_247robbery/LICENSE
Normal file
674
resources/[jobs]/[crime]/lation_247robbery/LICENSE
Normal 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>.
|
167
resources/[jobs]/[crime]/lation_247robbery/bridge/client.lua
Normal file
167
resources/[jobs]/[crime]/lation_247robbery/bridge/client.lua
Normal file
|
@ -0,0 +1,167 @@
|
|||
-- Initialize global variables to store framework & inventory
|
||||
Framework, Inventory = nil, nil
|
||||
|
||||
-- Initialize global player variables
|
||||
PlayerLoaded, PlayerData = nil, {}
|
||||
|
||||
-- Get framework
|
||||
local function InitializeFramework()
|
||||
if GetResourceState('es_extended') == 'started' then
|
||||
ESX = exports['es_extended']:getSharedObject()
|
||||
Framework = 'esx'
|
||||
|
||||
RegisterNetEvent('esx:playerLoaded', function(xPlayer)
|
||||
PlayerData = xPlayer
|
||||
PlayerLoaded = true
|
||||
TriggerEvent('lation_247robbery:onPlayerLoaded')
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx:onPlayerLogout', function()
|
||||
table.wipe(PlayerData)
|
||||
PlayerLoaded = false
|
||||
end)
|
||||
|
||||
AddEventHandler('onResourceStart', function(resourceName)
|
||||
if GetCurrentResourceName() ~= resourceName then return end
|
||||
PlayerData = GetPlayerData()
|
||||
PlayerLoaded = true
|
||||
TriggerEvent('lation_247robbery:onPlayerLoaded')
|
||||
end)
|
||||
|
||||
elseif GetResourceState('qbx_core') == 'started' then
|
||||
Framework = 'qbx'
|
||||
|
||||
AddEventHandler('QBCore:Client:OnPlayerLoaded', function()
|
||||
PlayerData = GetPlayerData()
|
||||
PlayerLoaded = true
|
||||
TriggerEvent('lation_247robbery:onPlayerLoaded')
|
||||
end)
|
||||
|
||||
RegisterNetEvent('qbx_core:client:playerLoggedOut', function()
|
||||
table.wipe(PlayerData)
|
||||
PlayerLoaded = false
|
||||
end)
|
||||
|
||||
AddEventHandler('onResourceStart', function(resourceName)
|
||||
if GetCurrentResourceName() ~= resourceName then return end
|
||||
PlayerData = GetPlayerData()
|
||||
PlayerLoaded = true
|
||||
TriggerEvent('lation_247robbery:onPlayerLoaded')
|
||||
end)
|
||||
elseif GetResourceState('qb-core') == 'started' then
|
||||
QBCore = exports['qb-core']:GetCoreObject()
|
||||
Framework = 'qb'
|
||||
|
||||
AddEventHandler('QBCore:Client:OnPlayerLoaded', function()
|
||||
PlayerData = GetPlayerData()
|
||||
PlayerLoaded = true
|
||||
TriggerEvent('lation_247robbery:onPlayerLoaded')
|
||||
end)
|
||||
|
||||
RegisterNetEvent('QBCore:Client:OnPlayerUnload', function()
|
||||
table.wipe(PlayerData)
|
||||
PlayerLoaded = false
|
||||
end)
|
||||
|
||||
AddEventHandler('onResourceStart', function(resourceName)
|
||||
if GetCurrentResourceName() ~= resourceName then return end
|
||||
PlayerData = GetPlayerData()
|
||||
PlayerLoaded = true
|
||||
TriggerEvent('lation_247robbery:onPlayerLoaded')
|
||||
end)
|
||||
elseif GetResourceState('ox_core') == 'started' then
|
||||
Ox = require '@ox_core.lib.init'
|
||||
Framework = 'ox'
|
||||
|
||||
AddEventHandler('ox:playerLoaded', function()
|
||||
PlayerData = GetPlayerData()
|
||||
PlayerLoaded = true
|
||||
TriggerEvent('lation_247robbery:onPlayerLoaded')
|
||||
end)
|
||||
|
||||
AddEventHandler('ox:playerLogout', function()
|
||||
table.wipe(PlayerData)
|
||||
PlayerLoaded = false
|
||||
end)
|
||||
|
||||
AddEventHandler('onResourceStart', function(resourceName)
|
||||
if GetCurrentResourceName() ~= resourceName then return end
|
||||
PlayerData = GetPlayerData()
|
||||
PlayerLoaded = true
|
||||
TriggerEvent('lation_247robbery:onPlayerLoaded')
|
||||
end)
|
||||
else
|
||||
-- Add custom framework here
|
||||
end
|
||||
end
|
||||
|
||||
-- Get inventory
|
||||
local function InitializeInventory()
|
||||
if GetResourceState('ox_inventory') == 'started' then
|
||||
Inventory = 'ox_inventory'
|
||||
elseif GetResourceState('qb-inventory') == 'started' then
|
||||
Inventory = 'qb-inventory'
|
||||
elseif GetResourceState('qs-inventory') == 'started' then
|
||||
Inventory = 'qs-inventory'
|
||||
elseif GetResourceState('ps-inventory') == 'started' then
|
||||
Inventory = 'ps-inventory'
|
||||
elseif GetResourceState('origen_inventory') == 'started' then
|
||||
Inventory = 'origen_inventory'
|
||||
elseif GetResourceState('codem-inventory') == 'started' then
|
||||
Inventory = 'codem-inventory'
|
||||
elseif GetResourceState('core_inventory') == 'started' then
|
||||
Inventory = 'core_inventory'
|
||||
else
|
||||
-- Add custom inventory here
|
||||
end
|
||||
end
|
||||
|
||||
-- Returns player data
|
||||
function GetPlayerData()
|
||||
if Framework == 'esx' then
|
||||
return ESX.GetPlayerData()
|
||||
elseif Framework == 'qb' then
|
||||
return QBCore.Functions.GetPlayerData()
|
||||
elseif Framework == 'qbx' then
|
||||
return exports.qbx_core:GetPlayerData()
|
||||
elseif Framework == 'ox' then
|
||||
return Ox.GetPlayer()
|
||||
else
|
||||
-- Add custom framework here
|
||||
end
|
||||
end
|
||||
|
||||
-- Returns boolean if player has specified amount of item
|
||||
--- @param item string
|
||||
--- @param amount number
|
||||
--- @return boolean
|
||||
function HasItem(item, amount)
|
||||
if not item or not amount then return false end
|
||||
if Inventory then
|
||||
if Inventory == 'ox_inventory' then
|
||||
return exports[Inventory]:Search('count', item) >= amount
|
||||
elseif Inventory == 'core_inventory' then
|
||||
return exports[Inventory]:hasItem(item, amount)
|
||||
else
|
||||
return exports[Inventory]:HasItem(item, amount)
|
||||
end
|
||||
else
|
||||
local player = GetPlayerData()
|
||||
if not player then return false end
|
||||
local inventory = Framework == 'esx' and player.inventory or player.items
|
||||
if not inventory then return false end
|
||||
for _, item_data in pairs(inventory) do
|
||||
if item_data and item_data.name == item then
|
||||
local count = item_data.amount or item_data.count or 0
|
||||
if count >= amount then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
-- Initialize defaults
|
||||
InitializeFramework()
|
||||
InitializeInventory()
|
264
resources/[jobs]/[crime]/lation_247robbery/bridge/server.lua
Normal file
264
resources/[jobs]/[crime]/lation_247robbery/bridge/server.lua
Normal file
|
@ -0,0 +1,264 @@
|
|||
-- Initialize global variables to store framework & inventory
|
||||
Framework, Inventory = nil, nil
|
||||
|
||||
-- Initialize config(s)
|
||||
local sh_config = require 'config.shared'
|
||||
|
||||
-- Get framework
|
||||
local function InitializeFramework()
|
||||
if GetResourceState('es_extended') == 'started' then
|
||||
ESX = exports['es_extended']:getSharedObject()
|
||||
Framework = 'esx'
|
||||
elseif GetResourceState('qbx_core') == 'started' then
|
||||
Framework = 'qbx'
|
||||
elseif GetResourceState('qb-core') == 'started' then
|
||||
QBCore = exports['qb-core']:GetCoreObject()
|
||||
Framework = 'qb'
|
||||
elseif GetResourceState('ox_core') == 'started' then
|
||||
Ox = require '@ox_core.lib.init'
|
||||
Framework = 'ox'
|
||||
else
|
||||
-- Add custom framework here
|
||||
end
|
||||
end
|
||||
|
||||
-- Get inventory
|
||||
local function InitializeInventory()
|
||||
if GetResourceState('ox_inventory') == 'started' then
|
||||
Inventory = 'ox_inventory'
|
||||
elseif GetResourceState('qb-inventory') == 'started' then
|
||||
Inventory = 'qb-inventory'
|
||||
elseif GetResourceState('qs-inventory') == 'started' then
|
||||
Inventory = 'qs-inventory'
|
||||
elseif GetResourceState('ps-inventory') == 'started' then
|
||||
Inventory = 'ps-inventory'
|
||||
elseif GetResourceState('origen_inventory') == 'started' then
|
||||
Inventory = 'origen_inventory'
|
||||
elseif GetResourceState('codem-inventory') == 'started' then
|
||||
Inventory = 'codem-inventory'
|
||||
elseif GetResourceState('core_inventory') == 'started' then
|
||||
Inventory = 'core_inventory'
|
||||
else
|
||||
-- Add custom inventory here
|
||||
end
|
||||
end
|
||||
|
||||
-- Get player from source
|
||||
--- @param source number Player ID
|
||||
function GetPlayer(source)
|
||||
if not source then return end
|
||||
if Framework == 'esx' then
|
||||
return ESX.GetPlayerFromId(source)
|
||||
elseif Framework == 'qb' then
|
||||
return QBCore.Functions.GetPlayer(source)
|
||||
elseif Framework == 'qbx' then
|
||||
return exports.qbx_core:GetPlayer(source)
|
||||
elseif Framework == 'ox' then
|
||||
return Ox.GetPlayer(source)
|
||||
else
|
||||
-- Add custom framework here
|
||||
end
|
||||
end
|
||||
|
||||
-- Function to get a player identifier by source
|
||||
--- @param source number Player ID
|
||||
function GetIdentifier(source)
|
||||
local player = GetPlayer(source)
|
||||
if not player then return end
|
||||
if Framework == 'esx' then
|
||||
return player.identifier
|
||||
elseif Framework == 'qb' or Framework == 'qbx' then
|
||||
return player.PlayerData.citizenid
|
||||
elseif Framework == 'ox' then
|
||||
return player.stateId
|
||||
else
|
||||
-- Add custom framework here
|
||||
end
|
||||
end
|
||||
|
||||
-- Function to get a player's name
|
||||
--- @param source number Player ID
|
||||
--- @return string
|
||||
function GetName(source)
|
||||
local player = GetPlayer(source)
|
||||
if not player then return 'Unknown' end
|
||||
if Framework == 'esx' then
|
||||
return player.getName()
|
||||
elseif Framework == 'qb' or Framework == 'qbx' then
|
||||
return player.PlayerData.charinfo.firstname.. ' ' ..player.PlayerData.charinfo.lastname
|
||||
elseif Framework == 'ox' then
|
||||
return player.get('firstName').. ' ' ..player.get('lastName')
|
||||
else
|
||||
-- Add custom framework here
|
||||
end
|
||||
return 'Unknown'
|
||||
end
|
||||
|
||||
-- Returns number of players with police job(s)
|
||||
--- @return number
|
||||
function GetPoliceCount()
|
||||
local count, jobs = 0, {}
|
||||
for _, job in pairs(sh_config.police.jobs) do
|
||||
jobs[job] = true
|
||||
end
|
||||
if Framework == 'esx' then
|
||||
for _, player in pairs(ESX.GetExtendedPlayers()) do
|
||||
if jobs[player.getJob().name] then
|
||||
count += 1
|
||||
end
|
||||
end
|
||||
elseif Framework == 'qb' then
|
||||
for _, playerId in pairs(QBCore.Functions.GetPlayers()) do
|
||||
local player = QBCore.Functions.GetPlayer(playerId)
|
||||
if jobs[player.PlayerData.job.name] and player.PlayerData.job.onduty then
|
||||
count += 1
|
||||
end
|
||||
end
|
||||
elseif Framework == 'qbx' then
|
||||
for job, _ in pairs(jobs) do
|
||||
count += exports.qbx_core:GetDutyCountJob(job)
|
||||
end
|
||||
elseif Framework == 'ox' then
|
||||
for _, player in pairs(Ox.GetPlayers()) do
|
||||
if jobs[player.getGroupByType('job')] then
|
||||
count += 1
|
||||
end
|
||||
end
|
||||
else
|
||||
-- Add custom framework here
|
||||
end
|
||||
return count
|
||||
end
|
||||
|
||||
-- Returns number of specified item in players inventory
|
||||
--- @param source number Player ID
|
||||
--- @param item string Item to search
|
||||
--- @return number
|
||||
function GetItemCount(source, item)
|
||||
if not source or not item then return 0 end
|
||||
local player = GetPlayer(source)
|
||||
if not player then return 0 end
|
||||
if Inventory then
|
||||
if Inventory == 'ox_inventory' then
|
||||
return exports[Inventory]:Search(source, 'count', item) or 0
|
||||
elseif Inventory == 'core_inventory' then
|
||||
return exports[Inventory]:getItemCount(source, item)
|
||||
else
|
||||
local itemData = exports[Inventory]:GetItemByName(source, item)
|
||||
if not itemData then return 0 end
|
||||
return itemData.amount or itemData.count or 0
|
||||
end
|
||||
else
|
||||
if Framework == 'esx' then
|
||||
local itemData = player.getInventoryItem(item)
|
||||
if not itemData then return 0 end
|
||||
return itemData.count or itemData.amount or 0
|
||||
elseif Framework == 'qb' then
|
||||
local itemData = player.Functions.GetItemByName(item)
|
||||
if not itemData then return 0 end
|
||||
return itemData.amount or itemData.count or 0
|
||||
else
|
||||
-- Add custom framework here
|
||||
end
|
||||
end
|
||||
return 0
|
||||
end
|
||||
|
||||
-- Returns correct framework money type if needed
|
||||
--- @param type string Money type
|
||||
--- @return string
|
||||
local function ConvertMoneyType(type)
|
||||
if type == 'money' and (Framework == 'qb' or Framework == 'qbx') then
|
||||
type = 'cash'
|
||||
elseif type == 'cash' and (Framework == 'esx' or Framework == 'ox') then
|
||||
type = 'money'
|
||||
else
|
||||
-- Add custom framework here
|
||||
end
|
||||
return type
|
||||
end
|
||||
|
||||
-- Add money to players account
|
||||
--- @param source number Player ID
|
||||
--- @param type string Account to add to
|
||||
--- @param amount number Amount to add
|
||||
function AddMoney(source, type, amount)
|
||||
local player = GetPlayer(source)
|
||||
if not player then return end
|
||||
if Framework == 'esx' then
|
||||
player.addAccountMoney(ConvertMoneyType(type), amount)
|
||||
elseif Framework == 'qb' or Framework == 'qbx' then
|
||||
player.Functions.AddMoney(ConvertMoneyType(type), amount)
|
||||
elseif Framework == 'ox' then
|
||||
if type == 'cash' or type == 'money' then
|
||||
exports.ox_inventory:AddItem(source, ConvertMoneyType(type), amount)
|
||||
else
|
||||
local accountId = Ox.GetCharacterAccount(source).id
|
||||
Ox.DepositMoney(source, accountId, amount)
|
||||
end
|
||||
else
|
||||
-- Add custom framework here
|
||||
end
|
||||
end
|
||||
|
||||
-- Adds an item to players inventory
|
||||
--- @param source number Player ID
|
||||
--- @param item string Item to add
|
||||
--- @param count number Quantity to add
|
||||
--- @param metadata any|table Optional metadata
|
||||
function AddItem(source, item, count, metadata)
|
||||
if count <= 0 then return end
|
||||
local player = GetPlayer(source)
|
||||
if not player then return end
|
||||
if Inventory then
|
||||
if Inventory == 'ox_inventory' then
|
||||
exports[Inventory]:AddItem(source, item, count, metadata)
|
||||
elseif Inventory == 'core_inventory' then
|
||||
exports[Inventory]:addItem(source, item, count, metadata)
|
||||
else
|
||||
exports[Inventory]:AddItem(source, item, count, nil, metadata)
|
||||
if Framework == 'qb' then
|
||||
TriggerClientEvent(Inventory.. ':client:ItemBox', source, QBCore.Shared.Items[item], 'add')
|
||||
end
|
||||
end
|
||||
else
|
||||
if Framework == 'esx' then
|
||||
player.addInventoryItem(item, count)
|
||||
elseif Framework == 'qb' then
|
||||
player.Functions.AddItem(item, count, nil, metadata)
|
||||
else
|
||||
-- Add custom framework here
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Removes an item from players inventory
|
||||
--- @param source number Player ID
|
||||
--- @param item string Item to remove
|
||||
--- @param count number Quantity to remove
|
||||
function RemoveItem(source, item, count)
|
||||
local player = GetPlayer(source)
|
||||
if not player then return end
|
||||
if Inventory then
|
||||
if Inventory == 'core_inventory' then
|
||||
exports[Inventory]:removeItem(source, item, count)
|
||||
else
|
||||
exports[Inventory]:RemoveItem(source, item, count)
|
||||
if Framework == 'qb' then
|
||||
TriggerClientEvent(Inventory.. ':client:ItemBox', source, QBCore.Shared.Items[item], 'remove')
|
||||
end
|
||||
end
|
||||
else
|
||||
if Framework == 'esx' then
|
||||
player.removeInventoryItem(item, count)
|
||||
elseif Framework == 'qb' then
|
||||
player.Functions.RemoveItem(item, count)
|
||||
else
|
||||
-- Add custom framework here
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Initialize defaults
|
||||
InitializeFramework()
|
||||
InitializeInventory()
|
245
resources/[jobs]/[crime]/lation_247robbery/client/functions.lua
Normal file
245
resources/[jobs]/[crime]/lation_247robbery/client/functions.lua
Normal file
|
@ -0,0 +1,245 @@
|
|||
-- Initialize config(s)
|
||||
local sh_config = require 'config.shared'
|
||||
|
||||
-- Display a notification
|
||||
--- @param message string
|
||||
--- @param type string
|
||||
function ShowNotification(message, type)
|
||||
if sh_config.setup.notify == 'ox_lib' then
|
||||
lib.notify({ description = message, type = type, position = 'top', icon = 'fas fa-store' })
|
||||
elseif sh_config.setup.notify == 'esx' then
|
||||
ESX.ShowNotification(message)
|
||||
elseif sh_config.setup.notify == 'qb' then
|
||||
QBCore.Functions.Notify(message, type)
|
||||
elseif sh_config.setup.notify == 'okok' then
|
||||
exports['okokNotify']:Alert('Convenience Store', message, 5000, type, false)
|
||||
elseif sh_config.setup.notify == 'sd-notify' then
|
||||
exports['sd-notify']:Notify('Convenience Store', message, type)
|
||||
elseif sh_config.setup.notify == 'wasabi_notify' then
|
||||
exports.wasabi_notify:notify('Convenience Store', message, 5000, type, false, 'fas fa-store')
|
||||
elseif sh_config.setup.notify == 'custom' then
|
||||
-- Add custom notification export/event here
|
||||
end
|
||||
end
|
||||
|
||||
-- Display a notification from server
|
||||
--- @param message string
|
||||
--- @param type string
|
||||
RegisterNetEvent('lation_247robbery:Notify', function(message, type)
|
||||
ShowNotification(message, type)
|
||||
end)
|
||||
|
||||
-- Display a minigame
|
||||
--- @param data table
|
||||
function Minigame(data)
|
||||
if lib.skillCheck(data.difficulty, data.inputs) then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-- Display a progress bar
|
||||
--- @param data table
|
||||
function ProgressBar(data)
|
||||
if sh_config.setup.progress == 'ox_lib' then
|
||||
-- Want to use ox_lib's progress circle instead of bar?
|
||||
-- Change "progressBar" to "progressCircle" below & done!
|
||||
if lib.progressBar({
|
||||
label = data.label,
|
||||
duration = data.duration,
|
||||
position = data.position or 'bottom',
|
||||
useWhileDead = data.useWhileDead,
|
||||
canCancel = data.canCancel,
|
||||
disable = data.disable,
|
||||
anim = {
|
||||
dict = data.anim.dict or nil,
|
||||
clip = data.anim.clip or nil,
|
||||
flag = data.anim.flag or nil
|
||||
},
|
||||
prop = {
|
||||
model = data.prop.model or nil,
|
||||
bone = data.prop.bone or nil,
|
||||
pos = data.prop.pos or nil,
|
||||
rot = data.prop.rot or nil
|
||||
}
|
||||
}) then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
elseif sh_config.setup.progress == 'qbcore' then
|
||||
local p = promise.new()
|
||||
QBCore.Functions.Progressbar(data.label, data.label, data.duration, data.useWhileDead, data.canCancel, {
|
||||
disableMovement = data.disable.move,
|
||||
disableCarMovement = data.disable.car,
|
||||
disableMouse = false,
|
||||
disableCombat = data.disable.combat
|
||||
}, {
|
||||
animDict = data.anim.dict or nil,
|
||||
anim = data.anim.clip or nil,
|
||||
flags = data.anim.flag or nil
|
||||
}, {
|
||||
model = data.prop.model or nil,
|
||||
bone = data.prop.bone or nil,
|
||||
coords = data.prop.pos or nil,
|
||||
rotation = data.prop.rot or nil
|
||||
}, {},
|
||||
function()
|
||||
p:resolve(true)
|
||||
end,
|
||||
function()
|
||||
p:resolve(false)
|
||||
end)
|
||||
return Citizen.Await(p)
|
||||
else
|
||||
-- Add 'custom' progress bar here
|
||||
end
|
||||
end
|
||||
|
||||
-- Send police dispatch message
|
||||
--- @param data table data.coords, data.street
|
||||
function PoliceDispatch(data)
|
||||
if not data then print('^1[ERROR]: Failed to retrieve dispatch data, cannot proceed^0') return end
|
||||
if sh_config.police.dispatch == 'cd_dispatch' then
|
||||
local playerData = exports['cd_dispatch']:GetPlayerInfo()
|
||||
if not playerData then
|
||||
print('^1[ERROR]: cd_dispatch failed to return playerData, cannot proceed^0')
|
||||
return
|
||||
end
|
||||
TriggerServerEvent('cd_dispatch:AddNotification', {
|
||||
job_table = sh_config.police.jobs,
|
||||
coords = playerData.coords,
|
||||
title = '10-88 - Store Robbery',
|
||||
message = 'An alarm has been triggered at 24/7 on ' ..playerData.street,
|
||||
flash = 0,
|
||||
unique_id = playerData.unique_id,
|
||||
sound = 1,
|
||||
blip = {
|
||||
sprite = 52,
|
||||
scale = 1.0,
|
||||
colour = 1,
|
||||
flashes = false,
|
||||
text = '10-88 - Store Robbery',
|
||||
time = 5,
|
||||
radius = 0,
|
||||
}
|
||||
})
|
||||
elseif sh_config.police.dispatch == 'ps-dispatch' then
|
||||
local alert = {
|
||||
coords = data.coords,
|
||||
message = 'An alarm has been triggered at 24/7 on ' ..data.street,
|
||||
dispatchCode = '10-88',
|
||||
description = 'Store Robbery',
|
||||
radius = 0,
|
||||
sprite = 52,
|
||||
color = 1,
|
||||
scale = 1.0,
|
||||
length = 3
|
||||
}
|
||||
exports["ps-dispatch"]:CustomAlert(alert)
|
||||
elseif sh_config.police.dispatch == 'qs-dispatch' then
|
||||
local playerData = exports['qs-dispatch']:GetPlayerInfo()
|
||||
if not playerData then
|
||||
print('^1[ERROR]: qs-dispatch failed to return playerData, cannot proceed^0')
|
||||
return
|
||||
end
|
||||
exports['qs-dispatch']:getSSURL(function(image)
|
||||
TriggerServerEvent('qs-dispatch:server:CreateDispatchCall', {
|
||||
job = sh_config.police.jobs,
|
||||
callLocation = playerData.coords,
|
||||
callCode = { code = '10-88', snippet = 'Store Robbery' },
|
||||
message = 'An alarm has been triggered at 24/7 on ' ..playerData.street_1,
|
||||
flashes = false,
|
||||
image = image or nil,
|
||||
blip = {
|
||||
sprite = 52,
|
||||
scale = 1.0,
|
||||
colour = 1,
|
||||
flashes = false,
|
||||
text = '10-88 - Store Robbery',
|
||||
time = (30 * 1000),
|
||||
}
|
||||
})
|
||||
end)
|
||||
elseif sh_config.police.dispatch == 'core_dispatch' then
|
||||
local gender = IsPedMale(cache.ped) and 'male' or 'female'
|
||||
TriggerServerEvent('core_dispatch:addCall', '10-88', 'Potential Store Robbery',
|
||||
{{icon = 'fa-venus-mars', info = gender}},
|
||||
{data.coords.x, data.coords.y, data.coords.z},
|
||||
'police', 30000, 52, 1, false)
|
||||
elseif sh_config.police.dispatch == 'rcore_dispatch' then
|
||||
local playerData = exports['rcore_dispatch']:GetPlayerData()
|
||||
if not playerData then
|
||||
print('^1[ERROR]: rcore_dispatch failed to return playerData, cannot proceed^0')
|
||||
return
|
||||
end
|
||||
local alert = {
|
||||
code = '10-88 - Store Robbery',
|
||||
default_priority = 'low',
|
||||
coords = playerData.coords,
|
||||
job = sh_config.police.jobs,
|
||||
text = 'An alarm has been triggered at 24/7 on ' ..playerData.street_1,
|
||||
type = 'alerts',
|
||||
blip_time = 30,
|
||||
blip = {
|
||||
sprite = 52,
|
||||
colour = 1,
|
||||
scale = 1.0,
|
||||
text = '10-88 - Store Robbery',
|
||||
flashes = false,
|
||||
radius = 0,
|
||||
}
|
||||
}
|
||||
TriggerServerEvent('rcore_dispatch:server:sendAlert', alert)
|
||||
elseif sh_config.police.dispatch == 'aty_dispatch' then
|
||||
TriggerEvent('aty_dispatch:SendDispatch', 'Potential Store Robbery', '10-88', 52, sh_config.police.jobs)
|
||||
elseif sh_config.police.dispatch == 'op-dispatch' then
|
||||
local job = 'police'
|
||||
local text = 'An alarm has been triggered at 24/7 on ' ..data.street
|
||||
local coords = data.coords
|
||||
local id = cache.serverId
|
||||
local title = '10-88 - Store Robbery'
|
||||
local panic = false
|
||||
TriggerServerEvent('Opto_dispatch:Server:SendAlert', job, title, text, coords, panic, id)
|
||||
elseif sh_config.police.dispatch == 'origen_police' then
|
||||
local alert = {
|
||||
coords = data.coords,
|
||||
title = '10-88 - Store Robbery',
|
||||
type = 'GENERAL',
|
||||
message = 'An alarm has been triggered at 24/7 on ' ..data.street,
|
||||
job = 'police',
|
||||
}
|
||||
TriggerServerEvent("SendAlert:police", alert)
|
||||
elseif sh_config.police.dispatch == 'emergencydispatch' then
|
||||
TriggerServerEvent('emergencydispatch:emergencycall:new', 'police', '10-88 | Potential Store Robbery', data.coords, true)
|
||||
elseif sh_config.police.dispatch == 'custom' then
|
||||
-- Add your custom dispatch system here
|
||||
else
|
||||
print('^1[ERROR]: No dispatch system was detected - please visit config/shared.lua "police" section^0')
|
||||
end
|
||||
end
|
||||
|
||||
-- Add circle target zones
|
||||
--- @param data table
|
||||
function AddCircleZone(data)
|
||||
if sh_config.setup.interact == 'ox_target' then
|
||||
exports.ox_target:addSphereZone(data)
|
||||
elseif sh_config.setup.interact == 'qb-target' then
|
||||
exports['qb-target']:AddCircleZone(data.name, data.coords, data.radius, {
|
||||
name = data.name,
|
||||
debugPoly = sh_config.setup.debug}, {
|
||||
options = data.options,
|
||||
distance = 2,
|
||||
})
|
||||
elseif sh_config.setup.interact == 'interact' then
|
||||
exports.interact:AddInteraction({
|
||||
coords = data.coords,
|
||||
interactDst = 2.0,
|
||||
id = data.name,
|
||||
options = data.options
|
||||
})
|
||||
elseif sh_config.setup.interact == 'custom' then
|
||||
-- Add support for a custom target system here
|
||||
else
|
||||
print('^1[ERROR]: No interaction system was detected - please visit config/shared "setup" section^0')
|
||||
end
|
||||
end
|
290
resources/[jobs]/[crime]/lation_247robbery/client/main.lua
Normal file
290
resources/[jobs]/[crime]/lation_247robbery/client/main.lua
Normal file
|
@ -0,0 +1,290 @@
|
|||
-- Initialize config(s)
|
||||
local sh_config = require 'config.shared'
|
||||
local cl_config = require 'config.client'
|
||||
local icons = require 'config.icons'
|
||||
|
||||
-- Initialize variables to track active locations
|
||||
local activeRegister, activeComputer, activeSafe = false, false, false
|
||||
|
||||
-- Initialize variables to store code & pin
|
||||
local safePin
|
||||
|
||||
-- Initialize variables to track failed attempts
|
||||
local wrongPIN, failedHack = 0, 0
|
||||
|
||||
-- Initialize table to build questionnaire if applicable
|
||||
local questionData = {}
|
||||
|
||||
-- Build the input dialog for questionnaire if applicable
|
||||
if sh_config.computers.questionnaire then
|
||||
for _, question in ipairs(sh_config.questionnaire.questions) do
|
||||
questionData[#questionData + 1] = {
|
||||
type = question.type,
|
||||
label = question.label,
|
||||
description = question.description,
|
||||
icon = question.icon,
|
||||
required = question.required
|
||||
}
|
||||
if question.type == 'select' then
|
||||
questionData[#questionData].options = question.options
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Used to check if the answers submitted are correct
|
||||
--- @param answers table
|
||||
local function AreAnswersCorrect(answers)
|
||||
for question, answer in ipairs(sh_config.questionnaire.answers) do
|
||||
local submitted_answer = answers[question]
|
||||
if sh_config.questionnaire.questions[question].type == 'select' then
|
||||
if tonumber(submitted_answer) ~= answer then
|
||||
return false
|
||||
end
|
||||
else
|
||||
if string.lower(submitted_answer) ~= string.lower(answer) then
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
-- Function to start the initial robbery process
|
||||
local function InitiateRegisterRobbery()
|
||||
local canStart = lib.callback.await('lation_247robbery:StartRobbery', false)
|
||||
if not canStart then activeRegister = false return end
|
||||
local dict, anim = cl_config.anims.lockpick.dict, cl_config.anims.lockpick.clip
|
||||
lib.requestAnimDict(dict)
|
||||
while not HasAnimDictLoaded(dict) do Wait(0) end
|
||||
TaskPlayAnim(cache.ped, dict, anim, 8.0, 8.0, -1, 51, 1.0, false, false, false)
|
||||
local skillcheck = Minigame(sh_config.registers.minigame)
|
||||
ClearPedTasks(cache.ped)
|
||||
if not skillcheck then
|
||||
TriggerServerEvent('lation_247robbery:DoesLockpickBreak')
|
||||
activeRegister = false
|
||||
return
|
||||
end
|
||||
local coords = GetEntityCoords(cache.ped)
|
||||
local data = {
|
||||
coords = coords,
|
||||
street = GetStreetNameFromHashKey(GetStreetNameAtCoord(coords.x, coords.y, coords.z))
|
||||
}
|
||||
PoliceDispatch(data)
|
||||
if ProgressBar(cl_config.anims.register) then
|
||||
local codeChance = math.random(100)
|
||||
if codeChance <= sh_config.registers.noteChance then
|
||||
local generatedCode = math.random(1111, 9999)
|
||||
if safePin then safePin = nil end
|
||||
safePin = generatedCode
|
||||
local note = lib.alertDialog({
|
||||
header = locale('alerts.note.header'),
|
||||
content = locale('alerts.note.content', safePin),
|
||||
centered = true,
|
||||
cancel = false,
|
||||
})
|
||||
if note == 'confirm' then
|
||||
activeSafe = true
|
||||
TriggerServerEvent('lation_247robbery:CompleteRegisterRobbery')
|
||||
end
|
||||
else
|
||||
activeComputer = true
|
||||
TriggerServerEvent('lation_247robbery:CompleteRegisterRobbery')
|
||||
end
|
||||
else
|
||||
activeRegister = false
|
||||
ShowNotification(locale('notify.cancel-rob'), 'error')
|
||||
end
|
||||
end
|
||||
|
||||
-- Function to handle hacking the computer if required
|
||||
local function InitiateComputerHack()
|
||||
activeComputer = false -- Deactive target
|
||||
if failedHack >= sh_config.computers.maxAttempts then
|
||||
activeRegister = false
|
||||
activeComputer = false
|
||||
failedHack = 0
|
||||
ShowNotification(locale('notify.failed-limit'), 'error')
|
||||
TriggerServerEvent('lation_247robbery:FailedRobbery')
|
||||
return
|
||||
end
|
||||
local dict, anim = cl_config.anims.hackPC.dict, cl_config.anims.hackPC.clip
|
||||
lib.requestAnimDict(dict)
|
||||
while not HasAnimDictLoaded(dict) do Wait(0) end
|
||||
TaskPlayAnim(cache.ped, dict, anim, 8.0, 8.0, -1, 1, 1, false, false, false)
|
||||
if sh_config.computers.questionnaire then
|
||||
local questions = lib.inputDialog(locale('inputs.questions.header'), questionData)
|
||||
if not questions then
|
||||
activeComputer = true
|
||||
ClearPedTasks(cache.ped)
|
||||
return
|
||||
end
|
||||
if AreAnswersCorrect(questions) then
|
||||
failedHack = 0
|
||||
ClearPedTasks(cache.ped)
|
||||
local generatedCode = math.random(1111, 9999)
|
||||
if safePin then safePin = nil end
|
||||
safePin = generatedCode
|
||||
lib.alertDialog({
|
||||
header = locale('alerts.hack.header'),
|
||||
content = locale('alerts.hack.content', safePin),
|
||||
centered = true,
|
||||
cancel = false
|
||||
})
|
||||
activeSafe = true
|
||||
else
|
||||
ClearPedTasks(cache.ped)
|
||||
activeComputer = true
|
||||
failedHack = failedHack + 1
|
||||
ShowNotification(locale('notify.failed-hack'), 'error')
|
||||
end
|
||||
else
|
||||
local skillcheck = Minigame(sh_config.computers.minigame)
|
||||
if not skillcheck then
|
||||
ClearPedTasks(cache.ped)
|
||||
activeComputer = true
|
||||
failedHack = failedHack + 1
|
||||
ShowNotification(locale('notify.failed-hack'), 'error')
|
||||
return
|
||||
end
|
||||
failedHack = 0
|
||||
ClearPedTasks(cache.ped)
|
||||
local generatedCode = math.random(1111, 9999)
|
||||
if safePin then safePin = nil end
|
||||
safePin = generatedCode
|
||||
lib.alertDialog({
|
||||
header = locale('alerts.hack.header'),
|
||||
content = locale('alerts.hack.content', safePin),
|
||||
centered = true,
|
||||
cancel = false
|
||||
})
|
||||
activeSafe = true
|
||||
end
|
||||
end
|
||||
|
||||
-- Function to handle the safe robbery
|
||||
local function InitiateSafeRobbery()
|
||||
activeSafe = false
|
||||
if wrongPIN >= sh_config.safes.maxAttempts then
|
||||
activeRegister = false
|
||||
activeSafe = false
|
||||
wrongPIN = 0
|
||||
ShowNotification(locale('notify.failed-limit'), 'error')
|
||||
TriggerServerEvent('lation_247robbery:FailedRobbery')
|
||||
return
|
||||
end
|
||||
local inputCode = lib.inputDialog(locale('inputs.safe.header'), {
|
||||
{
|
||||
type = 'input',
|
||||
label = locale('inputs.safe.label'),
|
||||
description = locale('inputs.safe.desc'),
|
||||
placeholder = locale('inputs.safe.placeholder'),
|
||||
icon = icons.safe_pin,
|
||||
required = true
|
||||
}
|
||||
})
|
||||
if not inputCode then activeSafe = true return end
|
||||
local convertedCode = tonumber(inputCode[1])
|
||||
if convertedCode ~= safePin then
|
||||
wrongPIN = wrongPIN + 1
|
||||
activeSafe = true
|
||||
ShowNotification(locale('notify.wrong-pin'), 'error')
|
||||
elseif convertedCode == safePin then
|
||||
activeSafe = false
|
||||
wrongPIN = 0
|
||||
if ProgressBar(cl_config.anims.safe) then
|
||||
activeRegister = false
|
||||
TriggerServerEvent('lation_247robbery:CompleteSafeRobbery')
|
||||
safePin = nil
|
||||
else
|
||||
activeSafe = true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Create interactions
|
||||
AddEventHandler('lation_247robbery:onPlayerLoaded', function()
|
||||
local gabz = GetResourceState('cfx-gabz-247') == 'started'
|
||||
local fm = GetResourceState('cfx-fm-supermarkets') == 'started'
|
||||
local coords = gabz and require 'data.gabz' or fm and require 'data.fmshop' or require 'data.default'
|
||||
for key, coord in pairs(coords.registers) do
|
||||
local data = {
|
||||
name = 'cash_register' ..key,
|
||||
coords = coord,
|
||||
radius = 0.35,
|
||||
debug = sh_config.setup.debug,
|
||||
options = {
|
||||
{
|
||||
label = locale('target.register'),
|
||||
icon = icons.register,
|
||||
iconColor = icons.register_color,
|
||||
canInteract = function()
|
||||
if not activeRegister then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end,
|
||||
action = function()
|
||||
activeRegister = true
|
||||
InitiateRegisterRobbery()
|
||||
end,
|
||||
onSelect = function()
|
||||
activeRegister = true
|
||||
InitiateRegisterRobbery()
|
||||
end,
|
||||
distance = 2
|
||||
}
|
||||
}
|
||||
}
|
||||
AddCircleZone(data)
|
||||
end
|
||||
for key, coord in pairs(coords.computers) do
|
||||
local data = {
|
||||
name = 'computer' ..key,
|
||||
coords = coord,
|
||||
radius = 0.35,
|
||||
debug = sh_config.setup.debug,
|
||||
options = {
|
||||
{
|
||||
label = locale('target.computer'),
|
||||
icon = icons.computer,
|
||||
iconColor = icons.computer_color,
|
||||
canInteract = function()
|
||||
if activeComputer then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end,
|
||||
action = InitiateComputerHack,
|
||||
onSelect = InitiateComputerHack,
|
||||
distance = 2
|
||||
}
|
||||
}
|
||||
}
|
||||
AddCircleZone(data)
|
||||
end
|
||||
for key, coord in pairs(coords.safes) do
|
||||
local data = {
|
||||
name = 'safe' ..key,
|
||||
coords = coord,
|
||||
radius = 0.45,
|
||||
debug = sh_config.setup.debug,
|
||||
options = {
|
||||
{
|
||||
label = locale('target.safe'),
|
||||
icon = icons.safe,
|
||||
iconColor = icons.safe_color,
|
||||
canInteract = function()
|
||||
if activeSafe then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end,
|
||||
action = InitiateSafeRobbery,
|
||||
onSelect = InitiateSafeRobbery,
|
||||
distance = 2
|
||||
}
|
||||
}
|
||||
}
|
||||
AddCircleZone(data)
|
||||
end
|
||||
end)
|
38
resources/[jobs]/[crime]/lation_247robbery/config/client.lua
Normal file
38
resources/[jobs]/[crime]/lation_247robbery/config/client.lua
Normal file
|
@ -0,0 +1,38 @@
|
|||
return {
|
||||
|
||||
----------------------------------------------
|
||||
-- 💃 Customize animations and props
|
||||
----------------------------------------------
|
||||
|
||||
anims = {
|
||||
lockpick = {
|
||||
dict = 'missheistfbisetup1',
|
||||
clip = 'hassle_intro_loop_f'
|
||||
},
|
||||
register = {
|
||||
label = 'Kasse leeren..',
|
||||
duration = 30000,
|
||||
position = 'bottom',
|
||||
useWhileDead = false,
|
||||
canCancel = true,
|
||||
disable = { car = true, move = true, combat = true },
|
||||
anim = { dict = 'anim@heists@ornate_bank@grab_cash', clip = 'grab' },
|
||||
prop = { model = 'p_ld_heist_bag_s', bone = 40269, pos = vec3(0.0454, 0.2131, -0.1887), rot = vec3(66.4762, 7.2424, -71.9051) }
|
||||
},
|
||||
hackPC = {
|
||||
dict = 'anim@heists@prison_heiststation@cop_reactions',
|
||||
clip = 'cop_b_idle'
|
||||
},
|
||||
safe = {
|
||||
label = 'Tresor leeren..',
|
||||
duration = 30000,
|
||||
position = 'bottom',
|
||||
useWhileDead = false,
|
||||
canCancel = false,
|
||||
disable = { car = true, move = true, combat = true },
|
||||
anim = { dict = 'anim@heists@ornate_bank@grab_cash', clip = 'grab' },
|
||||
prop = { model = 'p_ld_heist_bag_s', bone = 40269, pos = vec3(0.0454, 0.2131, -0.1887), rot = vec3(66.4762, 7.2424, -71.9051) }
|
||||
}
|
||||
}
|
||||
|
||||
}
|
14
resources/[jobs]/[crime]/lation_247robbery/config/icons.lua
Normal file
14
resources/[jobs]/[crime]/lation_247robbery/config/icons.lua
Normal file
|
@ -0,0 +1,14 @@
|
|||
return {
|
||||
-- Interactions
|
||||
register = 'fas fa-lock',
|
||||
register_color = '',
|
||||
|
||||
computer = 'fas fa-computer',
|
||||
computer_color = '',
|
||||
|
||||
safe = 'fas fa-key',
|
||||
safe_color = '',
|
||||
|
||||
-- Safe input
|
||||
safe_pin = 'fas fa-lock'
|
||||
}
|
36
resources/[jobs]/[crime]/lation_247robbery/config/server.lua
Normal file
36
resources/[jobs]/[crime]/lation_247robbery/config/server.lua
Normal file
|
@ -0,0 +1,36 @@
|
|||
return {
|
||||
|
||||
----------------------------------------------
|
||||
-- 💬 Setup logging system
|
||||
----------------------------------------------
|
||||
|
||||
logs = {
|
||||
-- What logging service do you want to use?
|
||||
-- Available options: 'fivemanage', 'fivemerr', 'discord' & 'none'
|
||||
-- It is highly recommended to use a proper logging service such as Fivemanage or Fivemerr
|
||||
service = 'discord',
|
||||
-- Do you want to include screenshots with your logs?
|
||||
-- This is only applicable to Fivemanage and Fivemerr
|
||||
screenshots = false,
|
||||
-- You can enable (true) or disable (false) specific player events to log here
|
||||
events = {
|
||||
-- register_robbed is when a register has been robbed
|
||||
register_robbed = true,
|
||||
-- safe_robbed is when.. come on now, you gotta know..
|
||||
safe_robbed = true
|
||||
},
|
||||
-- If service = 'discord', you can customize the webhook data here
|
||||
-- If not using Discord, this section can be ignored
|
||||
discord = {
|
||||
-- The name of the webhook
|
||||
name = '24/7 Robbery Logs',
|
||||
-- The webhook link
|
||||
link = 'https://discord.com/api/webhooks/1379948922344050768/GYG104XUy2wIVDRMeoRLnk8QbvMnEJjsz4yLsrzM0rJO_ZYOV_n8NUowjT1ez2SaQTTb',
|
||||
-- The webhook profile image
|
||||
image = 'https://i.imgur.com/ILTkWBh.png',
|
||||
-- The webhook footer image
|
||||
footer = 'https://i.imgur.com/ILTkWBh.png'
|
||||
}
|
||||
}
|
||||
|
||||
}
|
207
resources/[jobs]/[crime]/lation_247robbery/config/shared.lua
Normal file
207
resources/[jobs]/[crime]/lation_247robbery/config/shared.lua
Normal file
|
@ -0,0 +1,207 @@
|
|||
return {
|
||||
|
||||
-- 🔎 Looking for more high quality scripts?
|
||||
-- 🛒 Shop Now: https://lationscripts.com
|
||||
-- 💬 Join Discord: https://discord.gg/9EbY4nM5uu
|
||||
-- 😢 How dare you leave this option false?!
|
||||
YouFoundTheBestScripts = false,
|
||||
|
||||
----------------------------------------------
|
||||
-- 🛠️ Setup the basics below
|
||||
----------------------------------------------
|
||||
|
||||
setup = {
|
||||
-- Use only if needed, directed by support or know what you're doing
|
||||
-- Notice: enabling debug features will significantly increase resmon
|
||||
-- And should always be disabled in production
|
||||
debug = false,
|
||||
-- Set your interaction system below
|
||||
-- Available options are: 'ox_target', 'qb-target', 'interact' & 'custom'
|
||||
-- 'custom' needs to be added to client/functions.lua
|
||||
interact = 'qb-target',
|
||||
-- Set your notification system below
|
||||
-- Available options are: 'ox_lib', 'esx', 'qb', 'okok', 'sd-notify', 'wasabi_notify', 'mythic_notify' & 'custom'
|
||||
-- 'custom' needs to be added to client/functions.lua
|
||||
notify = 'ox_lib',
|
||||
-- Set your progress bar system below
|
||||
-- Available options are: 'ox_lib', 'qbcore' & 'custom'
|
||||
-- 'custom' needs to be added to client/functions.lua
|
||||
-- Any custom progress bar must also support animations
|
||||
progress = 'ox_lib',
|
||||
-- Do you want to be notified via server console if an update is available?
|
||||
-- True if yes, false if no
|
||||
version = true,
|
||||
-- Once a store robbery has succesfully started a cooldown begins
|
||||
-- This is per-player and not a global cooldown (cooldown is in seconds)
|
||||
cooldown = 600,
|
||||
-- By default, the player-based cooldowns are overridden by this global cooldown
|
||||
-- This will prevent robberies at all stores by any player until the cooldown expires
|
||||
-- If you prefer a more flexible player-based cooldown option, just disable global
|
||||
-- The duration variable here is also in seconds like above
|
||||
global = { enable = true, duration = 600 }
|
||||
},
|
||||
|
||||
----------------------------------------------
|
||||
-- 👮 Setup police options
|
||||
----------------------------------------------
|
||||
|
||||
police = {
|
||||
-- How many police must be online in order to start a robbery?
|
||||
count = 0,
|
||||
-- Add your police job(s) below
|
||||
jobs = { 'police', 'sheriff' },
|
||||
-- Set your dispatch system
|
||||
-- Available options: 'cd_dispatch', 'ps-dispatch', 'qs-dispatch'
|
||||
-- 'core_dispatch', 'rcore_dispatch', aty_dispatch', 'op-dispatch',
|
||||
-- 'origen_police', 'emergencydispatch' & 'custom' option
|
||||
dispatch = 'ps-dispatch',
|
||||
-- Risk is a feature you can enable that will increase the players
|
||||
-- Reward payout based on the number of police online during the robbery!
|
||||
-- Do you want to enable the risk feature?
|
||||
risk = true,
|
||||
-- If risk = true, percent is how much the reward payout increases
|
||||
-- In percentage for EVERY cop online. If percent = 10 and there are
|
||||
-- 3 police online, the reward payout will increase 30%
|
||||
percent = 10
|
||||
},
|
||||
|
||||
----------------------------------------------
|
||||
-- 🏪 Setup register robbery
|
||||
----------------------------------------------
|
||||
|
||||
registers = {
|
||||
-- Set the required item name below needed to rob a cash register
|
||||
item = 'screwdriverset',
|
||||
-- Customize the minigame (skillcheck) difficulty below
|
||||
minigame = {
|
||||
-- Set the skillcheck difficulty levels below
|
||||
-- You can set 'easy', 'medium' or 'hard' in any order
|
||||
-- And in any amount/quantity - Learn more about the skillcheck
|
||||
-- Here: https://overextended.dev/ox_lib/Modules/Interface/Client/skillcheck
|
||||
difficulty = { 'easy', 'easy', 'easy', 'easy', 'easy','easy', },
|
||||
-- The 'inputs' are the keys that will be used for the skillcheck
|
||||
-- Minigame and can be set to any key or keys of your choice
|
||||
inputs = { 'W', 'A', 'S', 'D' }
|
||||
},
|
||||
-- After a successful register robbery, what item(s) do you want to reward?
|
||||
-- { item = 'some_item', min = 1, max = 1, chance = 100, metadata = { ['key'] = value } }
|
||||
-- The metadata table is optional
|
||||
-- The 'item' can also be an account, such as 'cash' or 'bank'
|
||||
reward = {
|
||||
{ item = 'cash', min = 750, max = 1250, chance = 100 },
|
||||
-- { item = 'markedbills', min = 1, max = 1, chance = 100, metadata = { ['worth'] = math.random(750, 1250) } }
|
||||
-- Add or remove items as you wish following the same format
|
||||
},
|
||||
-- If a player fails to successfully lockpick the register
|
||||
-- There is a chance that their lockpick will break. In percentage,
|
||||
-- What chance do you want their lockpick to break? To never break, set 0
|
||||
-- To break every time, set 100
|
||||
breakChance = 50,
|
||||
-- After a player succesfully robs a register, there is this "noteChance" they
|
||||
-- "Find" the safe's PIN "under the register" and can skip the computer hacking
|
||||
-- Step if found. In percentage, what chance do they have to find this note?
|
||||
noteChance = 10
|
||||
},
|
||||
|
||||
----------------------------------------------
|
||||
-- 🖥️ Setup computer hacking
|
||||
----------------------------------------------
|
||||
|
||||
computers = {
|
||||
-- When a player is attempting to hack the computer how many
|
||||
-- Attempts do you want to allow? By default, after 3 failed attempts
|
||||
-- The robbery will end and not proceed any further
|
||||
maxAttempts = 3,
|
||||
-- Do you want to enable the questionnaire hack? If true, this will replace
|
||||
-- The skillcheck hack with a series of questions the player must answer correctly
|
||||
questionnaire = false,
|
||||
-- Customize the minigame (skillcheck) difficulty below
|
||||
minigame = {
|
||||
-- Set the skillcheck difficulty levels below
|
||||
-- You can set 'easy', 'medium' or 'hard' in any order
|
||||
-- And in any amount/quantity - Learn more about the skillcheck
|
||||
-- Here: https://overextended.dev/ox_lib/Modules/Interface/Client/skillcheck
|
||||
difficulty = { 'easy', 'easy', 'easy', 'easy', 'easy','easy', },
|
||||
-- The 'inputs' are the keys that will be used for the skillcheck
|
||||
-- Minigame and can be set to any key or keys of your choice
|
||||
inputs = { 'W', 'A', 'S', 'D' }
|
||||
},
|
||||
},
|
||||
|
||||
----------------------------------------------
|
||||
-- 🔐 Setup safe robbery
|
||||
----------------------------------------------
|
||||
|
||||
safes = {
|
||||
-- When a player is attempting to hack the safe (inputting the PIN) how
|
||||
-- Many attempts do you want to allow? By default, after 3 failed attempts
|
||||
-- The robbery will end and not proceed (they will not be rewarded)
|
||||
maxAttempts = 3,
|
||||
-- After a successful register robbery, what item(s) do you want to reward?
|
||||
-- { item = 'some_item', min = 1, max = 1, chance = 100, metadata = { ['key'] = value } }
|
||||
-- The metadata table is optional
|
||||
-- The 'item' can also be an account, such as 'cash' or 'bank'
|
||||
reward = {
|
||||
{ item = 'cash', min = 2000, max = 7000, chance = 50 },
|
||||
{ item = 'dildo', min = 1, max = 1, chance = 50 },
|
||||
-- { item = 'markedbills', min = 1, max = 1, chance = 100, metadata = { ['worth'] = math.random(2000, 7000) } }
|
||||
-- Add or remove items as you wish following the same format
|
||||
},
|
||||
},
|
||||
|
||||
----------------------------------------------
|
||||
-- ❓ Setup optional questionnaire
|
||||
----------------------------------------------
|
||||
|
||||
questionnaire = {
|
||||
questions = {
|
||||
[1] = {
|
||||
type = 'input',
|
||||
label = 'Question #1',
|
||||
description = 'Wann ist Weihnachten',
|
||||
icon = 'fas fa-bolt',
|
||||
required = true
|
||||
},
|
||||
[2] = {
|
||||
type = 'input',
|
||||
label = 'Question #2',
|
||||
description = 'Was ist Obey?',
|
||||
icon = 'fas fa-lock',
|
||||
required = true
|
||||
},
|
||||
[3] = {
|
||||
type = 'input',
|
||||
label = 'Question #3',
|
||||
description = 'Was ist eine GPU?',
|
||||
icon = 'fas fa-desktop',
|
||||
required = true
|
||||
},
|
||||
[4] = {
|
||||
type = 'select',
|
||||
label = 'Question #4',
|
||||
description = 'Was macht STRG+C?',
|
||||
icon = 'fas fa-keyboard',
|
||||
required = true,
|
||||
options = {
|
||||
{ value = 1, label = 'pause' },
|
||||
{ value = 2, label = 'drucken' },
|
||||
{ value = 3, label = 'löschen' },
|
||||
{ value = 4, label = 'kopieren' },
|
||||
}
|
||||
},
|
||||
-- Add more questions here, following the same format as above
|
||||
-- Be sure to increment the numbers correctly, [5], [6], etc
|
||||
},
|
||||
-- All the answers to the above questions must be placed here
|
||||
-- Put the answers in the same order the questions are above
|
||||
-- The answer to question [3] above should be [3] here as well
|
||||
-- Note: answers to type = 'select' should be the value numer
|
||||
answers = {
|
||||
[1] = 'dezember',
|
||||
[2] = 'automarke',
|
||||
[3] = 'grafikkarte',
|
||||
[4] = 4
|
||||
}
|
||||
}
|
||||
|
||||
}
|
57
resources/[jobs]/[crime]/lation_247robbery/data/default.lua
Normal file
57
resources/[jobs]/[crime]/lation_247robbery/data/default.lua
Normal file
|
@ -0,0 +1,57 @@
|
|||
return {
|
||||
registers = {
|
||||
vec3(29.1251, -1341.5042, 29.4944), -- Innocence Blvd
|
||||
vec3(-3045.5269, 585.7495, 7.9062), -- Inseno Road
|
||||
vec3(-3247.7947, 1003.5355, 12.8279), -- Barbareno Road
|
||||
vec3(1733.1542, 6418.9487, 35.0343), -- Great Ocean Highway
|
||||
vec3(1698.3787, 4923.2553, 42.2410), -- Grape Seed Main Street
|
||||
vec3(1960.0208, 3746.5747, 32.3408), -- Alhambra Drive
|
||||
vec3(546.8871, 2665.2727, 42.1536), -- Route 68
|
||||
vec3(2674.5544, 3284.9438, 55.2383), -- Senora Freeway
|
||||
vec3(2551.5698, 384.1099, 108.6201), -- Palomino Freeway
|
||||
vec3(376.8043, 331.3049, 103.5636), -- Clinton Avenue
|
||||
vec3(-1820.5584, 793.9172, 138.2765), -- North Rockford Drive
|
||||
vec3(-47.2251, -1757.5423, 29.5983), -- Grove Street
|
||||
vec3(-706.7102, -913.5667, 19.3929), -- Ginger Street
|
||||
vec3(1164.1452, -322.7899, 69.3824), -- Mirror Park Blvd
|
||||
vec3(29.1228, -1341.5043, 29.4944), -- Innocence Blvd
|
||||
vec3(-1232.8734, -1440.0337, 4.3739) -- Aguja Street
|
||||
},
|
||||
computers = {
|
||||
vec3(24.7435, -1339.3319, 29.4941), -- Innocence Blvd
|
||||
vec3(-3046.7769, 582.4587, 7.9059), -- Inseno Road
|
||||
vec3(-3250.2068, 1000.9899, 12.8277), -- Barbareno Road
|
||||
vec3(1731.5469, 6422.1841, 35.0343), -- Great Ocean Highway
|
||||
vec3(1707.3872, 4921.6953, 42.0722), -- Grape Seed Main Street
|
||||
vec3(1956.4008, 3746.9792, 32.3408), -- Alhambra Drive
|
||||
vec3(549.8992, 2663.4697, 42.1535), -- Route 68
|
||||
vec3(2671.2490, 3283.5005, 55.2392), -- Senora Freeway
|
||||
vec3(2549.2810, 381.3652, 108.6200), -- Palomino Freeway
|
||||
vec3(374.7944, 334.0489, 103.5635), -- Clinton Avenue
|
||||
vec3(-1828.9333, 797.3793, 138.2624), -- North Rockford Drive
|
||||
vec3(-44.7806, -1748.8189, 29.4642), -- Grove Street
|
||||
vec3(-710.4782, -905.2836, 19.2711), -- Ginger Street
|
||||
vec3(1158.9605, -315.2624, 69.2748), -- Mirror Park Blvd
|
||||
vec3(24.7447, -1339.3311, 29.4941), -- Innocence Blvd
|
||||
vec3(-1236.2167, -1438.5101, 4.3739) -- Aguja Street
|
||||
|
||||
},
|
||||
safes = {
|
||||
vec3(24.5569, -1340.9492, 29.4941), -- Innocence Blvd
|
||||
vec3(-3045.1655, 583.2350, 7.9059), -- Inseno Road
|
||||
vec3(-3248.6182, 1000.5917, 12.8277), -- Barbareno Road
|
||||
vec3(1730.7687, 6420.7734, 35.0343), -- Great Ocean Highway
|
||||
vec3(1708.1695, 4920.8208, 41.3514), -- Grape Seed Main Street
|
||||
vec3(1957.2903, 3745.5491, 32.3408), -- Alhambra Drive
|
||||
vec3(549.6087, 2665.0701, 42.1535), -- Route 68
|
||||
vec3(2671.2490, 3283.5005, 55.2392), -- Senora Freeway
|
||||
vec3(2550.8884, 381.0840, 108.6200), -- Palomino Freeway
|
||||
vec3(374.1689, 332.5431, 103.5635), -- Clinton Avenue
|
||||
vec3(-1829.5384, 798.4634, 137.5601), -- North Rockford Drive
|
||||
vec3(-43.8009, -1748.0804, 28.7776), -- Grove Street
|
||||
vec3(-710.1920, -904.1401, 18.5740), -- Ginger Street
|
||||
vec3(1159.0540, -314.1202, 68.5665), -- Mirror Park Blvd
|
||||
vec3(24.6812, -1340.9744, 29.4941), -- Innocence Blvd
|
||||
vec3(-1234.1045, -1436.7537, 4.3739) -- Aguja Street
|
||||
}
|
||||
}
|
50
resources/[jobs]/[crime]/lation_247robbery/data/fmshop.lua
Normal file
50
resources/[jobs]/[crime]/lation_247robbery/data/fmshop.lua
Normal file
|
@ -0,0 +1,50 @@
|
|||
return {
|
||||
registers = {
|
||||
vec3(25.04, -1345.57, 29.5), -- Innocence Blvd
|
||||
vec3(-3040.82, 584.48, 7.91), -- Inseno Road
|
||||
vec3(-3243.96, 1000.69, 12.83), -- Barbareno Road
|
||||
vec3(1729.11, 6416.57, 35.04), -- Great Ocean Highway
|
||||
vec3(1696.69, 4924.63, 42.06), -- Grape Seed Main Street
|
||||
vec3(1959.72, 3741.8, 32.34), -- Alhambra Drive
|
||||
vec3(548.72, 2669.54, 42.16), -- Route 68
|
||||
vec3(2676.81, 3280.74, 55.24), -- Senora Freeway
|
||||
vec3(2555.49, 381.45, 108.62), -- Palomino Freeway
|
||||
vec3(373.54, 327.99, 103.57), -- Clinton Avenue
|
||||
vec3(-1819.12, 792.29, 138.08), -- North Rockford Drive
|
||||
vec3(-48.56, -1759.19, 29.42), -- Grove Street
|
||||
vec3(-706.71, -915.73, 19.22), -- Ginger Street
|
||||
vec3(1164.49, -324.9, 69.21) -- Mirror Park Blvd
|
||||
},
|
||||
computers = {
|
||||
vec3(25.61, -1343.68, 26.39), -- Innocence Blvd
|
||||
vec3(-3042.71, 584.68, 4.8), -- Inseno Road
|
||||
vec3(-3245.73, 1001.57, 9.72), -- Barbareno Road
|
||||
vec3(1730.67, 6417.85, 31.93), -- Great Ocean Highway
|
||||
vec3(1707.3872, 4921.6953, 42.0722), -- Grape Seed Main Street
|
||||
vec3(1959.42, 3743.73, 29.23), -- Alhambra Drive
|
||||
vec3(548.25, 2667.68, 39.04), -- Route 68
|
||||
vec3(2675.55, 3282.3, 52.13), -- Senora Freeway
|
||||
vec3(2553.66, 382.3, 105.51), -- Palomino Freeway
|
||||
vec3(374.67, 329.5, 100.45), -- Clinton Avenue
|
||||
vec3(-1828.9333, 797.3793, 138.2624), -- North Rockford Drive
|
||||
vec3(-44.7806, -1748.8189, 29.4642), -- Grove Street
|
||||
vec3(-710.4782, -905.2836, 19.2711), -- Ginger Street
|
||||
vec3(1158.9605, -315.2624, 69.2748) -- Mirror Park Blvd
|
||||
},
|
||||
safes = {
|
||||
vec3(24.17, -1344.46, 25.99), -- Innocence Blvd
|
||||
vec3(-3041.6, 583.38, 4.4), -- Inseno Road
|
||||
vec3(-3245.09, 999.84, 9.32), -- Barbareno Road
|
||||
vec3(1728.75, 6417.89, 31.43), -- Great Ocean Highway
|
||||
vec3(1708.1695, 4920.8208, 41.3514), -- Grape Seed Main Street
|
||||
vec3(1958.38, 3742.24, 28.83), -- Alhambra Drive
|
||||
vec3(549.78, 2668.64, 38.69), -- Route 68
|
||||
vec3(2675.46, 3280.43, 51.63), -- Senora Freeway
|
||||
vec3(2554.44, 380.57, 105.01), -- Palomino Freeway
|
||||
vec3(372.86, 329.2, 100.05), -- Clinton Avenue
|
||||
vec3(-1829.5384, 798.4634, 137.5601), -- North Rockford Drive
|
||||
vec3(-43.8009, -1748.0804, 28.7776), -- Grove Street
|
||||
vec3(-710.1920, -904.1401, 18.5740), -- Ginger Street
|
||||
vec3(1159.0540, -314.1202, 68.5665) -- Mirror Park Blvd
|
||||
}
|
||||
}
|
56
resources/[jobs]/[crime]/lation_247robbery/data/gabz.lua
Normal file
56
resources/[jobs]/[crime]/lation_247robbery/data/gabz.lua
Normal file
|
@ -0,0 +1,56 @@
|
|||
return {
|
||||
registers = {
|
||||
vec3(25.4444, -1345.6597, 29.7458), -- Innocence Blvd
|
||||
vec3(-3040.8388, 585.0568, 8.1577), -- Inseno Road
|
||||
vec3(-3243.7705, 1001.1959, 13.1240), -- Barbareno Road
|
||||
vec3(1729.4234, 6416.1899, 35.2860), -- Great Ocean Highway
|
||||
vec3(1698.3787, 4923.2553, 42.2410), -- Grape Seed Main Street
|
||||
vec3(1960.1284, 3741.8007, 32.5925), -- Alhambra Drive
|
||||
vec3(548.2675, 2669.6276, 42.4053), -- Route 68
|
||||
vec3(2677.1232, 3280.9897, 55.4899), -- Senora Freeway
|
||||
vec3(2555.6130, 381.6807, 108.8406), -- Palomino Freeway
|
||||
vec3(373.8878, 327.6780, 103.8151), -- Clinton Avenue
|
||||
vec3(162.2107, 6642.0131, 31.9477), -- Paleto Blvd
|
||||
vec3(-1820.5584, 793.9172, 138.2765), -- North Rockford Drive
|
||||
vec3(-47.2251, -1757.5423, 29.5983), -- Grove Street
|
||||
vec3(-706.7102, -913.5667, 19.3929), -- Ginger Street
|
||||
vec3(1164.1452, -322.7899, 69.3824), -- Mirror Park Blvd
|
||||
vec3(813.3516, -781.0529, 26.4238) -- Otto's Grotto
|
||||
},
|
||||
computers = {
|
||||
vec3(29.5666, -1340.5445, 29.5400), -- Innocence Blvd
|
||||
vec3(-3046.9726, 587.3485, 7.9698), -- Inseno Road
|
||||
vec3(-3248.5605, 1005.7445, 12.8778), -- Barbareno Road
|
||||
vec3(1735.4163, 6419.0268, 35.1044), -- Great Ocean Highway
|
||||
vec3(1707.3872, 4921.6953, 42.0722), -- Grape Seed Main Street
|
||||
vec3(1961.1553, 3748.4353, 32.4213), -- Alhambra Drive
|
||||
vec3(544.8870, 2663.9619, 42.1643), -- Route 68
|
||||
vec3(2674.6093, 3287.1359, 55.3793), -- Senora Freeway
|
||||
vec3(2550.6496, 386.1718, 108.6351), -- Palomino Freeway
|
||||
vec3(379.0795, 331.7546, 103.6381), -- Clinton Avenue
|
||||
vec3(168.8938, 6642.8100, 31.7406), -- Paleto Blvd
|
||||
vec3(-1828.9333, 797.3793, 138.2624), -- North Rockford Drive
|
||||
vec3(-44.7806, -1748.8189, 29.4642), -- Grove Street
|
||||
vec3(-710.4782, -905.2836, 19.2711), -- Ginger Street
|
||||
vec3(1158.9605, -315.2624, 69.2748), -- Mirror Park Blvd
|
||||
vec3(817.5401, -775.8287, 26.2710) -- Otto's Grotto
|
||||
},
|
||||
safes = {
|
||||
vec3(31.5539, -1339.2442, 29.9318), -- Innocence Blvd
|
||||
vec3(-3048.7597, 588.8417, 8.3087), -- Inseno Road
|
||||
vec3(-3249.6362, 1007.7283, 13.2638), -- Barbareno Road
|
||||
vec3(1737.7717, 6419.2626, 35.4482), -- Great Ocean Highway
|
||||
vec3(1708.1695, 4920.8208, 41.3514), -- Grape Seed Main Street
|
||||
vec3(1962.2239, 3750.4909, 32.7439), -- Alhambra Drive
|
||||
vec3(543.0894, 2662.4709, 42.5580), -- Route 68
|
||||
vec3(2674.5131, 3289.5026, 55.6409), -- Senora Freeway
|
||||
vec3(2549.4816, 388.2724, 109.0129), -- Palomino Freeway
|
||||
vec3(381.3895, 332.4351, 103.9466), -- Clinton Avenue
|
||||
vec3(171.1812, 6642.2641, 32.0916), -- Paleto Blvd
|
||||
vec3(-1829.5384, 798.4634, 137.5601), -- North Rockford Drive
|
||||
vec3(-43.8009, -1748.0804, 28.7776), -- Grove Street
|
||||
vec3(-710.1920, -904.1401, 18.5740), -- Ginger Street
|
||||
vec3(1159.0540, -314.1202, 68.5665), -- Mirror Park Blvd
|
||||
vec3(819.6384, -774.5783, 26.5440) -- Otto's Grotto
|
||||
}
|
||||
}
|
40
resources/[jobs]/[crime]/lation_247robbery/fxmanifest.lua
Normal file
40
resources/[jobs]/[crime]/lation_247robbery/fxmanifest.lua
Normal file
|
@ -0,0 +1,40 @@
|
|||
fx_version 'cerulean'
|
||||
lua54 'yes'
|
||||
game 'gta5'
|
||||
name 'lation_247robbery'
|
||||
author 'iamlation'
|
||||
version '1.5.0'
|
||||
repository 'https://github.com/IamLation/lation_247robbery'
|
||||
description 'FiveM\'s most popular 24/7 store robbery script'
|
||||
|
||||
client_scripts {
|
||||
'config/client.lua',
|
||||
'bridge/client.lua',
|
||||
'client/*.lua'
|
||||
}
|
||||
|
||||
server_scripts {
|
||||
'config/server.lua',
|
||||
'bridge/server.lua',
|
||||
'server/*.lua'
|
||||
}
|
||||
|
||||
shared_scripts {
|
||||
'config/shared.lua',
|
||||
'config/icons.lua',
|
||||
'data/*.lua',
|
||||
'@ox_lib/init.lua',
|
||||
}
|
||||
|
||||
files {
|
||||
'locales/*.json'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
'ox_lib'
|
||||
}
|
||||
|
||||
ox_libs {
|
||||
'locale',
|
||||
'math'
|
||||
}
|
45
resources/[jobs]/[crime]/lation_247robbery/locales/en.json
Normal file
45
resources/[jobs]/[crime]/lation_247robbery/locales/en.json
Normal file
|
@ -0,0 +1,45 @@
|
|||
|
||||
{
|
||||
"notify": {
|
||||
"cancel-rob": "Du hast aufgehört, die Kasse auszurauben",
|
||||
"cooldown": "Das scheint keine gute Idee zu sein - ich sollte warten",
|
||||
"no-police": "Es sind nicht genug Polizisten in der Stadt",
|
||||
"missing-item": "Ich denke, das wäre einfacher mit einem Werkzeug",
|
||||
"item-broke": "Du hast den Dietrich zerbrochen und konntest die Kasse nicht öffnen",
|
||||
"failed-hack": "Der Hack des Computers ist fehlgeschlagen",
|
||||
"wrong-pin": "Das scheint nicht richtig zu sein... es ist noch verschlossen",
|
||||
"failed-limit": "Du hast zu oft versagt und den Raub nicht geschafft"
|
||||
},
|
||||
"target": {
|
||||
"register": "Kasse ausrauben",
|
||||
"computer": "Anmelden",
|
||||
"safe": "Entsperren"
|
||||
},
|
||||
"alerts": {
|
||||
"note": {
|
||||
"header": "Notiz gefunden",
|
||||
"content": "Du hast unter der Kasse eine interessante Notiz gefunden, auf der nur folgende Zahlen stehen: %s"
|
||||
},
|
||||
"hack": {
|
||||
"header": "Code aufgedeckt",
|
||||
"content": "Du hast den Computer erfolgreich gehackt und den folgenden Code gefunden: %s"
|
||||
}
|
||||
},
|
||||
"inputs": {
|
||||
"questions": {
|
||||
"header": "Sicherheitsfragen"
|
||||
},
|
||||
"safe": {
|
||||
"header": "Tresor",
|
||||
"label": "PIN eingeben",
|
||||
"desc": "Gib die PIN ein, um den Tresor zu entsperren",
|
||||
"placeholder": "1234"
|
||||
}
|
||||
},
|
||||
"logs": {
|
||||
"register-robbed-title": "Kasse ausgeraubt",
|
||||
"register-robbed-message": "%s (Kennung: %s) hat erfolgreich eine Kasse um %s ausgeraubt",
|
||||
"safe-robbed-title": "Tresor ausgeraubt",
|
||||
"safe-robbed-message": "%s (Kennung: %s) hat erfolgreich einen Tresor um %s ausgeraubt"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
-- Initialize config(s)
|
||||
local sv_config = require 'config.server'
|
||||
local sh_config = require 'config.shared'
|
||||
|
||||
-- Check to see if fm-logs or fmsdk is started
|
||||
local fmlogs = GetResourceState('fm-logs') == 'started'
|
||||
local fmsdk = GetResourceState('fmsdk') == 'started'
|
||||
|
||||
-- Log events if applicable
|
||||
--- @param message string Message contents
|
||||
--- @param type string Log type
|
||||
function EventLog(message, type)
|
||||
if not message or not sh_config.setup.debug then return end
|
||||
if sv_config.logs.service == 'fivemanage' then
|
||||
if not fmsdk then return end
|
||||
exports.fmsdk:LogMessage(type or 'info', message)
|
||||
elseif sv_config.logs.service == 'fivemerr' then
|
||||
if not fmlogs then return end
|
||||
exports['fm-logs']:createLog({
|
||||
LogType = 'Resource',
|
||||
Resource = 'lation_247robbery',
|
||||
Level = type or 'info',
|
||||
Message = message,
|
||||
})
|
||||
else
|
||||
print(message)
|
||||
end
|
||||
end
|
||||
|
||||
-- Log player events if applicable
|
||||
--- @param source number Player ID
|
||||
--- @param title string Log title
|
||||
--- @param message string Message contents
|
||||
function PlayerLog(source, title, message)
|
||||
if sv_config.logs.service == 'fivemanage' then
|
||||
if not fmsdk then return end
|
||||
if sv_config.logs.screenshots then
|
||||
exports.fmsdk:takeServerImage(source, {
|
||||
name = title,
|
||||
description = message,
|
||||
})
|
||||
else
|
||||
exports.fmsdk:LogMessage('info', message)
|
||||
end
|
||||
elseif sv_config.logs.service == 'fivemerr' then
|
||||
if not fmlogs then return end
|
||||
exports['fm-logs']:createLog({
|
||||
LogType = 'Player',
|
||||
Message = message,
|
||||
Resource = 'lation_247robbery',
|
||||
Source = source,
|
||||
}, { Screenshot = sv_config.logs.screenshots })
|
||||
elseif sv_config.logs.service == 'discord' then
|
||||
local embed = {
|
||||
{
|
||||
["color"] = 16711680,
|
||||
["title"] = "**".. title .."**",
|
||||
["description"] = message,
|
||||
["footer"] = {
|
||||
["text"] = os.date("%a %b %d, %I:%M%p"),
|
||||
["icon_url"] = sv_config.logs.discord.footer
|
||||
}
|
||||
}
|
||||
}
|
||||
PerformHttpRequest(sv_config.logs.discord.link, function()
|
||||
end, 'POST', json.encode({username = sv_config.logs.discord.name, embeds = embed, avatar_url = sv_config.logs.discord.image}),
|
||||
{['Content-Type'] = 'application/json'})
|
||||
end
|
||||
end
|
324
resources/[jobs]/[crime]/lation_247robbery/server/main.lua
Normal file
324
resources/[jobs]/[crime]/lation_247robbery/server/main.lua
Normal file
|
@ -0,0 +1,324 @@
|
|||
-- Initialize config(s)
|
||||
local sh_config = require 'config.shared'
|
||||
local sv_config = require 'config.server'
|
||||
|
||||
-- Initialize global state for cooldowns
|
||||
GlobalState.cooldown = false
|
||||
GlobalState.started = false
|
||||
|
||||
-- Initialize proper coordinates
|
||||
local gabz = GetResourceState('cfx-gabz-247') == 'started'
|
||||
local fm = GetResourceState('cfx-fm-supermarkets') == 'started'
|
||||
local stores = gabz and require 'data.gabz' or fm and require 'data.fmshop' or require 'data.default'
|
||||
|
||||
-- Initialize table to store known locations & robbery states
|
||||
local locations, states = {}, {}
|
||||
|
||||
-- Builds local table containing all locations categorized
|
||||
local function InitializeStores()
|
||||
for type, coords in pairs(stores) do
|
||||
for _, location in pairs(coords) do
|
||||
if not locations[type:lower()] then locations[type:lower()] = {} end
|
||||
locations[type:lower()][#locations[type:lower()] + 1] = location
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Returns boolean if player is nearby defined coords based on location type
|
||||
--- @param source number
|
||||
--- @param location string registers, computers, safes
|
||||
--- @return boolean
|
||||
local function IsPlayerNearby(source, location)
|
||||
if not source or not location then return false end
|
||||
local playerPos = GetEntityCoords(GetPlayerPed(source))
|
||||
for _, coords in pairs(locations[location]) do
|
||||
if #(playerPos - coords) <= 2.5 then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-- Returns boolean if player can start robbery
|
||||
--- @param identifier string
|
||||
--- @return boolean
|
||||
local function CanPlayerRob(identifier)
|
||||
if not identifier then return false end
|
||||
local currentTime = os.time()
|
||||
if sh_config.setup.global.enable then
|
||||
if GlobalState.cooldown or GlobalState.started then
|
||||
return false
|
||||
end
|
||||
end
|
||||
if not states[identifier] then return true end
|
||||
local lastCompleted = states[identifier].completed
|
||||
if lastCompleted then
|
||||
if (currentTime - lastCompleted) < sh_config.setup.cooldown then
|
||||
return false
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
-- Starts & ends global cooldown if enabled
|
||||
local function StartCooldown()
|
||||
GlobalState.cooldown = true
|
||||
local wait = math.floor(sh_config.setup.global.duration * 1000)
|
||||
SetTimeout(wait, function()
|
||||
GlobalState.cooldown = false
|
||||
end)
|
||||
end
|
||||
|
||||
-- Callback to initialize store robbery
|
||||
--- @param source number
|
||||
--- @return boolean
|
||||
lib.callback.register('lation_247robbery:StartRobbery', function(source)
|
||||
if not source then
|
||||
EventLog('[main.lua]: lation_247robbery:StartRobbery: unable to retrieve source', 'error')
|
||||
return false
|
||||
end
|
||||
local source = source
|
||||
local identifier = GetIdentifier(source)
|
||||
if not identifier then
|
||||
EventLog('[main.lua]: lation_247robbery:StartRobbery: unable to retrieve player identifier', 'error')
|
||||
return false
|
||||
end
|
||||
local isNearRegister = IsPlayerNearby(source, 'registers')
|
||||
if not isNearRegister then
|
||||
EventLog('[main.lua]: lation_247robbery:StartRobbery: player not nearby any registers', 'error')
|
||||
return false
|
||||
end
|
||||
local hasRequiredItem = GetItemCount(source, sh_config.registers.item) >= 1
|
||||
if not hasRequiredItem then
|
||||
TriggerClientEvent('lation_247robbery:Notify', source, locale('notify.missing-item'), 'error')
|
||||
EventLog('[main.lua]: lation_247robbery:StartRobbery: player missing required item', 'error')
|
||||
return false
|
||||
end
|
||||
if sh_config.police.count > 0 then
|
||||
local police = GetPoliceCount()
|
||||
if not police or police < sh_config.police.count then
|
||||
TriggerClientEvent('lation_247robbery:Notify', source, locale('notify.no-police'), 'error')
|
||||
EventLog('[main.lua]: lation_247robbery:StartRobbery: not enough police to start robbery', 'error')
|
||||
return false
|
||||
end
|
||||
end
|
||||
if not CanPlayerRob(identifier) then
|
||||
TriggerClientEvent('lation_247robbery:Notify', source, locale('notify.cooldown'), 'error')
|
||||
EventLog('[main.lua]: lation_247robbery:StartRobbery: cooldown is still active (for player or global)', 'error')
|
||||
return false
|
||||
end
|
||||
GlobalState.started = true
|
||||
if not states[identifier] then states[identifier] = {} end
|
||||
states[identifier].state = 'in_progress'
|
||||
states[identifier].started = os.time()
|
||||
-- Fallback to reset states if not completed in a reasonable amount of time
|
||||
SetTimeout(600000, function() -- 10 minute timeout
|
||||
if states[identifier] and states[identifier].state == 'in_progress' then
|
||||
states[identifier] = nil
|
||||
end
|
||||
if GlobalState.started then
|
||||
GlobalState.started = false
|
||||
end
|
||||
end)
|
||||
return true
|
||||
end)
|
||||
|
||||
-- Event to handle lockpick breaking chance
|
||||
RegisterNetEvent('lation_247robbery:DoesLockpickBreak', function()
|
||||
if not source then
|
||||
EventLog('[main.lua]: lation_247robbery:DoesLockpickBreak: unable to retrieve source', 'error')
|
||||
return
|
||||
end
|
||||
local source = source
|
||||
local identifier = GetIdentifier(source)
|
||||
if not identifier then
|
||||
EventLog('[main.lua]: lation_247robbery:DoesLockpickBreak: unable to retrieve player identifier', 'error')
|
||||
return
|
||||
end
|
||||
if not GlobalState.started then
|
||||
EventLog('[main.lua]: lation_247robbery:RegisterIncomplete: global state wasnt initiated', 'error')
|
||||
return
|
||||
end
|
||||
if not states[identifier] or states[identifier].state ~= 'in_progress' then
|
||||
EventLog('[main.lua]: lation_247robbery:DoesLockpickBreak: robbery wasnt initiated for player', 'error')
|
||||
return
|
||||
end
|
||||
local isNearRegister = IsPlayerNearby(source, 'registers')
|
||||
if not isNearRegister then
|
||||
EventLog('[main.lua]: lation_247robbery:DoesLockpickBreak: player not nearby any registers', 'error')
|
||||
return
|
||||
end
|
||||
if math.random(100) <= sh_config.registers.breakChance then
|
||||
RemoveItem(source, sh_config.registers.item, 1)
|
||||
TriggerClientEvent('lation_247robbery:Notify', source, locale('notify.item-broke'), 'error')
|
||||
end
|
||||
if GlobalState.started then GlobalState.started = false end
|
||||
end)
|
||||
|
||||
-- Event to handle robbery completion and rewards
|
||||
RegisterNetEvent('lation_247robbery:CompleteRegisterRobbery', function()
|
||||
if not source then
|
||||
EventLog('[main.lua]: lation_247robbery:CompleteRegisterRobbery: unable to retrieve source', 'error')
|
||||
return
|
||||
end
|
||||
local source = source
|
||||
local identifier = GetIdentifier(source)
|
||||
if not identifier then
|
||||
EventLog('[main.lua]: lation_247robbery:CompleteRegisterRobbery: unable to retrieve player identifier', 'error')
|
||||
return
|
||||
end
|
||||
local name = GetName(source)
|
||||
if not name then
|
||||
EventLog('[main.lua]: lation_247robbery:CompleteRegisterRobbery: unable to retrieve player name', 'error')
|
||||
return
|
||||
end
|
||||
if not states[identifier] or states[identifier].state ~= 'in_progress' then
|
||||
EventLog('[main.lua]: lation_247robbery:CompleteRegisterRobbery: robbery wasnt initiated for player', 'error')
|
||||
return
|
||||
end
|
||||
if not GlobalState.started then
|
||||
EventLog('[main.lua]: lation_247robbery:CompleteRegisterRobbery: global state wasnt initiated', 'error')
|
||||
return
|
||||
end
|
||||
local isNearRegister = IsPlayerNearby(source, 'registers')
|
||||
if not isNearRegister then
|
||||
EventLog('[main.lua]: lation_247robbery:CompleteRegisterRobbery: player not nearby any registers', 'error')
|
||||
return
|
||||
end
|
||||
local police = sh_config.police.risk and GetPoliceCount() or 0
|
||||
local items = {}
|
||||
for _, add in pairs(sh_config.registers.reward) do
|
||||
if math.random(100) <= add.chance then
|
||||
local quantity = math.random(add.min, add.max)
|
||||
if police > 0 then
|
||||
local increase = 1 + (police * sh_config.police.percent / 100)
|
||||
quantity = math.floor(quantity * increase)
|
||||
end
|
||||
if add.metadata then
|
||||
AddItem(source, add.item, quantity, add.metadata)
|
||||
else
|
||||
if add.item == 'cash' or add.item == 'money' or add.item == 'bank' then
|
||||
AddMoney(source, add.item, quantity)
|
||||
else
|
||||
AddItem(source, add.item, quantity)
|
||||
end
|
||||
end
|
||||
items[#items + 1] = { item = add.item, quantity = quantity }
|
||||
end
|
||||
end
|
||||
local rewards = ''
|
||||
for _, reward in ipairs(items) do
|
||||
rewards = rewards .. 'x' .. reward.quantity .. ' ' ..reward.item .. ', '
|
||||
end
|
||||
rewards = rewards:sub(1, -3)
|
||||
states[identifier].state = 'completed'
|
||||
states[identifier].completed = os.time()
|
||||
if sv_config.logs.events.register_robbed and #items > 0 then
|
||||
---@diagnostic disable-next-line: undefined-field
|
||||
PlayerLog(source, locale('logs.register-robbed-title'), locale('logs.register-robbed-message', name, identifier, rewards))
|
||||
end
|
||||
end)
|
||||
|
||||
-- Event to handle robbery completion and rewards
|
||||
RegisterNetEvent('lation_247robbery:CompleteSafeRobbery', function()
|
||||
if not source then
|
||||
EventLog('[main.lua]: lation_247robbery:CompleteSafeRobbery: unable to retrieve source', 'error')
|
||||
return
|
||||
end
|
||||
local source = source
|
||||
local identifier = GetIdentifier(source)
|
||||
if not identifier then
|
||||
EventLog('[main.lua]: lation_247robbery:CompleteSafeRobbery: unable to retrieve player identifier', 'error')
|
||||
return
|
||||
end
|
||||
local name = GetName(source)
|
||||
if not name then
|
||||
EventLog('[main.lua]: lation_247robbery:CompleteSafeRobbery: unable to retrieve player name', 'error')
|
||||
return
|
||||
end
|
||||
if not GlobalState.started then
|
||||
EventLog('[main.lua]: lation_247robbery:CompleteSafeRobbery: global state wasnt initiated', 'error')
|
||||
return
|
||||
end
|
||||
if not states[identifier] or states[identifier].state ~= 'completed' then
|
||||
EventLog('[main.lua]: lation_247robbery:CompleteSafeRobbery: player has not completed the register robbery', 'error')
|
||||
return
|
||||
end
|
||||
local isNearSafe = IsPlayerNearby(source, 'safes')
|
||||
if not isNearSafe then
|
||||
EventLog('[main.lua]: lation_247robbery:CompleteSafeRobbery: player not nearby any safes', 'error')
|
||||
return
|
||||
end
|
||||
local police = sh_config.police.risk and GetPoliceCount() or 0
|
||||
local items = {}
|
||||
for _, add in pairs(sh_config.safes.reward) do
|
||||
if math.random(100) <= add.chance then
|
||||
local quantity = math.random(add.min, add.max)
|
||||
if police > 0 then
|
||||
local increase = 1 + (police * sh_config.police.percent / 100)
|
||||
quantity = math.floor(quantity * increase)
|
||||
end
|
||||
if add.metadata then
|
||||
AddItem(source, add.item, quantity, add.metadata)
|
||||
else
|
||||
if add.item == 'cash' or add.item == 'money' or add.item == 'bank' then
|
||||
AddMoney(source, add.item, quantity)
|
||||
else
|
||||
AddItem(source, add.item, quantity)
|
||||
end
|
||||
end
|
||||
items[#items + 1] = { item = add.item, quantity = quantity }
|
||||
end
|
||||
end
|
||||
local rewards = ''
|
||||
for _, reward in ipairs(items) do
|
||||
rewards = rewards .. 'x' .. reward.quantity .. ' ' ..reward.item .. ', '
|
||||
end
|
||||
rewards = rewards:sub(1, -3)
|
||||
GlobalState.started = false
|
||||
states[identifier].state = nil
|
||||
states[identifier].completed = os.time()
|
||||
StartCooldown()
|
||||
if sv_config.logs.events.safe_robbed and #items > 0 then
|
||||
---@diagnostic disable-next-line: undefined-field
|
||||
PlayerLog(source, locale('logs.safe-robbed-title'), locale('logs.safe-robbed-message', name, identifier, rewards))
|
||||
end
|
||||
end)
|
||||
|
||||
-- Event to handle failed robbery
|
||||
RegisterNetEvent('lation_247robbery:FailedRobbery', function()
|
||||
if not source then
|
||||
EventLog('[main.lua]: lation_247robbery:FailedRobbery: unable to retrieve source', 'error')
|
||||
return
|
||||
end
|
||||
local source = source
|
||||
local identifier = GetIdentifier(source)
|
||||
if not identifier then
|
||||
EventLog('[main.lua]: lation_247robbery:FailedRobbery: unable to retrieve player identifier', 'error')
|
||||
return
|
||||
end
|
||||
local name = GetName(source)
|
||||
if not name then
|
||||
EventLog('[main.lua]: lation_247robbery:FailedRobbery: unable to retrieve player name', 'error')
|
||||
return
|
||||
end
|
||||
if not GlobalState.started then
|
||||
EventLog('[main.lua]: lation_247robbery:FailedRobbery: global state wasnt initiated', 'error')
|
||||
return
|
||||
end
|
||||
if not states[identifier] or states[identifier].state ~= 'completed' then
|
||||
EventLog('[main.lua]: lation_247robbery:FailedRobbery: robbery wasnt initiated for player', 'error')
|
||||
return
|
||||
end
|
||||
local isNearRegister = IsPlayerNearby(source, 'computers')
|
||||
if not isNearRegister then
|
||||
EventLog('[main.lua]: lation_247robbery:CompleteRegisterRobbery: player not nearby any registers', 'error')
|
||||
return
|
||||
end
|
||||
GlobalState.started = false
|
||||
states[identifier].state = nil
|
||||
states[identifier].completed = os.time()
|
||||
StartCooldown()
|
||||
end)
|
||||
|
||||
InitializeStores()
|
|
@ -0,0 +1,67 @@
|
|||
-- Initialize config(s)
|
||||
local sh_config = require 'config.shared'
|
||||
|
||||
-- Set resource
|
||||
local resourceName = 'lation_247robbery'
|
||||
local currentVersion = GetResourceMetadata(resourceName, 'version', 0)
|
||||
local currentName = GetCurrentResourceName()
|
||||
|
||||
-- Pls.. for the love of my analytics :sob:
|
||||
if currentName == resourceName .. '-main' then
|
||||
print("^1[Error]: Please remove the trailing '-main' from your resource folder name^0")
|
||||
print("^1[Error]: The resource folder should be named: 'lation_247robbery'^0")
|
||||
CreateThread(function()
|
||||
while true do
|
||||
Wait(60000)
|
||||
print("^1[Error]: Please remove the trailing '-main' from your resource folder name^0")
|
||||
print("^1[Error]: The resource folder should be named: 'lation_247robbery'^0")
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
-- Check script version
|
||||
local function checkversion()
|
||||
if not currentVersion then
|
||||
print("^1[Error]: Unable to determine current resource version for '" ..resourceName.. "'^0")
|
||||
return
|
||||
end
|
||||
SetTimeout(1000, function()
|
||||
PerformHttpRequest('https://api.github.com/repos/IamLation/' ..resourceName.. '/releases/latest', function(status, response)
|
||||
if status ~= 200 then return end
|
||||
response = json.decode(response)
|
||||
local latestVersion = response.tag_name
|
||||
if not latestVersion or latestVersion == currentVersion then return end
|
||||
if latestVersion ~= currentVersion then
|
||||
print('^3An update is available for ' ..resourceName.. '^0')
|
||||
print('^3Your Version: ^1' ..currentVersion.. '^0 | ^3Latest Version: ^2' ..latestVersion.. '^0')
|
||||
print('^3Download the latest release from https://github.com/IamLation/'..resourceName..'/releases/'..latestVersion..'^0')
|
||||
print('^3For more information about this update visit our Discord: https://discord.gg/9EbY4nM5uu^0')
|
||||
end
|
||||
end, 'GET')
|
||||
end)
|
||||
end
|
||||
|
||||
-- Thank you :)
|
||||
local function thankyou()
|
||||
SetTimeout(1500, function()
|
||||
print(' ')
|
||||
print('^2████████ ██ ██ █████ ███ ██ ██ ██ ███████ ██^0')
|
||||
print('^2 ██ ██ ██ ██ ██ ████ ██ ██ ██ ██ ██^0')
|
||||
print('^2 ██ ███████ ███████ ██ ██ ██ █████ ███████ ██^0')
|
||||
print('^2 ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ^0')
|
||||
print('^2 ██ ██ ██ ██ ██ ██ ████ ██ ██ ███████ ██^0')
|
||||
print(' ')
|
||||
print('^2YOU DID IT! You set YouFoundTheBestScripts to true!^0')
|
||||
print('^2I (Lation) officially love you, and as a thank you I want to give you a gift..^0')
|
||||
print('^2Here\'s a secret 20% OFF any script of your choice on https://lationscripts.com^0')
|
||||
print('^2Using the coupon code: "SECRETGIFT" (one-time use coupon, choose wisely)^0')
|
||||
end)
|
||||
end
|
||||
|
||||
if sh_config.setup.version then
|
||||
checkversion()
|
||||
end
|
||||
|
||||
if sh_config.YouFoundTheBestScripts then
|
||||
thankyou()
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue