This I made for people who cant configure the esx_kashacters and to fix all the issue ! thanks to KASH to make this nice Feature

Thanks You KASH (github.com/KASHZIN)Who The Original Develop This ESX_KASHACTERS RELEASE And To for the tutorial XxFri3ndlyxX (github.com/XxFri3ndlyxX)

this tutorial i made little bit use XxFri3ndlyxX tutorial

1.Step One [ essentialmode\client\main.lua ]

Delete Or Replace This !
--[[Citizen.CreateThread(function()
	while true do
		Citizen.Wait(0)

		if NetworkIsSessionStarted() then
			TriggerServerEvent('es:firstJoinProper')
			TriggerEvent('es:allowedToSpawn')
			return
		end
	end
end)]]--

2.Step Two [ es_extended [ LINE : 457 ] client/main.lua ]
This To Fix Cant Open Inventory When You Die And Get Revived

Change You Menu interactions to this !
``` ---Menu interactions
Citizen.CreateThread(function()
	while true do
		
		Citizen.Wait(0)

		if IsControlJustReleased(0, 289) and IsInputDisabled(0) and not ESX.UI.Menu.IsOpen('default', 'es_extended', 'inventory') then
			ESX.ShowInventory()
		end

	end
end)```

3. Step Three 
To Get Your esx_kashacters work you need do this on your database

SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME = 'owner'
And This
SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME = 'indentifier'
Credit @Xnubil

6. Step Six [Fix Datastore]
Duplicate Your esx_datastore or add This line on your esx_datastore server\main.lua

-- Fix was taken from this link --
-- https://forum.fivem.net/t/release-esx-kashacters-multi-character/251613/448?u=xxfri3ndlyxx --
AddEventHandler('esx:playerLoaded', function(source)

  local result = MySQL.Sync.fetchAll('SELECT * FROM datastore')

	for i=1, #result, 1 do
		local name   = result[i].name
		local label  = result[i].label
		local shared = result[i].shared

		local result2 = MySQL.Sync.fetchAll('SELECT * FROM datastore_data WHERE name = @name', {
			['@name'] = name
		})

		if shared == 0 then

			table.insert(DataStoresIndex, name)
			DataStores[name] = {}

			for j=1, #result2, 1 do
				local storeName  = result2[j].name
				local storeOwner = result2[j].owner
				local storeData  = (result2[j].data == nil and {} or json.decode(result2[j].data))
				local dataStore  = CreateDataStore(storeName, storeOwner, storeData)

				table.insert(DataStores[name], dataStore)
			end
		end
	end

	local _source = source
	local xPlayer = ESX.GetPlayerFromId(_source)
  	local dataStores = {}
  
	for i=1, #DataStoresIndex, 1 do
		local name      = DataStoresIndex[i]
		local dataStore = GetDataStore(name, xPlayer.identifier)

		if dataStore == nil then
			MySQL.Async.execute('INSERT INTO datastore_data (name, owner, data) VALUES (@name, @owner, @data)',
			{
				['@name']  = name,
				['@owner'] = xPlayer.identifier,
				['@data']  = '{}'
			})

			dataStore = CreateDataStore(name, xPlayer.identifier, {})
			table.insert(DataStores[name], dataStore)
		end

		table.insert(dataStores, dataStore)
	end

	xPlayer.set('dataStores', dataStores)
end)

Download Link : https://github.com/XxFri3ndlyxX/esx_datastore
Credits : https://github.com/XxFri3ndlyxX

5. Step Five [ Fix Ambulance ]
This To Fix Die Tele And When Your Get Revived You Cant Open any Menu only F2

Download My File the esx_ambulancejob (or download the lastest version esx_ambulancejob :v)

6. Step Six [ Fix your esx_kashacters identifier ]
Download My mysql-async And start on your server.cfg

7. Step Seven [ Fix Your Identifier And Spawn] 
Download My esx_kashacters Modified And start on your server.cfg
Thats All Identifier [esx_kashacters\server\main.lua] maybe thats all
you need in Roleplay Server if you wan to change just change it 

===--------------------------------------------------------------------===

Okey Thats All Make My esx_kashacters work properly if you wanna ask
My Discord : Blue.#5108

