Add files via upload
This commit is contained in:
22 files changed
+2196
No files matched your search
@@ -0,0 +1,458 @@
|
||||
Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)
|
||||
https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
|
||||
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
|
||||
|
||||
You are free to:
|
||||
|
||||
Share — copy and redistribute the material in any medium or format
|
||||
Adapt — remix, transform, and build upon the material
|
||||
|
||||
The licensor cannot revoke these freedoms as long as you follow the license terms.
|
||||
|
||||
Under the following terms:
|
||||
Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
|
||||
|
||||
NonCommercial — You may not use the material for commercial purposes.
|
||||
|
||||
ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
|
||||
|
||||
No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
|
||||
|
||||
Notices:
|
||||
You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation.
|
||||
No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material.
|
||||
|
||||
Creative Commons Corporation ("Creative Commons") is not a law firm and
|
||||
does not provide legal services or legal advice. Distribution of
|
||||
Creative Commons public licenses does not create a lawyer-client or
|
||||
other relationship. Creative Commons makes its licenses and related
|
||||
information available on an "as-is" basis. Creative Commons gives no
|
||||
warranties regarding its licenses, any material licensed under their
|
||||
terms and conditions, or any related information. Creative Commons
|
||||
disclaims all liability for damages resulting from their use to the
|
||||
fullest extent possible.
|
||||
|
||||
Using Creative Commons Public Licenses
|
||||
|
||||
Creative Commons public licenses provide a standard set of terms and
|
||||
conditions that creators and other rights holders may use to share
|
||||
original works of authorship and other material subject to copyright
|
||||
and certain other rights specified in the public license below. The
|
||||
following considerations are for informational purposes only, are not
|
||||
exhaustive, and do not form part of our licenses.
|
||||
|
||||
Considerations for licensors: Our public licenses are
|
||||
intended for use by those authorized to give the public
|
||||
permission to use material in ways otherwise restricted by
|
||||
copyright and certain other rights. Our licenses are
|
||||
irrevocable. Licensors should read and understand the terms
|
||||
and conditions of the license they choose before applying it.
|
||||
Licensors should also secure all rights necessary before
|
||||
applying our licenses so that the public can reuse the
|
||||
material as expected. Licensors should clearly mark any
|
||||
material not subject to the license. This includes other CC-
|
||||
licensed material, or material used under an exception or
|
||||
limitation to copyright. More considerations for licensors:
|
||||
wiki.creativecommons.org/Considerations_for_licensors
|
||||
|
||||
Considerations for the public: By using one of our public
|
||||
licenses, a licensor grants the public permission to use the
|
||||
licensed material under specified terms and conditions. If
|
||||
the licensor's permission is not necessary for any reason--for
|
||||
example, because of any applicable exception or limitation to
|
||||
copyright--then that use is not regulated by the license. Our
|
||||
licenses grant only permissions under copyright and certain
|
||||
other rights that a licensor has authority to grant. Use of
|
||||
the licensed material may still be restricted for other
|
||||
reasons, including because others have copyright or other
|
||||
rights in the material. A licensor may make special requests,
|
||||
such as asking that all changes be marked or described.
|
||||
Although not required by our licenses, you are encouraged to
|
||||
respect those requests where reasonable. More considerations
|
||||
for the public:
|
||||
wiki.creativecommons.org/Considerations_for_licensees
|
||||
|
||||
=======================================================================
|
||||
|
||||
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
|
||||
Public License
|
||||
|
||||
By exercising the Licensed Rights (defined below), You accept and agree
|
||||
to be bound by the terms and conditions of this Creative Commons
|
||||
Attribution-NonCommercial-ShareAlike 4.0 International Public License
|
||||
("Public License"). To the extent this Public License may be
|
||||
interpreted as a contract, You are granted the Licensed Rights in
|
||||
consideration of Your acceptance of these terms and conditions, and the
|
||||
Licensor grants You such rights in consideration of benefits the
|
||||
Licensor receives from making the Licensed Material available under
|
||||
these terms and conditions.
|
||||
|
||||
|
||||
Section 1 -- Definitions.
|
||||
|
||||
a. Adapted Material means material subject to Copyright and Similar
|
||||
Rights that is derived from or based upon the Licensed Material
|
||||
and in which the Licensed Material is translated, altered,
|
||||
arranged, transformed, or otherwise modified in a manner requiring
|
||||
permission under the Copyright and Similar Rights held by the
|
||||
Licensor. For purposes of this Public License, where the Licensed
|
||||
Material is a musical work, performance, or sound recording,
|
||||
Adapted Material is always produced where the Licensed Material is
|
||||
synched in timed relation with a moving image.
|
||||
|
||||
b. Adapter's License means the license You apply to Your Copyright
|
||||
and Similar Rights in Your contributions to Adapted Material in
|
||||
accordance with the terms and conditions of this Public License.
|
||||
|
||||
c. BY-NC-SA Compatible License means a license listed at
|
||||
creativecommons.org/compatiblelicenses, approved by Creative
|
||||
Commons as essentially the equivalent of this Public License.
|
||||
|
||||
d. Copyright and Similar Rights means copyright and/or similar rights
|
||||
closely related to copyright including, without limitation,
|
||||
performance, broadcast, sound recording, and Sui Generis Database
|
||||
Rights, without regard to how the rights are labeled or
|
||||
categorized. For purposes of this Public License, the rights
|
||||
specified in Section 2(b)(1)-(2) are not Copyright and Similar
|
||||
Rights.
|
||||
|
||||
e. Effective Technological Measures means those measures that, in the
|
||||
absence of proper authority, may not be circumvented under laws
|
||||
fulfilling obligations under Article 11 of the WIPO Copyright
|
||||
Treaty adopted on December 20, 1996, and/or similar international
|
||||
agreements.
|
||||
|
||||
f. Exceptions and Limitations means fair use, fair dealing, and/or
|
||||
any other exception or limitation to Copyright and Similar Rights
|
||||
that applies to Your use of the Licensed Material.
|
||||
|
||||
g. License Elements means the license attributes listed in the name
|
||||
of a Creative Commons Public License. The License Elements of this
|
||||
Public License are Attribution, NonCommercial, and ShareAlike.
|
||||
|
||||
h. Licensed Material means the artistic or literary work, database,
|
||||
or other material to which the Licensor applied this Public
|
||||
License.
|
||||
|
||||
i. Licensed Rights means the rights granted to You subject to the
|
||||
terms and conditions of this Public License, which are limited to
|
||||
all Copyright and Similar Rights that apply to Your use of the
|
||||
Licensed Material and that the Licensor has authority to license.
|
||||
|
||||
j. Licensor means the individual(s) or entity(ies) granting rights
|
||||
under this Public License.
|
||||
|
||||
k. NonCommercial means not primarily intended for or directed towards
|
||||
commercial advantage or monetary compensation. For purposes of
|
||||
this Public License, the exchange of the Licensed Material for
|
||||
other material subject to Copyright and Similar Rights by digital
|
||||
file-sharing or similar means is NonCommercial provided there is
|
||||
no payment of monetary compensation in connection with the
|
||||
exchange.
|
||||
|
||||
l. Share means to provide material to the public by any means or
|
||||
process that requires permission under the Licensed Rights, such
|
||||
as reproduction, public display, public performance, distribution,
|
||||
dissemination, communication, or importation, and to make material
|
||||
available to the public including in ways that members of the
|
||||
public may access the material from a place and at a time
|
||||
individually chosen by them.
|
||||
|
||||
m. Sui Generis Database Rights means rights other than copyright
|
||||
resulting from Directive 96/9/EC of the European Parliament and of
|
||||
the Council of 11 March 1996 on the legal protection of databases,
|
||||
as amended and/or succeeded, as well as other essentially
|
||||
equivalent rights anywhere in the world.
|
||||
|
||||
n. You means the individual or entity exercising the Licensed Rights
|
||||
under this Public License. Your has a corresponding meaning.
|
||||
|
||||
|
||||
Section 2 -- Scope.
|
||||
|
||||
a. License grant.
|
||||
|
||||
1. Subject to the terms and conditions of this Public License,
|
||||
the Licensor hereby grants You a worldwide, royalty-free,
|
||||
non-sublicensable, non-exclusive, irrevocable license to
|
||||
exercise the Licensed Rights in the Licensed Material to:
|
||||
|
||||
a. reproduce and Share the Licensed Material, in whole or
|
||||
in part, for NonCommercial purposes only; and
|
||||
|
||||
b. produce, reproduce, and Share Adapted Material for
|
||||
NonCommercial purposes only.
|
||||
|
||||
2. Exceptions and Limitations. For the avoidance of doubt, where
|
||||
Exceptions and Limitations apply to Your use, this Public
|
||||
License does not apply, and You do not need to comply with
|
||||
its terms and conditions.
|
||||
|
||||
3. Term. The term of this Public License is specified in Section
|
||||
6(a).
|
||||
|
||||
4. Media and formats; technical modifications allowed. The
|
||||
Licensor authorizes You to exercise the Licensed Rights in
|
||||
all media and formats whether now known or hereafter created,
|
||||
and to make technical modifications necessary to do so. The
|
||||
Licensor waives and/or agrees not to assert any right or
|
||||
authority to forbid You from making technical modifications
|
||||
necessary to exercise the Licensed Rights, including
|
||||
technical modifications necessary to circumvent Effective
|
||||
Technological Measures. For purposes of this Public License,
|
||||
simply making modifications authorized by this Section 2(a)
|
||||
(4) never produces Adapted Material.
|
||||
|
||||
5. Downstream recipients.
|
||||
|
||||
a. Offer from the Licensor -- Licensed Material. Every
|
||||
recipient of the Licensed Material automatically
|
||||
receives an offer from the Licensor to exercise the
|
||||
Licensed Rights under the terms and conditions of this
|
||||
Public License.
|
||||
|
||||
b. Additional offer from the Licensor -- Adapted Material.
|
||||
Every recipient of Adapted Material from You
|
||||
automatically receives an offer from the Licensor to
|
||||
exercise the Licensed Rights in the Adapted Material
|
||||
under the conditions of the Adapter's License You apply.
|
||||
|
||||
c. No downstream restrictions. You may not offer or impose
|
||||
any additional or different terms or conditions on, or
|
||||
apply any Effective Technological Measures to, the
|
||||
Licensed Material if doing so restricts exercise of the
|
||||
Licensed Rights by any recipient of the Licensed
|
||||
Material.
|
||||
|
||||
6. No endorsement. Nothing in this Public License constitutes or
|
||||
may be construed as permission to assert or imply that You
|
||||
are, or that Your use of the Licensed Material is, connected
|
||||
with, or sponsored, endorsed, or granted official status by,
|
||||
the Licensor or others designated to receive attribution as
|
||||
provided in Section 3(a)(1)(A)(i).
|
||||
|
||||
b. Other rights.
|
||||
|
||||
1. Moral rights, such as the right of integrity, are not
|
||||
licensed under this Public License, nor are publicity,
|
||||
privacy, and/or other similar personality rights; however, to
|
||||
the extent possible, the Licensor waives and/or agrees not to
|
||||
assert any such rights held by the Licensor to the limited
|
||||
extent necessary to allow You to exercise the Licensed
|
||||
Rights, but not otherwise.
|
||||
|
||||
2. Patent and trademark rights are not licensed under this
|
||||
Public License.
|
||||
|
||||
3. To the extent possible, the Licensor waives any right to
|
||||
collect royalties from You for the exercise of the Licensed
|
||||
Rights, whether directly or through a collecting society
|
||||
under any voluntary or waivable statutory or compulsory
|
||||
licensing scheme. In all other cases the Licensor expressly
|
||||
reserves any right to collect such royalties, including when
|
||||
the Licensed Material is used other than for NonCommercial
|
||||
purposes.
|
||||
|
||||
|
||||
Section 3 -- License Conditions.
|
||||
|
||||
Your exercise of the Licensed Rights is expressly made subject to the
|
||||
following conditions.
|
||||
|
||||
a. Attribution.
|
||||
|
||||
1. If You Share the Licensed Material (including in modified
|
||||
form), You must:
|
||||
|
||||
a. retain the following if it is supplied by the Licensor
|
||||
with the Licensed Material:
|
||||
|
||||
i. identification of the creator(s) of the Licensed
|
||||
Material and any others designated to receive
|
||||
attribution, in any reasonable manner requested by
|
||||
the Licensor (including by pseudonym if
|
||||
designated);
|
||||
|
||||
ii. a copyright notice;
|
||||
|
||||
iii. a notice that refers to this Public License;
|
||||
|
||||
iv. a notice that refers to the disclaimer of
|
||||
warranties;
|
||||
|
||||
v. a URI or hyperlink to the Licensed Material to the
|
||||
extent reasonably practicable;
|
||||
|
||||
b. indicate if You modified the Licensed Material and
|
||||
retain an indication of any previous modifications; and
|
||||
|
||||
c. indicate the Licensed Material is licensed under this
|
||||
Public License, and include the text of, or the URI or
|
||||
hyperlink to, this Public License.
|
||||
|
||||
2. You may satisfy the conditions in Section 3(a)(1) in any
|
||||
reasonable manner based on the medium, means, and context in
|
||||
which You Share the Licensed Material. For example, it may be
|
||||
reasonable to satisfy the conditions by providing a URI or
|
||||
hyperlink to a resource that includes the required
|
||||
information.
|
||||
3. If requested by the Licensor, You must remove any of the
|
||||
information required by Section 3(a)(1)(A) to the extent
|
||||
reasonably practicable.
|
||||
|
||||
b. ShareAlike.
|
||||
|
||||
In addition to the conditions in Section 3(a), if You Share
|
||||
Adapted Material You produce, the following conditions also apply.
|
||||
|
||||
1. The Adapter's License You apply must be a Creative Commons
|
||||
license with the same License Elements, this version or
|
||||
later, or a BY-NC-SA Compatible License.
|
||||
|
||||
2. You must include the text of, or the URI or hyperlink to, the
|
||||
Adapter's License You apply. You may satisfy this condition
|
||||
in any reasonable manner based on the medium, means, and
|
||||
context in which You Share Adapted Material.
|
||||
|
||||
3. You may not offer or impose any additional or different terms
|
||||
or conditions on, or apply any Effective Technological
|
||||
Measures to, Adapted Material that restrict exercise of the
|
||||
rights granted under the Adapter's License You apply.
|
||||
|
||||
|
||||
Section 4 -- Sui Generis Database Rights.
|
||||
|
||||
Where the Licensed Rights include Sui Generis Database Rights that
|
||||
apply to Your use of the Licensed Material:
|
||||
|
||||
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
|
||||
to extract, reuse, reproduce, and Share all or a substantial
|
||||
portion of the contents of the database for NonCommercial purposes
|
||||
only;
|
||||
|
||||
b. if You include all or a substantial portion of the database
|
||||
contents in a database in which You have Sui Generis Database
|
||||
Rights, then the database in which You have Sui Generis Database
|
||||
Rights (but not its individual contents) is Adapted Material,
|
||||
including for purposes of Section 3(b); and
|
||||
|
||||
c. You must comply with the conditions in Section 3(a) if You Share
|
||||
all or a substantial portion of the contents of the database.
|
||||
|
||||
For the avoidance of doubt, this Section 4 supplements and does not
|
||||
replace Your obligations under this Public License where the Licensed
|
||||
Rights include other Copyright and Similar Rights.
|
||||
|
||||
|
||||
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
|
||||
|
||||
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
|
||||
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
|
||||
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
|
||||
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
|
||||
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
|
||||
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
|
||||
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
|
||||
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
|
||||
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
|
||||
|
||||
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
|
||||
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
|
||||
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
|
||||
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
|
||||
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
|
||||
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
|
||||
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
|
||||
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
|
||||
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
|
||||
|
||||
c. The disclaimer of warranties and limitation of liability provided
|
||||
above shall be interpreted in a manner that, to the extent
|
||||
possible, most closely approximates an absolute disclaimer and
|
||||
waiver of all liability.
|
||||
|
||||
|
||||
Section 6 -- Term and Termination.
|
||||
|
||||
a. This Public License applies for the term of the Copyright and
|
||||
Similar Rights licensed here. However, if You fail to comply with
|
||||
this Public License, then Your rights under this Public License
|
||||
terminate automatically.
|
||||
|
||||
b. Where Your right to use the Licensed Material has terminated under
|
||||
Section 6(a), it reinstates:
|
||||
|
||||
1. automatically as of the date the violation is cured, provided
|
||||
it is cured within 30 days of Your discovery of the
|
||||
violation; or
|
||||
|
||||
2. upon express reinstatement by the Licensor.
|
||||
|
||||
For the avoidance of doubt, this Section 6(b) does not affect any
|
||||
right the Licensor may have to seek remedies for Your violations
|
||||
of this Public License.
|
||||
|
||||
c. For the avoidance of doubt, the Licensor may also offer the
|
||||
Licensed Material under separate terms or conditions or stop
|
||||
distributing the Licensed Material at any time; however, doing so
|
||||
will not terminate this Public License.
|
||||
|
||||
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
|
||||
License.
|
||||
|
||||
|
||||
Section 7 -- Other Terms and Conditions.
|
||||
|
||||
a. The Licensor shall not be bound by any additional or different
|
||||
terms or conditions communicated by You unless expressly agreed.
|
||||
|
||||
b. Any arrangements, understandings, or agreements regarding the
|
||||
Licensed Material not stated herein are separate from and
|
||||
independent of the terms and conditions of this Public License.
|
||||
|
||||
|
||||
Section 8 -- Interpretation.
|
||||
|
||||
a. For the avoidance of doubt, this Public License does not, and
|
||||
shall not be interpreted to, reduce, limit, restrict, or impose
|
||||
conditions on any use of the Licensed Material that could lawfully
|
||||
be made without permission under this Public License.
|
||||
|
||||
b. To the extent possible, if any provision of this Public License is
|
||||
deemed unenforceable, it shall be automatically reformed to the
|
||||
minimum extent necessary to make it enforceable. If the provision
|
||||
cannot be reformed, it shall be severed from this Public License
|
||||
without affecting the enforceability of the remaining terms and
|
||||
conditions.
|
||||
|
||||
c. No term or condition of this Public License will be waived and no
|
||||
failure to comply consented to unless expressly agreed to by the
|
||||
Licensor.
|
||||
|
||||
d. Nothing in this Public License constitutes or may be interpreted
|
||||
as a limitation upon, or waiver of, any privileges and immunities
|
||||
that apply to the Licensor or You, including from the legal
|
||||
processes of any jurisdiction or authority.
|
||||
|
||||
=======================================================================
|
||||
|
||||
Creative Commons is not a party to its public
|
||||
licenses. Notwithstanding, Creative Commons may elect to apply one of
|
||||
its public licenses to material it publishes and in those instances
|
||||
will be considered the “Licensor.” The text of the Creative Commons
|
||||
public licenses is dedicated to the public domain under the CC0 Public
|
||||
Domain Dedication. Except for the limited purpose of indicating that
|
||||
material is shared under a Creative Commons public license or as
|
||||
otherwise permitted by the Creative Commons policies published at
|
||||
creativecommons.org/policies, Creative Commons does not authorize the
|
||||
use of the trademark "Creative Commons" or any other trademark or logo
|
||||
of Creative Commons without its prior written consent including,
|
||||
without limitation, in connection with any unauthorized modifications
|
||||
to any of its public licenses or any other arrangements,
|
||||
understandings, or agreements concerning use of licensed material. For
|
||||
the avoidance of doubt, this paragraph does not form part of the
|
||||
public licenses.
|
||||
|
||||
Creative Commons may be contacted at creativecommons.org.
|
||||
@@ -0,0 +1,232 @@
|
||||
# ilv-interact
|
||||
|
||||
A **NoPixel 5 (NoPixel V) inspired** interaction system for FiveM.
|
||||
|
||||
Walk up to something, look at it, press **E**. No third-eye menus, no clutter – just the same minimal in-world prompts you've seen on NoPixel V.
|
||||
|
||||
**Author:** Iloveyou.scripts
|
||||
**Discord:** https://discord.gg/SYTCVXqTcs
|
||||
**Tebex:** https://iloveyou.tebex.io/
|
||||
|
||||
---
|
||||
|
||||
## Features
|
||||
|
||||
- **Ring dots** on every nearby interaction point, so players can see everything they can interact with.
|
||||
- **Crosshair hover** – a small centre-screen dot picks the in-range point closest to it. Move the camera to switch between points.
|
||||
- **`[E] LABEL` prompt** in a condensed italic HUD font, drawn in-game (no NUI) so it stays locked to the world with no lag.
|
||||
- **Multiple options per point** – scroll with the arrow keys or mouse wheel; the selected option carries the key badge.
|
||||
- **`canInteract` filtering** – options that fail their check are hidden; points with nothing to show disappear.
|
||||
- Coords, local entities, networked entities, entity bones and model-wide interactions.
|
||||
- Auto-disables on death, NUI focus, in vehicles and while cuffed (configurable).
|
||||
- Lightweight: ~44 KB of assets downloaded once, zero server-side work, a few sprite draws per frame.
|
||||
|
||||
## Installation
|
||||
|
||||
1. Place the folder in your resources directory and **name it `ilv-interact`** (the folder name is the resource name used by exports).
|
||||
2. Make sure [ox_lib](https://github.com/overextended/ox_lib) starts first.
|
||||
3. Add to your `server.cfg`:
|
||||
```cfg
|
||||
ensure ox_lib
|
||||
ensure ilv-interact
|
||||
```
|
||||
|
||||
## Controls
|
||||
|
||||
| Key | Action |
|
||||
| --- | --- |
|
||||
| Camera / mouse | Hover the crosshair over a point |
|
||||
| `E` | Use the selected option |
|
||||
| `↑` / `↓` or mouse wheel | Change option when a point has several |
|
||||
|
||||
## How distances work
|
||||
|
||||
| Field | Meaning | Default |
|
||||
| --- | --- | --- |
|
||||
| `distance` | How close the player must be for the **dot** to appear | `8.0` (`10.0` for networked entities / bones) |
|
||||
| `interactDst` | How close the player must be for the **prompt** to appear and `E` to work | `1.0` |
|
||||
| `offset` | `vec3` offset from the entity the point is placed at | `vec3(0, 0, 0)` |
|
||||
|
||||
---
|
||||
|
||||
## Options
|
||||
|
||||
Every export takes an `options` list. Each option supports:
|
||||
|
||||
```lua
|
||||
{
|
||||
name = 'my:option', -- optional, used by RemoveInteractionOption and to replace an existing option
|
||||
label = 'Pickup Hot Dog - $25',
|
||||
canInteract = function(entity, coords, args)
|
||||
return true -- return false to hide this option
|
||||
end,
|
||||
|
||||
-- Pick ONE of the following (checked in this order):
|
||||
action = function(entity, coords, args) end,
|
||||
serverEvent = 'my:server:event', -- TriggerServerEvent(serverEvent, args)
|
||||
event = 'my:client:event', -- TriggerEvent(event, option)
|
||||
|
||||
args = { any = 'data' },
|
||||
}
|
||||
```
|
||||
|
||||
## Exports
|
||||
|
||||
All `Add*` exports take a single table. Because the resource name contains a hyphen, call exports with brackets: `exports['ilv-interact']`.
|
||||
|
||||
### AddInteraction
|
||||
|
||||
Adds a point at fixed coords. Returns the interaction id.
|
||||
|
||||
```lua
|
||||
local id = exports['ilv-interact']:AddInteraction({
|
||||
coords = vec3(55.869, -1545.9351, 29.8501),
|
||||
distance = 2.0,
|
||||
interactDst = 1.0,
|
||||
name = 'laundromat_hack',
|
||||
options = {
|
||||
{
|
||||
label = 'Hack Security',
|
||||
event = 'sizan-robbery:client:UseBlueLaptop',
|
||||
canInteract = function()
|
||||
return true
|
||||
end,
|
||||
},
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
### AddLocalEntityInteraction
|
||||
|
||||
Adds a point on a client-side (non-networked) entity. Returns the interaction id.
|
||||
|
||||
```lua
|
||||
local id = exports['ilv-interact']:AddLocalEntityInteraction({
|
||||
entity = ped,
|
||||
offset = vec3(0.0, 0.0, 0.3),
|
||||
distance = 4.0,
|
||||
interactDst = 1.5,
|
||||
options = {
|
||||
{
|
||||
label = 'Talk',
|
||||
action = function(entity)
|
||||
print(('Talking to %s'):format(entity))
|
||||
end,
|
||||
},
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
### AddEntityInteraction
|
||||
|
||||
Adds a point on a networked entity. `netId` accepts a network id or an entity handle; non-networked entities fall back to `AddLocalEntityInteraction`. Returns the interaction id.
|
||||
|
||||
```lua
|
||||
local id = exports['ilv-interact']:AddEntityInteraction({
|
||||
netId = NetworkGetNetworkIdFromEntity(vehicle),
|
||||
distance = 5.0,
|
||||
interactDst = 1.5,
|
||||
options = {
|
||||
{ label = 'Search Vehicle', serverEvent = 'my:server:searchVehicle' },
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
### AddEntityBoneInteraction
|
||||
|
||||
Adds a point on an entity bone.
|
||||
|
||||
```lua
|
||||
exports['ilv-interact']:AddEntityBoneInteraction({
|
||||
entity = vehicle,
|
||||
bone = 'boot',
|
||||
distance = 3.0,
|
||||
interactDst = 1.5,
|
||||
options = {
|
||||
{ label = 'Open Trunk', action = function(entity) SetVehicleDoorOpen(entity, 5, false, false) end },
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
### AddModelInteraction
|
||||
|
||||
Adds a point to every spawned object of the given models.
|
||||
|
||||
```lua
|
||||
exports['ilv-interact']:AddModelInteraction({
|
||||
modelData = {
|
||||
{ model = 'p_dumpster_t', offset = vec3(0.0, 0.0, 1.0) },
|
||||
{ model = 'prop_dumpster_02a', offset = vec3(0.0, 0.0, 1.0) },
|
||||
},
|
||||
distance = 8.0,
|
||||
interactDst = 1.0,
|
||||
options = {
|
||||
{
|
||||
label = 'Search Trash',
|
||||
action = function(entity, coords, args)
|
||||
SearchTrash(entity)
|
||||
end,
|
||||
},
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
### Removing and updating
|
||||
|
||||
```lua
|
||||
exports['ilv-interact']:RemoveInteraction(id) -- remove by id
|
||||
exports['ilv-interact']:RemoveInteractionByEntity(entity) -- remove everything on an entity
|
||||
exports['ilv-interact']:RemoveInteractionOption(id, 'my:option') -- remove a single named option
|
||||
exports['ilv-interact']:UpdateInteraction(id, newOptions) -- replace the options list
|
||||
```
|
||||
|
||||
Interactions are removed automatically when the resource that created them stops.
|
||||
|
||||
### Disable
|
||||
|
||||
```lua
|
||||
exports['ilv-interact']:Disable(true) -- hide and block all interactions
|
||||
exports['ilv-interact']:Disable(false)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Configuration
|
||||
|
||||
Everything lives in [`shared/settings.lua`](shared/settings.lua).
|
||||
|
||||
### Prompt
|
||||
|
||||
Sizes are fractions of screen height – divide the pixel size you want at 1080p by 1080.
|
||||
|
||||
| Setting | Default | Description |
|
||||
| --- | --- | --- |
|
||||
| `key` | `'E'` | Letter shown in the key badge |
|
||||
| `uppercase` | `true` | Render labels in uppercase |
|
||||
| `textHeight` | `0.0125` | Label cap height (~13px) |
|
||||
| `keySize` | `0.0167` | Key badge size (~18px) |
|
||||
| `keyTextHeight` | `0.0095` | Letter size inside the badge |
|
||||
| `keyGap` | `0.0075` | Space between badge and label |
|
||||
| `dotSize` | `0.0155` | Interaction dot size (~16px) |
|
||||
| `crosshairSize` | `0.0055` | Crosshair dot size |
|
||||
| `crosshair` | `true` | Show the crosshair while points are nearby |
|
||||
| `hoverRadius` | `0.06` | How close the crosshair must be to a point to select it |
|
||||
| `rowSpacing` | `0.024` | Spacing between options on the same point |
|
||||
| `textColor` / `keyColor` / `keyTextColor` | white / white / near-black | RGBA colours |
|
||||
| `dimmedAlpha` | `140` | Opacity of non-selected options |
|
||||
| `shadowAlpha` | `110` | Label drop shadow strength (`0` to disable) |
|
||||
|
||||
### Disable
|
||||
|
||||
| Setting | Default | Description |
|
||||
| --- | --- | --- |
|
||||
| `onDeath` | `true` | Disable while dead |
|
||||
| `onNuiFocus` | `true` | Disable while NUI has focus |
|
||||
| `onVehicle` | `true` | Disable while in a vehicle |
|
||||
| `onHandCuff` | `true` | Disable while cuffed |
|
||||
|
||||
---
|
||||
|
||||
## Credits & License
|
||||
- Prompt font: [Barlow Condensed](https://github.com/jpt/barlow) SemiBold Italic, SIL Open Font License 1.1.
|
||||
- Licensed under [CC BY-NC-SA 4.0](LICENSE).
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 661 B |
@@ -0,0 +1,32 @@
|
||||
local Player = {}
|
||||
local Loaded = false
|
||||
|
||||
RegisterNetEvent('esx:setPlayerData', function(key, value)
|
||||
if not Loaded or GetInvokingResource() ~= 'es_extended' then return end
|
||||
|
||||
if key ~= 'job' then return end
|
||||
|
||||
Player.Group = { [value.name] = value.grade }
|
||||
|
||||
|
||||
TriggerEvent('interact:groupsChanged', Player.Group)
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx:playerLoaded',function(xPlayer)
|
||||
Player = {
|
||||
Group = {
|
||||
[xPlayer.job.name] = xPlayer.job.grade,
|
||||
},
|
||||
}
|
||||
|
||||
Loaded = true
|
||||
|
||||
TriggerEvent('interact:groupsChanged', Player.Group)
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx:onPlayerLogout', function()
|
||||
Player = table.wipe(Player)
|
||||
TriggerEvent('interact:groupsChanged', {})
|
||||
end)
|
||||
|
||||
return Bridge
|
||||
@@ -0,0 +1,19 @@
|
||||
--[[
|
||||
Bridge is a simple module that allows allows multi framework compatability.
|
||||
All framework code has been taken from Renewed-Lib which can be found here:
|
||||
https://github.com/Renewed-Scripts/Renewed-Lib
|
||||
]]
|
||||
|
||||
local function hasFramework(framework)
|
||||
return GetResourceState(framework) ~= 'missing'
|
||||
end
|
||||
|
||||
local framework = hasFramework('ox_core') and 'ox' or hasFramework('qb-core') and 'qb' or hasFramework('qbx_core') and 'qb' or hasFramework('es_extended') and 'esx' or nil
|
||||
|
||||
if not framework then
|
||||
return print('No framework detected')
|
||||
end
|
||||
|
||||
local resource = ('bridge.%s.client'):format(framework)
|
||||
|
||||
require (resource)
|
||||
@@ -0,0 +1,37 @@
|
||||
local file = ('imports/%s.lua'):format('client')
|
||||
local import = LoadResourceFile('ox_core', file)
|
||||
local chunk = assert(load(import, ('@@ox_core/%s'):format(file)))
|
||||
|
||||
chunk()
|
||||
|
||||
local Player = {}
|
||||
|
||||
RegisterNetEvent('ox:setGroup', function(name, grade)
|
||||
Player.group[name] = grade
|
||||
|
||||
TriggerEvent('interact:groupsChanged', Player.group)
|
||||
end)
|
||||
|
||||
AddEventHandler('ox:playerLoaded', function()
|
||||
Player = {
|
||||
group = Ox.GetPlayerData().groups
|
||||
}
|
||||
|
||||
TriggerEvent('interact:groupsChanged', Player.group)
|
||||
end)
|
||||
|
||||
AddEventHandler('ox:playerLogout', function()
|
||||
table.wipe(Player)
|
||||
TriggerEvent('interact:groupsChanged', {})
|
||||
end)
|
||||
|
||||
AddEventHandler('onResourceStart', function(resource)
|
||||
if resource == GetCurrentResourceName() then
|
||||
Wait(500)
|
||||
Player = {
|
||||
group = Ox.GetPlayerData().groups
|
||||
}
|
||||
|
||||
TriggerEvent('interact:groupsChanged', Player.group)
|
||||
end
|
||||
end)
|
||||
@@ -0,0 +1,43 @@
|
||||
local QBCore = exports['qb-core']:GetCoreObject()
|
||||
local Player = {}
|
||||
|
||||
-- Group Updaters --
|
||||
RegisterNetEvent('QBCore:Client:OnJobUpdate', function(job)
|
||||
if not Player.Group then return end
|
||||
|
||||
Player.Group[Player.job] = nil
|
||||
Player.Group[job.name] = job.grade.level
|
||||
Player.job = job.name
|
||||
|
||||
TriggerEvent('interact:groupsChanged', Player.Group)
|
||||
end)
|
||||
|
||||
RegisterNetEvent('QBCore:Client:OnGangUpdate', function(job)
|
||||
if not Player.Group then return end
|
||||
|
||||
Player.Group[Player.gang] = nil
|
||||
Player.Group[job.name] = job.grade.level
|
||||
Player.gang = job.name
|
||||
|
||||
TriggerEvent('interact:groupsChanged', Player.Group)
|
||||
end)
|
||||
|
||||
RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function()
|
||||
local PlayerData = QBCore.Functions.GetPlayerData()
|
||||
Player = {
|
||||
Group = {
|
||||
[PlayerData.job.name] = PlayerData.job.grade.level,
|
||||
[PlayerData.gang.name] = PlayerData.gang.grade.level
|
||||
},
|
||||
job = PlayerData.job.name,
|
||||
gang = PlayerData.gang.name,
|
||||
}
|
||||
|
||||
TriggerEvent('interact:groupsChanged', Player.Group)
|
||||
end)
|
||||
|
||||
RegisterNetEvent('QBCore:Client:OnPlayerUnload', function()
|
||||
Player = table.wipe(Player)
|
||||
TriggerEvent('interact:groupsChanged', {})
|
||||
end)
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
if GetConvar('interact_disabledefault', 'false') == 'true' then
|
||||
return
|
||||
end
|
||||
|
||||
local api = require 'client.interactions'
|
||||
|
||||
|
||||
|
||||
api.addGlobalVehicleInteraction({
|
||||
distance = 5.0,
|
||||
interactDst = 1.5,
|
||||
offset = vec3(0.0, 1.0, 0.0),
|
||||
bone = 'boot',
|
||||
id = 'interact:defaultTrunk',
|
||||
options = {
|
||||
name = 'interact:trunk',
|
||||
label = 'Trunk',
|
||||
action = function(entity)
|
||||
if GetVehicleDoorLockStatus(entity) ~= 1 then
|
||||
return lib.notify({ type = 'error', title = 'The trunk is locked.' })
|
||||
end
|
||||
|
||||
if GetVehicleDoorAngleRatio(entity, 5) <= 0.0 then
|
||||
return lib.notify({ type = 'error', title = 'the trunk is not open' })
|
||||
end
|
||||
|
||||
local plate = GetVehicleNumberPlateText(entity)
|
||||
local invId = 'trunk'..plate
|
||||
local coords = GetEntityCoords(entity)
|
||||
|
||||
TaskTurnPedToFaceCoord(cache.ped, coords.x, coords.y, coords.z, 0)
|
||||
|
||||
if not ps-inventory:openInventory('trunk', { id = invId, netid = NetworkGetNetworkIdFromEntity(entity), entityid = entity, door = 5 }) then return end
|
||||
end,
|
||||
},
|
||||
options = {
|
||||
label = 'hehehe',
|
||||
action = function(entity)
|
||||
end,
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,114 @@
|
||||
local entities = {}
|
||||
local netIds = {}
|
||||
local models = {}
|
||||
local localEnties = {}
|
||||
|
||||
-- Sub caches are used for caching shit that is run every 250ms in the main loop
|
||||
local subCache = {}
|
||||
|
||||
function entities.isNetIdNearby(netID)
|
||||
local entity = netIds[netID]
|
||||
return entity and entity.entity
|
||||
end
|
||||
|
||||
function entities.getModelEntities(model)
|
||||
return models[model]
|
||||
end
|
||||
|
||||
function entities.isEntityNearby(entity)
|
||||
return localEnties[entity]
|
||||
end
|
||||
|
||||
function entities.getEntitiesByType(type)
|
||||
local amount = 0
|
||||
local entityTable = {}
|
||||
|
||||
if subCache[type] then
|
||||
return #subCache[type], subCache[type]
|
||||
end
|
||||
|
||||
for k, v in pairs(localEnties) do
|
||||
if v.type == type then
|
||||
amount = amount + 1
|
||||
entityTable[amount] = k
|
||||
end
|
||||
end
|
||||
|
||||
for _, v in pairs(netIds) do
|
||||
if v.type == type then
|
||||
amount = amount + 1
|
||||
entityTable[amount] = v.entity
|
||||
end
|
||||
end
|
||||
|
||||
subCache[type] = entityTable
|
||||
|
||||
return amount, entityTable
|
||||
end
|
||||
|
||||
local function clearTables()
|
||||
table.wipe(netIds)
|
||||
table.wipe(models)
|
||||
table.wipe(localEnties)
|
||||
table.wipe(subCache)
|
||||
end
|
||||
|
||||
local NetworkGetNetworkIdFromEntity = NetworkGetNetworkIdFromEntity
|
||||
local NetworkGetEntityIsNetworked = NetworkGetEntityIsNetworked
|
||||
local GetEntityModel = GetEntityModel
|
||||
|
||||
local function buildEntities(eType, playerCoords)
|
||||
local entityPool = GetGamePool(eType)
|
||||
|
||||
local type = eType:sub(2):lower()
|
||||
|
||||
for i = 1, #entityPool do
|
||||
local entity = entityPool[i]
|
||||
|
||||
if #(playerCoords - GetEntityCoords(entity)) < 100.0 then
|
||||
local isNetworked = NetworkGetEntityIsNetworked(entity)
|
||||
local model = GetEntityModel(entity)
|
||||
|
||||
if isNetworked then
|
||||
local netId = NetworkGetNetworkIdFromEntity(entity)
|
||||
|
||||
if not netIds[netId] then
|
||||
netIds[netId] = {
|
||||
entity = entity,
|
||||
type = type,
|
||||
}
|
||||
end
|
||||
else
|
||||
localEnties[entity] = {
|
||||
entity = entity,
|
||||
type = type,
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
if not models[model] then
|
||||
models[model] = {}
|
||||
end
|
||||
|
||||
models[model][#models[model] + 1] = {
|
||||
entity = entity,
|
||||
type = type,
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
CreateThread(function()
|
||||
while true do
|
||||
local playerCoords = GetEntityCoords(cache.ped)
|
||||
clearTables()
|
||||
|
||||
buildEntities('CVehicle', playerCoords)
|
||||
buildEntities('CPed', playerCoords)
|
||||
buildEntities('CObject', playerCoords)
|
||||
|
||||
Wait(2500)
|
||||
end
|
||||
end)
|
||||
|
||||
return entities
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
-- Generated glyph metrics for assets/prompt/font.png (Barlow Condensed SemiBold Italic, OFL).
|
||||
return {
|
||||
width = 512,
|
||||
height = 512,
|
||||
lineHeight = 53,
|
||||
ascent = 44,
|
||||
capHeight = 31,
|
||||
glyphs = {
|
||||
[' '] = { x = 4, y = 4, w = 0, xoff = -1, adv = 9.00 },
|
||||
['!'] = { x = 8, y = 4, w = 14, xoff = -1, adv = 11.00 },
|
||||
['"'] = { x = 26, y = 4, w = 18, xoff = -1, adv = 13.00 },
|
||||
['#'] = { x = 48, y = 4, w = 28, xoff = -1, adv = 26.00 },
|
||||
['$'] = { x = 80, y = 4, w = 22, xoff = -1, adv = 19.00 },
|
||||
['%'] = { x = 106, y = 4, w = 35, xoff = -1, adv = 33.00 },
|
||||
['&'] = { x = 145, y = 4, w = 27, xoff = -1, adv = 25.00 },
|
||||
['('] = { x = 191, y = 4, w = 15, xoff = -1, adv = 12.00 },
|
||||
[')'] = { x = 210, y = 4, w = 16, xoff = -1, adv = 12.00 },
|
||||
['*'] = { x = 230, y = 4, w = 20, xoff = -1, adv = 15.00 },
|
||||
['+'] = { x = 254, y = 4, w = 21, xoff = -1, adv = 19.00 },
|
||||
[','] = { x = 279, y = 4, w = 10, xoff = -1, adv = 8.00 },
|
||||
['-'] = { x = 293, y = 4, w = 16, xoff = -1, adv = 14.00 },
|
||||
['.'] = { x = 313, y = 4, w = 11, xoff = -1, adv = 9.00 },
|
||||
['/'] = { x = 328, y = 4, w = 20, xoff = -1, adv = 17.00 },
|
||||
['0'] = { x = 352, y = 4, w = 22, xoff = -1, adv = 19.00 },
|
||||
['1'] = { x = 378, y = 4, w = 15, xoff = -1, adv = 12.00 },
|
||||
['2'] = { x = 397, y = 4, w = 21, xoff = -1, adv = 18.00 },
|
||||
['3'] = { x = 422, y = 4, w = 22, xoff = -1, adv = 18.00 },
|
||||
['4'] = { x = 448, y = 4, w = 22, xoff = -1, adv = 20.00 },
|
||||
['5'] = { x = 474, y = 4, w = 22, xoff = -1, adv = 18.00 },
|
||||
['6'] = { x = 4, y = 61, w = 21, xoff = -1, adv = 18.00 },
|
||||
['7'] = { x = 29, y = 61, w = 22, xoff = -1, adv = 17.00 },
|
||||
['8'] = { x = 55, y = 61, w = 21, xoff = -1, adv = 19.00 },
|
||||
['9'] = { x = 80, y = 61, w = 21, xoff = -1, adv = 18.00 },
|
||||
[':'] = { x = 105, y = 61, w = 13, xoff = -1, adv = 11.00 },
|
||||
[';'] = { x = 122, y = 61, w = 12, xoff = -1, adv = 9.00 },
|
||||
['<'] = { x = 138, y = 61, w = 22, xoff = -1, adv = 19.00 },
|
||||
['='] = { x = 164, y = 61, w = 22, xoff = -1, adv = 19.00 },
|
||||
['>'] = { x = 190, y = 61, w = 21, xoff = -1, adv = 19.00 },
|
||||
['?'] = { x = 215, y = 61, w = 21, xoff = -1, adv = 18.00 },
|
||||
['@'] = { x = 240, y = 61, w = 34, xoff = -1, adv = 32.00 },
|
||||
['A'] = { x = 278, y = 61, w = 22, xoff = -2, adv = 19.00 },
|
||||
['B'] = { x = 304, y = 61, w = 23, xoff = -1, adv = 20.00 },
|
||||
['C'] = { x = 331, y = 61, w = 22, xoff = -1, adv = 20.00 },
|
||||
['D'] = { x = 357, y = 61, w = 23, xoff = -1, adv = 20.00 },
|
||||
['E'] = { x = 384, y = 61, w = 23, xoff = -1, adv = 19.00 },
|
||||
['F'] = { x = 411, y = 61, w = 23, xoff = -1, adv = 18.00 },
|
||||
['G'] = { x = 438, y = 61, w = 23, xoff = -1, adv = 20.00 },
|
||||
['H'] = { x = 465, y = 61, w = 23, xoff = -1, adv = 20.00 },
|
||||
['I'] = { x = 492, y = 61, w = 13, xoff = -1, adv = 10.00 },
|
||||
['J'] = { x = 4, y = 118, w = 22, xoff = -1, adv = 19.00 },
|
||||
['K'] = { x = 30, y = 118, w = 25, xoff = -1, adv = 20.00 },
|
||||
['L'] = { x = 59, y = 118, w = 20, xoff = -1, adv = 18.00 },
|
||||
['M'] = { x = 83, y = 118, w = 26, xoff = -1, adv = 23.00 },
|
||||
['N'] = { x = 113, y = 118, w = 25, xoff = -1, adv = 22.00 },
|
||||
['O'] = { x = 142, y = 118, w = 23, xoff = -1, adv = 20.00 },
|
||||
['P'] = { x = 169, y = 118, w = 23, xoff = -1, adv = 19.00 },
|
||||
['Q'] = { x = 196, y = 118, w = 22, xoff = -1, adv = 19.00 },
|
||||
['R'] = { x = 222, y = 118, w = 23, xoff = -1, adv = 20.00 },
|
||||
['S'] = { x = 249, y = 118, w = 22, xoff = -1, adv = 19.00 },
|
||||
['T'] = { x = 275, y = 118, w = 24, xoff = -1, adv = 19.00 },
|
||||
['U'] = { x = 303, y = 118, w = 24, xoff = -1, adv = 20.00 },
|
||||
['V'] = { x = 331, y = 118, w = 24, xoff = -1, adv = 20.00 },
|
||||
['W'] = { x = 359, y = 118, w = 33, xoff = -1, adv = 28.00 },
|
||||
['X'] = { x = 396, y = 118, w = 24, xoff = -1, adv = 20.00 },
|
||||
['Y'] = { x = 424, y = 118, w = 24, xoff = -1, adv = 19.00 },
|
||||
['Z'] = { x = 452, y = 118, w = 22, xoff = -1, adv = 17.00 },
|
||||
['['] = { x = 478, y = 118, w = 17, xoff = -2, adv = 14.00 },
|
||||
[']'] = { x = 27, y = 175, w = 19, xoff = -1, adv = 14.00 },
|
||||
['^'] = { x = 50, y = 175, w = 20, xoff = -1, adv = 18.00 },
|
||||
['_'] = { x = 74, y = 175, w = 20, xoff = -2, adv = 17.00 },
|
||||
['`'] = { x = 98, y = 175, w = 13, xoff = -1, adv = 9.00 },
|
||||
['a'] = { x = 115, y = 175, w = 21, xoff = -1, adv = 19.00 },
|
||||
['b'] = { x = 140, y = 175, w = 21, xoff = -1, adv = 19.00 },
|
||||
['c'] = { x = 165, y = 175, w = 20, xoff = -1, adv = 18.00 },
|
||||
['d'] = { x = 189, y = 175, w = 22, xoff = -1, adv = 19.00 },
|
||||
['e'] = { x = 215, y = 175, w = 20, xoff = -1, adv = 18.00 },
|
||||
['f'] = { x = 239, y = 175, w = 17, xoff = -1, adv = 12.00 },
|
||||
['g'] = { x = 260, y = 175, w = 21, xoff = -1, adv = 18.00 },
|
||||
['h'] = { x = 285, y = 175, w = 21, xoff = -1, adv = 19.00 },
|
||||
['i'] = { x = 310, y = 175, w = 13, xoff = -1, adv = 9.00 },
|
||||
['j'] = { x = 327, y = 175, w = 17, xoff = -5, adv = 9.00 },
|
||||
['k'] = { x = 348, y = 175, w = 21, xoff = -1, adv = 18.00 },
|
||||
['l'] = { x = 373, y = 175, w = 12, xoff = -1, adv = 8.00 },
|
||||
['m'] = { x = 389, y = 175, w = 30, xoff = -1, adv = 28.00 },
|
||||
['n'] = { x = 423, y = 175, w = 21, xoff = -1, adv = 19.00 },
|
||||
['o'] = { x = 448, y = 175, w = 20, xoff = -1, adv = 18.00 },
|
||||
['p'] = { x = 472, y = 175, w = 21, xoff = -1, adv = 19.00 },
|
||||
['q'] = { x = 4, y = 232, w = 21, xoff = -1, adv = 19.00 },
|
||||
['r'] = { x = 29, y = 232, w = 17, xoff = -1, adv = 13.00 },
|
||||
['s'] = { x = 50, y = 232, w = 19, xoff = -1, adv = 17.00 },
|
||||
['t'] = { x = 73, y = 232, w = 15, xoff = -1, adv = 12.00 },
|
||||
['u'] = { x = 92, y = 232, w = 21, xoff = -1, adv = 19.00 },
|
||||
['v'] = { x = 117, y = 232, w = 21, xoff = -1, adv = 18.00 },
|
||||
['w'] = { x = 142, y = 232, w = 29, xoff = -1, adv = 25.00 },
|
||||
['x'] = { x = 175, y = 232, w = 22, xoff = -2, adv = 18.00 },
|
||||
['y'] = { x = 201, y = 232, w = 22, xoff = -2, adv = 17.00 },
|
||||
['z'] = { x = 227, y = 232, w = 19, xoff = -1, adv = 16.00 },
|
||||
['{'] = { x = 250, y = 232, w = 18, xoff = -1, adv = 14.00 },
|
||||
['|'] = { x = 272, y = 232, w = 13, xoff = -2, adv = 7.00 },
|
||||
['}'] = { x = 289, y = 232, w = 17, xoff = -2, adv = 14.00 },
|
||||
['~'] = { x = 310, y = 232, w = 23, xoff = -1, adv = 20.00 },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,588 @@
|
||||
local log = require 'shared.log'
|
||||
local utils = require 'client.utils'
|
||||
local settings = require 'shared.settings'
|
||||
local interactions, filteredInteractions = {}, {}
|
||||
local table_sort = table.sort
|
||||
|
||||
-- CACHE.
|
||||
local MODELS = {}
|
||||
local ENTITIES = {}
|
||||
local ENTITY_BONES = {}
|
||||
local NETWORKED_ENTITIES = {}
|
||||
|
||||
local api = {}
|
||||
|
||||
AddEventHandler('interactions:groupsChanged', function(newgroups)
|
||||
-- Use this event handler to loop through all current interactions and remove any that are not in the new groups that way we limit the amount of iterations needed
|
||||
end)
|
||||
|
||||
local function checkParams(entity, options)
|
||||
if not entity then
|
||||
log:error('Entity is required to add an interaction')
|
||||
return
|
||||
else
|
||||
if type(entity) ~= 'number' then
|
||||
log:error('Entity must be a number')
|
||||
return
|
||||
end
|
||||
|
||||
if not DoesEntityExist(entity) then
|
||||
log:error('Entity %s does not exist', entity)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
if not options then
|
||||
log:error('Options are required to add an interaction')
|
||||
return
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
--#TODO: Add a way to filter interactions based on the players group
|
||||
local function filterInteractions()
|
||||
local myGroups = 'police'
|
||||
|
||||
local newInteractions = {}
|
||||
local amount = 0
|
||||
for k ,v in pairs(interactions) do
|
||||
amount += 1
|
||||
newInteractions[amount] = v
|
||||
end
|
||||
|
||||
filteredInteractions = newInteractions
|
||||
end
|
||||
|
||||
---@param model number|string : The model to add the interaction to
|
||||
---@param options table : { label, canInteract, action, event, serverEvent, args }
|
||||
---@param data table : { distance, interactDst, resource }
|
||||
local function addModel(model, options, data)
|
||||
if type(model) ~= "number" then
|
||||
model = joaat(model)
|
||||
end
|
||||
|
||||
if not IsModelValid(model) then
|
||||
log:error('Model %s is not valid', model)
|
||||
return
|
||||
end
|
||||
|
||||
if not MODELS[model] then
|
||||
log:debug('Adding model %s to interactions', model)
|
||||
MODELS[model] = {
|
||||
model = model,
|
||||
offset = data.offset,
|
||||
options = options,
|
||||
distance = data.distance,
|
||||
interactDst = data.interactDst,
|
||||
resource = data.resource,
|
||||
}
|
||||
else
|
||||
log:debug('Updating model %s in interactions', model)
|
||||
for _, option in pairs(options) do
|
||||
MODELS[model].options[#MODELS[model].options + 1] = option
|
||||
end
|
||||
|
||||
-- Update the distance and interactDst if the new data is greater
|
||||
if data.distance > MODELS[model].distance then
|
||||
MODELS[model].distance = data.distance
|
||||
end
|
||||
|
||||
if data.interactDst > MODELS[model].interactDst then
|
||||
MODELS[model].interactDst = data.interactDst
|
||||
end
|
||||
|
||||
-- Update the offset if there is new data
|
||||
if data.offset then
|
||||
MODELS[model].offset = data.offset
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
---@param data table : { name, coords, options, distance, interactDst, groups }
|
||||
---@return number : The id of the interaction
|
||||
-- Add an interaction point at a set of coords
|
||||
function api.addInteraction(data)
|
||||
if not data.coords then
|
||||
log:error('Coords are required to add an interaction')
|
||||
return
|
||||
end
|
||||
|
||||
if not data.options then
|
||||
log:error('Options are required to add an interaction')
|
||||
return
|
||||
end
|
||||
|
||||
local id = #interactions + 1
|
||||
interactions[id] = {
|
||||
id = id,
|
||||
name = data.name or 'interaction:'..id,
|
||||
coords = data.coords,
|
||||
options = data.options or {},
|
||||
distance = data.distance or 8.0,
|
||||
interactDst = data.interactDst or 1.0,
|
||||
groups = data.groups or nil,
|
||||
resource = GetInvokingResource()
|
||||
}
|
||||
|
||||
filterInteractions()
|
||||
|
||||
return id
|
||||
end exports('AddInteraction', api.addInteraction)
|
||||
|
||||
---@param data table : { name, entity, options, distance, interactDst, groups }
|
||||
---@return number : The id of the interaction
|
||||
-- Add an interaction point on a local (client side) entity
|
||||
function api.addLocalEntityInteraction(data)
|
||||
local entity = data.entity
|
||||
if not checkParams(entity, data.options) then
|
||||
if ENTITIES[entity] then
|
||||
ENTITIES[entity] = nil
|
||||
end
|
||||
return
|
||||
end
|
||||
local id = #interactions + 1
|
||||
-- If then entity not registered yet, add it
|
||||
if not ENTITIES[entity] then
|
||||
log:debug('Adding entity %s to interactions', entity)
|
||||
|
||||
interactions[id] = {
|
||||
id = id,
|
||||
name = data.name or 'interaction:'..id,
|
||||
entity = entity,
|
||||
options = data.options or {},
|
||||
distance = data.distance or 8.0,
|
||||
interactDst = data.interactDst or 1.0,
|
||||
offset = data.offset or vec(0.0, 0.0, 0.0),
|
||||
groups = data.groups or nil,
|
||||
resource = GetInvokingResource()
|
||||
}
|
||||
|
||||
ENTITIES[entity] = interactions[id]
|
||||
|
||||
filterInteractions()
|
||||
return id
|
||||
end
|
||||
|
||||
-- If the entity is already registered, update it
|
||||
log:debug('Updating entity %s in interactions', entity)
|
||||
for index, option in pairs(data.options) do
|
||||
if option.name and ENTITIES[entity].options[index]?.name == option.name then
|
||||
log:debug('Option with name: ( %s ) already exists, updating', option.name)
|
||||
ENTITIES[entity].options[index] = option
|
||||
else
|
||||
ENTITIES[entity].options[#ENTITIES[entity].options + 1] = option
|
||||
end
|
||||
end
|
||||
|
||||
-- Update the distance and interactDst if the new data is greater
|
||||
if data.distance > ENTITIES[entity].distance then
|
||||
ENTITIES[entity].distance = data.distance
|
||||
end
|
||||
|
||||
if data.interactDst > ENTITIES[entity].interactDst then
|
||||
ENTITIES[entity].interactDst = data.interactDst
|
||||
end
|
||||
|
||||
-- Update the offset if there is new data
|
||||
if data.offset then
|
||||
ENTITIES[entity].offset = data.offset
|
||||
end
|
||||
|
||||
interactions[id] = {
|
||||
id = id,
|
||||
entity = entity,
|
||||
options = ENTITIES[entity].options,
|
||||
distance = ENTITIES[entity].distance,
|
||||
interactDst = ENTITIES[entity].interactDst,
|
||||
offset = ENTITIES[entity].offset,
|
||||
resource = GetInvokingResource()
|
||||
}
|
||||
|
||||
filterInteractions()
|
||||
|
||||
return id
|
||||
end exports('AddLocalEntityInteraction', api.addLocalEntityInteraction)
|
||||
|
||||
---@param data table : { name, netId, options, distance, interactDst, groups }
|
||||
---@return number : The id of the interaction
|
||||
-- Add an interaction point on a networked entity
|
||||
function api.addEntityInteraction(data)
|
||||
local netId = data.netId
|
||||
-- If the netId does not exist, we assume it is an entity
|
||||
local entity
|
||||
if type(netId) == 'number' and NetworkDoesNetworkIdExist(netId) then
|
||||
entity = utils.getEntity(netId)
|
||||
elseif type(netId) == 'number' then
|
||||
entity = netId
|
||||
end
|
||||
|
||||
if not checkParams(entity, data.options) then
|
||||
if NETWORKED_ENTITIES[netId] then
|
||||
NETWORKED_ENTITIES[netId] = nil
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
-- If the entity is not networked, add it as a local entity
|
||||
if not NetworkGetEntityIsNetworked(entity) then
|
||||
log:debug('Entity %s is not networked, adding as a local entity', entity)
|
||||
data.entity = entity
|
||||
return api.addLocalEntityInteraction(data)
|
||||
end
|
||||
netId = utils.getNet(entity)
|
||||
local id = #interactions + 1
|
||||
-- If then netId not registered yet, add it
|
||||
if not NETWORKED_ENTITIES[netId] then
|
||||
log:debug('Adding networkID %s to interactions', netId)
|
||||
|
||||
|
||||
interactions[id] = {
|
||||
id = id,
|
||||
name = data.name or 'interaction:'..id,
|
||||
entity = entity,
|
||||
options = data.options or {},
|
||||
distance = data.distance or 10.0,
|
||||
interactDst = data.interactDst or 1.0,
|
||||
offset = data.offset or vec(0.0, 0.0, 0.0),
|
||||
groups = data.groups or nil,
|
||||
resource = GetInvokingResource()
|
||||
}
|
||||
|
||||
NETWORKED_ENTITIES[netId] = interactions[id]
|
||||
|
||||
filterInteractions()
|
||||
return id
|
||||
end
|
||||
|
||||
-- If the networkID is already registered, update it
|
||||
log:debug('Updating networkID %s in interactions', netId)
|
||||
for index, option in pairs(data.options) do
|
||||
if option.name and NETWORKED_ENTITIES[netId].options[index]?.name == option.name then
|
||||
log:debug('Option with name: ( %s ) already exists, updating', option.name)
|
||||
NETWORKED_ENTITIES[netId].options[index] = option
|
||||
else
|
||||
NETWORKED_ENTITIES[netId].options[#NETWORKED_ENTITIES[netId].options + 1] = option
|
||||
end
|
||||
end
|
||||
|
||||
-- Update the distance and interactDst if the new data is greater
|
||||
if data.distance > NETWORKED_ENTITIES[netId].distance then
|
||||
NETWORKED_ENTITIES[netId].distance = data.distance
|
||||
end
|
||||
|
||||
if data.interactDst > NETWORKED_ENTITIES[netId].interactDst then
|
||||
NETWORKED_ENTITIES[netId].interactDst = data.interactDst
|
||||
end
|
||||
|
||||
-- Update the offset if there is new data
|
||||
if data.offset then
|
||||
NETWORKED_ENTITIES[netId].offset = data.offset
|
||||
end
|
||||
|
||||
interactions[id] = {
|
||||
id = id,
|
||||
entity = entity,
|
||||
options = NETWORKED_ENTITIES[netId].options,
|
||||
distance = NETWORKED_ENTITIES[netId].distance,
|
||||
interactDst = NETWORKED_ENTITIES[netId].interactDst,
|
||||
offset = NETWORKED_ENTITIES[netId].offset,
|
||||
resource = GetInvokingResource()
|
||||
}
|
||||
|
||||
filterInteractions()
|
||||
|
||||
return id
|
||||
end exports('AddEntityInteraction', api.addEntityInteraction)
|
||||
|
||||
---@param data table : { name, entity[number|string], bone[string], options, distance, interactDst, groups }
|
||||
---@return number : The id of the interaction
|
||||
-- Add an interaction point on a networked entity's bone
|
||||
function api.addEntityBoneInteraction(data)
|
||||
|
||||
if not data.entity then
|
||||
log:error('Entity is required to add an interaction')
|
||||
return
|
||||
end
|
||||
|
||||
if not data.bone then
|
||||
log:error('Bone is required to add an interaction')
|
||||
return
|
||||
end
|
||||
|
||||
if not data.options then
|
||||
log:error('Options are required to add an interaction')
|
||||
return
|
||||
end
|
||||
|
||||
-- temp workaround until table refactoring.
|
||||
local key = string.format('%s:%s', data.entity, data.bone)
|
||||
if not ENTITY_BONES[key] then
|
||||
log:debug('Added new entity bone interaction: %s', key)
|
||||
ENTITY_BONES[key] = {
|
||||
entity = data.entity,
|
||||
bone = data.bone,
|
||||
distance = data.distance or 10.0,
|
||||
interactDst = data.interactDst or 1.0,
|
||||
offset = data.offset or vec(0.0, 0.0, 0.0),
|
||||
options = data.options,
|
||||
groups = data.groups or nil,
|
||||
}
|
||||
else
|
||||
log:debug('Updating %s in bone interactions', key)
|
||||
|
||||
for index, option in pairs(data.options) do
|
||||
if option.name and ENTITY_BONES[key].options[index]?.name == option.name then
|
||||
log:debug('Option with name: ( %s ) already exists, updating', option.name)
|
||||
ENTITY_BONES[key].options[index] = option
|
||||
else
|
||||
ENTITY_BONES[key].options[#ENTITY_BONES[key].options + 1] = option
|
||||
end
|
||||
end
|
||||
|
||||
-- Update the distance and interactDst if the new data is greater
|
||||
if data.distance > ENTITY_BONES[key].distance then
|
||||
ENTITY_BONES[key].distance = data.distance
|
||||
end
|
||||
|
||||
if data.interactDst > ENTITY_BONES[key].interactDst then
|
||||
ENTITY_BONES[key].interactDst = data.interactDst
|
||||
end
|
||||
|
||||
-- Update the offset if there is new data
|
||||
if data.offset then
|
||||
ENTITY_BONES[key].offset = data.offset
|
||||
end
|
||||
|
||||
log:debug('Updated entity bone interaction: %s', key)
|
||||
ENTITY_BONES[key] = {
|
||||
entity = data.entity,
|
||||
bone = data.bone,
|
||||
options = ENTITY_BONES[key].options,
|
||||
distance = ENTITY_BONES[key].distance,
|
||||
interactDst = ENTITY_BONES[key].interactDst,
|
||||
offset = ENTITY_BONES[key].offset,
|
||||
resource = GetInvokingResource()
|
||||
}
|
||||
end
|
||||
|
||||
filterInteractions()
|
||||
|
||||
return id
|
||||
end exports('AddEntityBoneInteraction', api.addEntityBoneInteraction)
|
||||
|
||||
---@param data table : { name, modelData table : { model[string], offset[vec3] }, options, distance, interactDst, groups }
|
||||
-- Add interaction(s) to a list of models
|
||||
function api.addModelInteraction(data)
|
||||
data.distance = data.distance or 8.0
|
||||
data.interactDst = data.interactDst or 1.0
|
||||
for i = 1, #data.modelData do
|
||||
local modelData = data.modelData[i]
|
||||
if IsModelValid(modelData.model) then
|
||||
local min, max = GetModelDimensions(modelData.model)
|
||||
local size = (max - min)
|
||||
data.interactDst += (size.x / 8)
|
||||
data.distance += (size.x / 4)
|
||||
data.resource = GetInvokingResource()
|
||||
addModel(modelData.model, data.options, { offset = modelData.offset, distance = data.distance, interactDst = data.interactDst, resource = data.resource })
|
||||
end
|
||||
end
|
||||
end exports('AddModelInteraction', api.addModelInteraction)
|
||||
|
||||
---@param id number : The id of the interaction to remove
|
||||
-- Remove an interaction point by id.
|
||||
function api.removeInteraction(id)
|
||||
interactions[id] = nil
|
||||
log:debug('Removed interaction %s', id)
|
||||
filterInteractions()
|
||||
end
|
||||
exports('RemoveInteraction', api.removeInteraction)
|
||||
|
||||
---@param entity number : The entity to remove the interaction from
|
||||
-- Remove an interaction point by entity.
|
||||
function api.removeInteractionByEntity(entity)
|
||||
for i = #interactions, 1, -1 do
|
||||
local interaction = interactions[i]
|
||||
|
||||
if interaction.entity == entity then
|
||||
api.removeInteraction(i)
|
||||
end
|
||||
end
|
||||
end exports('RemoveInteractionByEntity', api.removeInteractionByEntity)
|
||||
|
||||
---@param id number : The id of the interaction to remove the option from
|
||||
---@param name? string : The name of the option to remove
|
||||
-- Remove an option from an interaction point by id.
|
||||
function api.removeInteractionOption(id, name)
|
||||
if not interactions[id] then
|
||||
log:error('Interaction with id: ( %s ) does not exist', id)
|
||||
return
|
||||
end
|
||||
|
||||
if not name then
|
||||
api.removeInteraction(id)
|
||||
return
|
||||
end
|
||||
|
||||
local options = interactions[id].options
|
||||
|
||||
if not options then
|
||||
log:error('Interaction with id: ( %s ) does not have any options', id)
|
||||
api.removeInteraction(id)
|
||||
return
|
||||
end
|
||||
|
||||
for i = #options, 1, -1 do
|
||||
local option = options[i]
|
||||
|
||||
if option.name == name then
|
||||
options[i] = nil
|
||||
log:debug('Removed option %s from interaction %s', name, id)
|
||||
end
|
||||
end
|
||||
end exports('RemoveInteractionOption', api.removeInteractionOption)
|
||||
|
||||
---@param id number : The id of the interaction to update
|
||||
---@param options table : The new options to update the interaction with
|
||||
-- Update an interaction point by id.
|
||||
function api.updateInteraction(id, options)
|
||||
if not options then
|
||||
log:error('Options are required to update an interaction')
|
||||
return
|
||||
end
|
||||
|
||||
if not interactions[id] then
|
||||
log:error('Interaction with id: ( %s ) does not exist', id)
|
||||
return
|
||||
end
|
||||
|
||||
if interactions[id] then
|
||||
interactions[id].options = options
|
||||
filterInteractions()
|
||||
end
|
||||
end exports('UpdateInteraction', api.updateInteraction)
|
||||
|
||||
function api.getNearbyInteractions()
|
||||
local options = {}
|
||||
local amount = 0
|
||||
|
||||
local playercoords = GetEntityCoords(cache.ped)
|
||||
|
||||
-- Temp loop : these checks need to be broken out into their own threads.
|
||||
local nearbyVehicles = lib.getNearbyVehicles(playercoords, settings.nearbyVehicleDistance, false)
|
||||
for i = 1, #nearbyVehicles do
|
||||
local vehicle = nearbyVehicles[i].vehicle
|
||||
local vehicleCoords = nearbyVehicles[i].coords
|
||||
|
||||
if settings.vehicleBoneDefaults.enabled then
|
||||
for bone, data in pairs(settings.vehicleBoneDefaults.bones) do
|
||||
local key = string.format('%s:%s', vehicle, bone)
|
||||
if not ENTITY_BONES[key] then
|
||||
api.addEntityBoneInteraction({
|
||||
entity = vehicle,
|
||||
bone = bone,
|
||||
options = data.options,
|
||||
distance = data.distance,
|
||||
interactDst = data.interactDst,
|
||||
offset = data.offset,
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for _, interaction in pairs(ENTITY_BONES) do
|
||||
local distance = #(utils.getCoordsFromInteract(interaction) - playercoords)
|
||||
if distance <= interaction.distance then
|
||||
amount += 1
|
||||
interaction.curDist = distance
|
||||
options[amount] = interaction
|
||||
end
|
||||
end
|
||||
|
||||
local nearbyObjects = lib.getNearbyObjects(playercoords, settings.nearbyObjectDistance)
|
||||
for i = 1, #nearbyObjects do
|
||||
local nearby = nearbyObjects[i]
|
||||
local hash = GetEntityModel(nearby.object)
|
||||
|
||||
if MODELS[hash] then
|
||||
local interaction = lib.table.deepclone(MODELS[hash])
|
||||
-- put the functions to original references
|
||||
for k, v in pairs(interaction) do
|
||||
if type(v) == "table" then
|
||||
for id, item in pairs(v) do
|
||||
if item.action then
|
||||
item.action = MODELS[hash].options[id].action
|
||||
end
|
||||
if MODELS[hash].options[id].canInteract then
|
||||
item.canInteract = MODELS[hash].options[id].canInteract
|
||||
end
|
||||
if item.canInteract then
|
||||
local canInteract = false
|
||||
pcall(function()
|
||||
canInteract = item.canInteract(nearby.object, nearby.coords, item.args)
|
||||
end)
|
||||
v[id] = canInteract and item or nil
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
local distance = #(nearby.coords - playercoords)
|
||||
interaction.entity = nearby.object
|
||||
|
||||
if distance <= interaction.distance then
|
||||
amount += 1
|
||||
interaction.curDist = distance
|
||||
options[amount] = interaction
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local amountOfInteractions = #filteredInteractions
|
||||
if amountOfInteractions > 0 then
|
||||
for i = 1, amountOfInteractions do
|
||||
local interaction = filteredInteractions[i]
|
||||
|
||||
local coords = interaction.coords or utils.getCoordsFromInteract(interaction)
|
||||
|
||||
local distance = #(coords - playercoords)
|
||||
|
||||
if distance <= interaction.distance then
|
||||
amount += 1
|
||||
interaction.curDist = distance
|
||||
options[amount] = interaction
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for _, v in pairs(options) do
|
||||
for i = 1, #v.options, 1 do
|
||||
if not v.options[i] then
|
||||
table.remove(v.options, i)
|
||||
end
|
||||
end
|
||||
end
|
||||
if amount > 1 then
|
||||
table_sort(options, function(a, b)
|
||||
return a.curDist < b.curDist
|
||||
end)
|
||||
end
|
||||
|
||||
return options
|
||||
end
|
||||
|
||||
function api.disable(state)
|
||||
LocalPlayer.state:set('interactionsDisabled', state, true)
|
||||
end exports('Disable', api.disable)
|
||||
|
||||
AddEventHandler('onClientResourceStop', function(resource)
|
||||
for i = #interactions, 1, -1 do
|
||||
local interaction = interactions[i]
|
||||
|
||||
if interaction.resource == resource then
|
||||
api.removeInteraction(interaction.id)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
return api
|
||||
@@ -0,0 +1,174 @@
|
||||
local interactions = require 'client.interactions'
|
||||
local utils = require 'client.utils'
|
||||
local settings = require 'shared.settings'
|
||||
local CURRENT_SELECTION = 1
|
||||
local CURRENT_OPTION = 0
|
||||
|
||||
-- CACHE
|
||||
local Wait = Wait
|
||||
local IsControlJustPressed = IsControlJustPressed
|
||||
local IsNuiFocused = IsNuiFocused
|
||||
local IsPedDeadOrDying = IsPedDeadOrDying
|
||||
local IsPedCuffed = IsPedCuffed
|
||||
|
||||
local visibleOptions = {}
|
||||
|
||||
-- Collects the options whose canInteract passes into visibleOptions and returns how many there are.
|
||||
local function getVisibleOptions(interaction)
|
||||
table.wipe(visibleOptions)
|
||||
local amount = 0
|
||||
local options = interaction.options
|
||||
for i = 1, #options do
|
||||
local option = options[i]
|
||||
local ok = true
|
||||
if option.canInteract then
|
||||
ok = false
|
||||
pcall(function() ok = option.canInteract(interaction.entity, interaction.coords, option.args) end)
|
||||
end
|
||||
if ok then
|
||||
amount += 1
|
||||
visibleOptions[amount] = option
|
||||
end
|
||||
end
|
||||
return amount
|
||||
end
|
||||
|
||||
local function triggerOption(interaction, option)
|
||||
if option.action then
|
||||
pcall(function() option.action(interaction.entity, interaction.coords, option.args) end)
|
||||
elseif option.serverEvent then
|
||||
TriggerServerEvent(option.serverEvent, option.args)
|
||||
elseif option.event then
|
||||
TriggerEvent(option.event, option)
|
||||
end
|
||||
end
|
||||
|
||||
local nearby = {}
|
||||
local screenCoords, screenCount = {}, 0
|
||||
local hoverRadius = settings.Prompt.hoverRadius
|
||||
local GetAspectRatio = GetAspectRatio
|
||||
local math_sqrt = math.sqrt
|
||||
|
||||
local function CreateInteractions()
|
||||
local aspect = GetAspectRatio(false)
|
||||
local active, activeCoords, activeAmount, activeIndex
|
||||
local bestDist = hoverRadius
|
||||
screenCount = 0
|
||||
|
||||
-- Pass 1: find every on-screen point and pick the in-range one closest to the crosshair.
|
||||
for i = 1, #nearby do
|
||||
local interaction = nearby[i]
|
||||
local coords = interaction.coords or utils.getCoordsFromInteract(interaction)
|
||||
local onScreen, sx, sy = GetScreenCoordFromWorldCoord(coords.x, coords.y, coords.z)
|
||||
|
||||
if onScreen then
|
||||
local amount = getVisibleOptions(interaction)
|
||||
|
||||
if amount > 0 then
|
||||
screenCount += 1
|
||||
screenCoords[screenCount] = coords
|
||||
|
||||
if interaction.curDist <= interaction.interactDst then
|
||||
local dx, dy = (sx - 0.5) * aspect, sy - 0.5
|
||||
local dist = math_sqrt(dx * dx + dy * dy)
|
||||
if dist < bestDist then
|
||||
bestDist = dist
|
||||
active, activeCoords, activeAmount, activeIndex = interaction, coords, amount, screenCount
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if screenCount == 0 then
|
||||
CURRENT_OPTION = 0
|
||||
return
|
||||
end
|
||||
|
||||
-- Pass 2: dots for everything except the hovered point, which gets the prompt instead.
|
||||
for i = 1, screenCount do
|
||||
if i ~= activeIndex then
|
||||
utils.drawDot(screenCoords[i])
|
||||
end
|
||||
end
|
||||
|
||||
if settings.Prompt.crosshair then
|
||||
utils.drawCrosshair()
|
||||
end
|
||||
|
||||
if not active then
|
||||
CURRENT_OPTION = 0
|
||||
return
|
||||
end
|
||||
|
||||
-- Rebuild the option list for the hovered point (pass 1 overwrote it while scanning).
|
||||
getVisibleOptions(active)
|
||||
|
||||
-- Bone and model interactions have no id, so fall back to the entity.
|
||||
local key = active.id or active.entity
|
||||
if key ~= CURRENT_OPTION then
|
||||
CURRENT_OPTION = key
|
||||
CURRENT_SELECTION = 1
|
||||
end
|
||||
|
||||
if CURRENT_SELECTION > activeAmount then
|
||||
CURRENT_SELECTION = activeAmount
|
||||
end
|
||||
|
||||
if CURRENT_SELECTION > 1 and (IsControlJustPressed(0, 172) or IsControlJustPressed(0, 15)) then
|
||||
CURRENT_SELECTION -= 1
|
||||
elseif CURRENT_SELECTION < activeAmount and (IsControlJustPressed(0, 173) or IsControlJustPressed(0, 14)) then
|
||||
CURRENT_SELECTION += 1
|
||||
end
|
||||
|
||||
utils.drawPrompt(activeCoords, visibleOptions, CURRENT_SELECTION)
|
||||
|
||||
if IsControlJustPressed(0, 38) then
|
||||
triggerOption(active, visibleOptions[CURRENT_SELECTION])
|
||||
end
|
||||
end
|
||||
|
||||
local function isDisabled()
|
||||
if LocalPlayer.state.interactionsDisabled then
|
||||
return true
|
||||
end
|
||||
|
||||
if settings.Disable.onDeath and (IsPedDeadOrDying(cache.ped) or LocalPlayer.state.isDead) then
|
||||
return true
|
||||
end
|
||||
|
||||
if settings.Disable.onNuiFocus and IsNuiFocused() then
|
||||
return true
|
||||
end
|
||||
|
||||
if settings.Disable.onVehicle and cache.vehicle then
|
||||
return true
|
||||
end
|
||||
|
||||
if settings.Disable.onHandCuff and IsPedCuffed(cache.ped) then
|
||||
return true
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
-- Fast thread
|
||||
CreateThread(function ()
|
||||
lib.requestStreamedTextureDict('interactions_txd')
|
||||
while true do
|
||||
local wait = 500
|
||||
if next(nearby) and not isDisabled() then
|
||||
wait = 0
|
||||
CreateInteractions()
|
||||
end
|
||||
Wait(wait)
|
||||
end
|
||||
end)
|
||||
|
||||
-- Slow checker thread
|
||||
CreateThread(function()
|
||||
while true do
|
||||
nearby = interactions.getNearbyInteractions()
|
||||
Wait(500)
|
||||
end
|
||||
end)
|
||||
@@ -0,0 +1,50 @@
|
||||
CurrentTarget = nil
|
||||
|
||||
local StartShapeTestSweptSphere = StartShapeTestSweptSphere
|
||||
local GetShapeTestResult = GetShapeTestResult
|
||||
local GetPedBoneCoords = GetPedBoneCoords
|
||||
local GetGameplayCamRot = GetGameplayCamRot
|
||||
local GetEntityType = GetEntityType
|
||||
|
||||
local function getForwardVector(rotation)
|
||||
local rot = (math.pi / 180.0) * rotation
|
||||
return vector3(-math.sin(rot.z) * math.abs(math.cos(rot.x)), math.cos(rot.z) * math.abs(math.cos(rot.x)), math.sin(rot.x))
|
||||
end
|
||||
|
||||
local function rayCast(origin, target, options, ignoreEntity, radius)
|
||||
local handle = StartShapeTestSweptSphere(origin.x, origin.y, origin.z, target.x, target.y, target.z, radius, options, ignoreEntity, 0)
|
||||
return GetShapeTestResult(handle)
|
||||
end
|
||||
|
||||
local function entityInFrontOfPlayer(distance, radius, _, ignoreEntity)
|
||||
distance = distance or 3.0
|
||||
local originCoords = GetPedBoneCoords(cache.ped, 31086, 0, 0, 0)
|
||||
local forwardVectors = getForwardVector(GetGameplayCamRot(2))
|
||||
local forwardCoords = originCoords + (forwardVectors * distance)
|
||||
|
||||
if not forwardVectors then return end
|
||||
|
||||
local _, hit, _, _, targetEntity = rayCast(originCoords, forwardCoords, -1, ignoreEntity, radius or 0.2)
|
||||
|
||||
if not hit and targetEntity == 0 then return end
|
||||
|
||||
local entityType = GetEntityType(targetEntity)
|
||||
|
||||
return targetEntity, entityType
|
||||
end
|
||||
|
||||
CreateThread(function()
|
||||
while true do
|
||||
Wait(250)
|
||||
local entity, entityType
|
||||
pcall(function() entity, entityType, _ = entityInFrontOfPlayer(3.0, 0.2, 286, cache.ped) end)
|
||||
if entity and entityType ~= 0 then
|
||||
if entity ~= CurrentTarget then
|
||||
CurrentTarget = entity
|
||||
end
|
||||
elseif CurrentTarget then
|
||||
CurrentTarget = nil
|
||||
end
|
||||
|
||||
end
|
||||
end)
|
||||
@@ -0,0 +1,6 @@
|
||||
local settings = require 'shared.settings'
|
||||
local txd = CreateRuntimeTxd('interactions_txd')
|
||||
|
||||
for _, v in pairs(settings.Textures) do
|
||||
CreateRuntimeTextureFromImage(txd, tostring(v), "assets/prompt/"..v..".png")
|
||||
end
|
||||
@@ -0,0 +1,147 @@
|
||||
local settings = require 'shared.settings'
|
||||
local textures = settings.Textures
|
||||
|
||||
local SetDrawOrigin = SetDrawOrigin
|
||||
local DrawSprite = DrawSprite
|
||||
local ClearDrawOrigin = ClearDrawOrigin
|
||||
local DoesEntityExist = DoesEntityExist
|
||||
local GetEntityBonePosition_2 = GetEntityBonePosition_2
|
||||
local GetEntityBoneIndexByName = GetEntityBoneIndexByName
|
||||
local GetOffsetFromEntityInWorldCoords = GetOffsetFromEntityInWorldCoords
|
||||
local IsEntityAPed = IsEntityAPed
|
||||
local GetEntityCoords = GetEntityCoords
|
||||
|
||||
local utils = {}
|
||||
|
||||
function utils.getNet(entity)
|
||||
return NetworkGetNetworkIdFromEntity(entity)
|
||||
end
|
||||
|
||||
function utils.getEntity(netID)
|
||||
return NetworkGetEntityFromNetworkId(netID)
|
||||
end
|
||||
|
||||
function utils.getTrunkOffset(entity)
|
||||
local min, _ = GetModelDimensions(GetEntityModel(entity))
|
||||
return GetOffsetFromEntityInWorldCoords(entity, 0.0, min.y - 0.5, 0.0)
|
||||
end
|
||||
|
||||
function utils.getCoordsFromInteract(interaction)
|
||||
if interaction.entity then
|
||||
if DoesEntityExist(interaction.entity) then
|
||||
if interaction.bone then
|
||||
return GetEntityBonePosition_2(interaction.entity, GetEntityBoneIndexByName(interaction.entity, interaction.bone))
|
||||
elseif interaction.model then
|
||||
return GetOffsetFromEntityInWorldCoords(interaction.entity, 0.0 + interaction.offset.x, 0.0 + interaction.offset.y, 0.0 + interaction.offset.z)
|
||||
else
|
||||
if IsEntityAPed(interaction.entity) then
|
||||
if interaction.offset and interaction.offset ~= vec3(0.0, 0.0, 0.0) then
|
||||
return GetOffsetFromEntityInWorldCoords(interaction.entity, 0.0 + interaction.offset.x, 0.0 + interaction.offset.y, 0.0 + interaction.offset.z)
|
||||
end
|
||||
return GetEntityBonePosition_2(interaction.entity, 0) -- SKEL_ROOT
|
||||
else
|
||||
if interaction.offset and interaction.offset ~= vec3(0.0, 0.0, 0.0) then
|
||||
return GetOffsetFromEntityInWorldCoords(interaction.entity, 0.0 + interaction.offset.x, 0.0 + interaction.offset.y, 0.0 + interaction.offset.z)
|
||||
end
|
||||
return GetEntityCoords(interaction.entity)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return vec3(0.0, 0.0, 0.0)
|
||||
end
|
||||
|
||||
local TXD = 'interactions_txd'
|
||||
local prompt = settings.Prompt
|
||||
local font = require 'client.font'
|
||||
local glyphs = font.glyphs
|
||||
local GetAspectRatio = GetAspectRatio
|
||||
local DrawSpriteUv = DrawSpriteUv
|
||||
local string_upper = string.upper
|
||||
local string_sub = string.sub
|
||||
|
||||
-- Draws text from the font atlas. x is the left edge, centerY the vertical centre of the capitals.
|
||||
-- Returns the drawn width. Must be called with a draw origin set if x/y are relative.
|
||||
local function drawGlyphs(text, x, centerY, capHeight, aspect, r, g, b, a)
|
||||
local k = capHeight / font.capHeight
|
||||
local h = font.lineHeight * k
|
||||
local cy = centerY + capHeight * 0.5 - font.ascent * k + h * 0.5
|
||||
local kx = k / aspect
|
||||
local vh = font.lineHeight / font.height
|
||||
local pen = x
|
||||
|
||||
for i = 1, #text do
|
||||
local glyph = glyphs[string_sub(text, i, i)] or glyphs['?']
|
||||
if glyph.w > 0 then
|
||||
local u, v = glyph.x / font.width, glyph.y / font.height
|
||||
DrawSpriteUv(TXD, textures.font, pen + (glyph.xoff + glyph.w * 0.5) * kx, cy, glyph.w * kx, h,
|
||||
u, v, u + glyph.w / font.width, v + vh, 0.0, r, g, b, a)
|
||||
end
|
||||
pen += glyph.adv * kx
|
||||
end
|
||||
|
||||
return pen - x
|
||||
end
|
||||
|
||||
local function measureText(text, capHeight, aspect)
|
||||
local kx = capHeight / font.capHeight / aspect
|
||||
local width = 0
|
||||
for i = 1, #text do
|
||||
width += (glyphs[string_sub(text, i, i)] or glyphs['?']).adv * kx
|
||||
end
|
||||
return width
|
||||
end
|
||||
|
||||
local function drawText(text, x, centerY, capHeight, aspect, color, alpha)
|
||||
if prompt.shadowAlpha > 0 then
|
||||
local offset = capHeight * 0.08
|
||||
drawGlyphs(text, x + offset / aspect, centerY + offset, capHeight, aspect, 0, 0, 0, math.floor(prompt.shadowAlpha * alpha / 255))
|
||||
end
|
||||
drawGlyphs(text, x, centerY, capHeight, aspect, color[1], color[2], color[3], alpha)
|
||||
end
|
||||
|
||||
-- Ring dot marking an interaction point.
|
||||
function utils.drawDot(coords)
|
||||
local size = prompt.dotSize
|
||||
SetDrawOrigin(coords.x, coords.y, coords.z, 0)
|
||||
DrawSprite(TXD, textures.dot, 0.0, 0.0, size / GetAspectRatio(false), size, 0.0, 255, 255, 255, 255)
|
||||
ClearDrawOrigin()
|
||||
end
|
||||
|
||||
-- Small dot in the middle of the screen used to hover between points.
|
||||
function utils.drawCrosshair()
|
||||
local size = prompt.crosshairSize
|
||||
DrawSprite(TXD, textures.crosshair, 0.5, 0.5, size / GetAspectRatio(false), size, 0.0, 255, 255, 255, 255)
|
||||
end
|
||||
|
||||
-- "[E] LABEL" drawn in place of the dot. The key badge sits on the point, the label to its right.
|
||||
-- With several options the selected row stays on the point, the others are dimmed above/below it.
|
||||
function utils.drawPrompt(coords, options, selection)
|
||||
local aspect = GetAspectRatio(false)
|
||||
local keyH = prompt.keySize
|
||||
local keyW = keyH / aspect
|
||||
local labelX = keyW * 0.5 + prompt.keyGap / aspect
|
||||
local keyTextX = -measureText(prompt.key, prompt.keyTextHeight, aspect) * 0.5
|
||||
local key, textColor, keyColor, keyTextColor = prompt.key, prompt.textColor, prompt.keyColor, prompt.keyTextColor
|
||||
|
||||
SetDrawOrigin(coords.x, coords.y, coords.z, 0)
|
||||
|
||||
for i = 1, #options do
|
||||
local y = (i - selection) * prompt.rowSpacing
|
||||
local label = options[i].label or ''
|
||||
if prompt.uppercase then label = string_upper(label) end
|
||||
|
||||
if i == selection then
|
||||
DrawSprite(TXD, textures.key, 0.0, y, keyW, keyH, 0.0, keyColor[1], keyColor[2], keyColor[3], keyColor[4])
|
||||
drawGlyphs(key, keyTextX, y, prompt.keyTextHeight, aspect, keyTextColor[1], keyTextColor[2], keyTextColor[3], keyTextColor[4])
|
||||
drawText(label, labelX, y, prompt.textHeight, aspect, textColor, textColor[4])
|
||||
else
|
||||
drawText(label, labelX, y, prompt.textHeight, aspect, textColor, prompt.dimmedAlpha)
|
||||
end
|
||||
end
|
||||
|
||||
ClearDrawOrigin()
|
||||
end
|
||||
|
||||
return utils
|
||||
@@ -0,0 +1,32 @@
|
||||
fx_version 'cerulean'
|
||||
game 'gta5'
|
||||
use_experimental_fxv2_oal 'yes'
|
||||
lua54 'yes'
|
||||
|
||||
name 'ilv-interact'
|
||||
author 'Iloveyou.scripts'
|
||||
description 'Crosshair-driven world interaction prompts'
|
||||
version '1.0.0'
|
||||
|
||||
files {
|
||||
'client/interactions.lua',
|
||||
'client/utils.lua',
|
||||
'client/font.lua',
|
||||
'shared/settings.lua',
|
||||
'shared/log.lua',
|
||||
'assets/prompt/*.png'
|
||||
}
|
||||
|
||||
shared_scripts {
|
||||
'@ox_lib/init.lua',
|
||||
}
|
||||
|
||||
client_scripts {
|
||||
'client/textures.lua',
|
||||
'client/interacts.lua',
|
||||
'client/raycast.lua'
|
||||
}
|
||||
|
||||
server_scripts {
|
||||
'server/main.lua',
|
||||
}
|
||||
Whitespace-only changes.
@@ -0,0 +1,11 @@
|
||||
local settings = 'shared.settings'
|
||||
|
||||
return {
|
||||
debug = function(self, message, ...)
|
||||
if not settings.Debug then return end
|
||||
print(('[%s] %s'):format('DEBUG', message:format(...)))
|
||||
end,
|
||||
error = function(self, message, ...)
|
||||
print(('[%s] %s'):format('ERROR', message:format(...)))
|
||||
end
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
local BackEngineVehicles = {
|
||||
[`ninef`] = true,
|
||||
[`adder`] = true,
|
||||
[`vagner`] = true,
|
||||
[`t20`] = true,
|
||||
[`infernus`] = true,
|
||||
[`zentorno`] = true,
|
||||
[`reaper`] = true,
|
||||
[`comet2`] = true,
|
||||
[`comet3`] = true,
|
||||
[`jester`] = true,
|
||||
[`jester2`] = true,
|
||||
[`cheetah`] = true,
|
||||
[`cheetah2`] = true,
|
||||
[`prototipo`] = true,
|
||||
[`turismor`] = true,
|
||||
[`pfister811`] = true,
|
||||
[`ardent`] = true,
|
||||
[`nero`] = true,
|
||||
[`nero2`] = true,
|
||||
[`tempesta`] = true,
|
||||
[`vacca`] = true,
|
||||
[`bullet`] = true,
|
||||
[`osiris`] = true,
|
||||
[`entityxf`] = true,
|
||||
[`turismo2`] = true,
|
||||
[`fmj`] = true,
|
||||
[`re7b`] = true,
|
||||
[`tyrus`] = true,
|
||||
[`italigtb`] = true,
|
||||
[`penetrator`] = true,
|
||||
[`monroe`] = true,
|
||||
[`ninef2`] = true,
|
||||
[`stingergt`] = true,
|
||||
[`surfer`] = true,
|
||||
[`surfer2`] = true,
|
||||
[`gp1`] = true,
|
||||
[`autarch`] = true,
|
||||
[`tyrant`] = true
|
||||
}
|
||||
|
||||
local function ToggleDoor(vehicle, door)
|
||||
if GetVehicleDoorLockStatus(vehicle) < 2 then
|
||||
if GetVehicleDoorAngleRatio(vehicle, door) > 0.0 then
|
||||
SetVehicleDoorShut(vehicle, door, false)
|
||||
else
|
||||
SetVehicleDoorOpen(vehicle, door, false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
Debug = GetConvar('debug', 'false') == 'true' and true or false, -- Enable / Disable debug mode
|
||||
Textures = { -- Do not change (files in assets/prompt)
|
||||
key = 'key',
|
||||
dot = 'dot',
|
||||
crosshair = 'crosshair',
|
||||
font = 'font',
|
||||
},
|
||||
-- Sizes are fractions of screen height (divide the pixel size at 1080p by 1080).
|
||||
Prompt = {
|
||||
key = 'E', -- Letter shown in the key badge (the control itself is INPUT_PICKUP / 38)
|
||||
uppercase = true, -- Show labels in uppercase
|
||||
textHeight = 0.0125, -- Cap height of the label text (~13px at 1080p)
|
||||
keySize = 0.0167, -- Key badge size (~18px)
|
||||
keyTextHeight = 0.0095, -- Cap height of the letter inside the badge
|
||||
keyGap = 0.0075, -- Space between the badge and the label
|
||||
dotSize = 0.0155, -- Interaction point dot (~16px)
|
||||
crosshairSize = 0.0055, -- Centre-screen crosshair dot (~6px incl. shadow)
|
||||
crosshair = true, -- Draw the crosshair dot while interaction points are nearby
|
||||
hoverRadius = 0.06, -- How close (screen space) the crosshair must be to a point to select it
|
||||
rowSpacing = 0.024,
|
||||
textColor = { 255, 255, 255, 255 },
|
||||
keyColor = { 255, 255, 255, 255 },
|
||||
keyTextColor = { 20, 20, 20, 255 },
|
||||
dimmedAlpha = 140, -- Alpha of non-selected options when a point has several
|
||||
shadowAlpha = 110, -- Text drop shadow, 0 to disable
|
||||
},
|
||||
Disable = {
|
||||
onDeath = true, -- Disable interactions on death
|
||||
onNuiFocus = true, -- Disable interactions while NUI is focused
|
||||
onVehicle = true, -- Disable interactions while in a vehicle
|
||||
onHandCuff = true, -- Disable interactions while handcuffed
|
||||
},
|
||||
|
||||
-- Nearby object distance check.
|
||||
nearbyObjectDistance = 20.0, -- Keep it at 15.0 at minimum.
|
||||
nearbyVehicleDistance = 4.0,
|
||||
|
||||
vehicleBoneDefaults = {
|
||||
enabled = true,
|
||||
bones = {
|
||||
['boot']= {
|
||||
distance = 3.0,
|
||||
interactDst = 1.5,
|
||||
offset = vec3(0.0, 1.0, 0.0),
|
||||
options = {
|
||||
{
|
||||
name = 'interact:trunk',
|
||||
label = 'Trunk',
|
||||
action = function(entity)
|
||||
ToggleDoor(entity, BackEngineVehicles[GetEntityModel(entity)] and 4 or 5)
|
||||
end,
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
Reference in new issue
Block a user