Thank you Again to KASH And XxFri3ndlyxX ! :)
ENJOY YOUR ESX_KASHACTERS
This commit is contained in:
EbenSantuy
2019-07-17 15:26:07 +07:00
committed by GitHub
commit 5b591a94b5
41 changed files with 19582 additions and 0 deletions
+674
View File
@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://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.
fxserver-esx_ambulancejob
Copyright (C) 2015 Jérémie N'gadi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://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:
fxserver-esx_ambulancejob Copyright (C) 2015 Jérémie N'gadi
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://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
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+48
View File
@@ -0,0 +1,48 @@
# esx_ambulancejob
## Requirements
* Auto mode
- [esx_skin](https://github.com/ESX-Org/esx_skin)
- [esx_vehicleshop](https://github.com/ESX-Org/esx_vehicleshop)
* Player management (boss actions)
- [esx_society](https://github.com/ESX-Org/esx_society)
## Download & Installation
### Using [fvm](https://github.com/qlaffont/fvm-installer)
```
fvm install --save --folder=esx esx-org/esx_ambulancejob
```
### Using Git
```
cd resources
git clone https://github.com/ESX-Org/esx_ambulancejob [esx]/esx_ambulancejob
```
### Manually
- Download https://github.com/ESX-Org/esx_ambulancejob/archive/master.zip
- Put it in the `[esx]` directory
## Installation
- Import `esx_ambulancejob.sql` in your database
- If you want player management you have to set `Config.EnablePlayerManagement` to `true` in `config.lua`
- Add this in your `server.cfg`:
```
start esx_ambulancejob
```
# Legal
### License
esx_ambulancejob - ambulance script for fivem
Copyright (C) 2015-2018 Jérémie N'gadi
This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version.
This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details.
You should have received a copy Of the GNU General Public License along with this program. If Not, see http://www.gnu.org/licenses/.
+40
View File
@@ -0,0 +1,40 @@
resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'
description 'ESX Ambulance Job'
version '1.2.0'
server_scripts {
'@mysql-async/lib/MySQL.lua',
'@es_extended/locale.lua',
'locales/br.lua',
'locales/en.lua',
'locales/fi.lua',
'locales/fr.lua',
'locales/es.lua',
'locales/sv.lua',
'locales/pl.lua',
'locales/cs.lua',
'config.lua',
'server/main.lua'
}
client_scripts {
'@es_extended/locale.lua',
'locales/br.lua',
'locales/en.lua',
'locales/fi.lua',
'locales/fr.lua',
'locales/es.lua',
'locales/sv.lua',
'locales/pl.lua',
'locales/cs.lua',
'config.lua',
'client/main.lua',
'client/job.lua'
}
dependencies {
'es_extended',
'esx_vehicleshop'
}
+918
View File
@@ -0,0 +1,918 @@
local CurrentAction, CurrentActionMsg, CurrentActionData = nil, '', {}
local HasAlreadyEnteredMarker, LastHospital, LastPart, LastPartNum
local IsBusy = false
local spawnedVehicles, isInShopMenu = {}, false
function OpenAmbulanceActionsMenu()
local elements = {
{label = _U('cloakroom'), value = 'cloakroom'}
}
if Config.EnablePlayerManagement and ESX.PlayerData.job.grade_name == 'boss' then
table.insert(elements, {label = _U('boss_actions'), value = 'boss_actions'})
end
ESX.UI.Menu.CloseAll()
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'ambulance_actions', {
title = _U('ambulance'),
align = 'top-left',
elements = elements
}, function(data, menu)
if data.current.value == 'cloakroom' then
OpenCloakroomMenu()
elseif data.current.value == 'boss_actions' then
TriggerEvent('esx_society:openBossMenu', 'ambulance', function(data, menu)
menu.close()
end, {wash = false})
end
end, function(data, menu)
menu.close()
end)
end
function OpenMobileAmbulanceActionsMenu()
ESX.UI.Menu.CloseAll()
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'mobile_ambulance_actions', {
title = _U('ambulance'),
align = 'top-left',
elements = {
{label = _U('ems_menu'), value = 'citizen_interaction'}
}
}, function(data, menu)
if data.current.value == 'citizen_interaction' then
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'citizen_interaction', {
title = _U('ems_menu_title'),
align = 'top-left',
elements = {
{label = _U('ems_menu_revive'), value = 'revive'},
{label = _U('ems_menu_small'), value = 'small'},
{label = _U('ems_menu_big'), value = 'big'},
{label = _U('ems_menu_putincar'), value = 'put_in_vehicle'}
}
}, function(data, menu)
if IsBusy then return end
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
if closestPlayer == -1 or closestDistance > 1.0 then
ESX.ShowNotification(_U('no_players'))
else
if data.current.value == 'revive' then
IsBusy = true
ESX.TriggerServerCallback('esx_ambulancejob:getItemAmount', function(quantity)
if quantity > 0 then
local closestPlayerPed = GetPlayerPed(closestPlayer)
if IsPedDeadOrDying(closestPlayerPed, 1) then
local playerPed = PlayerPedId()
ESX.ShowNotification(_U('revive_inprogress'))
local lib, anim = 'mini@cpr@char_a@cpr_str', 'cpr_pumpchest'
for i=1, 15, 1 do
Citizen.Wait(900)
ESX.Streaming.RequestAnimDict(lib, function()
TaskPlayAnim(PlayerPedId(), lib, anim, 8.0, -8.0, -1, 0, 0, false, false, false)
end)
end
TriggerServerEvent('esx_ambulancejob:removeItem', 'medikit')
TriggerServerEvent('esx_ambulancejob:revive', GetPlayerServerId(closestPlayer))
-- Show revive award?
if Config.ReviveReward > 0 then
ESX.ShowNotification(_U('revive_complete_award', GetPlayerName(closestPlayer), Config.ReviveReward))
else
ESX.ShowNotification(_U('revive_complete', GetPlayerName(closestPlayer)))
end
else
ESX.ShowNotification(_U('player_not_unconscious'))
end
else
ESX.ShowNotification(_U('not_enough_medikit'))
end
IsBusy = false
end, 'medikit')
elseif data.current.value == 'small' then
ESX.TriggerServerCallback('esx_ambulancejob:getItemAmount', function(quantity)
if quantity > 0 then
local closestPlayerPed = GetPlayerPed(closestPlayer)
local health = GetEntityHealth(closestPlayerPed)
if health > 0 then
local playerPed = PlayerPedId()
IsBusy = true
ESX.ShowNotification(_U('heal_inprogress'))
TaskStartScenarioInPlace(playerPed, 'CODE_HUMAN_MEDIC_TEND_TO_DEAD', 0, true)
Citizen.Wait(10000)
ClearPedTasks(playerPed)
TriggerServerEvent('esx_ambulancejob:removeItem', 'bandage')
TriggerServerEvent('esx_ambulancejob:heal', GetPlayerServerId(closestPlayer), 'small')
ESX.ShowNotification(_U('heal_complete', GetPlayerName(closestPlayer)))
IsBusy = false
else
ESX.ShowNotification(_U('player_not_conscious'))
end
else
ESX.ShowNotification(_U('not_enough_bandage'))
end
end, 'bandage')
elseif data.current.value == 'big' then
ESX.TriggerServerCallback('esx_ambulancejob:getItemAmount', function(quantity)
if quantity > 0 then
local closestPlayerPed = GetPlayerPed(closestPlayer)
local health = GetEntityHealth(closestPlayerPed)
if health > 0 then
local playerPed = PlayerPedId()
IsBusy = true
ESX.ShowNotification(_U('heal_inprogress'))
TaskStartScenarioInPlace(playerPed, 'CODE_HUMAN_MEDIC_TEND_TO_DEAD', 0, true)
Citizen.Wait(10000)
ClearPedTasks(playerPed)
TriggerServerEvent('esx_ambulancejob:removeItem', 'medikit')
TriggerServerEvent('esx_ambulancejob:heal', GetPlayerServerId(closestPlayer), 'big')
ESX.ShowNotification(_U('heal_complete', GetPlayerName(closestPlayer)))
IsBusy = false
else
ESX.ShowNotification(_U('player_not_conscious'))
end
else
ESX.ShowNotification(_U('not_enough_medikit'))
end
end, 'medikit')
elseif data.current.value == 'put_in_vehicle' then
TriggerServerEvent('esx_ambulancejob:putInVehicle', GetPlayerServerId(closestPlayer))
end
end
end, function(data, menu)
menu.close()
end)
end
end, function(data, menu)
menu.close()
end)
end
function FastTravel(coords, heading)
local playerPed = PlayerPedId()
DoScreenFadeOut(800)
while not IsScreenFadedOut() do
Citizen.Wait(500)
end
ESX.Game.Teleport(playerPed, coords, function()
DoScreenFadeIn(800)
if heading then
SetEntityHeading(playerPed, heading)
end
end)
end
-- Draw markers & Marker logic
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
local playerCoords = GetEntityCoords(PlayerPedId())
local letSleep, isInMarker, hasExited = true, false, false
local currentHospital, currentPart, currentPartNum
for hospitalNum,hospital in pairs(Config.Hospitals) do
-- Ambulance Actions
for k,v in ipairs(hospital.AmbulanceActions) do
local distance = GetDistanceBetweenCoords(playerCoords, v, true)
if distance < Config.DrawDistance then
DrawMarker(Config.Marker.type, v, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Config.Marker.x, Config.Marker.y, Config.Marker.z, Config.Marker.r, Config.Marker.g, Config.Marker.b, Config.Marker.a, false, false, 2, Config.Marker.rotate, nil, nil, false)
letSleep = false
end
if distance < Config.Marker.x then
isInMarker, currentHospital, currentPart, currentPartNum = true, hospitalNum, 'AmbulanceActions', k
end
end
-- Pharmacies
for k,v in ipairs(hospital.Pharmacies) do
local distance = GetDistanceBetweenCoords(playerCoords, v, true)
if distance < Config.DrawDistance then
DrawMarker(Config.Marker.type, v, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Config.Marker.x, Config.Marker.y, Config.Marker.z, Config.Marker.r, Config.Marker.g, Config.Marker.b, Config.Marker.a, false, false, 2, Config.Marker.rotate, nil, nil, false)
letSleep = false
end
if distance < Config.Marker.x then
isInMarker, currentHospital, currentPart, currentPartNum = true, hospitalNum, 'Pharmacy', k
end
end
-- Vehicle Spawners
for k,v in ipairs(hospital.Vehicles) do
local distance = GetDistanceBetweenCoords(playerCoords, v.Spawner, true)
if distance < Config.DrawDistance then
DrawMarker(v.Marker.type, v.Spawner, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, v.Marker.x, v.Marker.y, v.Marker.z, v.Marker.r, v.Marker.g, v.Marker.b, v.Marker.a, false, false, 2, v.Marker.rotate, nil, nil, false)
letSleep = false
end
if distance < v.Marker.x then
isInMarker, currentHospital, currentPart, currentPartNum = true, hospitalNum, 'Vehicles', k
end
end
-- Helicopter Spawners
for k,v in ipairs(hospital.Helicopters) do
local distance = GetDistanceBetweenCoords(playerCoords, v.Spawner, true)
if distance < Config.DrawDistance then
DrawMarker(v.Marker.type, v.Spawner, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, v.Marker.x, v.Marker.y, v.Marker.z, v.Marker.r, v.Marker.g, v.Marker.b, v.Marker.a, false, false, 2, v.Marker.rotate, nil, nil, false)
letSleep = false
end
if distance < v.Marker.x then
isInMarker, currentHospital, currentPart, currentPartNum = true, hospitalNum, 'Helicopters', k
end
end
-- Fast Travels
for k,v in ipairs(hospital.FastTravels) do
local distance = GetDistanceBetweenCoords(playerCoords, v.From, true)
if distance < Config.DrawDistance then
DrawMarker(v.Marker.type, v.From, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, v.Marker.x, v.Marker.y, v.Marker.z, v.Marker.r, v.Marker.g, v.Marker.b, v.Marker.a, false, false, 2, v.Marker.rotate, nil, nil, false)
letSleep = false
end
if distance < v.Marker.x then
FastTravel(v.To.coords, v.To.heading)
end
end
-- Fast Travels (Prompt)
for k,v in ipairs(hospital.FastTravelsPrompt) do
local distance = GetDistanceBetweenCoords(playerCoords, v.From, true)
if distance < Config.DrawDistance then
DrawMarker(v.Marker.type, v.From, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, v.Marker.x, v.Marker.y, v.Marker.z, v.Marker.r, v.Marker.g, v.Marker.b, v.Marker.a, false, false, 2, v.Marker.rotate, nil, nil, false)
letSleep = false
end
if distance < v.Marker.x then
isInMarker, currentHospital, currentPart, currentPartNum = true, hospitalNum, 'FastTravelsPrompt', k
end
end
end
-- Logic for exiting & entering markers
if isInMarker and not HasAlreadyEnteredMarker or (isInMarker and (LastHospital ~= currentHospital or LastPart ~= currentPart or LastPartNum ~= currentPartNum)) then
if
(LastHospital ~= nil and LastPart ~= nil and LastPartNum ~= nil) and
(LastHospital ~= currentHospital or LastPart ~= currentPart or LastPartNum ~= currentPartNum)
then
TriggerEvent('esx_ambulancejob:hasExitedMarker', LastHospital, LastPart, LastPartNum)
hasExited = true
end
HasAlreadyEnteredMarker, LastHospital, LastPart, LastPartNum = true, currentHospital, currentPart, currentPartNum
TriggerEvent('esx_ambulancejob:hasEnteredMarker', currentHospital, currentPart, currentPartNum)
end
if not hasExited and not isInMarker and HasAlreadyEnteredMarker then
HasAlreadyEnteredMarker = false
TriggerEvent('esx_ambulancejob:hasExitedMarker', LastHospital, LastPart, LastPartNum)
end
if letSleep then
Citizen.Wait(500)
end
end
end)
AddEventHandler('esx_ambulancejob:hasEnteredMarker', function(hospital, part, partNum)
if ESX.PlayerData.job and ESX.PlayerData.job.name == 'ambulance' then
if part == 'AmbulanceActions' then
CurrentAction = part
CurrentActionMsg = _U('actions_prompt')
CurrentActionData = {}
elseif part == 'Pharmacy' then
CurrentAction = part
CurrentActionMsg = _U('open_pharmacy')
CurrentActionData = {}
elseif part == 'Vehicles' then
CurrentAction = part
CurrentActionMsg = _U('garage_prompt')
CurrentActionData = {hospital = hospital, partNum = partNum}
elseif part == 'Helicopters' then
CurrentAction = part
CurrentActionMsg = _U('helicopter_prompt')
CurrentActionData = {hospital = hospital, partNum = partNum}
elseif part == 'FastTravelsPrompt' then
local travelItem = Config.Hospitals[hospital][part][partNum]
CurrentAction = part
CurrentActionMsg = travelItem.Prompt
CurrentActionData = {to = travelItem.To.coords, heading = travelItem.To.heading}
end
end
end)
AddEventHandler('esx_ambulancejob:hasExitedMarker', function(hospital, part, partNum)
if not isInShopMenu then
ESX.UI.Menu.CloseAll()
end
CurrentAction = nil
end)
-- Key Controls
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
if CurrentAction then
ESX.ShowHelpNotification(CurrentActionMsg)
if IsControlJustReleased(0, Keys['E']) then
if CurrentAction == 'AmbulanceActions' then
OpenAmbulanceActionsMenu()
elseif CurrentAction == 'Pharmacy' then
OpenPharmacyMenu()
elseif CurrentAction == 'Vehicles' then
OpenVehicleSpawnerMenu(CurrentActionData.hospital, CurrentActionData.partNum)
elseif CurrentAction == 'Helicopters' then
OpenHelicopterSpawnerMenu(CurrentActionData.hospital, CurrentActionData.partNum)
elseif CurrentAction == 'FastTravelsPrompt' then
FastTravel(CurrentActionData.to, CurrentActionData.heading)
end
CurrentAction = nil
end
elseif ESX.PlayerData.job ~= nil and ESX.PlayerData.job.name == 'ambulance' and not IsDead then
if IsControlJustReleased(0, Keys['F6']) then
OpenMobileAmbulanceActionsMenu()
end
else
Citizen.Wait(500)
end
end
end)
RegisterNetEvent('esx_ambulancejob:putInVehicle')
AddEventHandler('esx_ambulancejob:putInVehicle', function()
local playerPed = PlayerPedId()
local coords = GetEntityCoords(playerPed)
if IsAnyVehicleNearPoint(coords, 5.0) then
local vehicle = GetClosestVehicle(coords, 5.0, 0, 71)
if DoesEntityExist(vehicle) then
local maxSeats, freeSeat = GetVehicleMaxNumberOfPassengers(vehicle)
for i=maxSeats - 1, 0, -1 do
if IsVehicleSeatFree(vehicle, i) then
freeSeat = i
break
end
end
if freeSeat then
TaskWarpPedIntoVehicle(playerPed, vehicle, freeSeat)
end
end
end
end)
function OpenCloakroomMenu()
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'cloakroom', {
title = _U('cloakroom'),
align = 'top-left',
elements = {
{label = _U('ems_clothes_civil'), value = 'citizen_wear'},
{label = _U('ems_clothes_ems'), value = 'ambulance_wear'},
}
}, function(data, menu)
if data.current.value == 'citizen_wear' then
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
TriggerEvent('skinchanger:loadSkin', skin)
end)
elseif data.current.value == 'ambulance_wear' then
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
if skin.sex == 0 then
TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_male)
else
TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_female)
end
end)
end
menu.close()
end, function(data, menu)
menu.close()
end)
end
function OpenVehicleSpawnerMenu(hospital, partNum)
local playerCoords = GetEntityCoords(PlayerPedId())
local elements = {
{label = _U('garage_storeditem'), action = 'garage'},
{label = _U('garage_storeitem'), action = 'store_garage'},
{label = _U('garage_buyitem'), action = 'buy_vehicle'}
}
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle', {
title = _U('garage_title'),
align = 'top-left',
elements = elements
}, function(data, menu)
if data.current.action == 'buy_vehicle' then
local shopCoords = Config.Hospitals[hospital].Vehicles[partNum].InsideShop
local shopElements = {}
local authorizedVehicles = Config.AuthorizedVehicles[ESX.PlayerData.job.grade_name]
if #authorizedVehicles > 0 then
for k,vehicle in ipairs(authorizedVehicles) do
table.insert(shopElements, {
label = ('%s - <span style="color:green;">%s</span>'):format(vehicle.label, _U('shop_item', ESX.Math.GroupDigits(vehicle.price))),
name = vehicle.label,
model = vehicle.model,
price = vehicle.price,
type = 'car'
})
end
else
return
end
OpenShopMenu(shopElements, playerCoords, shopCoords)
elseif data.current.action == 'garage' then
local garage = {}
ESX.TriggerServerCallback('esx_vehicleshop:retrieveJobVehicles', function(jobVehicles)
if #jobVehicles > 0 then
for k,v in ipairs(jobVehicles) do
local props = json.decode(v.vehicle)
local vehicleName = GetLabelText(GetDisplayNameFromVehicleModel(props.model))
local label = ('%s - <span style="color:darkgoldenrod;">%s</span>: '):format(vehicleName, props.plate)
if v.stored then
label = label .. ('<span style="color:green;">%s</span>'):format(_U('garage_stored'))
else
label = label .. ('<span style="color:darkred;">%s</span>'):format(_U('garage_notstored'))
end
table.insert(garage, {
label = label,
stored = v.stored,
model = props.model,
vehicleProps = props
})
end
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_garage', {
title = _U('garage_title'),
align = 'top-left',
elements = garage
}, function(data2, menu2)
if data2.current.stored then
local foundSpawn, spawnPoint = GetAvailableVehicleSpawnPoint(hospital, 'Vehicles', partNum)
if foundSpawn then
menu2.close()
ESX.Game.SpawnVehicle(data2.current.model, spawnPoint.coords, spawnPoint.heading, function(vehicle)
ESX.Game.SetVehicleProperties(vehicle, data2.current.vehicleProps)
TriggerServerEvent('esx_vehicleshop:setJobVehicleState', data2.current.vehicleProps.plate, false)
ESX.ShowNotification(_U('garage_released'))
end)
end
else
ESX.ShowNotification(_U('garage_notavailable'))
end
end, function(data2, menu2)
menu2.close()
end)
else
ESX.ShowNotification(_U('garage_empty'))
end
end, 'car')
elseif data.current.action == 'store_garage' then
StoreNearbyVehicle(playerCoords)
end
end, function(data, menu)
menu.close()
end)
end
function StoreNearbyVehicle(playerCoords)
local vehicles, vehiclePlates = ESX.Game.GetVehiclesInArea(playerCoords, 30.0), {}
if #vehicles > 0 then
for k,v in ipairs(vehicles) do
-- Make sure the vehicle we're saving is empty, or else it wont be deleted
if GetVehicleNumberOfPassengers(v) == 0 and IsVehicleSeatFree(v, -1) then
table.insert(vehiclePlates, {
vehicle = v,
plate = ESX.Math.Trim(GetVehicleNumberPlateText(v))
})
end
end
else
ESX.ShowNotification(_U('garage_store_nearby'))
return
end
ESX.TriggerServerCallback('esx_ambulancejob:storeNearbyVehicle', function(storeSuccess, foundNum)
if storeSuccess then
local vehicleId = vehiclePlates[foundNum]
local attempts = 0
ESX.Game.DeleteVehicle(vehicleId.vehicle)
IsBusy = true
Citizen.CreateThread(function()
while IsBusy do
Citizen.Wait(0)
drawLoadingText(_U('garage_storing'), 255, 255, 255, 255)
end
end)
-- Workaround for vehicle not deleting when other players are near it.
while DoesEntityExist(vehicleId.vehicle) do
Citizen.Wait(500)
attempts = attempts + 1
-- Give up
if attempts > 30 then
break
end
vehicles = ESX.Game.GetVehiclesInArea(playerCoords, 30.0)
if #vehicles > 0 then
for k,v in ipairs(vehicles) do
if ESX.Math.Trim(GetVehicleNumberPlateText(v)) == vehicleId.plate then
ESX.Game.DeleteVehicle(v)
break
end
end
end
end
IsBusy = false
ESX.ShowNotification(_U('garage_has_stored'))
else
ESX.ShowNotification(_U('garage_has_notstored'))
end
end, vehiclePlates)
end
function GetAvailableVehicleSpawnPoint(hospital, part, partNum)
local spawnPoints = Config.Hospitals[hospital][part][partNum].SpawnPoints
local found, foundSpawnPoint = false, nil
for i=1, #spawnPoints, 1 do
if ESX.Game.IsSpawnPointClear(spawnPoints[i].coords, spawnPoints[i].radius) then
found, foundSpawnPoint = true, spawnPoints[i]
break
end
end
if found then
return true, foundSpawnPoint
else
ESX.ShowNotification(_U('garage_blocked'))
return false
end
end
function OpenHelicopterSpawnerMenu(hospital, partNum)
local playerCoords = GetEntityCoords(PlayerPedId())
ESX.PlayerData = ESX.GetPlayerData()
local elements = {
{label = _U('helicopter_garage'), action = 'garage'},
{label = _U('helicopter_store'), action = 'store_garage'},
{label = _U('helicopter_buy'), action = 'buy_helicopter'}
}
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'helicopter_spawner', {
title = _U('helicopter_title'),
align = 'top-left',
elements = elements
}, function(data, menu)
if data.current.action == 'buy_helicopter' then
local shopCoords = Config.Hospitals[hospital].Helicopters[partNum].InsideShop
local shopElements = {}
local authorizedHelicopters = Config.AuthorizedHelicopters[ESX.PlayerData.job.grade_name]
if #authorizedHelicopters > 0 then
for k,helicopter in ipairs(authorizedHelicopters) do
table.insert(shopElements, {
label = ('%s - <span style="color:green;">%s</span>'):format(helicopter.label, _U('shop_item', ESX.Math.GroupDigits(helicopter.price))),
name = helicopter.label,
model = helicopter.model,
price = helicopter.price,
type = 'helicopter'
})
end
else
ESX.ShowNotification(_U('helicopter_notauthorized'))
return
end
OpenShopMenu(shopElements, playerCoords, shopCoords)
elseif data.current.action == 'garage' then
local garage = {}
ESX.TriggerServerCallback('esx_vehicleshop:retrieveJobVehicles', function(jobVehicles)
if #jobVehicles > 0 then
for k,v in ipairs(jobVehicles) do
local props = json.decode(v.vehicle)
local vehicleName = GetLabelText(GetDisplayNameFromVehicleModel(props.model))
local label = ('%s - <span style="color:darkgoldenrod;">%s</span>: '):format(vehicleName, props.plate)
if v.stored then
label = label .. ('<span style="color:green;">%s</span>'):format(_U('garage_stored'))
else
label = label .. ('<span style="color:darkred;">%s</span>'):format(_U('garage_notstored'))
end
table.insert(garage, {
label = label,
stored = v.stored,
model = props.model,
vehicleProps = props
})
end
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'helicopter_garage', {
title = _U('helicopter_garage_title'),
align = 'top-left',
elements = garage
}, function(data2, menu2)
if data2.current.stored then
local foundSpawn, spawnPoint = GetAvailableVehicleSpawnPoint(hospital, 'Helicopters', partNum)
if foundSpawn then
menu2.close()
ESX.Game.SpawnVehicle(data2.current.model, spawnPoint.coords, spawnPoint.heading, function(vehicle)
ESX.Game.SetVehicleProperties(vehicle, data2.current.vehicleProps)
TriggerServerEvent('esx_vehicleshop:setJobVehicleState', data2.current.vehicleProps.plate, false)
ESX.ShowNotification(_U('garage_released'))
end)
end
else
ESX.ShowNotification(_U('garage_notavailable'))
end
end, function(data2, menu2)
menu2.close()
end)
else
ESX.ShowNotification(_U('garage_empty'))
end
end, 'helicopter')
elseif data.current.action == 'store_garage' then
StoreNearbyVehicle(playerCoords)
end
end, function(data, menu)
menu.close()
end)
end
function OpenShopMenu(elements, restoreCoords, shopCoords)
local playerPed = PlayerPedId()
isInShopMenu = true
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_shop', {
title = _U('vehicleshop_title'),
align = 'top-left',
elements = elements
}, function(data, menu)
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_shop_confirm', {
title = _U('vehicleshop_confirm', data.current.name, data.current.price),
align = 'top-left',
elements = {
{ label = _U('confirm_no'), value = 'no' },
{ label = _U('confirm_yes'), value = 'yes' }
}
}, function(data2, menu2)
if data2.current.value == 'yes' then
local newPlate = exports['esx_vehicleshop']:GeneratePlate()
local vehicle = GetVehiclePedIsIn(playerPed, false)
local props = ESX.Game.GetVehicleProperties(vehicle)
props.plate = newPlate
ESX.TriggerServerCallback('esx_ambulancejob:buyJobVehicle', function (bought)
if bought then
ESX.ShowNotification(_U('vehicleshop_bought', data.current.name, ESX.Math.GroupDigits(data.current.price)))
isInShopMenu = false
ESX.UI.Menu.CloseAll()
DeleteSpawnedVehicles()
FreezeEntityPosition(playerPed, false)
SetEntityVisible(playerPed, true)
ESX.Game.Teleport(playerPed, restoreCoords)
else
ESX.ShowNotification(_U('vehicleshop_money'))
menu2.close()
end
end, props, data.current.type)
else
menu2.close()
end
end, function(data2, menu2)
menu2.close()
end)
end, function(data, menu)
isInShopMenu = false
ESX.UI.Menu.CloseAll()
DeleteSpawnedVehicles()
FreezeEntityPosition(playerPed, false)
SetEntityVisible(playerPed, true)
ESX.Game.Teleport(playerPed, restoreCoords)
end, function(data, menu)
DeleteSpawnedVehicles()
WaitForVehicleToLoad(data.current.model)
ESX.Game.SpawnLocalVehicle(data.current.model, shopCoords, 0.0, function(vehicle)
table.insert(spawnedVehicles, vehicle)
TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
FreezeEntityPosition(vehicle, true)
end)
end)
WaitForVehicleToLoad(elements[1].model)
ESX.Game.SpawnLocalVehicle(elements[1].model, shopCoords, 0.0, function(vehicle)
table.insert(spawnedVehicles, vehicle)
TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
FreezeEntityPosition(vehicle, true)
end)
end
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
if isInShopMenu then
DisableControlAction(0, 75, true) -- Disable exit vehicle
DisableControlAction(27, 75, true) -- Disable exit vehicle
else
Citizen.Wait(500)
end
end
end)
function DeleteSpawnedVehicles()
while #spawnedVehicles > 0 do
local vehicle = spawnedVehicles[1]
ESX.Game.DeleteVehicle(vehicle)
table.remove(spawnedVehicles, 1)
end
end
function WaitForVehicleToLoad(modelHash)
modelHash = (type(modelHash) == 'number' and modelHash or GetHashKey(modelHash))
if not HasModelLoaded(modelHash) then
RequestModel(modelHash)
while not HasModelLoaded(modelHash) do
Citizen.Wait(0)
DisableControlAction(0, Keys['TOP'], true)
DisableControlAction(0, Keys['DOWN'], true)
DisableControlAction(0, Keys['LEFT'], true)
DisableControlAction(0, Keys['RIGHT'], true)
DisableControlAction(0, 176, true) -- ENTER key
DisableControlAction(0, Keys['BACKSPACE'], true)
drawLoadingText(_U('vehicleshop_awaiting_model'), 255, 255, 255, 255)
end
end
end
function drawLoadingText(text, red, green, blue, alpha)
SetTextFont(4)
SetTextScale(0.0, 0.5)
SetTextColour(red, green, blue, alpha)
SetTextDropshadow(0, 0, 0, 0, 255)
SetTextEdge(1, 0, 0, 0, 255)
SetTextDropShadow()
SetTextOutline()
SetTextCentre(true)
BeginTextCommandDisplayText("STRING")
AddTextComponentSubstringPlayerName(text)
EndTextCommandDisplayText(0.5, 0.5)
end
function OpenPharmacyMenu()
ESX.UI.Menu.CloseAll()
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'pharmacy', {
title = _U('pharmacy_menu_title'),
align = 'top-left',
elements = {
{label = _U('pharmacy_take', _U('medikit')), value = 'medikit'},
{label = _U('pharmacy_take', _U('bandage')), value = 'bandage'}
}
}, function(data, menu)
TriggerServerEvent('esx_ambulancejob:giveItem', data.current.value)
end, function(data, menu)
menu.close()
end)
end
function WarpPedInClosestVehicle(ped)
local coords = GetEntityCoords(ped)
local vehicle, distance = ESX.Game.GetClosestVehicle(coords)
if distance ~= -1 and distance <= 5.0 then
local maxSeats, freeSeat = GetVehicleMaxNumberOfPassengers(vehicle)
for i=maxSeats - 1, 0, -1 do
if IsVehicleSeatFree(vehicle, i) then
freeSeat = i
break
end
end
if freeSeat then
TaskWarpPedIntoVehicle(ped, vehicle, freeSeat)
end
else
ESX.ShowNotification(_U('no_vehicles'))
end
end
RegisterNetEvent('esx_ambulancejob:heal')
AddEventHandler('esx_ambulancejob:heal', function(healType, quiet)
local playerPed = PlayerPedId()
local maxHealth = GetEntityMaxHealth(playerPed)
if healType == 'small' then
local health = GetEntityHealth(playerPed)
local newHealth = math.min(maxHealth, math.floor(health + maxHealth / 8))
SetEntityHealth(playerPed, newHealth)
elseif healType == 'big' then
SetEntityHealth(playerPed, maxHealth)
end
if not quiet then
ESX.ShowNotification(_U('healed'))
end
end)
+396
View File
@@ -0,0 +1,396 @@
Keys = {
["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57,
["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177,
["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18,
["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182,
["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81,
["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70,
["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178,
["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173,
["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118
}
local FirstSpawn, PlayerLoaded = true, false
IsDead = false
ESX = nil
Citizen.CreateThread(function()
while ESX == nil do
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
Citizen.Wait(0)
end
while ESX.GetPlayerData().job == nil do
Citizen.Wait(100)
end
PlayerLoaded = true
ESX.PlayerData = ESX.GetPlayerData()
end)
RegisterNetEvent('esx:playerLoaded')
AddEventHandler('esx:playerLoaded', function(xPlayer)
ESX.PlayerData = xPlayer
PlayerLoaded = true
end)
RegisterNetEvent('esx:setJob')
AddEventHandler('esx:setJob', function(job)
ESX.PlayerData.job = job
end)
AddEventHandler('playerSpawned', function()
IsDead = false
if FirstSpawn then
exports.spawnmanager:setAutoSpawn(false) -- disable respawn
FirstSpawn = false
ESX.TriggerServerCallback('esx_ambulancejob:getDeathStatus', function(isDead)
if isDead and Config.AntiCombatLog then
while not PlayerLoaded do
Citizen.Wait(1000)
end
ESX.ShowNotification(_U('combatlog_message'))
RemoveItemsAfterRPDeath()
end
end)
end
end)
-- Create blips
Citizen.CreateThread(function()
for k,v in pairs(Config.Hospitals) do
local blip = AddBlipForCoord(v.Blip.coords)
SetBlipSprite(blip, v.Blip.sprite)
SetBlipScale(blip, v.Blip.scale)
SetBlipColour(blip, v.Blip.color)
SetBlipAsShortRange(blip, true)
BeginTextCommandSetBlipName('STRING')
AddTextComponentSubstringPlayerName(_U('hospital'))
EndTextCommandSetBlipName(blip)
end
end)
-- Disable most inputs when dead
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
if IsDead then
DisableAllControlActions(0)
EnableControlAction(0, Keys['G'], true)
EnableControlAction(0, Keys['T'], true)
EnableControlAction(0, Keys['E'], true)
else
Citizen.Wait(500)
end
end
end)
function OnPlayerDeath()
IsDead = true
ESX.UI.Menu.CloseAll()
TriggerServerEvent('esx_ambulancejob:setDeathStatus', true)
StartDeathTimer()
StartDistressSignal()
StartScreenEffect('DeathFailOut', 0, false)
end
RegisterNetEvent('esx_ambulancejob:useItem')
AddEventHandler('esx_ambulancejob:useItem', function(itemName)
ESX.UI.Menu.CloseAll()
if itemName == 'medikit' then
local lib, anim = 'anim@heists@narcotics@funding@gang_idle', 'gang_chatting_idle01' -- TODO better animations
local playerPed = PlayerPedId()
ESX.Streaming.RequestAnimDict(lib, function()
TaskPlayAnim(playerPed, lib, anim, 8.0, -8.0, -1, 0, 0, false, false, false)
Citizen.Wait(500)
while IsEntityPlayingAnim(playerPed, lib, anim, 3) do
Citizen.Wait(0)
DisableAllControlActions(0)
end
TriggerEvent('esx_ambulancejob:heal', 'big', true)
ESX.ShowNotification(_U('used_medikit'))
end)
elseif itemName == 'bandage' then
local lib, anim = 'anim@heists@narcotics@funding@gang_idle', 'gang_chatting_idle01' -- TODO better animations
local playerPed = PlayerPedId()
ESX.Streaming.RequestAnimDict(lib, function()
TaskPlayAnim(playerPed, lib, anim, 8.0, -8.0, -1, 0, 0, false, false, false)
Citizen.Wait(500)
while IsEntityPlayingAnim(playerPed, lib, anim, 3) do
Citizen.Wait(0)
DisableAllControlActions(0)
end
TriggerEvent('esx_ambulancejob:heal', 'small', true)
ESX.ShowNotification(_U('used_bandage'))
end)
end
end)
function StartDistressSignal()
Citizen.CreateThread(function()
local timer = Config.BleedoutTimer
while timer > 0 and IsDead do
Citizen.Wait(2)
timer = timer - 30
SetTextFont(4)
SetTextScale(0.45, 0.45)
SetTextColour(185, 185, 185, 255)
SetTextDropshadow(0, 0, 0, 0, 255)
SetTextEdge(1, 0, 0, 0, 255)
SetTextDropShadow()
SetTextOutline()
BeginTextCommandDisplayText('STRING')
AddTextComponentSubstringPlayerName(_U('distress_send'))
EndTextCommandDisplayText(0.175, 0.805)
if IsControlPressed(0, Keys['G']) then
SendDistressSignal()
Citizen.CreateThread(function()
Citizen.Wait(1000 * 60 * 5)
if IsDead then
StartDistressSignal()
end
end)
break
end
end
end)
end
function SendDistressSignal()
local playerPed = PlayerPedId()
local coords = GetEntityCoords(playerPed)
ESX.ShowNotification(_U('distress_sent'))
TriggerServerEvent('esx_phone:send', 'ambulance', _U('distress_message'), false, {
x = coords.x,
y = coords.y,
z = coords.z
})
end
function DrawGenericTextThisFrame()
SetTextFont(4)
SetTextScale(0.0, 0.5)
SetTextColour(255, 255, 255, 255)
SetTextDropshadow(0, 0, 0, 0, 255)
SetTextEdge(1, 0, 0, 0, 255)
SetTextDropShadow()
SetTextOutline()
SetTextCentre(true)
end
function secondsToClock(seconds)
local seconds, hours, mins, secs = tonumber(seconds), 0, 0, 0
if seconds <= 0 then
return 0, 0
else
local hours = string.format("%02.f", math.floor(seconds / 3600))
local mins = string.format("%02.f", math.floor(seconds / 60 - (hours * 60)))
local secs = string.format("%02.f", math.floor(seconds - hours * 3600 - mins * 60))
return mins, secs
end
end
function StartDeathTimer()
local canPayFine = false
if Config.EarlyRespawnFine then
ESX.TriggerServerCallback('esx_ambulancejob:checkBalance', function(canPay)
canPayFine = canPay
end)
end
local earlySpawnTimer = ESX.Math.Round(Config.EarlyRespawnTimer / 1000)
local bleedoutTimer = ESX.Math.Round(Config.BleedoutTimer / 1000)
Citizen.CreateThread(function()
-- early respawn timer
while earlySpawnTimer > 0 and IsDead do
Citizen.Wait(1000)
if earlySpawnTimer > 0 then
earlySpawnTimer = earlySpawnTimer - 1
end
end
-- bleedout timer
while bleedoutTimer > 0 and IsDead do
Citizen.Wait(1000)
if bleedoutTimer > 0 then
bleedoutTimer = bleedoutTimer - 1
end
end
end)
Citizen.CreateThread(function()
local text, timeHeld
-- early respawn timer
while earlySpawnTimer > 0 and IsDead do
Citizen.Wait(0)
text = _U('respawn_available_in', secondsToClock(earlySpawnTimer))
DrawGenericTextThisFrame()
SetTextEntry("STRING")
AddTextComponentString(text)
DrawText(0.5, 0.8)
end
-- bleedout timer
while bleedoutTimer > 0 and IsDead do
Citizen.Wait(0)
text = _U('respawn_bleedout_in', secondsToClock(bleedoutTimer))
if not Config.EarlyRespawnFine then
text = text .. _U('respawn_bleedout_prompt')
if IsControlPressed(0, Keys['E']) and timeHeld > 60 then
RemoveItemsAfterRPDeath()
break
end
elseif Config.EarlyRespawnFine and canPayFine then
text = text .. _U('respawn_bleedout_fine', ESX.Math.GroupDigits(Config.EarlyRespawnFineAmount))
if IsControlPressed(0, Keys['E']) and timeHeld > 60 then
TriggerServerEvent('esx_ambulancejob:payFine')
RemoveItemsAfterRPDeath()
break
end
end
if IsControlPressed(0, Keys['E']) then
timeHeld = timeHeld + 1
else
timeHeld = 0
end
DrawGenericTextThisFrame()
SetTextEntry("STRING")
AddTextComponentString(text)
DrawText(0.5, 0.8)
end
if bleedoutTimer < 1 and IsDead then
RemoveItemsAfterRPDeath()
end
end)
end
function RemoveItemsAfterRPDeath()
TriggerServerEvent('esx_ambulancejob:setDeathStatus', false)
Citizen.CreateThread(function()
DoScreenFadeOut(800)
while not IsScreenFadedOut() do
Citizen.Wait(10)
end
ESX.TriggerServerCallback('esx_ambulancejob:removeItemsAfterRPDeath', function()
local formattedCoords = {
x = Config.RespawnPoint.coords.x,
y = Config.RespawnPoint.coords.y,
z = Config.RespawnPoint.coords.z
}
ESX.SetPlayerData('lastPosition', formattedCoords)
ESX.SetPlayerData('loadout', {})
TriggerServerEvent('esx:updateLastPosition', formattedCoords)
RespawnPed(PlayerPedId(), formattedCoords, Config.RespawnPoint.heading)
StopScreenEffect('DeathFailOut')
DoScreenFadeIn(800)
end)
end)
end
function RespawnPed(ped, coords, heading)
SetEntityCoordsNoOffset(ped, coords.x, coords.y, coords.z, false, false, false, true)
NetworkResurrectLocalPlayer(coords.x, coords.y, coords.z, heading, true, false)
SetPlayerInvincible(ped, false)
TriggerEvent('playerSpawned', coords.x, coords.y, coords.z)
ClearPedBloodDamage(ped)
ESX.UI.Menu.CloseAll()
end
RegisterNetEvent('esx_phone:loaded')
AddEventHandler('esx_phone:loaded', function(phoneNumber, contacts)
local specialContact = {
name = 'Ambulance',
number = 'ambulance',
base64Icon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEwAACxMBAJqcGAAABp5JREFUWIW1l21sFNcVhp/58npn195de23Ha4Mh2EASSvk0CPVHmmCEI0RCTQMBKVVooxYoalBVCVokICWFVFVEFeKoUdNECkZQIlAoFGMhIkrBQGxHwhAcChjbeLcsYHvNfsx+zNz+MBDWNrYhzSvdP+e+c973XM2cc0dihFi9Yo6vSzN/63dqcwPZcnEwS9PDmYoE4IxZIj+ciBb2mteLwlZdfji+dXtNU2AkeaXhCGteLZ/X/IS64/RoR5mh9tFVAaMiAldKQUGiRzFp1wXJPj/YkxblbfFLT/tjq9/f1XD0sQyse2li7pdP5tYeLXXMMGUojAiWKeOodE1gqpmNfN2PFeoF00T2uLGKfZzTwhzqbaEmeYWAQ0K1oKIlfPb7t+7M37aruXvEBlYvnV7xz2ec/2jNs9kKooKNjlksiXhJfLqf1PXOIU9M8fmw/XgRu523eTNyhhu6xLjbSeOFC6EX3t3V9PmwBla9Vv7K7u85d3bpqlwVcvHn7B8iVX+IFQoNKdwfstuFtWoFvwp9zj5XL7nRlPXyudjS9z+u35tmuH/lu6dl7+vSVXmDUcpbX+skP65BxOOPJA4gjDicOM2PciejeTwcsYek1hyl6me5nhNnmwPXBhjYuGC699OpzoaAO0PbYJSy5vgt4idOPrJwf6QuX2FO0oOtqIgj9pDU5dCWrMlyvXf86xsGgHyPeLos83Brns1WFXLxxgVBorHpW4vfQ6KhkbUtCot6srns1TLPjNVr7+1J0PepVc92H/Eagkb7IsTWd4ZMaN+yCXv5zLRY9GQ9xuYtQz4nfreWGdH9dNlkfnGq5/kdO88ekwGan1B3mDJsdMxCqv5w2Iq0khLs48vSllrsG/Y5pfojNugzScnQXKBVA8hrX51ddHq0o6wwIlgS8Y7obZdUZVjOYLC6e3glWkBBVHC2RJ+w/qezCuT/2sV6Q5VYpowjvnf/iBJJqvpYBgBS+w6wVB5DLEOiTZHWy36nNheg0jUBs3PoJnMfyuOdAECqrZ3K7KcACGQp89RAtlysCphqZhPtRzYlcPx+ExklJUiq0le5omCfOGFAYn3qFKS/fZAWS7a3Y2wa+GJOEy4US+B3aaPUYJamj4oI5LA/jWQBt5HIK5+JfXzZsJVpXi/ac8+mxWIXWzAG4Wb4g/jscNMp63I4U5FcKaVvsNyFALokSA47Kx8PVk83OabCHZsiqwAKEpjmfUJIkoh/R+L9oTpjluhRkGSPG4A7EkS+Y3HZk0OXYpIVNy01P5yItnptDsvtIwr0SunqoVP1GG1taTHn1CloXm9aLBEIEDl/IS2W6rg+qIFEYR7+OJTesqJqYa95/VKBNOHLjDBZ8sDS2998a0Bs/F//gvu5Z9NivadOc/U3676pEsizBIN1jCYlhClL+ELJDrkobNUBfBZqQfMN305HAgnIeYi4OnYMh7q/AsAXSdXK+eH41sykxd+TV/AsXvR/MeARAttD9pSqF9nDNfSEoDQsb5O31zQFprcaV244JPY7bqG6Xd9K3C3ALgbfk3NzqNE6CdplZrVFL27eWR+UASb6479ULfhD5AzOlSuGFTE6OohebElbcb8fhxA4xEPUgdTK19hiNKCZgknB+Ep44E44d82cxqPPOKctCGXzTmsBXbV1j1S5XQhyHq6NvnABPylu46A7QmVLpP7w9pNz4IEb0YyOrnmjb8bjB129fDBRkDVj2ojFbYBnCHHb7HL+OC7KQXeEsmAiNrnTqLy3d3+s/bvlVmxpgffM1fyM5cfsPZLuK+YHnvHELl8eUlwV4BXim0r6QV+4gD9Nlnjbfg1vJGktbI5UbN/TcGmAAYDG84Gry/MLLl/zKouO2Xukq/YkCyuWYV5owTIGjhVFCPL6J7kLOTcH89ereF1r4qOsm3gjSevl85El1Z98cfhB3qBN9+dLp1fUTco+0OrVMnNjFuv0chYbBYT2HcBoa+8TALyWQOt/ImPHoFS9SI3WyRajgdt2mbJgIlbREplfveuLf/XXemjXX7v46ZxzPlfd8YlZ01My5MUEVdIY5rueYopw4fQHkbv7/rZkTw6JwjyalBCHur9iD9cI2mU0UzD3P9H6yZ1G5dt7Gwe96w07dl5fXj7vYqH2XsNovdTI6KMrlsAXhRyz7/C7FBO/DubdVq4nBLPaohcnBeMr3/2k4fhQ+Uc8995YPq2wMzNjww2X+vwNt1p00ynrd2yKDJAVN628sBX1hZIdxXdStU9G5W2bd9YHR5L3f/CNmJeY9G8WAAAAAElFTkSuQmCC'
}
TriggerEvent('esx_phone:addSpecialContact', specialContact.name, specialContact.number, specialContact.base64Icon)
end)
AddEventHandler('esx:onPlayerDeath', function(data)
OnPlayerDeath()
end)
RegisterNetEvent('esx_ambulancejob:revive')
AddEventHandler('esx_ambulancejob:revive', function()
local playerPed = PlayerPedId()
local coords = GetEntityCoords(playerPed)
TriggerServerEvent('esx_ambulancejob:setDeathStatus', false)
Citizen.CreateThread(function()
DoScreenFadeOut(800)
while not IsScreenFadedOut() do
Citizen.Wait(50)
end
local formattedCoords = {
x = ESX.Math.Round(coords.x, 1),
y = ESX.Math.Round(coords.y, 1),
z = ESX.Math.Round(coords.z, 1)
}
ESX.SetPlayerData('lastPosition', formattedCoords)
TriggerServerEvent('esx:updateLastPosition', formattedCoords)
RespawnPed(playerPed, formattedCoords, 0.0)
StopScreenEffect('DeathFailOut')
DoScreenFadeIn(800)
end)
end)
-- Load unloaded IPLs
if Config.LoadIpl then
Citizen.CreateThread(function()
RequestIpl('Coroner_Int_on') -- Morgue
end)
end
+175
View File
@@ -0,0 +1,175 @@
Config = {}
Config.DrawDistance = 100.0
Config.Marker = { type = 21, x = 1.5, y = 1.5, z = 0.5, r = 102, g = 0, b = 102, a = 100, rotate = true }
Config.ReviveReward = 350 -- revive reward, set to 0 if you don't want it enabled
Config.AntiCombatLog = true -- enable anti-combat logging?
Config.LoadIpl = true -- disable if you're using fivem-ipl or other IPL loaders
Config.Locale = 'en'
local second = 1000
local minute = 60 * second
Config.EarlyRespawnTimer = 7 * minute -- Time til respawn is available
Config.BleedoutTimer = 10 * minute -- Time til the player bleeds out
Config.EnablePlayerManagement = true
Config.RemoveWeaponsAfterRPDeath = true
Config.RemoveCashAfterRPDeath = true
Config.RemoveItemsAfterRPDeath = true
-- Let the player pay for respawning early, only if he can afford it.
Config.EarlyRespawnFine = false
Config.EarlyRespawnFineAmount = 5000
Config.RespawnPoint = { coords = vector3(281.27, -581.24, 42.75), heading = 65.5 }
Config.Hospitals = {
CentralLosSantos = {
Blip = {
coords = vector3(289.71, -585.82, 42.19),
sprite = 61,
scale = 1.2,
color = 2
},
AmbulanceActions = {
vector3(310.48, -599.23, 43.29)
},
Pharmacies = {
vector3(270.5, -1363.22, 24.53)
},
Vehicles = {
{
Spawner = vector3(295.27, -600.8, 43.3),
InsideShop = vector3(446.7, -1355.6, 43.5),
Marker = { type = 36, x = 1.0, y = 1.0, z = 1.0, r = 100, g = 50, b = 200, a = 100, rotate = true },
SpawnPoints = {
{ coords = vector3(290.26, -599.41, 43.15), heading = 151.5, radius = 1.0 },
{ coords = vector3(294.0, -1433.1, 29.8), heading = 227.6, radius = 4.0 },
{ coords = vector3(309.4, -1442.5, 29.8), heading = 227.6, radius = 6.0 }
}
}
},
Helicopters = {
{
Spawner = vector3(345.46, -580.32, 74.16),
InsideShop = vector3(305.6, -1419.7, 41.5),
Marker = { type = 34, x = 1.5, y = 1.5, z = 1.5, r = 100, g = 150, b = 150, a = 100, rotate = true },
SpawnPoints = {
{ coords = vector3(352.06, -588.03, 74.16), heading = 330.5, radius = 10.0 },
{ coords = vector3(299.5, -1453.2, 46.5), heading = 142.7, radius = 10.0 }
}
}
},
FastTravels = {
{
From = vector3(315.48, -583.04, 42.31),
To = { coords = vector3(272.8, -1358.8, 23.5), heading = 0.0 },
Marker = { type = 1, x = 2.0, y = 2.0, z = 0.5, r = 102, g = 0, b = 102, a = 100, rotate = false }
},
{
From = vector3(275.3, -1361, 23.5),
To = { coords = vector3(318.37, -584.1, 42.3), heading = 0.0 },
Marker = { type = 1, x = 2.0, y = 2.0, z = 0.5, r = 102, g = 0, b = 102, a = 100, rotate = false }
},
{
From = vector3(332.9, -591.3, 42.31),
To = { coords = vector3(341.4, -584.99, 73.19), heading = 258.5 },
Marker = { type = 1, x = 1.5, y = 1.5, z = 0.5, r = 102, g = 0, b = 102, a = 100, rotate = false }
},
{
From = vector3(338.56, -583.64, 73.22),
To = { coords = vector3(333.6, -589.61, 43.28), heading = 338.38 },
Marker = { type = 1, x = 2.0, y = 2.0, z = 0.5, r = 102, g = 0, b = 102, a = 100, rotate = false }
},
{
From = vector3(298.57, -584.43, 42.28),
To = { coords = vector3(303.48, -586.12, 42.29), heading = 0.0 },
Marker = { type = 1, x = 1.5, y = 1.5, z = 1.0, r = 102, g = 0, b = 102, a = 100, rotate = false }
},
{
From = vector3(300.57, -585.11, 42.31),
To = { coords = vector3(296.79, -584.34, 42.16), heading = 0.0 },
Marker = { type = 1, x = 1.5, y = 1.5, z = 1.0, r = 102, g = 0, b = 102, a = 100, rotate = false }
}
},
FastTravelsPrompt = {
{
From = vector3(237.4, -1373.8, 26.0),
To = { coords = vector3(251.9, -1363.3, 38.5), heading = 0.0 },
Marker = { type = 1, x = 1.5, y = 1.5, z = 0.5, r = 102, g = 0, b = 102, a = 100, rotate = false },
Prompt = _U('fast_travel')
},
{
From = vector3(256.5, -1357.7, 36.0),
To = { coords = vector3(235.4, -1372.8, 26.3), heading = 0.0 },
Marker = { type = 1, x = 1.5, y = 1.5, z = 0.5, r = 102, g = 0, b = 102, a = 100, rotate = false },
Prompt = _U('fast_travel')
}
}
}
}
Config.AuthorizedVehicles = {
ambulance = {
{ model = 'ambulance', label = 'Ambulance Van', price = 5000},
{ model = 'dodgesamu', label = 'Dodge Samu', price = 5000}
},
doctor = {
{ model = 'ambulance', label = 'Ambulance Van', price = 4500},
{ model = 'dodgesamu', label = 'Dodge Samu', price = 5000}
},
chief_doctor = {
{ model = 'ambulance', label = 'Ambulance Van', price = 3000},
{ model = 'dodgeems', label = 'Dodge EMS', price = 5000}
},
boss = {
{ model = 'ambulance', label = 'Ambulance Van', price = 2000},
{ model = 'dodgeems', label = 'Dodge EMS', price = 5000}
}
}
Config.AuthorizedHelicopters = {
ambulance = {},
doctor = {
{ model = 'buzzard2', label = 'Nagasaki Buzzard', price = 20000 },
{ model = 'polmav', label = 'EMS', livery = 1, price = 20000 }
},
chief_doctor = {
{ model = 'buzzard2', label = 'Nagasaki Buzzard', price = 20000 },
{ model = 'polmav', label = 'EMS', livery = 1, price = 20000 }
},
boss = {
{ model = 'buzzard2', label = 'Nagasaki Buzzard', price = 20000 },
{ model = 'polmav', label = 'EMS', livery = 1, price = 20000 }
}
}
+33
View File
@@ -0,0 +1,33 @@
USE `essentialmode`;
INSERT INTO `addon_account` (name, label, shared) VALUES
('society_ambulance', 'Ambulance', 1)
;
INSERT INTO `addon_inventory` (name, label, shared) VALUES
('society_ambulance', 'Ambulance', 1)
;
INSERT INTO `datastore` (name, label, shared) VALUES
('society_ambulance', 'Ambulance', 1)
;
INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES
('ambulance',0,'ambulance','Ambulancier',20,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'),
('ambulance',1,'doctor','Medecin',40,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'),
('ambulance',2,'chief_doctor','Medecin-chef',60,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'),
('ambulance',3,'boss','Chirurgien',80,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}')
;
INSERT INTO `jobs` (name, label) VALUES
('ambulance','Ambulance')
;
INSERT INTO `items` (name, label, `limit`) VALUES
('bandage','Bandage', 20),
('medikit','Medikit', 5)
;
ALTER TABLE `users`
ADD `is_dead` TINYINT(1) NULL DEFAULT '0'
;
+90
View File
@@ -0,0 +1,90 @@
Locales['br'] = {
-- Cloakroom
['cloakroom'] = 'Vestiário',
['ems_clothes_civil'] = 'Roupa Normal',
['ems_clothes_ems'] = 'Entrar como Socorrista',
-- Vehicles
['ambulance'] = 'ambulance',
['helicopter_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Helicopter Actions~s~.',
['helicopter_buy'] = 'helicopter shop',
['helicopter_garage'] = 'open garage',
['helicopter_store'] = 'store helicopter in garage',
['helicopter_garage_title'] = 'helicopter Garage',
['helicopter_title'] = 'helicopter Actions',
['helicopter_notauthorized'] = 'you\'re not authorized to buy helicopters.',
['garage_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Vehicle Actions~s~.',
['garage_title'] = 'vehicle Actions',
['garage_stored'] = 'stored',
['garage_notstored'] = 'not in garage',
['garage_storing'] = 'we\'re attempting to remove the vehicle, make sure no players are around it.',
['garage_has_stored'] = 'the vehicle has been stored in your garage',
['garage_has_notstored'] = 'no nearby owned vehicles were found',
['garage_notavailable'] = 'your vehicle is not stored in the garage.',
['garage_blocked'] = 'there\'s no available spawn points!',
['garage_empty'] = 'you dont have any vehicles in your garage.',
['garage_released'] = 'your vehicle has been released from the garage.',
['garage_store_nearby'] = 'there is no nearby vehicles.',
['garage_storeditem'] = 'open garage',
['garage_storeitem'] = 'store vehicle in garage',
['garage_buyitem'] = 'vehicle shop',
['shop_item'] = '$%s',
['vehicleshop_title'] = 'vehicle Shop',
['vehicleshop_confirm'] = 'do you want to buy this vehicle?',
['vehicleshop_bought'] = 'you have bought ~y~%s~s~ for ~r~$%s~s~',
['vehicleshop_money'] = 'you cannot afford that vehicle',
['vehicleshop_awaiting_model'] = 'the vehicle is currently ~g~DOWNLOADING & LOADING~s~ please wait',
['confirm_no'] = 'no',
['confirm_yes'] = 'yes',
-- Action Menu
['hospital'] = 'Hôspital',
['revive_inprogress'] = 'Reanimação em andamento',
['revive_complete'] = 'você ressuscitou ~y~%s~s~',
['revive_complete_award'] = 'você ressuscitou ~y~%s~s~, ~g~$%s~s~',
['heal_inprogress'] = 'you are healing!',
['heal_complete'] = 'you have healed ~y~%s~s~',
['no_players'] = 'Nenhum jogador nas proximidades',
['no_vehicles'] = 'Sem veículos nas proximidades',
['player_not_unconscious'] = 'Não está inconsciente',
['player_not_conscious'] = 'that player is not conscious!',
-- Boss Menu
['boss_actions'] = 'Menu Administração',
-- Misc
['invalid_amount'] = '~r~Quantidade inválida',
['actions_prompt'] = 'press ~INPUT_CONTEXT~ access the ~y~Ambulance Actions~s~.',
['deposit_amount'] = 'Quantidade inválida para deposito',
['money_withdraw'] = 'Quantidade a ser retirada',
['fast_travel'] = 'Aperte ~INPUT_CONTEXT~ para mover-se rapidamente.',
['open_pharmacy'] = 'Aperte ~INPUT_CONTEXT~ para abrir a farmácia.',
['pharmacy_menu_title'] = 'Farmácia',
['pharmacy_take'] = 'tomar <span style="color:blue;">%s</span>',
['medikit'] = 'Seringa',
['bandage'] = 'Vendagem',
['max_item'] = 'você já carrega o suficiente sobre você.',
-- F6 Menu
['ems_menu'] = 'Interação com cidadão',
['ems_menu_title'] = 'Ambulância - Interação com cidadão',
['ems_menu_revive'] = 'Reanimar',
['ems_menu_putincar'] = 'Colocar no veiculo',
['ems_menu_small'] = 'Curar pequenas feridas',
['ems_menu_big'] = 'Tratando lesões graves',
-- Phone
['alert_ambulance'] = 'Alerta Socorro',
-- Death
['respawn_available_in'] = 'respawn available in ~b~%s minutes %s seconds~s~',
['respawn_bleedout_in'] = 'you will bleed out in ~b~%s minutes %s seconds~s~\n',
['respawn_bleedout_prompt'] = 'hold [~b~E~s~] to respawn',
['respawn_bleedout_fine'] = 'hold [~b~E~s~] to respawn for ~g~$%s~s~',
['respawn_bleedout_fine_msg'] = 'you paid ~r~$%s~s~ to respawn.',
['distress_send'] = 'press [~b~G~s~] to send distress signal',
['distress_sent'] = 'distress signal has been sent to available units!',
['distress_message'] = 'medical attention required: unconscious citizen!',
['combatlog_message'] = 'you have been force-respawned because you\'ve previously left the server when dead.',
-- Revive
['revive_help'] = 'reviver um jogador',
-- Item
['used_medikit'] = 'você usou 1x Seringa',
['used_bandage'] = 'você usou 1x Vendagem',
['not_enough_medikit'] = 'Você não tem ~b~Seringa~s~.',
['not_enough_bandage'] = 'Você não tem ~b~Vendagem~s~.',
['healed'] = 'Você foi tratado.',
}
+90
View File
@@ -0,0 +1,90 @@
Locales['cs'] = {
-- Cloakroom
['cloakroom'] = 'šatna',
['ems_clothes_civil'] = 'civilní oblečení',
['ems_clothes_ems'] = 'zdravotnické oblečení',
-- Vehicles
['ambulance'] = 'ambulance',
['helicopter_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Helicopter Actions~s~.',
['helicopter_buy'] = 'helicopter shop',
['helicopter_garage'] = 'open garage',
['helicopter_store'] = 'store helicopter in garage',
['helicopter_garage_title'] = 'helicopter Garage',
['helicopter_title'] = 'helicopter Actions',
['helicopter_notauthorized'] = 'you\'re not authorized to buy helicopters.',
['garage_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Vehicle Actions~s~.',
['garage_title'] = 'vehicle Actions',
['garage_stored'] = 'stored',
['garage_notstored'] = 'not in garage',
['garage_storing'] = 'we\'re attempting to remove the vehicle, make sure no players are around it.',
['garage_has_stored'] = 'the vehicle has been stored in your garage',
['garage_has_notstored'] = 'no nearby owned vehicles were found',
['garage_notavailable'] = 'your vehicle is not stored in the garage.',
['garage_blocked'] = 'there\'s no available spawn points!',
['garage_empty'] = 'you dont have any vehicles in your garage.',
['garage_released'] = 'your vehicle has been released from the garage.',
['garage_store_nearby'] = 'there is no nearby vehicles.',
['garage_storeditem'] = 'open garage',
['garage_storeitem'] = 'store vehicle in garage',
['garage_buyitem'] = 'vehicle shop',
['shop_item'] = '$%s',
['vehicleshop_title'] = 'vehicle Shop',
['vehicleshop_confirm'] = 'do you want to buy this vehicle?',
['vehicleshop_bought'] = 'you have bought ~y~%s~s~ for ~r~$%s~s~',
['vehicleshop_money'] = 'you cannot afford that vehicle',
['vehicleshop_awaiting_model'] = 'the vehicle is currently ~g~DOWNLOADING & LOADING~s~ please wait',
['confirm_no'] = 'no',
['confirm_yes'] = 'yes',
-- Action Menu
['hospital'] = 'nemocnice',
['revive_inprogress'] = 'probíhá oživení!',
['revive_complete'] = 'oživili jste ~y~%s~s~',
['revive_complete_award'] = 'oživili jste ~y~%s~s~ a dostali jste ~g~$%s~s~!',
['heal_inprogress'] = 'uzdravujete!',
['heal_complete'] = 'uzdravili jste ~y~%s~s~',
['no_players'] = 'v okolí není žádný hráč!',
['no_vehicles'] = 'v okolí není žádné vozidlo',
['player_not_unconscious'] = 'hráč není v bezvědomí!',
['player_not_conscious'] = 'hráč je v bezvědomí!',
-- Boss Menu
['boss_actions'] = 'akce šéfa',
-- Misc
['invalid_amount'] = '~r~neplatná částka',
['actions_prompt'] = 'press ~INPUT_CONTEXT~ access the ~y~Ambulance Actions~s~.',
['deposit_amount'] = 'částka vkladu',
['money_withdraw'] = 'částka výběru',
['fast_travel'] = 'stiskněte ~INPUT_CONTEXT~ k rychlému odcestování.',
['open_pharmacy'] = 'stiskněte ~INPUT_CONTEXT~ k otevření lékárny.',
['pharmacy_menu_title'] = 'lékárna',
['pharmacy_take'] = 'vzít ~y~%s~s~',
['medikit'] = 'lékarnička',
['bandage'] = 'obvaz',
['max_item'] = 'již nesete dostatek věcí.',
-- F6 Menu
['ems_menu'] = 'Zdravotnické menu',
['ems_menu_title'] = 'záchranka - Zdravotnické menu',
['ems_menu_revive'] = 'oživit hráče',
['ems_menu_putincar'] = 'naložit do vozidla',
['ems_menu_small'] = 'ošetřit malé zranění',
['ems_menu_big'] = 'ošetřit vážné zranění',
-- Phone
['alert_ambulance'] = 'zdravotnický poplach',
-- Death
['respawn_available_in'] = 'oživení dostupné za ~b~%s minut a %s sekund~s~\n',
['respawn_bleedout_in'] = 'vykrvácíte za ~b~%s minut a %s sekund~s~\n',
['respawn_bleedout_prompt'] = 'držte [~b~E~s~] pro respawn.',
['respawn_now_fine'] = 'držte [~b~E~s~] pro oživení za ~g~$%s~s~',
['respawn_bleedout_fine_msg'] = 'zaplatili jste ~r~$%s~s~ za respawn.',
['distress_send'] = 'stiskněte [~b~G~s~] pro vyslání tísňového signálu',
['distress_sent'] = 'tísňový signál byl vyslán dostupným jednotkám!',
['distress_message'] = 'nutná lékařská péče: občan v bezvědomí!',
['combatlog_message'] = 'byli jste násilně oživeni, protože jste předtím opustili server, když jste byli mrtví.',
-- Revive
['revive_help'] = 'oživit hráče',
-- Item
['used_medikit'] = 'použili jste ~y~1x~s~ lékarničku',
['used_bandage'] = 'použili jste ~y~1x~s~ obvaz',
['not_enough_medikit'] = 'nemáte ~b~medikit~s~.',
['not_enough_bandage'] = 'nemáte~b~bandage~s~.',
['healed'] = 'byli jste ošetřeni.',
}
+90
View File
@@ -0,0 +1,90 @@
Locales['en'] = {
-- Cloakroom
['cloakroom'] = 'locker Room',
['ems_clothes_civil'] = 'civilian Clothes',
['ems_clothes_ems'] = 'EMS Clothes',
-- Vehicles
['ambulance'] = 'ambulance',
['helicopter_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Helicopter Actions~s~.',
['helicopter_buy'] = 'helicopter shop',
['helicopter_garage'] = 'open garage',
['helicopter_store'] = 'store helicopter in garage',
['helicopter_garage_title'] = 'helicopter Garage',
['helicopter_title'] = 'helicopter Actions',
['helicopter_notauthorized'] = 'you\'re not authorized to buy helicopters.',
['garage_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Vehicle Actions~s~.',
['garage_title'] = 'vehicle Actions',
['garage_stored'] = 'stored',
['garage_notstored'] = 'not in garage',
['garage_storing'] = 'we\'re attempting to remove the vehicle, make sure no players are around it.',
['garage_has_stored'] = 'the vehicle has been stored in your garage',
['garage_has_notstored'] = 'no nearby owned vehicles were found',
['garage_notavailable'] = 'your vehicle is not stored in the garage.',
['garage_blocked'] = 'there\'s no available spawn points!',
['garage_empty'] = 'you dont have any vehicles in your garage.',
['garage_released'] = 'your vehicle has been released from the garage.',
['garage_store_nearby'] = 'there is no nearby vehicles.',
['garage_storeditem'] = 'open garage',
['garage_storeitem'] = 'store vehicle in garage',
['garage_buyitem'] = 'vehicle shop',
['shop_item'] = '$%s',
['vehicleshop_title'] = 'vehicle Shop',
['vehicleshop_confirm'] = 'do you want to buy this vehicle?',
['vehicleshop_bought'] = 'you have bought ~y~%s~s~ for ~r~$%s~s~',
['vehicleshop_money'] = 'you cannot afford that vehicle',
['vehicleshop_awaiting_model'] = 'the vehicle is currently ~g~DOWNLOADING & LOADING~s~ please wait',
['confirm_no'] = 'no',
['confirm_yes'] = 'yes',
-- Action Menu
['hospital'] = 'hospital',
['revive_inprogress'] = 'a revive is in progress!',
['revive_complete'] = 'you have revived ~y~%s~s~',
['revive_complete_award'] = 'you have revived ~y~%s~s~ and earned ~g~$%s~s~!',
['heal_inprogress'] = 'you are healing!',
['heal_complete'] = 'you have healed ~y~%s~s~',
['no_players'] = 'no players nearby',
['no_vehicles'] = 'no vehicles nearby',
['player_not_unconscious'] = 'that player is not unconscious!',
['player_not_conscious'] = 'that player is not conscious!',
-- Boss Menu
['boss_actions'] = 'boss Actions',
-- Misc
['invalid_amount'] = '~r~Invalid amount',
['actions_prompt'] = 'press ~INPUT_CONTEXT~ access the ~y~Ambulance Actions~s~.',
['deposit_amount'] = 'deposit Amount',
['money_withdraw'] = 'amount withdrawn',
['fast_travel'] = 'press ~INPUT_CONTEXT~ to fast travel.',
['open_pharmacy'] = 'press ~INPUT_CONTEXT~ to open the pharmacy.',
['pharmacy_menu_title'] = 'pharmacy',
['pharmacy_take'] = 'take <span style="color:blue;">%s</span>',
['medikit'] = 'medikit',
['bandage'] = 'bandage',
['max_item'] = 'You are already carrying enough.',
-- F6 Menu
['ems_menu'] = 'EMS Menu',
['ems_menu_title'] = 'ambulance - EMS Menu',
['ems_menu_revive'] = 'revive Player',
['ems_menu_putincar'] = 'put in Vehicle',
['ems_menu_small'] = 'heal small wounds',
['ems_menu_big'] = 'treat serious injuries',
-- Phone
['alert_ambulance'] = 'alert Ambulance',
-- Death
['respawn_available_in'] = 'respawn available in ~b~%s minutes %s seconds~s~',
['respawn_bleedout_in'] = 'you will bleed out in ~b~%s minutes %s seconds~s~\n',
['respawn_bleedout_prompt'] = 'hold [~b~E~s~] to respawn',
['respawn_bleedout_fine'] = 'hold [~b~E~s~] to respawn for ~g~$%s~s~',
['respawn_bleedout_fine_msg'] = 'you paid ~r~$%s~s~ to respawn.',
['distress_send'] = 'press [~b~G~s~] to send distress signal',
['distress_sent'] = 'distress signal has been sent to available units!',
['distress_message'] = 'medical attention required: unconscious citizen!',
['combatlog_message'] = 'you have been force-respawned because you\'ve previously left the server when dead.',
-- Revive
['revive_help'] = 'revive a player',
-- Item
['used_medikit'] = 'You have used ~y~1x~s~ medikit',
['used_bandage'] = 'You have used ~y~1x~s~ bandage',
['not_enough_medikit'] = 'You do not have ~b~medikit~s~.',
['not_enough_bandage'] = 'You do not have ~b~bandage~s~.',
['healed'] = 'you have been treated.',
}
+90
View File
@@ -0,0 +1,90 @@
Locales['es'] = {
-- Cloakroom
['cloakroom'] = 'Guardarropa',
['ems_clothes_civil'] = 'Camiseta',
['ems_clothes_ems'] = 'Equipo de ambulancia',
-- Vehicles
['ambulance'] = 'ambulance',
['helicopter_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Helicopter Actions~s~.',
['helicopter_buy'] = 'helicopter shop',
['helicopter_garage'] = 'open garage',
['helicopter_store'] = 'store helicopter in garage',
['helicopter_garage_title'] = 'helicopter Garage',
['helicopter_title'] = 'helicopter Actions',
['helicopter_notauthorized'] = 'you\'re not authorized to buy helicopters.',
['garage_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Vehicle Actions~s~.',
['garage_title'] = 'vehicle Actions',
['garage_stored'] = 'stored',
['garage_notstored'] = 'not in garage',
['garage_storing'] = 'we\'re attempting to remove the vehicle, make sure no players are around it.',
['garage_has_stored'] = 'the vehicle has been stored in your garage',
['garage_has_notstored'] = 'no nearby owned vehicles were found',
['garage_notavailable'] = 'your vehicle is not stored in the garage.',
['garage_blocked'] = 'there\'s no available spawn points!',
['garage_empty'] = 'you dont have any vehicles in your garage.',
['garage_released'] = 'your vehicle has been released from the garage.',
['garage_store_nearby'] = 'there is no nearby vehicles.',
['garage_storeditem'] = 'open garage',
['garage_storeitem'] = 'store vehicle in garage',
['garage_buyitem'] = 'vehicle shop',
['shop_item'] = '$%s',
['vehicleshop_title'] = 'vehicle Shop',
['vehicleshop_confirm'] = 'do you want to buy this vehicle?',
['vehicleshop_bought'] = 'you have bought ~y~%s~s~ for ~r~$%s~s~',
['vehicleshop_money'] = 'you cannot afford that vehicle',
['vehicleshop_awaiting_model'] = 'the vehicle is currently ~g~DOWNLOADING & LOADING~s~ please wait',
['confirm_no'] = 'no',
['confirm_yes'] = 'yes',
-- Action Menu
['hospital'] = 'hospital',
['revive_inprogress'] = 'reanimación en curso',
['revive_complete'] = 'has sido reanimado ~y~%s~s~',
['revive_complete_award'] = 'has sido reanimado ~y~%s~s~, ~g~$%s~s~',
['heal_inprogress'] = 'you are healing!',
['heal_complete'] = 'you have healed ~y~%s~s~',
['no_players'] = 'ningún jugador cerca',
['no_vehicles'] = 'ningún vehículo cerca',
['player_not_unconscious'] = 'n\'estás inconsciente',
['player_not_conscious'] = 'that player is not conscious!',
-- Boss Menu
['boss_actions'] = 'boss Actions',
-- Misc
['invalid_amount'] = '~r~cantidad no válida',
['actions_prompt'] = 'press ~INPUT_CONTEXT~ access the ~y~Ambulance Actions~s~.',
['deposit_amount'] = 'cantidad de fianza depositada',
['money_withdraw'] = 'cantidad de fianza retirada',
['fast_travel'] = 'Press ~INPUT_CONTEXT~ to fast travel.',
['open_pharmacy'] = 'Press ~INPUT_CONTEXT~ to open the pharmacy.',
['pharmacy_menu_title'] = 'Pharmacy',
['pharmacy_take'] = 'take <span style="color:blue;">%s</span>',
['medikit'] = 'medikit',
['bandage'] = 'bandage',
['max_item'] = 'You are already carrying enough on yourself.',
-- F6 Menu
['ems_menu'] = 'ayuda ciudadana',
['ems_menu_title'] = 'ambulancia - Ayuda Ciudadana',
['ems_menu_revive'] = 'reanimar',
['ems_menu_putincar'] = 'meter en el vehículo',
['ems_menu_small'] = 'heal small wounds',
['ems_menu_big'] = 'treat serious injuries',
-- Phone
['alert_ambulance'] = 'Alerta de ambulancia',
-- Death
['respawn_available_in'] = 'respawn available in ~b~%s minutes %s seconds~s~',
['respawn_bleedout_in'] = 'you will bleed out in ~b~%s minutes %s seconds~s~\n',
['respawn_bleedout_prompt'] = 'hold [~b~E~s~] to respawn',
['respawn_bleedout_fine'] = 'hold [~b~E~s~] to respawn for ~g~$%s~s~',
['respawn_bleedout_fine_msg'] = 'you paid ~r~$%s~s~ to respawn.',
['distress_send'] = 'press [~b~G~s~] to send distress signal',
['distress_sent'] = 'distress signal has been sent to available units!',
['distress_message'] = 'medical attention required: unconscious citizen!',
['combatlog_message'] = 'you have been force-respawned because you\'ve previously left the server when dead.',
-- Revive
['revive_help'] = 'reviver un jugador',
-- Item
['used_medikit'] = 'You have used ~y~1x~s~ medikit',
['used_bandage'] = 'You have used ~y~1x~s~ bandage',
['not_enough_medikit'] = 'You do not have ~b~medikit~s~.',
['not_enough_bandage'] = 'You do not have ~b~bandage~s~.',
['healed'] = 'you have been treated.',
}
+90
View File
@@ -0,0 +1,90 @@
Locales['fi'] = {
-- Cloakroom
['cloakroom'] = 'Vaatelokero',
['ems_clothes_civil'] = 'Siviilikamppeet',
['ems_clothes_ems'] = 'Työkamppeet',
-- Vehicles
['ambulance'] = 'ambulance',
['helicopter_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Helicopter Actions~s~.',
['helicopter_buy'] = 'helicopter shop',
['helicopter_garage'] = 'open garage',
['helicopter_store'] = 'store helicopter in garage',
['helicopter_garage_title'] = 'helicopter Garage',
['helicopter_title'] = 'helicopter Actions',
['helicopter_notauthorized'] = 'you\'re not authorized to buy helicopters.',
['garage_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Vehicle Actions~s~.',
['garage_title'] = 'vehicle Actions',
['garage_stored'] = 'stored',
['garage_notstored'] = 'not in garage',
['garage_storing'] = 'we\'re attempting to remove the vehicle, make sure no players are around it.',
['garage_has_stored'] = 'the vehicle has been stored in your garage',
['garage_has_notstored'] = 'no nearby owned vehicles were found',
['garage_notavailable'] = 'your vehicle is not stored in the garage.',
['garage_blocked'] = 'there\'s no available spawn points!',
['garage_empty'] = 'you dont have any vehicles in your garage.',
['garage_released'] = 'your vehicle has been released from the garage.',
['garage_store_nearby'] = 'there is no nearby vehicles.',
['garage_storeditem'] = 'open garage',
['garage_storeitem'] = 'store vehicle in garage',
['garage_buyitem'] = 'vehicle shop',
['shop_item'] = '$%s',
['vehicleshop_title'] = 'vehicle Shop',
['vehicleshop_confirm'] = 'do you want to buy this vehicle?',
['vehicleshop_bought'] = 'you have bought ~y~%s~s~ for ~r~$%s~s~',
['vehicleshop_money'] = 'you cannot afford that vehicle',
['vehicleshop_awaiting_model'] = 'the vehicle is currently ~g~DOWNLOADING & LOADING~s~ please wait',
['confirm_no'] = 'no',
['confirm_yes'] = 'yes',
-- Action Menu
['hospital'] = 'sairaala',
['revive_inprogress'] = 'elvytys on menossa!',
['revive_complete'] = 'sinä elvytit henkilön ~y~%s~s~',
['revive_complete_award'] = 'sinä elvytit henkilön ~y~%s~s~ ja tienasit ~g~$%s~s~!',
['heal_inprogress'] = 'sinä olet parantamassa!',
['heal_complete'] = 'sinä paransit henkilön ~y~%s~s~',
['no_players'] = 'ei pelaajia lähettyvillä',
['no_vehicles'] = 'ei ajoneuvoja lähettyvillä',
['player_not_unconscious'] = 'tämä pelaaja ei ole tajuton!',
['player_not_conscious'] = 'tämä pelaaja ei ole tajuissaan!',
-- Boss Menu
['boss_actions'] = 'pomovalikko',
-- Misc
['invalid_amount'] = '~r~Virheellinen summa',
['actions_prompt'] = 'press ~INPUT_CONTEXT~ access the ~y~Ambulance Actions~s~.',
['deposit_amount'] = 'talletettava summa',
['money_withdraw'] = 'nostettava summa',
['fast_travel'] = 'paina ~INPUT_CONTEXT~ liikkuaksesi nopeasti kerrosten välillä',
['open_pharmacy'] = 'paina ~INPUT_CONTEXT~ avataksesi lääkekaappi',
['pharmacy_menu_title'] = 'lääkekaappi',
['pharmacy_take'] = 'ota <span style="color:blue;">%s</span>',
['medikit'] = 'ensiapupakkauksia',
['bandage'] = 'sideharsoja',
['max_item'] = 'sinulla on jo tarpeeksi mukana',
-- F6 Menu
['ems_menu'] = 'ensihoito menu',
['ems_menu_title'] = 'ensihoito - Siviilin kanssakäyminen',
['ems_menu_revive'] = 'elvytä',
['ems_menu_putincar'] = 'Laita ajoneuvoon',
['ems_menu_small'] = 'hoida pieniä haavoja',
['ems_menu_big'] = 'hoida isoja haavoja',
-- Phone
['alert_ambulance'] = 'hälyytys Ensihoidolle',
-- Death
['respawn_available_in'] = 'respawn available in ~b~%s minutes %s seconds~s~',
['respawn_bleedout_in'] = 'you will bleed out in ~b~%s minutes %s seconds~s~\n',
['respawn_bleedout_prompt'] = 'hold [~b~E~s~] to respawn',
['respawn_bleedout_fine'] = 'hold [~b~E~s~] to respawn for ~g~$%s~s~',
['respawn_bleedout_fine_msg'] = 'you paid ~r~$%s~s~ to respawn.',
['distress_send'] = 'press [~b~G~s~] to send distress signal',
['distress_sent'] = 'distress signal has been sent to available units!',
['distress_message'] = 'medical attention required: unconscious citizen!',
['combatlog_message'] = 'you have been force-respawned because you\'ve previously left the server when dead.',
-- Revive
['revive_help'] = 'elvytä pelaaja',
-- Item
['used_medikit'] = 'sinä käytit ensiapupakkauksen',
['used_bandage'] = 'sinä käytit sideharsoja',
['not_enough_medikit'] = 'ei tarpeeksi ~b~ensiapupakkauksia~s~.',
['not_enough_bandage'] = 'ei tarpeeksi ~b~sideharsoja~s~.',
['healed'] = 'sinua parannettiin',
}
+90
View File
@@ -0,0 +1,90 @@
Locales['fr'] = {
-- Cloakroom
['cloakroom'] = 'Vestiaire',
['ems_clothes_civil'] = 'Tenue Civil',
['ems_clothes_ems'] = 'Tenue Ambulancier',
-- Vehicles
['ambulance'] = 'ambulance',
['helicopter_prompt'] = 'appuyez sur ~INPUT_CONTEXT~ pour accéder aux ~y~Actions de l\'hélicoptère~s~.',
['helicopter_buy'] = 'magasin hélicoptère',
['helicopter_garage'] = 'ouvrir le garage',
['helicopter_store'] = 'garer l\'hélicoptère dans le garage',
['helicopter_garage_title'] = 'garage hélicoptère',
['helicopter_title'] = 'actions hélicoptère',
['helicopter_notauthorized'] = 'vous n\'êtes pas autorisé à acheter un hélicoptère.',
['garage_prompt'] = 'appuyez sur ~INPUT_CONTEXT~ pour accéder aux ~y~Actions des véhciules~s~.',
['garage_title'] = 'actions véhicules',
['garage_stored'] = 'rangé',
['garage_notstored'] = 'en dehors du garage',
['garage_storing'] = 'tentative de suppression du véhicule, assurez-vous que personne ne soit autour.',
['garage_has_stored'] = 'le véhicule a bien été rangé dans le garage',
['garage_has_notstored'] = 'aucun véhicule dans le garage',
['garage_notavailable'] = 'votre véhicule n\'est pas rangé dans le garage.',
['garage_blocked'] = 'la sortie du garage est obstruée!',
['garage_empty'] = 'vous n\'avez aucun véhicule dans le garage.',
['garage_released'] = 'votre véhicule a été sorti.',
['garage_store_nearby'] = 'aucun véhicule a proximité.',
['garage_storeditem'] = 'ouvrir le garage',
['garage_storeitem'] = 'ranger le véhicule',
['garage_buyitem'] = 'magasin véhicule',
['shop_item'] = '$%s',
['vehicleshop_title'] = 'magasin véhicule',
['vehicleshop_confirm'] = 'voulez-vous acheter ce véhicule?',
['vehicleshop_bought'] = 'vous avez acheté ~y~%s~s~ pour ~r~$%s~s~',
['vehicleshop_money'] = 'vous ne pouvez pas acheter ce véhicule',
['vehicleshop_awaiting_model'] = 'le véhicule est actuellement en ~g~PRÉPARATION~s~ veuillez patienter',
['confirm_no'] = 'non',
['confirm_yes'] = 'oui',
-- Action Menu
['hospital'] = 'hôpital',
['revive_inprogress'] = 'réanimation en cours',
['revive_complete'] = 'vous avez réanimé ~y~%s~s~',
['revive_complete_award'] = 'vous avez réanimé ~y~%s~s~, ~g~$%s~s~',
['heal_inprogress'] = 'vous soignez...',
['heal_complete'] = 'vous avez soigné ~y~%s~s~',
['no_players'] = 'aucun joueur à proximité',
['no_vehicles'] = 'aucun véhicule à proximité',
['player_not_unconscious'] = 'n\'est pas inconscient',
['player_not_conscious'] = 'Cette personne est inconsciente!',
-- Boss Menu
['boss_actions'] = 'action Patron',
-- Misc
['invalid_amount'] = '~r~montant invalide',
['actions_prompt'] = 'press ~INPUT_CONTEXT~ access the ~y~Ambulance Actions~s~.',
['deposit_amount'] = 'montant du dépôt',
['money_withdraw'] = 'montant du retrait',
['fast_travel'] = 'appuyez sur ~INPUT_CONTEXT~ pour vous déplacer rapidement.',
['open_pharmacy'] = 'appuyez sur ~INPUT_CONTEXT~ pour ouvrir la pharmacie.',
['pharmacy_menu_title'] = 'Pharmacie',
['pharmacy_take'] = 'prendre <span style="color:blue;">%s</span>',
['medikit'] = 'kit de soin',
['bandage'] = 'bandage',
['max_item'] = 'vous en portez déjà assez sur vous.',
-- F6 Menu
['ems_menu'] = 'interaction citoyen',
['ems_menu_title'] = 'ambulance - Interactions Citoyen',
['ems_menu_revive'] = 'réanimer',
['ems_menu_putincar'] = 'mettre dans véhicule',
['ems_menu_small'] = 'soigner petites blessures',
['ems_menu_big'] = 'soigner blessures graves',
-- Phone
['alert_ambulance'] = 'alerte Ambulance',
-- Death
['respawn_available_in'] = 'réanimation possible dans ~b~%s minutes %s secondes~s~',
['respawn_bleedout_in'] = 'vous allez souffrir d\'une hémorragie dans ~b~%s minutes %s secondes~s~\n',
['respawn_bleedout_prompt'] = 'maintenez [~b~E~s~] pour être réanimé',
['respawn_bleedout_fine'] = 'maintenez [~b~E~s~] pour être réanimé pour ~g~$%s~s~',
['respawn_bleedout_fine_msg'] = 'vous avez payé ~r~$%s~s~ pour être réanimer.',
['distress_send'] = 'appuyez sur [~b~G~s~] pour envoyer un signal de détresse',
['distress_sent'] = 'un signal a été envoyé à toutes les unités disponibles!',
['distress_message'] = 'interventtion requise: citoyen inconscient!',
['combatlog_message'] = 'vous avez été réanimé de force car vous avez quitté le serveur.',
-- Revive
['revive_help'] = 'relancer un joueur',
-- Item
['used_medikit'] = 'vous avez utilisé 1x kit de soin',
['used_bandage'] = 'vous avez utilisé 1x bandage',
['not_enough_medikit'] = 'vous n\'avez pas de ~b~kit de soin~s~.',
['not_enough_bandage'] = 'vous n\'avez pas de ~b~bandage~s~.',
['healed'] = 'vous avez été soigné.',
}
+90
View File
@@ -0,0 +1,90 @@
Locales['pl'] = {
-- Cloakroom
['cloakroom'] = 'szatnia',
['ems_clothes_civil'] = 'ubrania cywilne',
['ems_clothes_ems'] = 'ubrania EMS',
-- Vehicles
['ambulance'] = 'ambulance',
['helicopter_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Helicopter Actions~s~.',
['helicopter_buy'] = 'helicopter shop',
['helicopter_garage'] = 'open garage',
['helicopter_store'] = 'store helicopter in garage',
['helicopter_garage_title'] = 'helicopter Garage',
['helicopter_title'] = 'helicopter Actions',
['helicopter_notauthorized'] = 'you\'re not authorized to buy helicopters.',
['garage_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Vehicle Actions~s~.',
['garage_title'] = 'vehicle Actions',
['garage_stored'] = 'stored',
['garage_notstored'] = 'not in garage',
['garage_storing'] = 'we\'re attempting to remove the vehicle, make sure no players are around it.',
['garage_has_stored'] = 'the vehicle has been stored in your garage',
['garage_has_notstored'] = 'no nearby owned vehicles were found',
['garage_notavailable'] = 'your vehicle is not stored in the garage.',
['garage_blocked'] = 'there\'s no available spawn points!',
['garage_empty'] = 'you dont have any vehicles in your garage.',
['garage_released'] = 'your vehicle has been released from the garage.',
['garage_store_nearby'] = 'there is no nearby vehicles.',
['garage_storeditem'] = 'open garage',
['garage_storeitem'] = 'store vehicle in garage',
['garage_buyitem'] = 'vehicle shop',
['shop_item'] = '$%s',
['vehicleshop_title'] = 'vehicle Shop',
['vehicleshop_confirm'] = 'do you want to buy this vehicle?',
['vehicleshop_bought'] = 'you have bought ~y~%s~s~ for ~r~$%s~s~',
['vehicleshop_money'] = 'you cannot afford that vehicle',
['vehicleshop_awaiting_model'] = 'the vehicle is currently ~g~DOWNLOADING & LOADING~s~ please wait',
['confirm_no'] = 'no',
['confirm_yes'] = 'yes',
-- Action Menu
['hospital'] = 'szpital',
['revive_inprogress'] = 'trwa wskrzeszenie',
['revive_complete'] = 'zostałeś wskrzeszony ~y~%s~s~',
['revive_complete_award'] = 'zostałeś wskrzeszony ~y~%s~s~ i zarobiono ~g~$%s~s~!',
['heal_inprogress'] = 'leczysz!',
['heal_complete'] = 'zostałeś uleczony ~y~%s~s~',
['no_players'] = 'brak graczy w pobliżu',
['no_vehicles'] = 'brak pojazdów w pobliżu',
['player_not_unconscious'] = 'ten gracz nie jest nieprzytomny!',
['player_not_conscious'] = 'ten gracz nie jest świadomy!',
-- Boss Menu
['boss_actions'] = 'akcje szefa',
-- Misc
['invalid_amount'] = '~r~Nieprawidłowa kwota',
['actions_prompt'] = 'press ~INPUT_CONTEXT~ access the ~y~Ambulance Actions~s~.',
['deposit_amount'] = 'kwota depozytu',
['money_withdraw'] = 'wycofana kwota',
['fast_travel'] = 'naciśnij na ~INPUT_CONTEXT~ do szybkiej podróży.',
['open_pharmacy'] = 'naciśnij na ~INPUT_CONTEXT~ aby otworzyć aptekę',
['pharmacy_menu_title'] = 'apteka',
['pharmacy_take'] = 'weź <span style="color:blue;">%s</span>',
['medikit'] = 'apteczka',
['bandage'] = 'bandaż',
['max_item'] = 'już masz na sobie dość.',
-- F6 Menu
['ems_menu'] = 'menu EMS',
['ems_menu_title'] = 'eMS Menu - Ambulans',
['ems_menu_revive'] = 'ożyw gracza',
['ems_menu_putincar'] = 'umieścić w pojeździe',
['ems_menu_small'] = 'ulecz małe rany',
['ems_menu_big'] = 'ulecz poważne obrażenia',
-- Phone
['alert_ambulance'] = 'wezwij ambulans',
-- Death
['respawn_available_in'] = 'respawn available in ~b~%s minutes %s seconds~s~',
['respawn_bleedout_in'] = 'you will bleed out in ~b~%s minutes %s seconds~s~\n',
['respawn_bleedout_prompt'] = 'hold [~b~E~s~] to respawn',
['respawn_bleedout_fine'] = 'hold [~b~E~s~] to respawn for ~g~$%s~s~',
['respawn_bleedout_fine_msg'] = 'you paid ~r~$%s~s~ to respawn.',
['distress_send'] = 'press [~b~G~s~] to send distress signal',
['distress_sent'] = 'distress signal has been sent to available units!',
['distress_message'] = 'medical attention required: unconscious citizen!',
['combatlog_message'] = 'you have been force-respawned because you\'ve previously left the server when dead.',
-- Revive
['revive_help'] = 'ożyw gracza',
-- Item
['used_medikit'] = 'użyłeś 1x Apteczki',
['used_bandage'] = 'użyłeś 1x Bandaża',
['not_enough_medikit'] = 'nie posiadasz ~b~apteczki~s~.',
['not_enough_bandage'] = 'nie posiadasz ~b~bandaża~s~.',
['healed'] = 'zostałeś potraktowany',
}
+90
View File
@@ -0,0 +1,90 @@
Locales['sv'] = {
-- Cloakroom
['cloakroom'] = 'omklädnignsrum',
['ems_clothes_civil'] = 'civilkläder',
['ems_clothes_ems'] = 'ambulanskläder',
-- Vehicles
['ambulance'] = 'ambulance',
['helicopter_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Helicopter Actions~s~.',
['helicopter_buy'] = 'helicopter shop',
['helicopter_garage'] = 'open garage',
['helicopter_store'] = 'store helicopter in garage',
['helicopter_garage_title'] = 'helicopter Garage',
['helicopter_title'] = 'helicopter Actions',
['helicopter_notauthorized'] = 'you\'re not authorized to buy helicopters.',
['garage_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Vehicle Actions~s~.',
['garage_title'] = 'vehicle Actions',
['garage_stored'] = 'stored',
['garage_notstored'] = 'not in garage',
['garage_storing'] = 'we\'re attempting to remove the vehicle, make sure no players are around it.',
['garage_has_stored'] = 'the vehicle has been stored in your garage',
['garage_has_notstored'] = 'no nearby owned vehicles were found',
['garage_notavailable'] = 'your vehicle is not stored in the garage.',
['garage_blocked'] = 'there\'s no available spawn points!',
['garage_empty'] = 'you dont have any vehicles in your garage.',
['garage_released'] = 'your vehicle has been released from the garage.',
['garage_store_nearby'] = 'there is no nearby vehicles.',
['garage_storeditem'] = 'open garage',
['garage_storeitem'] = 'store vehicle in garage',
['garage_buyitem'] = 'vehicle shop',
['shop_item'] = '%s SEK',
['vehicleshop_title'] = 'vehicle Shop',
['vehicleshop_confirm'] = 'do you want to buy this vehicle?',
['vehicleshop_bought'] = 'you have bought ~y~%s~s~ for ~r~$%s~s~',
['vehicleshop_money'] = 'you cannot afford that vehicle',
['vehicleshop_awaiting_model'] = 'the vehicle is currently ~g~DOWNLOADING & LOADING~s~ please wait',
['confirm_no'] = 'no',
['confirm_yes'] = 'yes',
-- Action Menu
['hospital'] = 'sjukhus',
['revive_inprogress'] = 'en återupplivning har börjats',
['revive_complete'] = 'du har återupplivat ~y~%s~s~, bra jobbat!',
['revive_complete_award'] = 'du har återupplivat ~y~%s~s~ och tjärnat ~g~%s SEK~s~ för dina tjänster, bra jobbat!',
['heal_inprogress'] = 'du behandlar patienten!',
['heal_complete'] = 'du har behandlat ~y~%s~s~',
['no_players'] = 'det finns inga spelare i närheten!',
['no_vehicles'] = 'det finns inget fordon i närheten!',
['player_not_unconscious'] = 'spelaren är inte medvetslös!',
['player_not_conscious'] = 'spelaren är inte vid medvetande!',
-- Boss Menu
['boss_actions'] = 'chef meny',
-- Misc
['invalid_amount'] = '~r~Ogiltig mängd',
['actions_prompt'] = 'tryck ~INPUT_CONTEXT~ för att öppna menyn.',
['deposit_amount'] = 'mängd att sätta in',
['money_withdraw'] = 'mängd att ta ut',
['fast_travel'] = 'tryck på ~INPUT_CONTEXT~ för att snabbresa.',
['open_pharmacy'] = 'tryck på ~INPUT_CONTEXT~ för att öppna apoteket.',
['pharmacy_menu_title'] = 'apotek',
['pharmacy_take'] = 'ta <span style="color:blue;">%s</span>',
['medikit'] = 'medicinkit',
['bandage'] = 'bandage',
['max_item'] = 'du har redan tillräckligt mycket på dig.',
-- F6 Menu
['ems_menu'] = 'ambulansmeny',
['ems_menu_title'] = 'ambulansmeny',
['ems_menu_revive'] = 'återuppliva spelare',
['ems_menu_putincar'] = 'sätt i fordon',
['ems_menu_small'] = 'behandla mindre skador',
['ems_menu_big'] = 'behandla svåra skador',
-- Phone
['alert_ambulance'] = 'ambulanssamtal',
-- Death
['respawn_available_in'] = 'respawn tillgänglig om ~b~%s:%s~s~',
['respawn_bleedout_in'] = 'du kommer att blöda ut om ~b~%s:%s~s~\n',
['respawn_bleedout_prompt'] = 'håll [~b~E~s~] för att respawna',
['respawn_bleedout_fine'] = 'håll [~b~E~s~] för att respawna, kostar ~g~%s SEK~s~',
['respawn_bleedout_fine_msg'] = 'du betalade ~r~%s SEK~s~ för att respawna.',
['distress_send'] = 'tryck ~b~[G]~s~ för att skicka nödsignal',
['distress_sent'] = 'nödsignal har skickats till samtliga enheter!',
['distress_message'] = 'läkarvård krävs: medvetslös medborgare!',
['combatlog_message'] = 'du har force-respawnats på grund av att du lämnat servern medans du var död',
-- Revive
['revive_help'] = 'återuppliva en spelare',
-- Item
['used_medikit'] = 'du har använt ~y~1x~s~ ~b~Medecinkit~s~',
['used_bandage'] = 'du har använt ~y~1x~s~ ~b~Bandage~s~',
['not_enough_medikit'] = 'du har inget ~b~Medecinkit~s~.',
['not_enough_bandage'] = 'du har inget ~b~Bandage~s~.',
['healed'] = 'dina skador har blivit behandlade.',
}
@@ -0,0 +1,33 @@
USE `essentialmode`;
INSERT INTO `addon_account` (name, label, shared) VALUES
('society_ambulance', 'Záchranka', 1)
;
INSERT INTO `addon_inventory` (name, label, shared) VALUES
('society_ambulance', 'Záchranka', 1)
;
INSERT INTO `datastore` (name, label, shared) VALUES
('society_ambulance', 'Záchranka', 1)
;
INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES
('ambulance',0,'ambulance','Zdravotník',20,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'),
('ambulance',1,'doctor','Doktor',40,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'),
('ambulance',2,'chief_doctor','Primář',60,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'),
('ambulance',3,'boss','Chirurg',80,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}')
;
INSERT INTO `jobs` (name, label) VALUES
('ambulance','Záchranka')
;
INSERT INTO `items` (name, label, `limit`) VALUES
('bandage','Obvaz', 20),
('medikit','Lékarnička', 5)
;
ALTER TABLE `users`
ADD `is_dead` TINYINT(1) NULL DEFAULT '0'
;
@@ -0,0 +1,33 @@
USE `essentialmode`;
INSERT INTO `addon_account` (name, label, shared) VALUES
('society_ambulance', 'Notdienst', 1)
;
INSERT INTO `addon_inventory` (name, label, shared) VALUES
('society_ambulance', 'Ambulance', 1)
;
INSERT INTO `datastore` (name, label, shared) VALUES
('society_ambulance', 'Ambulance', 1)
;
INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES
('ambulance',0,'ambulance','Sanitäter',20,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'),
('ambulance',1,'doctor','Arzt',40,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'),
('ambulance',2,'chief_doctor','Chefarzt',60,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'),
('ambulance',3,'boss','Chirurg',80,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}')
;
INSERT INTO `jobs` (name, label) VALUES
('ambulance','Notdienst')
;
INSERT INTO `items` (name, label, `limit`) VALUES
('bandage','Bandage', 20),
('medikit','Medikit', 5)
;
ALTER TABLE `users`
ADD `is_dead` TINYINT(1) NULL DEFAULT '0'
;
@@ -0,0 +1,33 @@
USE `essentialmode`;
INSERT INTO `addon_account` (name, label, shared) VALUES
('society_ambulance', 'EMS', 1)
;
INSERT INTO `addon_inventory` (name, label, shared) VALUES
('society_ambulance', 'EMS', 1)
;
INSERT INTO `datastore` (name, label, shared) VALUES
('society_ambulance', 'EMS', 1)
;
INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES
('ambulance',0,'ambulance','Jr. EMT',20,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'),
('ambulance',1,'doctor','EMT',40,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'),
('ambulance',2,'chief_doctor','Sr. EMT',60,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'),
('ambulance',3,'boss','EMT Supervisor',80,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}')
;
INSERT INTO `jobs` (name, label) VALUES
('ambulance','EMS')
;
INSERT INTO `items` (name, label, `limit`) VALUES
('bandage','Bandage', 20),
('medikit','Medikit', 5)
;
ALTER TABLE `users`
ADD `is_dead` TINYINT(1) NULL DEFAULT '0'
;
@@ -0,0 +1,33 @@
USE `essentialmode`;
INSERT INTO `addon_account` (name, label, shared) VALUES
('society_ambulance', 'Ensihoito', 1)
;
INSERT INTO `addon_inventory` (name, label, shared) VALUES
('society_ambulance', 'Ensihoito', 1)
;
INSERT INTO `datastore` (name, label, shared) VALUES
('society_ambulance', 'Ensihoito', 1)
;
INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES
('ambulance',0,'ambulance','Ensihoitaja',20,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'),
('ambulance',1,'doctor','Lääkäri',40,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'),
('ambulance',2,'chief_doctor','Yli-lääkäri',60,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'),
('ambulance',3,'boss','Kirurgi',80,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}')
;
INSERT INTO `jobs` (name, label) VALUES
('ambulance','Ensihoito')
;
INSERT INTO `items` (name, label, `limit`) VALUES
('bandage','Sideharso', 20),
('medikit','Ensiapupakkaus', 5)
;
ALTER TABLE `users`
ADD `is_dead` TINYINT(1) NULL DEFAULT '0'
;
@@ -0,0 +1,33 @@
USE `essentialmode`;
INSERT INTO `addon_account` (name, label, shared) VALUES
('society_ambulance', 'Ambulance', 1)
;
INSERT INTO `addon_inventory` (name, label, shared) VALUES
('society_ambulance', 'Ambulance', 1)
;
INSERT INTO `datastore` (name, label, shared) VALUES
('society_ambulance', 'Pogotowie ratunkowe', 1)
;
INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES
('ambulance',0,'ambulance','Ratownik',20,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'),
('ambulance',1,'doctor','Lekarz',40,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'),
('ambulance',2,'chief_doctor','Chirurg',60,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'),
('ambulance',3,'boss','Ordynator',80,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}')
;
INSERT INTO `jobs` (name, label) VALUES
('ambulance','Pogotowie ratunkowe')
;
INSERT INTO `items` (name, label, `limit`) VALUES
('bandage','Bandaż', 20),
('medikit','Defibrylator', 5)
;
ALTER TABLE `users`
ADD `is_dead` TINYINT(1) NULL DEFAULT '0'
;
+306
View File
@@ -0,0 +1,306 @@
ESX = nil
local playersHealing = {}
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
RegisterServerEvent('esx_ambulancejob:revive')
AddEventHandler('esx_ambulancejob:revive', function(target)
local xPlayer = ESX.GetPlayerFromId(source)
if xPlayer.job.name == 'ambulance' then
xPlayer.addMoney(Config.ReviveReward)
TriggerClientEvent('esx_ambulancejob:revive', target)
else
print(('esx_ambulancejob: %s attempted to revive!'):format(xPlayer.identifier))
end
end)
RegisterServerEvent('esx_ambulancejob:heal')
AddEventHandler('esx_ambulancejob:heal', function(target, type)
local xPlayer = ESX.GetPlayerFromId(source)
if xPlayer.job.name == 'ambulance' then
TriggerClientEvent('esx_ambulancejob:heal', target, type)
else
print(('esx_ambulancejob: %s attempted to heal!'):format(xPlayer.identifier))
end
end)
RegisterServerEvent('esx_ambulancejob:putInVehicle')
AddEventHandler('esx_ambulancejob:putInVehicle', function(target)
local xPlayer = ESX.GetPlayerFromId(source)
if xPlayer.job.name == 'ambulance' then
TriggerClientEvent('esx_ambulancejob:putInVehicle', target)
else
print(('esx_ambulancejob: %s attempted to put in vehicle!'):format(xPlayer.identifier))
end
end)
TriggerEvent('esx_phone:registerNumber', 'ambulance', _U('alert_ambulance'), true, true)
TriggerEvent('esx_society:registerSociety', 'ambulance', 'Ambulance', 'society_ambulance', 'society_ambulance', 'society_ambulance', {type = 'public'})
ESX.RegisterServerCallback('esx_ambulancejob:removeItemsAfterRPDeath', function(source, cb)
local xPlayer = ESX.GetPlayerFromId(source)
if Config.RemoveCashAfterRPDeath then
if xPlayer.getMoney() > 0 then
xPlayer.removeMoney(xPlayer.getMoney())
end
if xPlayer.getAccount('black_money').money > 0 then
xPlayer.setAccountMoney('black_money', 0)
end
end
if Config.RemoveItemsAfterRPDeath then
for i=1, #xPlayer.inventory, 1 do
if xPlayer.inventory[i].count > 0 then
xPlayer.setInventoryItem(xPlayer.inventory[i].name, 0)
end
end
end
local playerLoadout = {}
if Config.RemoveWeaponsAfterRPDeath then
for i=1, #xPlayer.loadout, 1 do
xPlayer.removeWeapon(xPlayer.loadout[i].name)
end
else -- save weapons & restore em' since spawnmanager removes them
for i=1, #xPlayer.loadout, 1 do
table.insert(playerLoadout, xPlayer.loadout[i])
end
-- give back wepaons after a couple of seconds
Citizen.CreateThread(function()
Citizen.Wait(5000)
for i=1, #playerLoadout, 1 do
if playerLoadout[i].label ~= nil then
xPlayer.addWeapon(playerLoadout[i].name, playerLoadout[i].ammo)
end
end
end)
end
cb()
end)
if Config.EarlyRespawnFine then
ESX.RegisterServerCallback('esx_ambulancejob:checkBalance', function(source, cb)
local xPlayer = ESX.GetPlayerFromId(source)
local bankBalance = xPlayer.getAccount('bank').money
cb(bankBalance >= Config.EarlyRespawnFineAmount)
end)
RegisterServerEvent('esx_ambulancejob:payFine')
AddEventHandler('esx_ambulancejob:payFine', function()
local xPlayer = ESX.GetPlayerFromId(source)
local fineAmount = Config.EarlyRespawnFineAmount
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('respawn_bleedout_fine_msg', ESX.Math.GroupDigits(fineAmount)))
xPlayer.removeAccountMoney('bank', fineAmount)
end)
end
ESX.RegisterServerCallback('esx_ambulancejob:getItemAmount', function(source, cb, item)
local xPlayer = ESX.GetPlayerFromId(source)
local quantity = xPlayer.getInventoryItem(item).count
cb(quantity)
end)
ESX.RegisterServerCallback('esx_ambulancejob:buyJobVehicle', function(source, cb, vehicleProps, type)
local xPlayer = ESX.GetPlayerFromId(source)
local price = getPriceFromHash(vehicleProps.model, xPlayer.job.grade_name, type)
-- vehicle model not found
if price == 0 then
print(('esx_ambulancejob: %s attempted to exploit the shop! (invalid vehicle model)'):format(xPlayer.identifier))
cb(false)
else
if xPlayer.getMoney() >= price then
xPlayer.removeMoney(price)
MySQL.Async.execute('INSERT INTO owned_vehicles (owner, vehicle, plate, type, job, `stored`) VALUES (@owner, @vehicle, @plate, @type, @job, @stored)', {
['@owner'] = xPlayer.identifier,
['@vehicle'] = json.encode(vehicleProps),
['@plate'] = vehicleProps.plate,
['@type'] = type,
['@job'] = xPlayer.job.name,
['@stored'] = true
}, function (rowsChanged)
cb(true)
end)
else
cb(false)
end
end
end)
ESX.RegisterServerCallback('esx_ambulancejob:storeNearbyVehicle', function(source, cb, nearbyVehicles)
local xPlayer = ESX.GetPlayerFromId(source)
local foundPlate, foundNum
for k,v in ipairs(nearbyVehicles) do
local result = MySQL.Sync.fetchAll('SELECT plate FROM owned_vehicles WHERE owner = @owner AND plate = @plate AND job = @job', {
['@owner'] = xPlayer.identifier,
['@plate'] = v.plate,
['@job'] = xPlayer.job.name
})
if result[1] then
foundPlate, foundNum = result[1].plate, k
break
end
end
if not foundPlate then
cb(false)
else
MySQL.Async.execute('UPDATE owned_vehicles SET `stored` = true WHERE owner = @owner AND plate = @plate AND job = @job', {
['@owner'] = xPlayer.identifier,
['@plate'] = foundPlate,
['@job'] = xPlayer.job.name
}, function (rowsChanged)
if rowsChanged == 0 then
print(('esx_ambulancejob: %s has exploited the garage!'):format(xPlayer.identifier))
cb(false)
else
cb(true, foundNum)
end
end)
end
end)
function getPriceFromHash(hashKey, jobGrade, type)
if type == 'helicopter' then
local vehicles = Config.AuthorizedHelicopters[jobGrade]
for k,v in ipairs(vehicles) do
if GetHashKey(v.model) == hashKey then
return v.price
end
end
elseif type == 'car' then
local vehicles = Config.AuthorizedVehicles[jobGrade]
for k,v in ipairs(vehicles) do
if GetHashKey(v.model) == hashKey then
return v.price
end
end
end
return 0
end
RegisterServerEvent('esx_ambulancejob:removeItem')
AddEventHandler('esx_ambulancejob:removeItem', function(item)
local _source = source
local xPlayer = ESX.GetPlayerFromId(_source)
xPlayer.removeInventoryItem(item, 1)
if item == 'bandage' then
TriggerClientEvent('esx:showNotification', _source, _U('used_bandage'))
elseif item == 'medikit' then
TriggerClientEvent('esx:showNotification', _source, _U('used_medikit'))
end
end)
RegisterServerEvent('esx_ambulancejob:giveItem')
AddEventHandler('esx_ambulancejob:giveItem', function(itemName)
local xPlayer = ESX.GetPlayerFromId(source)
if xPlayer.job.name ~= 'ambulance' then
print(('esx_ambulancejob: %s attempted to spawn in an item!'):format(xPlayer.identifier))
return
elseif (itemName ~= 'medikit' and itemName ~= 'bandage') then
print(('esx_ambulancejob: %s attempted to spawn in an item!'):format(xPlayer.identifier))
return
end
local xItem = xPlayer.getInventoryItem(itemName)
local count = 1
if xItem.limit ~= -1 then
count = xItem.limit - xItem.count
end
if xItem.count < xItem.limit then
xPlayer.addInventoryItem(itemName, count)
else
TriggerClientEvent('esx:showNotification', source, _U('max_item'))
end
end)
TriggerEvent('es:addGroupCommand', 'revive', 'admin', function(source, args, user)
if args[1] ~= nil then
if GetPlayerName(tonumber(args[1])) ~= nil then
print(('esx_ambulancejob: %s used admin revive'):format(GetPlayerIdentifiers(source)[1]))
TriggerClientEvent('esx_ambulancejob:revive', tonumber(args[1]))
end
else
TriggerClientEvent('esx_ambulancejob:revive', source)
end
end, function(source, args, user)
TriggerClientEvent('chat:addMessage', source, { args = { '^1SYSTEM', 'Insufficient Permissions.' } })
end, { help = _U('revive_help'), params = {{ name = 'id' }} })
ESX.RegisterUsableItem('medikit', function(source)
if not playersHealing[source] then
local xPlayer = ESX.GetPlayerFromId(source)
xPlayer.removeInventoryItem('medikit', 1)
playersHealing[source] = true
TriggerClientEvent('esx_ambulancejob:useItem', source, 'medikit')
Citizen.Wait(10000)
playersHealing[source] = nil
end
end)
ESX.RegisterUsableItem('bandage', function(source)
if not playersHealing[source] then
local xPlayer = ESX.GetPlayerFromId(source)
xPlayer.removeInventoryItem('bandage', 1)
playersHealing[source] = true
TriggerClientEvent('esx_ambulancejob:useItem', source, 'bandage')
Citizen.Wait(10000)
playersHealing[source] = nil
end
end)
ESX.RegisterServerCallback('esx_ambulancejob:getDeathStatus', function(source, cb)
local identifier = GetPlayerIdentifiers(source)[1]
MySQL.Async.fetchScalar('SELECT is_dead FROM users WHERE identifier = @identifier', {
['@identifier'] = identifier
}, function(isDead)
if isDead then
print(('esx_ambulancejob: %s attempted combat logging!'):format(identifier))
end
cb(isDead)
end)
end)
RegisterServerEvent('esx_ambulancejob:setDeathStatus')
AddEventHandler('esx_ambulancejob:setDeathStatus', function(isDead)
local identifier = GetPlayerIdentifiers(source)[1]
if type(isDead) ~= 'boolean' then
print(('esx_ambulancejob: %s attempted to parse something else than a boolean to setDeathStatus!'):format(identifier))
return
end
MySQL.Sync.execute('UPDATE users SET is_dead = @isDead WHERE identifier = @identifier', {
['@identifier'] = identifier,
['@isDead'] = isDead
})
end)
Binary file not shown.
+284
View File
@@ -0,0 +1,284 @@
# KASHacters - ESX Multi Characters
## Installation
**_How to install instruction._ Created By XxFri3ndlyxX**
<br>
- First you need a serrver that has at least the basic scripts and their requirements.
```
### [ESSENTIALS] ###
start mysql-async
start essentialmode
start esplugin_mysql
start es_extended
start async
start es_ui
start es_admin2
start esx_kashacters
start esx_identity
start skinchanger
start esx_skin
start instance
start esx_datastore
start esx_addonaccount
start esx_addoninventory
start cron
start esx_menu_default
start esx_menu_list
start esx_menu_dialog
start esx_license
start esx_billing
start esx_society
start esx_policejob
start esx_ambulancejob
start esx_vehicleshop
```
<br>
Then
<br>
- Download the resource
- Rename the resource to esx_kashacters
- import the sql file in your database
- Go to *essentialmode\client\main.lua* and edit/comment the code.
```
--[[Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
if NetworkIsSessionStarted() then
TriggerServerEvent('es:firstJoinProper')
TriggerEvent('es:allowedToSpawn')
return
end
end
end)]]--
```
## Inventory Quick Fix
- To fix the inventory not showing after death.
Quick fix you can do.
In es_extended Look for
```
-- Menu interactions
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
if IsControlJustReleased(0, Keys['F2']) and IsInputDisabled(0) and not isDead and not ESX.UI.Menu.IsOpen('default', 'es_extended', 'inventory') then
ESX.ShowInventory()
end
end
end)
```
and change it to
```
-- Menu interactions
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
if IsControlJustReleased(0, Keys['F2']) and IsInputDisabled(0) and not ESX.UI.Menu.IsOpen('default', 'es_extended', 'inventory') then
ESX.ShowInventory()
end
end
end)
```
-I know this is not the best solution. But i don't have time to fix this the proper way. Use this quick fix or fix it properly on your own. I's something to do with isdead not being trigged properly. Also you can do the same to other menu that don't work by removing the and not isDead
## Tables (Owned & Identifier)
- Now we edit the table and add all our identifier to make sure our character loads.
- *Edit the code in esx_kashacters\server\main.lua*
```
local IdentifierTables = {
{table = "addon_account_data", column = "owner"},
{table = "addon_inventory_items", column = "owner"},
{table = "billing", column = "identifier"},
{table = "characters", column = "identifier"},
{table = "datastore_data", column = "owner"},
{table = "owned_vehicles", column = "owner"},
{table = "rented_vehicles", column = "owner"},
{table = "society_moneywash", column = "identifier"},
{table = "users", column = "identifier"},
{table = "user_accounts", column = "identifier"},
{table = "user_inventory", column = "identifier"},
{table = "user_licenses", column = "owner"},
}
```
To get your identifier.
Do this query in your database
`SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME = 'owner'`
and
`SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME = 'indentifier'`
Credit @Xnubil for this query line
The table list provided is just an example. Yours may differ depending on what you install on your server.
Once You've done all that. add start esx_kashacters to your server.cfg
## Ambulance Fix
The Fix for the ambulance on the kashacter script is already implemented.
Now all you have to do is go to your ambulance script that is up to date and
comment or delete
```
--[[
AddEventHandler('playerSpawned', function()
IsDead = false
if FirstSpawn then
exports.spawnmanager:setAutoSpawn(false) -- disable respawn
FirstSpawn = false
ESX.TriggerServerCallback('esx_ambulancejob:getDeathStatus', function(isDead)
if isDead and Config.AntiCombatLog then
while not PlayerLoaded do
Citizen.Wait(1000)
end
ESX.ShowNotification(_U('combatlog_message'))
RemoveItemsAfterRPDeath()
end
end)
end
end)
]]--
```
<br>
Then add this
<br>
```
RegisterNetEvent('esx_ambulancejob:multicharacter')
AddEventHandler('esx_ambulancejob:multicharacter', function()
IsDead = false
ESX.TriggerServerCallback('esx_ambulancejob:getDeathStatus', function(isDead)
if isDead and Config.AntiCombatLog then
ESX.ShowNotification(_U('combatlog_message'))
RemoveItemsAfterRPDeath()
end
end)
end)
```
Then change this
```
function RespawnPed(ped, coords, heading)
SetEntityCoordsNoOffset(ped, coords.x, coords.y, coords.z, false, false, false, true)
NetworkResurrectLocalPlayer(coords.x, coords.y, coords.z, heading, true, false)
SetPlayerInvincible(ped, false)
TriggerEvent('playerspawned', coords.x, coords.y, coords.z)
ClearPedBloodDamage(ped)
ESX.UI.Menu.CloseAll()
end
```
to
```
function RespawnPed(ped, coords, heading)
SetEntityCoordsNoOffset(ped, coords.x, coords.y, coords.z, false, false, false, true)
NetworkResurrectLocalPlayer(coords.x, coords.y, coords.z, heading, true, false)
SetPlayerInvincible(ped, false)
TriggerEvent('esx_ambulancejob:multicharacter', coords.x, coords.y, coords.z)
ClearPedBloodDamage(ped)
ESX.UI.Menu.CloseAll()
end
```
If you do not do this last part once you repawn after death you will be frozen into place.
## Duplication Entry (Datastore)
To fix The datastore duplicated entry download this https://github.com/XxFri3ndlyxX/esx_datastore
Or
Add this code to your server/main.lua
```-- Fix for kashacters duplication entry --
-- Fix was taken from this link --
-- https://forum.fivem.net/t/release-esx-kashacters-multi-character/251613/448?u=xxfri3ndlyxx --
AddEventHandler('esx:playerLoaded', function(source)
local result = MySQL.Sync.fetchAll('SELECT * FROM datastore')
for i=1, #result, 1 do
local name = result[i].name
local label = result[i].label
local shared = result[i].shared
local result2 = MySQL.Sync.fetchAll('SELECT * FROM datastore_data WHERE name = @name', {
['@name'] = name
})
if shared == 0 then
table.insert(DataStoresIndex, name)
DataStores[name] = {}
for j=1, #result2, 1 do
local storeName = result2[j].name
local storeOwner = result2[j].owner
local storeData = (result2[j].data == nil and {} or json.decode(result2[j].data))
local dataStore = CreateDataStore(storeName, storeOwner, storeData)
table.insert(DataStores[name], dataStore)
end
end
end
local _source = source
local xPlayer = ESX.GetPlayerFromId(_source)
local dataStores = {}
for i=1, #DataStoresIndex, 1 do
local name = DataStoresIndex[i]
local dataStore = GetDataStore(name, xPlayer.identifier)
if dataStore == nil then
MySQL.Async.execute('INSERT INTO datastore_data (name, owner, data) VALUES (@name, @owner, @data)',
{
['@name'] = name,
['@owner'] = xPlayer.identifier,
['@data'] = '{}'
})
dataStore = CreateDataStore(name, xPlayer.identifier, {})
table.insert(DataStores[name], dataStore)
end
table.insert(dataStores, dataStore)
end
xPlayer.set('dataStores', dataStores)
end)
```
> *Pay ATTENTION: You have to call the resource 'esx_kashacters' in order for the javascript to work!!!**
## How it works
> What this script does it manipulates ESX for loading characters
So when you are choosing your character it changes your steam id which is normally steam: to Char: this prevents ESX from loading another character because it is looking for you exact steamid. So when you choose your character it will change it from Char: to your normal steam id (steam:). When creating a new character it will spawn you without an exact steamid which creates a new database entry for your steamid
## Credits
> ESX Framework and **KASH** AND **Onno204** for creating the resource. You can do whatever the f with it what you want but it is nice to give the main man credits ;)
+19
View File
@@ -0,0 +1,19 @@
resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'
server_scripts {
"@mysql-async/lib/MySQL.lua",
"server/main.lua",
}
client_scripts {
"client/main.lua",
}
ui_page {
'html/ui.html',
}
files {
'html/ui.html',
'html/css/main.css',
'html/js/app.js',
}
+120
View File
@@ -0,0 +1,120 @@
ESX = nil
Citizen.CreateThread(function()
while ESX == nil do
Citizen.Wait(200)
TriggerEvent('esx:getSharedObject', function (obj) ESX = obj end)
end
end)
-- This Code Was changed to fix error With player spawner as default --
-- Link to the post with the error fix --
-- https://forum.fivem.net/t/release-esx-kashacters-multi-character/251613/316?u=xxfri3ndlyxx --
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
if NetworkIsSessionStarted() then
Citizen.Wait(100)
TriggerServerEvent("kashactersS:SetupCharacters")
TriggerEvent("kashactersC:SetupCharacters")
return -- break the loop
end
end
end)
local IsChoosing = true
Citizen.CreateThread(function ()
while true do
Citizen.Wait(0)
if IsChoosing then
DisplayHud(false)
DisplayRadar(false)
end
end
end)
local cam = nil
local cam2 = nil
RegisterNetEvent('kashactersC:SetupCharacters')
AddEventHandler('kashactersC:SetupCharacters', function()
DoScreenFadeOut(10)
while not IsScreenFadedOut() do
Citizen.Wait(10)
end
SetTimecycleModifier('hud_def_blur')
FreezeEntityPosition(GetPlayerPed(-1), true)
cam = CreateCamWithParams("DEFAULT_SCRIPTED_CAMERA", -1355.93,-1487.78,520.75, 300.00,0.00,0.00, 100.00, false, 0)
SetCamActive(cam, true)
RenderScriptCams(true, false, 1, true, true)
end)
RegisterNetEvent('kashactersC:SetupUI')
AddEventHandler('kashactersC:SetupUI', function(Characters)
DoScreenFadeIn(500)
Citizen.Wait(500)
SetNuiFocus(true, true)
SendNUIMessage({
action = "openui",
characters = Characters,
})
end)
RegisterNetEvent('kashactersC:SpawnCharacter')
AddEventHandler('kashactersC:SpawnCharacter', function(spawn, isnew)
TriggerServerEvent('es:firstJoinProper')
TriggerEvent('es:allowedToSpawn')
SetTimecycleModifier('default')
local pos = spawn
SetEntityCoords(GetPlayerPed(-1), pos.x, pos.y, pos.z)
DoScreenFadeIn(500)
Citizen.Wait(500)
cam2 = CreateCamWithParams("DEFAULT_SCRIPTED_CAMERA", -1355.93,-1487.78,520.75, 300.00,0.00,0.00, 100.00, false, 0)
PointCamAtCoord(cam2, pos.x,pos.y,pos.z+200)
SetCamActiveWithInterp(cam2, cam, 900, true, true)
Citizen.Wait(900)
exports.spawnmanager:setAutoSpawn(false)
TriggerEvent('esx_ambulancejob:multicharacter', source)
if isnew then
TriggerEvent('esx_identity:showRegisterIdentity')
end
cam = CreateCamWithParams("DEFAULT_SCRIPTED_CAMERA", pos.x,pos.y,pos.z+200, 300.00,0.00,0.00, 100.00, false, 0)
PointCamAtCoord(cam, pos.x,pos.y,pos.z+2)
SetCamActiveWithInterp(cam, cam2, 3700, true, true)
Citizen.Wait(3700)
PlaySoundFrontend(-1, "Zoom_Out", "DLC_HEIST_PLANNING_BOARD_SOUNDS", 1)
RenderScriptCams(false, true, 500, true, true)
PlaySoundFrontend(-1, "CAR_BIKE_WHOOSH", "MP_LOBBY_SOUNDS", 1)
FreezeEntityPosition(GetPlayerPed(-1), false)
Citizen.Wait(500)
SetCamActive(cam, false)
DestroyCam(cam, true)
IsChoosing = false
DisplayHud(true)
DisplayRadar(true)
end)
RegisterNetEvent('kashactersC:ReloadCharacters')
AddEventHandler('kashactersC:ReloadCharacters', function()
TriggerServerEvent("kashactersS:SetupCharacters")
TriggerEvent("kashactersC:SetupCharacters")
end)
RegisterNUICallback("CharacterChosen", function(data, cb)
SetNuiFocus(false,false)
DoScreenFadeOut(500)
TriggerServerEvent('kashactersS:CharacterChosen', data.charid, data.ischar)
while not IsScreenFadedOut() do
Citizen.Wait(10)
end
cb("ok")
end)
RegisterNUICallback("DeleteCharacter", function(data, cb)
SetNuiFocus(false,false)
DoScreenFadeOut(500)
TriggerServerEvent('kashactersS:DeleteCharacter', data.charid)
while not IsScreenFadedOut() do
Citizen.Wait(10)
end
cb("ok")
end)
+39
View File
@@ -0,0 +1,39 @@
-- phpMyAdmin SQL Dump
-- version 4.8.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Gegenereerd op: 02 feb 2019 om 20:58
-- Serverversie: 10.1.32-MariaDB
-- PHP-versie: 7.2.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `esx_standalone`
--
-- --------------------------------------------------------
--
-- Tabelstructuur voor tabel `user_lastcharacter`
--
CREATE TABLE `user_lastcharacter` (
`steamid` varchar(255) NOT NULL,
`charid` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
+72
View File
@@ -0,0 +1,72 @@
html {
overflow: hidden;
}
p {
margin: 0 !important;
}
.main-container {
display:none;
width: 70vw;
margin: auto;
position: relative;
top: 35vh;
}
.character-container {
width: 100%;
margin: auto;
display: flex;
justify-content: space-between;
}
.character-box {
color: #FFFFFF;
background: rgba(0,0,0,0.6);
padding: 20px;
text-align: center;
border: 2px solid transparent;
}
.character-box:hover {
background: rgba(42, 125, 193,1.0);
border-radius: 5px;
transition: 200ms;
}
.character-info {
text-align: left!important;
}
.character-buttons {
display: none;
width: 70vw;
margin:15px auto;
}
.btn-play {
background: #43A047;
color: #FFFFFF;
float:left;
margin-right: 10px;
}
.btn-play:hover {
background: #2eb72c;
}
.btn-delete {
background: #930b0b;
color: #FFFFFF;
float:left;
}
.btn-delete:hover {
background: #b50c0c;
}
.active-char {
border: 2px solid rgba(0,0,0,0.4);
}
+72
View File
@@ -0,0 +1,72 @@
$(".character-box").hover(
function() {
$(this).css({
"background": "rgba(42, 125, 193, 1.0)",
"transition": "200ms",
});
}, function() {
$(this).css({
"background": "rgba(0,0,0,0.6)",
"transition": "200ms",
});
}
);
$(".character-box").click(function () {
$(".character-box").removeClass('active-char');
$(this).addClass('active-char');
$(".character-buttons").css({"display":"block"});
if ($(this).attr("data-ischar") === "true") {
$("#delete").css({"display":"block"});
} else {
$("#delete").css({"display":"none"});
}
});
$("#play-char").click(function () {
$.post("http://esx_kashacters/CharacterChosen", JSON.stringify({
charid: $('.active-char').attr("data-charid"),
ischar: $('.active-char').attr("data-ischar"),
}));
Kashacter.CloseUI();
});
$("#deletechar").click(function () {
$.post("http://esx_kashacters/DeleteCharacter", JSON.stringify({
charid: $('.active-char').attr("data-charid"),
}));
Kashacter.CloseUI();
});
(() => {
Kashacter = {};
Kashacter.ShowUI = function(data) {
$('.main-container').css({"display":"block"});
if(data.characters !== null) {
$.each(data.characters, function (index, char) {
if (char.charid !== 0) {
var charid = char.identifier.charAt(4);
$('[data-charid=' + charid + ']').html('<h3 class="character-fullname">'+ char.firstname +' '+ char.lastname +'</h3><div class="character-info"><p class="character-info-work"><strong>Work: </strong><span>'+ char.job +'</span></p><p class="character-info-money"><strong>Cash: </strong><span>'+ char.money +'</span></p><p class="character-info-bank"><strong>Bank: </strong><span>'+ char.bank +'</span></p> <p class="character-info-dateofbirth"><strong>Date of birth: </strong><span>'+ char.dateofbirth +'</span></p> <p class="character-info-gender"><strong>Gender: </strong><span>'+ char.sex +'</span></p></div>').attr("data-ischar", "true");
}
});
}
};
Kashacter.CloseUI = function() {
$('.main-container').css({"display":"none"});
$(".character-box").removeClass('active-char');
$("#delete").css({"display":"none"});
$(".character-box").html('<h3 class="character-fullname"><i class="fas fa-plus"></i></h3><div class="character-info"><p class="character-info-new">Create new character</p></div>').attr("data-ischar", "false");
};
window.onload = function(e) {
window.addEventListener('message', function(event) {
switch(event.data.action) {
case 'openui':
Kashacter.ShowUI(event.data);
break;
}
})
}
})();
+70
View File
@@ -0,0 +1,70 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Custom CSS -->
<link rel="stylesheet" type="text/css" href="css/main.css" />
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
</head>
<body style="background-color: rgba(0,0,0,0); font-family: 'Roboto', sans-serif !important;">
<div class="main-container">
<div class="character-container">
<div class="character-box" data-ischar="false" data-charid="1">
<h3 class="character-fullname"><i class="fas fa-plus"></i></h3>
<div class="character-info">
<p class="character-info-new">Create new character</p>
</div>
</div>
<div class="character-box" data-ischar="false" data-charid="2">
<h3 class="character-fullname"><i class="fas fa-plus"></i></h3>
<div class="character-info">
<p class="character-info-new">Create new character</p>
</div>
</div>
<div class="character-box" data-ischar="false" data-charid="3">
<h3 class="character-fullname"><i class="fas fa-plus"></i></h3>
<div class="character-info">
<p class="character-info-new">Create new character</p>
</div>
</div>
<div class="character-box" data-ischar="false" data-charid="4">
<h3 class="character-fullname"><i class="fas fa-plus"></i></h3>
<div class="character-info">
<p class="character-info-new">Create new character</p>
</div>
</div>
</div>
<div class="character-buttons">
<button class="btn btn-play" id="play-char">PLAY</button>
<button class="btn btn-delete" id="delete" data-toggle="modal" data-target="#delete-char">DELETE</button>
</div>
</div>
<div id="delete-char" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
</div>
<div class="modal-body">
<h5>Are You Sure?</h5>
<hr>
<p>By deleting your account we won't be able to recover it, all properties, cars etc. will be deleted</p>
<hr>
<div class="modal-footer">
<button id="deletechar" class="btn btn-delete" data-toggle="modal" data-dismiss="modal">DELETE</button>
</div>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
<script src="js/app.js" type="text/javascript"></script>
</body>
</html>
+122
View File
@@ -0,0 +1,122 @@
---------------------------------------------------------------------------------------
-- Edit this table to all the database tables and columns
-- where identifiers are used (such as users, owned_vehicles, owned_properties etc.)
---------------------------------------------------------------------------------------
local IdentifierTables = {
{table = "users", column = "identifier"},
{table = "user_accounts", column = "identifier"},
-- {table = "user_contacts", column = "identifier"},
{table = "user_inventory", column = "identifier"},
-- {table = "user_parkings", column = "identifier"},
{table = "society_moneywash", column = "identifier"},
{table = "phone_users_contacts", column = "identifier"},
--{table = "jail", column = "identifier"},
{table = "characters", column = "identifier"},
{table = "billing", column = "identifier"},
{table = "rented_vehicles", column = "owner"},
{table = "addon_account_data", column = "owner"},
{table = "addon_inventory_items", column = "owner"},
{table = "datastore_data", column = "owner"},
{table = "owned_vehicles", column = "owner"},
{table = "phone_calls", column = "owner"},
{table = "phone_messages", column = "owner"},
{table = "rented_vehicles", column = "owner"},
{table = "user_licenses", column = "owner"},
}
RegisterServerEvent("kashactersS:SetupCharacters")
AddEventHandler('kashactersS:SetupCharacters', function()
local src = source
local LastCharId = GetLastCharacter(src)
SetIdentifierToChar(GetPlayerIdentifiers(src)[1], LastCharId)
local Characters = GetPlayerCharacters(src)
TriggerClientEvent('kashactersC:SetupUI', src, Characters)
end)
RegisterServerEvent("kashactersS:CharacterChosen")
AddEventHandler('kashactersS:CharacterChosen', function(charid, ischar)
local src = source
local spawn = {}
SetLastCharacter(src, tonumber(charid))
SetCharToIdentifier(GetPlayerIdentifiers(src)[1], tonumber(charid))
if ischar == "true" then
spawn = GetSpawnPos(src)
else
TriggerClientEvent('skinchanger:loadDefaultModel', src, true, cb)
spawn = { x = 195.55, y = -933.36, z = 29.90 } -- DEFAULT SPAWN POSITION
end
TriggerClientEvent("kashactersC:SpawnCharacter", src, spawn)
end)
RegisterServerEvent("kashactersS:DeleteCharacter")
AddEventHandler('kashactersS:DeleteCharacter', function(charid)
local src = source
DeleteCharacter(GetPlayerIdentifiers(src)[1], charid)
TriggerClientEvent("kashactersC:ReloadCharacters", src)
end)
function GetPlayerCharacters(source)
local identifier = GetIdentifierWithoutSteam(GetPlayerIdentifiers(source)[1])
local Chars = MySQLAsyncExecute("SELECT * FROM `users` WHERE identifier LIKE '%"..identifier.."%'")
for i = 1, #Chars, 1 do
charJob = MySQLAsyncExecute("SELECT * FROM `jobs` WHERE `name` = '"..Chars[i].job.."'")
charJobgrade = MySQLAsyncExecute("SELECT * FROM `job_grades` WHERE `grade` = '"..Chars[i].job_grade.."'")
Chars[i].job = charJob[1].label
Chars[i].job_grade = charJobgrade[1].label
end
return Chars
end
function GetLastCharacter(source)
local LastChar = MySQLAsyncExecute("SELECT `charid` FROM `user_lastcharacter` WHERE `steamid` = '"..GetPlayerIdentifiers(source)[1].."'")
if LastChar[1] ~= nil and LastChar[1].charid ~= nil then
return tonumber(LastChar[1].charid)
else
MySQLAsyncExecute("INSERT INTO `user_lastcharacter` (`steamid`, `charid`) VALUES('"..GetPlayerIdentifiers(source)[1].."', 1)")
return 1
end
end
function SetLastCharacter(source, charid)
MySQLAsyncExecute("UPDATE `user_lastcharacter` SET `charid` = '"..charid.."' WHERE `steamid` = '"..GetPlayerIdentifiers(source)[1].."'")
end
function SetIdentifierToChar(identifier, charid)
for _, itable in pairs(IdentifierTables) do
MySQLAsyncExecute("UPDATE `"..itable.table.."` SET `"..itable.column.."` = 'Char"..charid..GetIdentifierWithoutSteam(identifier).."' WHERE `"..itable.column.."` = '"..identifier.."'")
end
end
function SetCharToIdentifier(identifier, charid)
for _, itable in pairs(IdentifierTables) do
MySQLAsyncExecute("UPDATE `"..itable.table.."` SET `"..itable.column.."` = '"..identifier.."' WHERE `"..itable.column.."` = 'Char"..charid..GetIdentifierWithoutSteam(identifier).."'")
end
end
function DeleteCharacter(identifier, charid)
for _, itable in pairs(IdentifierTables) do
MySQLAsyncExecute("DELETE FROM `"..itable.table.."` WHERE `"..itable.column.."` = 'Char"..charid..GetIdentifierWithoutSteam(identifier).."'")
end
end
function GetSpawnPos(source)
local SpawnPos = MySQLAsyncExecute("SELECT `position` FROM `users` WHERE `identifier` = '"..GetPlayerIdentifiers(source)[1].."'")
return json.decode(SpawnPos[1].position)
end
function GetIdentifierWithoutSteam(Identifier)
return string.gsub(Identifier, "steam", "")
end
function MySQLAsyncExecute(query)
local IsBusy = true
local result = nil
MySQL.Async.fetchAll(query, {}, function(data)
result = data
IsBusy = false
end)
while IsBusy do
Citizen.Wait(0)
end
return result
end
+14
View File
@@ -0,0 +1,14 @@
Copyright © 2017, Joel Wurtz; © 2018 Matthias Mandelartz
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.
The Software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the
warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or
copyright holders X be liable for any claim, damages or other liability, whether in an action of contract, tort or
otherwise, arising from, out of or in connection with the software or the use or other dealings in the Software.
+126
View File
@@ -0,0 +1,126 @@
# MySQL Async Library for FiveM
This library intends to provide function to connect to a MySQL library in a Sync and Async Way.
## Disclaimer
This mod does not replace EssentialMode, it offers instead a way of connecting to MySQL from lua-scripts, but
it will never contain any gameplay logic. It will remain a simple wrapper around MySQL functions.
All feedback is appreciated in order to deliver a stable release.
## Installation
Install the content of this repository in the `resources/mysql-async` folder. **Name of the folder** matters,
do not use a different name (otherwise you must have knowledge on how this works and make the appropriate changes)
Once installed, you will need to add this line of code in the resource file of each mod needing a MySQL client:
```
server_script '@mysql-async/lib/MySQL.lua'
```
### Warning
On Linux servers, users need to stick with the old mysql-async 2.x at least for the moment, due to some issues the linux server has with v8/javascript.
It can be downloaded from https://github.com/brouznouf/fivem-mysql-async/tree/2.0 or the release section. Note that the connection_string is different for 3.0.0 and 2.x.
## Configuration
Add this convar to your server configuration and change the values according to your MySQL installation:
`set mysql_connection_string "mysql://username:password@host/database?dateStrings=true"`
Further options can be found under https://github.com/mysqljs/mysql#connection-options
## Usage
### Waiting for MySQL to be ready
You need to encapsulate your code into `MySQL.ready` to be sure that the mod will be available and initialized
before your first request.
```lua
MySQL.ready(function ()
print(MySQL.Sync.fetchScalar('SELECT @parameters', {
['@parameters'] = 'string'
}))
end)
```
### Async
#### MySQL.Async.execute(string query, array params, function callback)
Works like `MySQL.Sync.execute` but will return immediatly instead of waiting for the execution of the query.
To exploit the result of an async method you must use a callback function:
```lua
MySQL.Async.execute('SELECT SLEEP(10)', {}, function(rowsChanged)
print(rowsChanged)
end)
```
#### MySQL.Async.fetchAll(string query, array params, function callback)
Works like `MySQL.Sync.fetchAll` and provide callback like the `MySQL.Async.execute` method:
```lua
MySQL.Async.fetchAll('SELECT * FROM player', {}, function(players)
print(players[1].name)
end)
```
#### MySQL.Async.fetchScalar(string query, array params, function callback)
Same as before for the fetchScalar method.
```lua
MySQL.Async.fetchScalar("SELECT COUNT(1) FROM players", function(countPlayer)
print(countPlayer)
end
```
### Sync
> Sync functions can block the main thread, always prefer the Async version if possible, there is very rare
> use case for you to use this.
#### MySQL.Sync.execute(string query, array params) : int
Execute a mysql query which should not send any result (like a Insert / Delete / Update), and will return the
number of affected rows.
```lua
MySQL.Sync.execute("UPDATE player SET name=@name WHERE id=@id", {['@id'] = 10, ['@name'] = 'foo'})
```
#### MySQL.Sync.fetchAll(string query, array params) : object[]
Fetch results from MySQL and returns them in the form of an Array of Objects:
```lua
local players = MySQL.Sync.fetchAll('SELECT id, name FROM player')
print(players[1].id)
```
#### MySQL.Sync.fetchScalar(string query, array params) : mixed
Fetch the first field of the first row in a query:
```lua
local countPlayer = MySQL.Sync.fetchScalar("SELECT COUNT(1) FROM players")
```
## Features
* Async / Sync
* It uses the https://github.com/mysqljs/mysql library to provide a connection to your mysql server.
* Create and close a connection for each query, the underlying library use a connection pool so only the
mysql auth is done each time, old tcp connections are keeped in memory for performance reasons
## Credits
Some parts of this library, and also my understanding were directly inspired by "Essential Mode", thanks to
them to have begin to work on this, which allows guy like me to not start from scratch every time...
+55
View File
@@ -0,0 +1,55 @@
# Upgrading from Legacy Server
## A note about EssentialMode
This library does not provide api compatibility with EssentialMode. The reason is that old API was not logic due to the
way on how mysql work which was inducing bad behavior, like executing multiple queries instead of one, or using only one
connection for all players (which was the main source of bug, having sync is not a problem as long as you know what you
are doing).
Then if you come from legacy server and still using essential mod API, you should update by using this path:
* Use the 1.0 of this library and read the UPGRADING.md file of it to use the new API
* Then you can Update to fxserver and use the 2.X version of this lib
* Then read the following advices on how to update your existing codebase for the 2.0 version
## Require
The `require` keyword does not exist anymore and will throw an error on fxserver. You should remove all references to
require, there is no replacement as this is no longer useful.
However you will have to add this line to your resource file `__resource.lua` in order to have access to the mysql async:
```lua
server_script '@mysql-async/lib/MySQL.lua'
```
## Configuration
There is no more configuration file in this lib, instead it use directly a `conv_var` which is basically a variable set
in the configuration file of your fxserver `server.cfg`
So you can remove the config file that you were having and add this line into your `server.cfg` file :
```
set mysql_connection_string "server=mariadb;database=fivem;userid=root;password=fivem"
```
It is highly recommended to set those variable **before** starting modules so they will be available directly on startup
(even if we provide some safety check for someone defining this var after...)
## Startup code with queries
You may have some sql queries at the start of your module, however due to the new way of loading modules in fxserver
(which is somehow async): Your library can be loaded before mysql-async even if you start it after.
To handle this use case, this library provide a special event `onMySQLReady` that is emitted once it's loaded, so you can do:
```lua
AddEventHandler('onMySQLReady', function ()
-- Startup code using mysql
end)
```
+3
View File
@@ -0,0 +1,3 @@
resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'
server_script 'mysql-async.js'
+84
View File
@@ -0,0 +1,84 @@
--executed = 0
--received = 0
--
--local function Loop()
-- SetTimeout(2, function ()
---- MySQL.Sync.fetchAll('WRONG SQL QUERY', {})
--
-- MySQL.Sync.fetchScalar('SELECT @parameters', {
-- ['@parameters'] = 'string'
-- })
--
-- executed = executed + 1
--
-- MySQL.Async.fetchAll('SELECT "hello2" as world', {}, function(result)
-- received = received + 1
-- end)
--
-- if executed % 100 == 0 then
-- print(received .. "/" .. executed)
-- end
--
-- Loop()
-- end)
--end
--
--AddEventHandler('onMySQLReady', function ()
-- Loop()
--end)
MySQL.ready(function ()
print(MySQL.Sync.fetchScalar('SELECT @parameters', {
['@parameters'] = 1
}))
print(MySQL.Sync.fetchScalar('SELECT @parameters', {
['@parameters'] = 'string'
}))
MySQL.Async.fetchScalar('SELECT NOW() as world', {}, function(result)
print(result)
end)
MySQL.Async.execute('SELECT SLEEP(5)', nil, function()
print("1")
end)
MySQL.Async.execute('SELECT SLEEP(4)', nil, function()
print("2")
end)
MySQL.Async.execute('SELECT SLEEP(3)', {}, function()
print("3")
end)
MySQL.Async.execute('SELECT SLEEP(2)', nil, function()
print("4")
end)
MySQL.Async.execute('SELECT SLEEP(1)', nil, function()
print("5")
end)
print(MySQL.Sync.fetchScalar("SELECT money FROM users WHERE id = 'yolo' "))
MySQL.Async.fetchAll("SELECT money FROM users WHERE id = 'yolo' ", {}, function (result)
print(#result)
end)
print(MySQL.Sync.fetchAll('SELECT "hello1" as world', {})[1].world)
MySQL.Async.fetchAll('SELECT "hello2" as world', {}, function(result)
print(result[1].world)
end)
print(MySQL.Sync.fetchScalar('SELECT "hello3" as world', {}))
MySQL.Async.fetchScalar('SELECT "hello4" as world', {}, function(result)
print(result)
end)
print(json.encode(MySQL.Sync.fetchScalar('SELECT null', {})))
MySQL.Async.fetchScalar('SELECT null', {}, function(result)
print(result)
end)
MySQL.Sync.fetchAll('WRONG SQL QUERY', {})
end)
+212
View File
@@ -0,0 +1,212 @@
MySQL = {
Async = {},
Sync = {},
Threaded = {} -- remove in the next big version
}
local function safeParameters(params)
if nil == params then
return {[''] = ''}
end
assert(type(params) == "table", "A table is expected")
assert(params[1] == nil, "Parameters should not be an array, but a map (key / value pair) instead")
if next(params) == nil then
return {[''] = ''}
end
return params
end
---
-- Execute a query with no result required, sync version
--
-- @param query
-- @param params
--
-- @return int Number of rows updated
--
function MySQL.Sync.execute(query, params)
assert(type(query) == "string", "The SQL Query must be a string")
local res = 0
local finishedQuery = false
exports['mysql-async']:mysql_execute(query, safeParameters(params), function (result)
res = result
finishedQuery = true
end)
repeat Citizen.Wait(0) until finishedQuery == true
return res
end
---
-- Execute a query and fetch all results in an sync way
--
-- @param query
-- @param params
--
-- @return table Query results
--
function MySQL.Sync.fetchAll(query, params)
assert(type(query) == "string", "The SQL Query must be a string")
local res = {}
local finishedQuery = false
exports['mysql-async']:mysql_fetch_all(query, safeParameters(params), function (result)
res = result
finishedQuery = true
end)
repeat Citizen.Wait(0) until finishedQuery == true
return res
end
---
-- Execute a query and fetch the first column of the first row, sync version
-- Useful for count function by example
--
-- @param query
-- @param params
--
-- @return mixed Value of the first column in the first row
--
function MySQL.Sync.fetchScalar(query, params)
assert(type(query) == "string", "The SQL Query must be a string")
local res = ''
local finishedQuery = false
exports['mysql-async']:mysql_fetch_scalar(query, safeParameters(params), function (result)
res = result
finishedQuery = true
end)
repeat Citizen.Wait(0) until finishedQuery == true
return res
end
---
-- Execute a query and retrieve the last id insert, sync version
--
-- @param query
-- @param params
--
-- @return mixed Value of the last insert id
--
function MySQL.Sync.insert(query, params)
assert(type(query) == "string", "The SQL Query must be a string")
local res = 0
local finishedQuery = false
exports['mysql-async']:mysql_insert(query, safeParameters(params), function (result)
res = result
finishedQuery = true
end)
repeat Citizen.Wait(0) until finishedQuery == true
return res
end
---
-- Execute a List of querys and returns bool true when all are executed successfully
--
-- @param querys
-- @param params
--
-- @return bool if the transaction was successful
--
--function MySQL.Sync.transaction(querys, params)
-- assert(type(querys) == "table", "The SQL Query must be a table of strings")
--
-- return exports['mysql-async']:mysql_sync_transaction(querys, safeParameters(params))
--end
---
-- Execute a query with no result required, async version
--
-- @param query
-- @param params
-- @param func(int)
--
function MySQL.Async.execute(query, params, func)
assert(type(query) == "string", "The SQL Query must be a string")
exports['mysql-async']:mysql_execute(query, safeParameters(params), func)
end
---
-- Execute a query and fetch all results in an async way
--
-- @param query
-- @param params
-- @param func(table)
--
function MySQL.Async.fetchAll(query, params, func)
assert(type(query) == "string", "The SQL Query must be a string")
exports['mysql-async']:mysql_fetch_all(query, safeParameters(params), func)
end
---
-- Execute a query and fetch the first column of the first row, async version
-- Useful for count function by example
--
-- @param query
-- @param params
-- @param func(mixed)
--
function MySQL.Async.fetchScalar(query, params, func)
assert(type(query) == "string", "The SQL Query must be a string")
exports['mysql-async']:mysql_fetch_scalar(query, safeParameters(params), func)
end
---
-- Execute a query and retrieve the last id insert, async version
--
-- @param query
-- @param params
-- @param func(string)
--
function MySQL.Async.insert(query, params, func)
assert(type(query) == "string", "The SQL Query must be a string")
exports['mysql-async']:mysql_insert(query, safeParameters(params), func)
end
---
-- Execute a List of querys and returns bool true when all are executed successfully
--
-- @param querys
-- @param params
-- @param func(bool)
--
--function MySQL.Async.transaction(querys, params, func)
-- assert(type(querys) == "table", "The SQL Query must be a table of strings")
--
-- return exports['mysql-async']:mysql_transaction(querys, safeParameters(params), func)
--end
--
-- Remove in the next big update
--
MySQL.Threaded.execute = MySQL.Sync.execute
MySQL.Threaded.fetchAll = MySQL.Sync.fetchAll
MySQL.Threaded.fetchScalar = MySQL.Sync.fetchScalar
MySQL.Threaded.insert = MySQL.Sync.insert
local isReady = false
local callbackDictionary = {}
AddEventHandler('MySQLReady', function ()
isReady = true
for i, cb in ipairs(callbackDictionary) do
callbackDictionary[i] = nil
cb()
end
end)
function MySQL.ready (callback)
if isReady then
callback()
else
table.insert(callbackDictionary, callback)
end
end
File diff suppressed because it is too large Load Diff
+139
View File
@@ -0,0 +1,139 @@
const mysql = require('mysql');
let config = {};
let debug = 0;
let pool;
function prepareQuery(query, parameters) {
let sql = query;
if (parameters !== null && typeof parameters === 'object') {
sql = query.replace(/@(\w+)/g, (txt, key) => {
if (parameters.hasOwnProperty(key)) {
return mysql.escape(parameters[key]);
} else if (parameters.hasOwnProperty(`@${key}`)) {
return mysql.escape(parameters[`@${key}`]);
}
return txt;
});
}
return sql;
}
function writeDebug(time, sql, error) {
if (error) console.log(`[ERROR] [MySQL] An error happens on MySQL for query "${sql}": ${error.message}`)
if (debug) console.log(`[MySQL] [${(time[0]*1e3+time[1]*1e-6).toFixed()}ms] ${sql}`);
}
async function safeInvoke(callback, args) {
if (typeof callback === 'function') setImmediate(() => {
callback(args);
});
}
// transform tinyint(1) to boolean
function useBoolean(fields, results) {
if (fields) {
fields.forEach(field => {
// found a column with tinyint(1)
if (field.type === 1 && field.length === 1) {
results.forEach((_, index) => {
results[index][field.name] = (results[index][field.name] !== 0);
});
}
});
}
return results;
}
global.exports('mysql_execute', (query, parameters, callback) => {
let sql = prepareQuery(query, parameters);
let start = process.hrtime();
pool.query(sql, (error, results) => {
writeDebug(process.hrtime(start), sql, error);
safeInvoke(callback, (results) ? results.affectedRows : 0);
});
});
global.exports('mysql_fetch_all', (query, parameters, callback) => {
let sql = prepareQuery(query, parameters);
let start = process.hrtime();
pool.query(sql, (error, results, fields) => {
writeDebug(process.hrtime(start), sql, error);
results = useBoolean(fields, results);
safeInvoke(callback, results);
});
});
global.exports('mysql_fetch_scalar', (query, parameters, callback) => {
let sql = prepareQuery(query, parameters);
let start = process.hrtime();
pool.query(sql, (error, results, fields) => {
writeDebug(process.hrtime(start), sql, error);
results = useBoolean(fields, results);
safeInvoke(callback, (results) ? Object.values(results[0])[0] : null);
});
});
global.exports('mysql_insert', (query, parameters, callback) => {
let sql = prepareQuery(query, parameters);
let start = process.hrtime();
pool.query(sql, (error, results) => {
writeDebug(process.hrtime(start), sql, error);
safeInvoke(callback, (results) ? results.insertId : 0);
});
});
function parseOptions(config, options) {
const cfg = config;
const opts = options.split('&');
opts.forEach((o) => {
const keyValue = o.split('=');
cfg[keyValue[0]] = keyValue[1];
});
return cfg;
}
function parseConnectingString(connectionString) {
if(/(?:database|initial\scatalog)=(?:(.*?);|(.*))/gi.test(connectionString)) {
let matches = (/(?:host|server|data\s?source|addr(?:ess)?)=(?:(.*?);|(.*))/gi.exec(connectionString));
const host = (matches) ? matches[1] || matches[2] : 'localhost';
matches = (/(?:Port)=(?:(.*?);|(.*))/gi.exec(connectionString));
const port = (matches) ? matches[1] || matches[2] : 3306;
matches = (/(?:user\s?(?:id|name)?|uid)=(?:(.*?);|(.*))/gi.exec(connectionString));
const user = (matches) ? matches[1] || matches[2] : 'root';
matches = (/(?:password|pwd)=(?:(.*?);|(.*))/gi.exec(connectionString));
const password = (matches) ? matches[1] || matches[2] : '';
matches = (/(?:database|initial\scatalog)=(?:(.*?);|(.*))/gi.exec(connectionString));
const database = (matches) ? matches[1] || matches[2] : '';
return { host, port, user, password, database, dateStrings: true };
} else if(/mysql:\/\//gi.test(connectionString)) {
let matches = /mysql:\/\/(.*?)(?::|@)(?:(.*)@)?(.*?)(?::(\d{1,5}))?\/(.*?)\?(.*)/gi.exec(connectionString);
const host = (matches[3]) ? matches[3] : 'localhost';
const port = (matches[4]) ? matches[4] : 3306;
const user = (matches[1]) ? matches[1] : 'root';
const password = (matches[2]) ? matches[2] : '';
const database = (matches[5]) ? matches[5] : '';
const config = { host, port, user, password, database };
const options = matches[6];
return parseOptions(config, options);
} else throw new Error('No valid connection string found');
}
let isReady = false;
global.on('onServerResourceStart', (resourcename) => {
if (resourcename == 'mysql-async') {
const connectionString = global.GetConvar('mysql_connection_string', 'mysql://localhost/');
config = parseConnectingString(connectionString);
debug = global.GetConvarInt('mysql_debug', 0);
pool = mysql.createPool(config);
global.emit('onMySQLReady'); // avoid ESX bugs
isReady = true;
}
if (isReady) {
global.emit('MySQLReady'); // avoid ESX bugs
}
});
+22
View File
@@ -0,0 +1,22 @@
{
"name": "mysql-async",
"version": "3.0.1",
"description": "fivem-mysql-async",
"private": true,
"scripts": {
"build": "webpack"
},
"contributors": [
"Joel Wurtz",
"Matthias Mandelartz"
],
"license": "MIT",
"dependencies": {
"mysql": "^2.16.0"
},
"devDependencies": {
"eslint": "^5.6.0",
"webpack": "^4.19.0",
"webpack-cli": "^3.1.0"
}
}
+14
View File
@@ -0,0 +1,14 @@
const path = require('path');
module.exports = {
entry: './mysql.js',
target: 'node',
mode: 'production',
output: {
filename: 'mysql-async.js',
path: path.resolve(__dirname, '..'),
},
optimization: {
minimize: false,
},
};
+130
View File
@@ -0,0 +1,130 @@
Thanks You KASH (github.com/KASHZIN)Who The Original Develop This ESX_KASHACTERS RELEASE And To XxFri3ndlyxX (github.com/XxFri3ndlyxX)
1.Step One [ essentialmode\client\main.lua ]
Delete Or Replace This !
```--[[Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
if NetworkIsSessionStarted() then
TriggerServerEvent('es:firstJoinProper')
TriggerEvent('es:allowedToSpawn')
return
end
end
end)]]--```
2.Step Two [ es_extended [ LINE : 457 ] client/main.lua ]
This To Fix Cant Open Inventory When You Die And Get Revived
Change You Menu interactions to this !
``` ---Menu interactions
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
if IsControlJustReleased(0, 289) and IsInputDisabled(0) and not ESX.UI.Menu.IsOpen('default', 'es_extended', 'inventory') then
ESX.ShowInventory()
end
end
end)```
3. Step Three
To Get Your esx_kashacters work you need do this on your database
```SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME = 'owner'```
And This
```SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME = 'indentifier'```
Credit @Xnubil
6. Step Six [Fix Datastore]
Duplicate Your esx_datastore or add This line on your esx_datastore server\main.lua
```-- Fix was taken from this link --
-- https://forum.fivem.net/t/release-esx-kashacters-multi-character/251613/448?u=xxfri3ndlyxx --
AddEventHandler('esx:playerLoaded', function(source)
local result = MySQL.Sync.fetchAll('SELECT * FROM datastore')
for i=1, #result, 1 do
local name = result[i].name
local label = result[i].label
local shared = result[i].shared
local result2 = MySQL.Sync.fetchAll('SELECT * FROM datastore_data WHERE name = @name', {
['@name'] = name
})
if shared == 0 then
table.insert(DataStoresIndex, name)
DataStores[name] = {}
for j=1, #result2, 1 do
local storeName = result2[j].name
local storeOwner = result2[j].owner
local storeData = (result2[j].data == nil and {} or json.decode(result2[j].data))
local dataStore = CreateDataStore(storeName, storeOwner, storeData)
table.insert(DataStores[name], dataStore)
end
end
end
local _source = source
local xPlayer = ESX.GetPlayerFromId(_source)
local dataStores = {}
for i=1, #DataStoresIndex, 1 do
local name = DataStoresIndex[i]
local dataStore = GetDataStore(name, xPlayer.identifier)
if dataStore == nil then
MySQL.Async.execute('INSERT INTO datastore_data (name, owner, data) VALUES (@name, @owner, @data)',
{
['@name'] = name,
['@owner'] = xPlayer.identifier,
['@data'] = '{}'
})
dataStore = CreateDataStore(name, xPlayer.identifier, {})
table.insert(DataStores[name], dataStore)
end
table.insert(dataStores, dataStore)
end
xPlayer.set('dataStores', dataStores)
end)```
Download Link : https://github.com/XxFri3ndlyxX/esx_datastore
Credits : https://github.com/XxFri3ndlyxX
5. Step Five [ Fix Ambulance ]
This To Fix Die Tele And When Your Get Revived You Cant Open any Menu only F2
Download My File the esx_ambulancejob (or download the lastest version esx_ambulancejob :v)
6. Step Six [ Fix your esx_kashacters identifier ]
Download My mysql-async And start on your server.cfg
7. Step Seven [ Fix Your Identifier And Spawn]
Download My esx_kashacters Modified And start on your server.cfg
Thats All Identifier [esx_kashacters\server\main.lua] maybe thats all
you need in Roleplay Server if you wan to change just change it
===--------------------------------------------------------------------===
Okey Thats All Make My esx_kashacters work properly if you wanna ask
My Discord : Blue.#5108
Thank you Again to KASH And XxFri3ndlyxX ! :)
ENJOY YOUR ESX_KASHACTERS