├── .gitignore
├── LICENSE
├── README.md
├── client.lua
├── config.lua
├── dependencies
└── NativeUI.lua
├── functions.lua
├── fxmanifest.lua
├── menu.lua
├── server.lua
└── stream
└── char_floyd.ytd
/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled Lua sources
2 | luac.out
3 |
4 | # luarocks build files
5 | *.src.rock
6 | *.zip
7 | *.tar.gz
8 |
9 | # Object files
10 | *.o
11 | *.os
12 | *.ko
13 | *.obj
14 | *.elf
15 |
16 | # Precompiled Headers
17 | *.gch
18 | *.pch
19 |
20 | # Libraries
21 | *.lib
22 | *.a
23 | *.la
24 | *.lo
25 | *.def
26 | *.exp
27 |
28 | # Shared objects (inc. Windows DLLs)
29 | *.dll
30 | *.so
31 | *.so.*
32 | *.dylib
33 |
34 | # Executables
35 | *.exe
36 | *.out
37 | *.app
38 | *.i*86
39 | *.x86_64
40 | *.hex
41 |
42 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://semdevelopment.com/discord)
2 |
3 | # SEM_InteractionMenu
4 | *Multi Purpose FiveM Interaction Menu*
5 |
6 | This resource is a menu with actions for LEO, Fire and Civ including Vehicle Controls and Emotes!
7 |
8 | Each section has features that would be used by each of the professions, for example the LEO Menu has Cuff, Drag, Seat, etc.
9 | Some menu features also have commands out of ease during RP.
10 |
11 | SEM_InteractionMenu was created using NativeUI [LUA]
12 |
13 |
14 | ### Information:
15 | Current Version: **v1.7.1**
16 |
17 | Changes: **• Fixes menu item skipping**
18 |
19 | **THIS UPDATE *ONLY* AFFECTS THE DEPENDENCY NATIVEUI - YOU CAN JUST UPDATE THAT FILE *(NO OTHER FILES WERE CHANGED!)***
20 |
21 |
22 | ### Links:
23 |
24 | Support/Discord: [Click Here](https://semdevelopment.com/discord)
25 |
26 | Information: [Click Here](https://semdevelopment.com/releases/interactionmenu)
27 |
28 | Instruction/Docs: [Click here](https://semdevelopment.com/releases/interactionmenu/docs)
29 |
30 | *For full changes checkout [here](https://semdevelopment.com/releases/interactionmenu/docs/changelog)*
31 |
--------------------------------------------------------------------------------
/client.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | ──────────────────────────────────────────────────────────────
3 |
4 | SEM_InteractionMenu (client.lua) - Created by Scott M
5 | Current Version: v1.7.1 (Sep 2021)
6 |
7 | Support: https://semdevelopment.com/discord
8 |
9 | !!! Change vaules in the 'config.lua' !!!
10 | DO NOT EDIT THIS IF YOU DON'T KNOW WHAT YOU ARE DOING
11 |
12 | ──────────────────────────────────────────────────────────────
13 | ]]
14 |
15 |
16 |
17 | --Cuffing Event
18 | local isCuffed = false
19 | RegisterNetEvent('SEM_InteractionMenu:Cuff')
20 | AddEventHandler('SEM_InteractionMenu:Cuff', function()
21 | local Ped = PlayerPedId()
22 | if (DoesEntityExist(Ped)) then
23 | Citizen.CreateThread(function()
24 | RequestAnimDict('mp_arresting')
25 | while not HasAnimDictLoaded('mp_arresting') do
26 | Citizen.Wait(0)
27 | end
28 |
29 | if isCuffed then
30 | isCuffed = false
31 | Citizen.Wait(500)
32 | SetEnableHandcuffs(Ped, false)
33 | ClearPedTasksImmediately(Ped)
34 | else
35 | isCuffed = true
36 | SetEnableHandcuffs(Ped, true)
37 | TaskPlayAnim(Ped, 'mp_arresting', 'idle', 8.0, -8, -1, 49, 0, 0, 0, 0)
38 | end
39 | end)
40 | end
41 | end)
42 |
43 | --Cuff Animation & Restructions
44 | Citizen.CreateThread(function()
45 | while true do
46 | Citizen.Wait(1)
47 |
48 | if isCuffed then
49 | if not IsEntityPlayingAnim(GetPlayerPed(PlayerId()), 'mp_arresting', 'idle', 3) then
50 | TaskPlayAnim(GetPlayerPed(PlayerId()), 'mp_arresting', 'idle', 8.0, -8, -1, 49, 0, 0, 0, 0)
51 | end
52 |
53 | SetCurrentPedWeapon(PlayerPedId(), 'weapon_unarmed', true)
54 |
55 | if not Config.VehEnterCuffed then
56 | DisableControlAction(1, 23, true) --F | Enter Vehicle
57 | DisableControlAction(1, 75, true) --F | Exit Vehicle
58 | end
59 | DisableControlAction(1, 140, true) --R
60 | DisableControlAction(1, 141, true) --Q
61 | DisableControlAction(1, 142, true) --LMB
62 | SetPedPathCanUseLadders(GetPlayerPed(PlayerId()), false)
63 | if IsPedInAnyVehicle(GetPlayerPed(PlayerId()), false) then
64 | DisableControlAction(0, 59, true) --Vehicle Driving
65 | end
66 | end
67 | end
68 | end)
69 |
70 |
71 |
72 | --Dragging Event
73 | local Drag = false
74 | local OfficerDrag = -1
75 | RegisterNetEvent('SEM_InteractionMenu:Drag')
76 | AddEventHandler('SEM_InteractionMenu:Drag', function(ID)
77 | Drag = not Drag
78 | OfficerDrag = ID
79 |
80 | if not Drag then
81 | DetachEntity(PlayerPedId(), true, false)
82 | end
83 | end)
84 |
85 | --Drag Attachment
86 | Citizen.CreateThread(function()
87 | while true do
88 | Citizen.Wait(1)
89 |
90 | if Drag then
91 | local Ped = GetPlayerPed(GetPlayerFromServerId(OfficerDrag))
92 | local Ped2 = PlayerPedId()
93 | AttachEntityToEntity(Ped2, Ped, 4103, 0.35, 0.38, 0.0, 0.0, 0.0, 0.0, false, false, false, false, 2, true)
94 | DisableControlAction(1, 140, true) --R
95 | DisableControlAction(1, 141, true) --Q
96 | DisableControlAction(1, 142, true) --LMB
97 | end
98 | end
99 | end)
100 |
101 |
102 |
103 | --Force Seat Player Event
104 | RegisterNetEvent('SEM_InteractionMenu:Seat')
105 | AddEventHandler('SEM_InteractionMenu:Seat', function(Veh)
106 | local Pos = GetEntityCoords(PlayerPedId())
107 | local EntityWorld = GetOffsetFromEntityInWorldCoords(PlayerPedId(), 0.0, 20.0, 0.0)
108 | local RayHandle = CastRayPointToPoint(Pos.x, Pos.y, Pos.z, EntityWorld.x, EntityWorld.y, EntityWorld.z, 10, PlayerPedId(), 0)
109 | local _, _, _, _, VehicleHandle = GetRaycastResult(RayHandle)
110 | if VehicleHandle ~= nil then
111 | SetPedIntoVehicle(PlayerPedId(), VehicleHandle, 1)
112 | end
113 | end)
114 |
115 |
116 |
117 | --Force Unseat Player Event
118 | RegisterNetEvent('SEM_InteractionMenu:Unseat')
119 | AddEventHandler('SEM_InteractionMenu:Unseat', function(ID)
120 | local Ped = GetPlayerPed(ID)
121 | ClearPedTasksImmediately(Ped)
122 | PlayerPos = GetEntityCoords(PlayerPedId(), true)
123 | local X = PlayerPos.x - 0
124 | local Y = PlayerPos.y - 0
125 |
126 | SetEntityCoords(PlayerPedId(), X, Y, PlayerPos.z)
127 | end)
128 |
129 |
130 |
131 | --Spike Strip Spawn Event
132 | local SpawnedSpikes = {}
133 | RegisterNetEvent('SEM_InteractionMenu:Spikes-SpawnSpikes')
134 | AddEventHandler('SEM_InteractionMenu:Spikes-SpawnSpikes', function(Length)
135 | if IsPedInAnyVehicle(PlayerPedId(), false) then
136 | Notify('~r~You can\'t set spikes while in a vehicle!')
137 | return
138 | end
139 |
140 | local SpawnCoords = GetOffsetFromEntityInWorldCoords(GetPlayerPed(PlayerId()) , 0.0, 2.0, 0.0)
141 | for a = 1, Length do
142 | local Spike = CreateObject(GetHashKey('P_ld_stinger_s'), SpawnCoords.x, SpawnCoords.y, SpawnCoords.z, 1, 1, 1)
143 | local NetID = NetworkGetNetworkIdFromEntity(Spike)
144 | SetNetworkIdExistsOnAllMachines(NetID, true)
145 | SetNetworkIdCanMigrate(NetID, false)
146 | SetEntityHeading(Spike, GetEntityHeading(GetPlayerPed(PlayerId()) ))
147 | PlaceObjectOnGroundProperly(Spike)
148 | FreezeEntityPosition(Spike, true)
149 | SpawnCoords = GetOffsetFromEntityInWorldCoords(Spike, 0.0, 4.0, 0.0)
150 | table.insert(SpawnedSpikes, NetID)
151 | end
152 | end)
153 |
154 | --Spike Strip Delete Event
155 | RegisterNetEvent('SEM_InteractionMenu:Spikes-DeleteSpikes')
156 | AddEventHandler('SEM_InteractionMenu:Spikes-DeleteSpikes', function()
157 | for a = 1, #SpawnedSpikes do
158 | local Spike = NetworkGetEntityFromNetworkId(SpawnedSpikes[a])
159 | DeleteEntity(Spike)
160 | end
161 | Notify('~r~Spikes Strips Removed!')
162 | SpawnedSpikes = {}
163 | end)
164 |
165 | --Spike Strip Tire Popping
166 | Citizen.CreateThread(function()
167 | while true do
168 | Citizen.Wait(25)
169 |
170 | if IsPedInAnyVehicle(PlayerPedId() , false) then
171 | local Vehicle = GetVehiclePedIsIn(PlayerPedId() , false)
172 |
173 | if GetPedInVehicleSeat(Vehicle, -1) == PlayerPedId() then
174 | local VehiclePos = GetEntityCoords(Vehicle, false)
175 | local Spike = GetClosestObjectOfType(VehiclePos.x, VehiclePos.y, VehiclePos.z, 2.0, GetHashKey('P_ld_stinger_s'), 1, 1, 1)
176 |
177 | if Spike ~= 0 then
178 | local Tires = {
179 | {bone = 'wheel_lf', index = 0},
180 | {bone = 'wheel_rf', index = 1},
181 | {bone = 'wheel_lm', index = 2},
182 | {bone = 'wheel_rm', index = 3},
183 | {bone = 'wheel_lr', index = 4},
184 | {bone = 'wheel_rr', index = 5}
185 | }
186 |
187 | for a = 1, #Tires do
188 | local TirePos = GetWorldPositionOfEntityBone(Vehicle, GetEntityBoneIndexByName(Vehicle, Tires[a].bone))
189 | local Spike = GetClosestObjectOfType(TirePos.x, TirePos.y, TirePos.z, 2.0, GetHashKey('P_ld_stinger_s'), 1, 1, 1)
190 | local SpikePos = GetEntityCoords(Spike, false)
191 | local Distance = Vdist(TirePos.x, TirePos.y, TirePos.z, SpikePos.x, SpikePos.y, SpikePos.z)
192 |
193 | if Distance < 1.8 then
194 | if not IsVehicleTyreBurst(Vehicle, Tires[a].index, true) or IsVehicleTyreBurst(Vehicle, Tires[a].index, false) then
195 | SetVehicleTyreBurst(Vehicle, Tires[a].index, false, 1000.0)
196 | end
197 | end
198 | end
199 | end
200 | end
201 | end
202 | end
203 | end)
204 |
205 |
206 |
207 | --Backup
208 | RegisterNetEvent('SEM_InteractionMenu:CallBackup')
209 | AddEventHandler('SEM_InteractionMenu:CallBackup', function(Code, StreetName, Coords)
210 | if LEORestrict() then
211 | local BackupBlip = nil
212 | local BackupBlips = {}
213 |
214 | local function CreateBlip(x, y, z, Name, Sprite, Size, Colour)
215 | BackupBlip = AddBlipForCoord(x, y, z)
216 | SetBlipSprite(BackupBlip, Sprite)
217 | SetBlipDisplay(BackupBlip, 4)
218 | SetBlipScale(BackupBlip, Size)
219 | SetBlipColour(BackupBlip, Colour)
220 | SetBlipAsShortRange(BackupBlip, true)
221 |
222 | BeginTextCommandSetBlipName('STRING')
223 | AddTextComponentString(Name)
224 | EndTextCommandSetBlipName(BackupBlip)
225 | table.insert(BackupBlips, BackupBlip)
226 | Citizen.Wait(Config.BackupBlipTimeout * 60000)
227 | for _, Blip in pairs(BackupBlips) do
228 | RemoveBlip(Blip)
229 | end
230 | end
231 |
232 | if Code == 1 then
233 | Notify('An officer is requesting ~g~Code 1 ~w~backup at ~b~' .. StreetName)
234 | CreateBlip(Coords.x, Coords.y, Coords.z, 'Code 1 Backup Requested', 56, 0.8, 2)
235 | elseif Code == 2 then
236 | Notify('An officer is requesting ~y~Code 2 ~w~backup at ~b~' .. StreetName)
237 | CreateBlip(Coords.x, Coords.y, Coords.z, 'Code 2 Backup Requested', 56, 0.8, 17)
238 | elseif Code == 3 then
239 | Notify('An officer is requesting ~r~Code 3 ~w~backup at ~b~' .. StreetName)
240 | CreateBlip(Coords.x, Coords.y, Coords.z, 'Code 3 Backup Requested', 56, 1.0, 49)
241 | elseif Code == 99 then
242 | Notify('An officer is requesting ~r~Code 99 ~w~backup at ~b~' .. StreetName)
243 | CreateBlip(Coords.x, Coords.y, Coords.z, 'Code 99 Backup Requested', 56, 1.2, 49)
244 | elseif Code == 'panic' then
245 | Notify('An officer has pressed their ~r~Panic Button ~w~at ~b~' .. StreetName)
246 | CreateBlip(Coords.x, Coords.y, Coords.z, 'Panic Button Pressed', 103, 1.2, 49)
247 | end
248 | end
249 | end)
250 |
251 |
252 |
253 | --Jail
254 | CurrentlyJailed = false
255 | EarlyRelease = false
256 | OriginalJailTime = 0
257 | RegisterNetEvent('SEM_InteractionMenu:JailPlayer')
258 | AddEventHandler('SEM_InteractionMenu:JailPlayer', function(JailTime)
259 | if CurrentlyJailed then
260 | return
261 | end
262 | if CurrentlyHospitaled then
263 | return
264 | end
265 |
266 | OriginalJailTime = JailTime
267 |
268 | local Ped = PlayerPedId()
269 | if DoesEntityExist(Ped) then
270 | Citizen.CreateThread(function()
271 | SetEntityCoords(Ped, Config.JailLocation.Jail.x, Config.JailLocation.Jail.y, Config.JailLocation.Jail.z)
272 | SetEntityHeading(Ped, Config.JailLocation.Jail.h)
273 | CurrentlyJailed = true
274 |
275 | while JailTime >= 0 and not EarlyRelease do
276 | SetEntityInvincible(Ped, true)
277 | if IsPedInAnyVehicle(Ped, false) then
278 | ClearPedTasksImmediately(Ped)
279 | end
280 |
281 | if JailTime % 30 == 0 and JailTime ~= 0 then
282 | TriggerEvent('chat:addMessage', {
283 | multiline = true,
284 | color = {86, 96, 252},
285 | args = {'Judge', JailTime .. ' months until release.'},
286 | })
287 | end
288 |
289 | Citizen.Wait(1000)
290 |
291 | local Location = GetEntityCoords(Ped, true)
292 | local Distance = Vdist(Config.JailLocation.Jail.x, Config.JailLocation.Jail.y, Config.JailLocation.Jail.z, Location['x'], Location['y'], Location['z'])
293 | if Distance > 100 then
294 | SetEntityCoords(Ped, Config.JailLocation.Jail.x, Config.JailLocation.Jail.y, Config.JailLocation.Jail.z)
295 | SetEntityHeading(Ped, Config.JailLocation.Jail.h)
296 | TriggerEvent('chat:addMessage', {
297 | multiline = true,
298 | color = {86, 96, 252},
299 | args = {'Judge', 'Don\'t try escape, its impossible'},
300 | })
301 | end
302 |
303 | JailTime = JailTime - 1
304 | end
305 |
306 | if EarlyRelease then
307 | TriggerServerEvent('SEM_InteractionMenu:GlobalChat', {86, 96, 252}, 'Judge', GetPlayerName(PlayerId()) .. ' was released from Jail on Parole')
308 | else
309 | TriggerServerEvent('SEM_InteractionMenu:GlobalChat', {86, 96, 252}, 'Judge', GetPlayerName(PlayerId()) .. ' was released from Jail after ' .. OriginalJailTime .. ' months(s).')
310 | end
311 | SetEntityCoords(Ped, Config.JailLocation.Release.x, Config.JailLocation.Release.y, Config.JailLocation.Release.z)
312 | SetEntityHeading(Ped, Config.JailLocation.Release.h)
313 | CurrentlyJailed = false
314 | EarlyRelease = false
315 | end)
316 | end
317 | end)
318 |
319 | RegisterNetEvent('SEM_InteractionMenu:UnjailPlayer')
320 | AddEventHandler('SEM_InteractionMenu:UnjailPlayer', function()
321 | EarlyRelease = true
322 | end)
323 |
324 |
325 |
326 | --Toggle LEO Weapons
327 | CarbineEquipped = false
328 | ShotgunEquipped = false
329 | Citizen.CreateThread(function()
330 | while true do
331 | Citizen.Wait(50)
332 |
333 | if Config.UnrackWeapons == 1 then
334 | local Ped = PlayerPedId()
335 | local CurrentWeapon = GetSelectedPedWeapon(Ped)
336 |
337 | if CarbineEquipped then
338 | SetCurrentPedWeapon(Ped, 'weapon_carbinerifle', true)
339 | else
340 | if tostring(CurrentWeapon) == '-2084633992' then
341 | Notify('~o~You need to unrack your rifle before you can use it')
342 | SetCurrentPedWeapon(Ped, 'weapon_unarmed', true)
343 | end
344 | end
345 |
346 | if ShotgunEquipped then
347 | SetCurrentPedWeapon(Ped, 'weapon_pumpshotgun', true)
348 | else
349 | if tostring(CurrentWeapon) == '487013001' then
350 | Notify('~o~You need to unrack your shotgun before you can use it')
351 | SetCurrentPedWeapon(Ped, 'weapon_unarmed', true)
352 | end
353 | end
354 | end
355 | end
356 | end)
357 |
358 |
359 |
360 | --Civilian Adverts
361 | RegisterNetEvent('SEM_InteractionMenu:SyncAds')
362 | AddEventHandler('SEM_InteractionMenu:SyncAds',function(Text, Name, Loc, File, ID)
363 | Ad(Text, Name, Loc, File, ID)
364 | end)
365 |
366 |
367 |
368 | --Inventory
369 | RegisterNetEvent('SEM_InteractionMenu:InventoryResult')
370 | AddEventHandler('SEM_InteractionMenu:InventoryResult', function(Inventory)
371 | Citizen.Wait(5000)
372 |
373 | if Inventory == nil then
374 | Inventory = 'Empty'
375 | end
376 |
377 | Notify('~b~Inventory Items: ~g~' .. Inventory)
378 | end)
379 |
380 |
381 |
382 | --BAC
383 | RegisterNetEvent('SEM_InteractionMenu:BACResult')
384 | AddEventHandler('SEM_InteractionMenu:BACResult', function(BACLevel)
385 | Citizen.Wait(5000)
386 |
387 | if BACLevel == nil then
388 | BACLevel = 0.00
389 | end
390 |
391 | if tonumber(BACLevel) < 0.08 then
392 | Notify('~b~BAC Level: ~g~' .. tostring(BACLevel))
393 | else
394 | Notify('~b~BAC Level: ~r~' .. tostring(BACLevel))
395 | end
396 | end)
397 |
398 |
399 |
400 |
401 | --Hospital
402 | CurrentlyHospitalized = false
403 | EarlyDischarge = false
404 | OriginalHospitalTime = 0
405 | RegisterNetEvent('SEM_InteractionMenu:HospitalizePlayer')
406 | AddEventHandler('SEM_InteractionMenu:HospitalizePlayer', function(HospitalTime, HospitalLocation)
407 | if CurrentlyHospitaled then
408 | return
409 | end
410 | if CurrentlyJailed then
411 | return
412 | end
413 |
414 | OriginalHospitalTime = HospitalTime
415 |
416 | local Ped = PlayerPedId()
417 | if DoesEntityExist(Ped) then
418 | Citizen.CreateThread(function()
419 | SetEntityCoords(Ped, HospitalLocation.Hospital.x, HospitalLocation.Hospital.y, HospitalLocation.Hospital.z)
420 | SetEntityHeading(Ped, HospitalLocation.Hospital.h)
421 | CurrentlyHospitaled = true
422 |
423 | while HospitalTime >= 0 and not EarlyDischarge do
424 | SetEntityInvincible(Ped, true)
425 | if IsPedInAnyVehicle(Ped, false) then
426 | ClearPedTasksImmediately(Ped)
427 | end
428 |
429 | if HospitalTime % 30 == 0 and HospitalTime ~= 0 then
430 | TriggerEvent('chat:addMessage', {
431 | multiline = true,
432 | color = {86, 96, 252},
433 | args = {'Doctor', HospitalTime .. ' months until release.'},
434 | })
435 | end
436 |
437 | Citizen.Wait(1000)
438 |
439 | local Location = GetEntityCoords(Ped, true)
440 | local Distance = Vdist(HospitalLocation.Hospital.x, HospitalLocation.Hospital.y, HospitalLocation.Hospital.z, Location['x'], Location['y'], Location['z'])
441 | if Distance > 30 then
442 | SetEntityCoords(Ped, HospitalLocation.Hospital.x, HospitalLocation.Hospital.y, HospitalLocation.Hospital.z)
443 | SetEntityHeading(Ped, HospitalLocation.Hospital.h)
444 | TriggerEvent('chat:addMessage', {
445 | multiline = true,
446 | color = {86, 96, 252},
447 | args = {'Doctor', 'You cannot discharge yourself!'},
448 | })
449 | end
450 |
451 | HospitalTime = HospitalTime - 1
452 | end
453 |
454 | if EarlyDischarge then
455 | TriggerServerEvent('SEM_InteractionMenu:GlobalChat', {86, 96, 252}, 'Doctor', GetPlayerName(PlayerId()) .. ' was discharged from Hospital early')
456 | else
457 | TriggerServerEvent('SEM_InteractionMenu:GlobalChat', {86, 96, 252}, 'Doctor', GetPlayerName(PlayerId()) .. ' was discharged from Hospital after ' .. OriginalHospitalTime .. ' months(s).')
458 | end
459 | SetEntityCoords(Ped, HospitalLocation.Release.x, HospitalLocation.Release.y, HospitalLocation.Release.z)
460 | SetEntityHeading(Ped, HospitalLocation.Release.h)
461 | CurrentlyHospitaled = false
462 | EarlyDischarge = false
463 | end)
464 | end
465 | end)
466 |
467 | RegisterNetEvent('SEM_InteractionMenu:UnhospitalizePlayer')
468 | AddEventHandler('SEM_InteractionMenu:UnhospitalizePlayer', function()
469 | EarlyDischarge = true
470 | end)
471 |
472 |
473 |
474 | --Station Blips
475 | Citizen.CreateThread(function()
476 | if Config.DisplayStationBlips then
477 | local function CreateBlip(x, y, z, Name, Colour, Sprite)
478 | StationBlip = AddBlipForCoord(x, y, z)
479 | SetBlipSprite(StationBlip, Sprite)
480 | if Config.StationBlipsDispalyed == 1 then
481 | SetBlipDisplay(StationBlip, 3)
482 | elseif Config.StationBlipsDispalyed == 2 then
483 | SetBlipDisplay(StationBlip, 5)
484 | else
485 | SetBlipDisplay(StationBlip, 2)
486 | end
487 | SetBlipScale(StationBlip, 1.0)
488 | SetBlipColour(StationBlip, Colour)
489 | SetBlipAsShortRange(StationBlip, true)
490 |
491 | BeginTextCommandSetBlipName('STRING')
492 | AddTextComponentString(Name)
493 | EndTextCommandSetBlipName(StationBlip)
494 | end
495 |
496 | for _, Station in pairs(Config.LEOStations) do
497 | CreateBlip(Station.coords.x, Station.coords.y, Station.coords.z, 'Police Station', 38, 60)
498 | end
499 | for _, Station in pairs(Config.FireStations) do
500 | CreateBlip(Station.coords.x, Station.coords.y, Station.coords.z, 'Fire Station', 1, 60)
501 | end
502 | for _, Station in pairs(Config.HospitalStations) do
503 | CreateBlip(Station.coords.x, Station.coords.y, Station.coords.z, 'Hospital', 2, 61)
504 | end
505 | end
506 | end)
507 |
508 |
509 |
510 | --Permissions
511 | LEOAce = false
512 | TriggerServerEvent('SEM_InteractionMenu:LEOPerms')
513 | RegisterNetEvent('SEM_InteractionMenu:LEOPermsResult')
514 | AddEventHandler('SEM_InteractionMenu:LEOPermsResult', function(Allowed)
515 | if Allowed then
516 | LEOAce = true
517 | else
518 | LEOAce = false
519 | end
520 | end)
521 |
522 | FireAce = false
523 | TriggerServerEvent('SEM_InteractionMenu:FirePerms')
524 | RegisterNetEvent('SEM_InteractionMenu:FirePermsResult')
525 | AddEventHandler('SEM_InteractionMenu:FirePermsResult', function(Allowed)
526 | if Allowed then
527 | FireAce = true
528 | else
529 | FireAce = false
530 | end
531 | end)
532 |
533 | UnjailAllowed = false
534 | TriggerServerEvent('SEM_InteractionMenu:UnjailPerms')
535 | RegisterNetEvent('SEM_InteractionMenu:UnjailPermsResult')
536 | AddEventHandler('SEM_InteractionMenu:UnjailPermsResult', function(Allowed)
537 | if Allowed then
538 | UnjailAllowed = true
539 | else
540 | UnjailAllowed = false
541 | end
542 | end)
543 |
544 | UnhospitalAllowed = false
545 | TriggerServerEvent('SEM_InteractionMenu:UnhospitalPerms')
546 | RegisterNetEvent('SEM_InteractionMenu:UnhospitalPermsResult')
547 | AddEventHandler('SEM_InteractionMenu:UnhospitalPermsResult', function(Allowed)
548 | if Allowed then
549 | UnhospitalAllowed = true
550 | else
551 | UnhospitalAllowed = false
552 | end
553 | end)
554 |
555 |
556 |
557 | --Emote
558 | Citizen.CreateThread(function()
559 | while true do
560 | Citizen.Wait(1)
561 |
562 | if EmotePlaying then
563 | if Config.EmoteHelp then
564 | NotifyHelp('You are playing an Emote, ~b~Move to Cancel')
565 | end
566 |
567 | -- Spacebar W S A D
568 | if (IsControlPressed(0, 22) or IsControlPressed(0, 32) or IsControlPressed(0, 33) or IsControlPressed(0, 34) or IsControlPressed(0, 35)) then
569 | CancelEmote()
570 | end
571 | end
572 | end
573 | end)
574 |
575 |
576 |
577 | --Commands
578 | Citizen.CreateThread(function()
579 | if EmoteRestrict() then
580 | local Index = 0
581 | local Emotes = ''
582 | for _, Emote in pairs(Config.EmotesList) do
583 | Index = Index + 1
584 | if Index == 1 then
585 | Emotes = Emotes .. Emote.name
586 | else
587 | Emotes = Emotes .. ', ' .. Emote.name
588 | end
589 | end
590 |
591 | TriggerEvent('chat:addSuggestion', '/emotes', 'List of Current Avaliable Emotes')
592 | TriggerEvent('chat:addSuggestion', '/emote', 'Play Emote', {{name = 'Emote Name', help = 'Emotes: ' .. Emotes}})
593 | else
594 | TriggerEvent('chat:removeSuggestion', '/emotes')
595 | TriggerEvent('chat:removeSuggestion', '/emote')
596 | end
597 |
598 | TriggerEvent('chat:addSuggestion', '/eng', 'Toggles Engine')
599 | TriggerEvent('chat:addSuggestion', '/hood', 'Toggles Vehicle\'s Hood')
600 | TriggerEvent('chat:addSuggestion', '/trunk', 'Toggles Vehicle\'s Trunk')
601 | TriggerEvent('chat:addSuggestion', '/clear', 'Clears all Weapons')
602 | TriggerEvent('chat:addSuggestion', '/cuff', 'Cuff Player', {{name = 'ID', help = 'Players Server ID'}})
603 | TriggerEvent('chat:addSuggestion', '/drag', 'Drag Player', {{name = 'ID', help = 'Players Server ID'}})
604 | TriggerEvent('chat:addSuggestion', '/dropweapon', 'Drops Weapon in Hand')
605 | TriggerEvent('chat:addSuggestion', '/loadout', 'Equips LEO Weapon Loadout')
606 | TriggerEvent('chat:addSuggestion', '/coords', 'Shows Current Player Coords and Heading')
607 |
608 | if Config.Radar ~= 0 then
609 | TriggerEvent('chat:addSuggestion', '/radar', 'Toggle Radar Menu')
610 | end
611 |
612 | if Config.LEOAccess == 3 or Config.FireAccess == 3 then
613 | if Config.OndutyPSWDActive then
614 | TriggerEvent('chat:addSuggestion', '/onduty', 'Enable LEO/Fire Menu', {{name = 'Department', help = 'LEO or Fire'}, {name = 'Password', help = 'Onduty Password'}})
615 | else
616 | TriggerEvent('chat:addSuggestion', '/onduty', 'Enable LEO/Fire Menu', {{name = 'Department', help = 'LEO or Fire'}})
617 | end
618 | else
619 | TriggerEvent('chat:removeSuggestion', '/onduty')
620 | end
621 | end)
622 |
623 | LEOOnduty = false
624 | FireOnduty = false
625 | RegisterCommand('onduty', function(source, args, rawCommand)
626 | if Config.LEOAccess == 3 or Config.FireAccess == 3 then
627 | if Config.OndutyPSWDActive then
628 | if args[2] == Config.OndutyPSWD then
629 | local Department = args[1]:lower()
630 | if Department == 'leo' then
631 | LEOOnduty = not LEOOnduty
632 | if LEOOnduty then
633 | Notify('~g~You are onduty as an LEO')
634 | else
635 | Notify('~o~You are no longer onduty as an LEO')
636 | end
637 | elseif Department == 'fire' then
638 | FireOnduty = not FireOnduty
639 | if FireOnduty == true then
640 | Notify('~g~You are onduty as an Firefighter')
641 | else
642 | Notify('~o~You are no longer onduty as an Firefighter')
643 | end
644 | else
645 | Notify('~r~Invalid Department!')
646 | end
647 | else
648 | Notify('~r~Incorrect Password')
649 | end
650 | else
651 | local Department = args[1]:lower()
652 | if Department == 'leo' then
653 | LEOOnduty = not LEOOnduty
654 | if LEOOnduty then
655 | Notify('~g~You are onduty as an LEO')
656 | else
657 | Notify('~o~You are no longer onduty as an LEO')
658 | end
659 | elseif Department == 'fire' then
660 | FireOnduty = not FireOnduty
661 | if FireOnduty == true then
662 | Notify('~g~You are onduty as an Firefighter')
663 | else
664 | Notify('~o~You are no longer onduty as an Firefighter')
665 | end
666 | else
667 | Notify('~r~Invalid Department!')
668 | end
669 | end
670 | end
671 | end)
672 |
673 | function IsOndutyLEO()
674 | return LEOOnduty
675 | end
676 | function IsOndutyFire()
677 | return FireOnduty
678 | end
679 |
680 | RegisterCommand('cuff', function(source, args, rawCommand)
681 | if LEORestrict() or FireRestrict() then
682 | if args[1] ~= nil then
683 | local ID = tonumber(args[1])
684 | if Config.CommandDistanceChecked then
685 | if GetDistance(source) < Config.CommandDistance then
686 | TriggerServerEvent('SEM_InteractionMenu:CuffNear', ID)
687 | else
688 | Notify('~r~That player is too far away')
689 | end
690 | else
691 | TriggerServerEvent('SEM_InteractionMenu:CuffNear', ID)
692 | end
693 | else
694 | TriggerServerEvent('SEM_InteractionMenu:CuffNear', GetClosestPlayer())
695 | end
696 | else
697 | Notify('~r~Insufficient Permissions')
698 | end
699 | end)
700 |
701 | RegisterCommand('drag', function(source, args, rawCommand)
702 | if LEORestrict() or FireRestrict() then
703 | if args[1] ~= nil then
704 | local ID = tonumber(args[1])
705 | if Config.CommandDistanceChecked then
706 | if GetDistance(source) < Config.CommandDistance then
707 | TriggerServerEvent('SEM_InteractionMenu:DragNear', ID)
708 | else
709 | Notify('~r~That player is too far away')
710 | end
711 | else
712 | TriggerServerEvent('SEM_InteractionMenu:DragNear', ID)
713 | end
714 | else
715 | TriggerServerEvent('SEM_InteractionMenu:DragNear', GetClosestPlayer())
716 | end
717 | else
718 | Notify('~r~Insufficient Permissions')
719 | end
720 | end)
721 |
722 | RegisterCommand('radar', function(source, args, rawCommand)
723 | if Config.Radar ~= 0 then
724 | if LEORestrict() or FireRestrict() then
725 | ToggleRadar()
726 | else
727 | Notify('~r~Insufficient Permissions')
728 | end
729 | end
730 | end)
731 |
732 | RegisterCommand('loadout', function(source, args, rawCommand)
733 | if LEORestrict() then
734 | if args[1] then
735 | local RequestedLoadout = args[1]
736 |
737 | for Name, Loadout in pairs(Config.LEOLoadouts) do
738 | if Name:lower() == RequestedLoadout:lower() then
739 | SetEntityHealth(GetPlayerPed(-1), 200)
740 | RemoveAllPedWeapons(GetPlayerPed(-1), true)
741 | AddArmourToPed(GetPlayerPed(-1), 100)
742 |
743 | for _, Weapon in pairs(Loadout) do
744 | GiveWeapon(Weapon.weapon)
745 |
746 | for _, Component in pairs(Weapon.components) do
747 | AddWeaponComponent(Weapon.weapon, Component)
748 | end
749 | end
750 | return
751 | end
752 | end
753 |
754 | Notify('~r~Invalid Loadout')
755 | else
756 | SetEntityHealth(PlayerPedId(), 200)
757 | RemoveAllPedWeapons(PlayerPedId(), true)
758 | AddArmourToPed(PlayerPedId(), 100)
759 | GiveWeapon('weapon_nightstick')
760 | GiveWeapon('weapon_flashlight')
761 | GiveWeapon('weapon_fireextinguisher')
762 | GiveWeapon('weapon_flare')
763 | GiveWeapon('weapon_stungun')
764 | GiveWeapon('weapon_combatpistol')
765 | AddWeaponComponent('weapon_combatpistol', 'component_at_pi_flsh')
766 | Notify('~g~Loadout Spawned')
767 | end
768 | else
769 | Notify('~r~You aren\'t an LEO')
770 | end
771 | end)
772 |
773 | RegisterCommand('hu', function(source, args, rawCommand)
774 | local Ped = PlayerPedId()
775 | if DoesEntityExist(Ped) and not HandCuffed then
776 | Citizen.CreateThread(function()
777 | LoadAnimation('random@mugging3')
778 | if IsEntityPlayingAnim(Ped, 'random@mugging3', 'handsup_standing_base', 3) or HandCuffed then
779 | ClearPedSecondaryTask(Ped)
780 | SetEnableHandcuffs(Ped, false)
781 | elseif not IsEntityPlayingAnim(Ped, 'random@mugging3', 'handsup_standing_base', 3) or not HandCuffed then
782 | TaskPlayAnim(Ped, 'random@mugging3', 'handsup_standing_base', 8.0, -8, -1, 49, 0, 0, 0, 0)
783 | SetEnableHandcuffs(Ped, true)
784 | end
785 | end)
786 | end
787 | end)
788 |
789 | RegisterCommand('huk', function(source, args, rawCommand)
790 | local Ped = PlayerPedId()
791 | if (DoesEntityExist(Ped) and not IsEntityDead(Ped)) and not HandCuffed then
792 | Citizen.CreateThread(function()
793 | LoadAnimation('random@arrests')
794 | if (IsEntityPlayingAnim(Ped, 'random@arrests', 'kneeling_arrest_idle', 3)) then
795 | TaskPlayAnim(Ped, 'random@arrests', 'kneeling_arrest_get_up', 8.0, 1.0, -1, 128, 0, 0, 0, 0)
796 | else
797 | TaskPlayAnim(Ped, 'random@arrests', 'idle_2_hands_up', 8.0, 1.0, -1, 2, 0, 0, 0, 0)
798 | Wait (4000)
799 | TaskPlayAnim(Ped, 'random@arrests', 'kneeling_arrest_idle', 8.0, 1.0, -1, 2, 0, 0, 0, 0)
800 | end
801 | end)
802 | end
803 | end)
804 |
805 | RegisterCommand('dropweapon', function(source, args, rawCommand)
806 | local CurrentWeapon = GetSelectedPedWeapon(PlayerPedId())
807 | SetPedDropsInventoryWeapon(PlayerPedId(), CurrentWeapon, -2.0, 0.0, 0.5, 30)
808 | Notify('~r~Weapon Dropped!')
809 | end)
810 |
811 | RegisterCommand('clear', function(source, args, rawCommand)
812 | SetEntityHealth(PlayerPedId(), 200)
813 | RemoveAllPedWeapons(PlayerPedId(), true)
814 | Notify('~r~All Weapons Cleared!')
815 | end)
816 |
817 | RegisterCommand('eng', function(source, args, rawCommand)
818 | local Veh = GetVehiclePedIsIn(PlayerPedId(), false)
819 | if Veh ~= nil and Veh ~= 0 and GetPedInVehicleSeat(Veh, 0) then
820 | SetVehicleEngineOn(Veh, (not GetIsVehicleEngineRunning(Veh)), false, true)
821 | Notify('~g~Engine Toggled!')
822 | end
823 | end)
824 |
825 | RegisterCommand('hood', function(source, args, rawCommand)
826 | local Veh = GetVehiclePedIsIn(PlayerPedId(), false)
827 |
828 | if Veh ~= nil and Veh ~= 0 and Veh ~= 1 then
829 | if GetVehicleDoorAngleRatio(Veh, 4) > 0 then
830 | SetVehicleDoorShut(Veh, 4, false)
831 | else
832 | SetVehicleDoorOpen(Veh, 4, false, false)
833 | end
834 | end
835 |
836 | Notify('~g~Hood Toggled!')
837 | end)
838 |
839 | RegisterCommand('trunk', function(source, args, rawCommand)
840 | local Veh = GetVehiclePedIsIn(PlayerPedId(), false)
841 |
842 | if Veh ~= nil and Veh ~= 0 and Veh ~= 1 then
843 | if GetVehicleDoorAngleRatio(Veh, 5) > 0 then
844 | SetVehicleDoorShut(Veh, 5, false)
845 | else
846 | SetVehicleDoorOpen(Veh, 5, false, false)
847 | end
848 | end
849 |
850 | Notify('~g~Trunk Toggled!')
851 | end)
852 |
853 | RegisterCommand('emotes', function(source, args, rawCommand)
854 | if EmoteRestrict() then
855 | local Index = 0
856 | local Emotes = ''
857 | for _, Emote in pairs(Config.EmotesList) do
858 | Index = Index + 1
859 | if Index == 1 then
860 | Emotes = Emotes .. Emote.name
861 | else
862 | Emotes = Emotes .. ', ' .. Emote.name
863 | end
864 | end
865 |
866 | TriggerEvent('chat:addMessage', {
867 | multiline = true,
868 | color = {255, 0 ,0},
869 | args = {'Emotes', '\n^r^7' .. Emotes},
870 | })
871 | end
872 | end)
873 |
874 | RegisterCommand('emote', function(source, args, rawCommand)
875 | if EmoteRestrict() then
876 | local SelectedEmote = args[1]
877 |
878 | for _, Emote in pairs(Config.EmotesList) do
879 | if Emote.name == SelectedEmote then
880 | PlayEmote(Emote.emote, Emote.name)
881 | return
882 | end
883 | end
884 |
885 | TriggerEvent('chat:addMessage', {
886 | multiline = true,
887 | color = {255, 0, 0},
888 | args = {'Emotes', 'Invalid Emote!'},
889 | })
890 | end
891 | end)
892 |
893 | RegisterCommand('coords', function(source, args, rawCommand)
894 | local Coords = GetEntityCoords(PlayerPedId())
895 | local Heading = GetEntityHeading(PlayerPedId())
896 |
897 | TriggerEvent('chatMessage', 'Coords', {255, 255, 0}, '\nX: ' .. Coords.x .. '\nY: ' .. Coords.y .. '\nZ: ' .. Coords.z .. '\nHeading: ' .. Heading)
898 | end)
899 |
--------------------------------------------------------------------------------
/config.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | ───────────────────────────────────────────────────────────────
3 |
4 | SEM_InteractionMenu (config.lua) - Created by Scott M
5 | Current Version: v1.7.1 (Sep 2021)
6 |
7 | Support: https://semdevelopment.com/discord
8 |
9 | ───────────────────────────────────────────────────────────────
10 | ]]
11 |
12 |
13 |
14 | Config = {}
15 |
16 |
17 |
18 | ---------------------------------------------------------------
19 | -- --
20 | -- Menu Features --
21 | -- --
22 | ---------------------------------------------------------------
23 |
24 | --This is how the version check will be displayed in the server console
25 | --Full = 0 [Default] | Simple = 1 | Disabled = 2
26 | Config.VersionChecker = 0
27 |
28 | --This is how you open the menu either via a command or button
29 | --Button = 0 [Default] | Command = 1
30 | Config.OpenMenu = 0
31 |
32 | --This is the button that will open the menu (If chosen at Config.OpenMenu)
33 | --Default = 244 [M] | To change the button check out https://docs.fivem.net/game-references/controls/
34 | --Controller Support for this resource is DISABLED!
35 | Config.MenuButton = 244
36 |
37 | --This is the command that will open the menu (If chosen at Config.OpenMenu)
38 | Config.Command = 'semmenu'
39 |
40 | --This is the width of the menu when open
41 | --Default = 80
42 | Config.MenuWidth = 80
43 |
44 | --This is the position of the menu when open
45 | --Left = 0 [Default] | Right = 1
46 | Config.MenuOrientation = 0
47 |
48 | --This is the title of the menu dispalyed
49 | --Default = The default title of the menu is 'Interaction Menu'
50 | --Player Name = This is the name of the player
51 | --Custom = This is a custom title set by you at Config.MenuTitleCustom
52 | --Default = 0 [Default] | Player Name = 1 | Custom = 2
53 | Config.MenuTitle = 0
54 |
55 | --This is the custom title you can set for the menu (If chosen at Config.MenuTitle)
56 | Config.MenuTitleCustom = 'Custom Menu Title'
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 | ---------------------------------------------------------------
75 | -- --
76 | -- General/Shared Features --
77 | -- --
78 | ---------------------------------------------------------------
79 |
80 | --This determines if the onduty password is active, if false the password will NOT be required when doing the command
81 | Config.OndutyPSWDActive = false
82 |
83 | --This is the onduty password, only people with the password can access the menu if chosen at Config.LEOAccess/Config.FireAccess
84 | Config.OndutyPSWD = 'OndutyPSWD'
85 |
86 | --This determines if the distance between the player using the command and the person being cuffed/dragged is checked
87 | Config.CommandDistanceChecked = true
88 |
89 | --This determines how close you need to be to cuff/drag someone using their ID
90 | --Default = 50
91 | Config.CommandDistance = 50
92 |
93 | --This determines if the stations section of the LEO & Fire menu will be visible
94 | --Station Locations can be set at Config.LEOStations & Config.FireStations
95 | Config.ShowStations = true
96 |
97 | --This determines if the stations menu will have a teleport section, if set to false ONLY the waypoint option will be visible
98 | Config.AllowStationTeleport = true
99 |
100 | --This determines if the stations set in the Config.LEOStations & Config.FireStations have blips on the map
101 | Config.DisplayStationBlips = true
102 |
103 | --This sets where the station blips will be displayed (Mini Map / Main Map)
104 | --On Mini Map & Main Map = 0 [Default] | Only on Main Map = 1 | Only on Mini Map = 2
105 | Config.StationBlipsDispalyed = 0
106 |
107 | --These are the props avaliable via the LEO & Fire menus
108 | Config.Props = {
109 | --[[
110 | EXAMPLE:
111 | {name = 'a', spawncode = 'b'},
112 | ────────────────────────────────────────────────────────────────
113 | 'a' is the title that shows in the menu
114 | 'b' is the spawn code for prop that will be spawned
115 | ]]
116 | {name = 'Police Barrier', spawncode = 'prop_barrier_work05'},
117 | {name = 'Barrier', spawncode = 'prop_barrier_work06a'},
118 | {name = 'Traffic Cone', spawncode = 'prop_roadcone01a'},
119 | {name = 'Cone', spawncode = 'prop_roadcone02b'},
120 | {name = 'Work Barrier', spawncode = 'prop_mp_barrier_02b'},
121 | {name = 'Work Barrier 2', spawncode = 'prop_barrier_work01a'},
122 | {name = 'Lighting', spawncode = 'prop_worklight_03b'},
123 | {name = 'Tent', spawncode = 'prop_gazebo_02'},
124 | }
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 | ---------------------------------------------------------------
143 | -- --
144 | -- LEO Features --
145 | -- --
146 | ---------------------------------------------------------------
147 |
148 | --This sets who can access the LEO menu
149 | --!!! NOTE: If LEO Peds is selected then onlys peds from the Config.LEOUniforms will have access to the menu
150 | --Disabled = 0 | Everyone = 1 [Default] | LEO Peds = 2 | Onduty Command = 3 | Ace Permissions = 4
151 | Config.LEOAccess = 1
152 |
153 | --This determines if the radar button will be displayed
154 | --NOTE: Wraith Radar is the ONLY radar script that works with the menu at the moment (This also includes any editied version) - Both his old and new radar are compatiable, link below
155 | --[[
156 | Links:
157 | WraithRS | Advanced Radar System: https://forum.cfx.re/t/release-wraithrs-advanced-radar-system-1-0-2/48543
158 | Ascaped Plate Reader Edit: https://forum.cfx.re/t/release-edit-wraithrs-new-plate-reader/147269
159 |
160 | Wraith ARS 2X Radar & Plate Reader: https://forum.cfx.re/t/release-wraith-ars-2x-police-radar-and-plate-reader-v1-2-4/1058277
161 |
162 | **Other modified version of these resoruce should work**
163 | ]]
164 | --Disabled = 0 [Default] | Wraith ARS 2x = 1 | WraithRS = 2
165 | Config.Radar = 0
166 |
167 | --This determines when someone if cuffed if they can enter or exit a vehicle
168 | Config.VehEnterCuffed = false
169 |
170 | --This determines if you need to unrack the carbine rifle of pumpshotun from a vehicle to obtain it
171 | --Disabled = 0 | Constant = 1 | Free-hand = 2 [Default]
172 | --Constant = Once unracked it is unable to be removed from hand until racked again in a vehicle
173 | --Free-hand = Once unracked it is able to be removed from hand
174 | Config.UnrackWeapons = 2
175 |
176 | --This sets if the Jail functions will be visible in the menu
177 | Config.LEOJail = true
178 |
179 | --This is the max time that someone can be jailed for (Seconds)
180 | Config.MaxJailTime = 300
181 |
182 | --These is the location of the jail and release point
183 | Config.JailLocation = {
184 | Jail = {x = 1675.28, y = 2648.55, z = 45.56, h = 49.50},
185 | Release = {x = 1851.24, y = 2585.77, z = 45.67, h = 271.44},
186 | }
187 |
188 | --This determines if the backup section of the LEO menu will be visible
189 | Config.DisplayBackup = true
190 |
191 | --This sets the time between the blip being created and removed (Minutes)
192 | --Default = 5
193 | Config.BackupBlipTimeout = 5
194 |
195 | --This determines if the LEO props menu will be available
196 | Config.DisplayProps = true
197 |
198 | --These are the station available via the station menu
199 | Config.LEOStations = {
200 | {name = 'Sandy Shores', coords = {x = 1850.04, y = 3679.36, z = 34.26 , h = 208.84}},
201 | {name = 'Paleto Bay', coords = {x = -438.51, y = 6017.93, z = 31.49 , h = 352.90}},
202 |
203 | {name = 'Mission Row', coords = {x = 432.08, y = -985.25, z = 30.71 , h = 44.02}},
204 | {name = 'Davis', coords = {x = 373.99, y = -1607.59, z = 29.29 , h = 192.15}},
205 | {name = 'Vinewood', coords = {x = 638.03, y = -1.85, z = 82.78 , h = 290.18}},
206 | {name = 'Vespucci', coords = {x = -1090.87, y = -807.29, z = 19.26 , h = 64.92}},
207 |
208 | {name = 'NOOSE Headquarters', coords = {x = 2504.29, y = -384.11, z = 94.12, h = 264.01}},
209 | }
210 |
211 | --This determines if the LEO Unfiroms section will be visible
212 | Config.DisplayLEOUniforms = true
213 |
214 | --These are the LEO uniforms that are available via the loadouts - these will also be the uniforms which will give access to the LEO menu if that option if chosen at Config.LEOAccess
215 | Config.LEOUniforms = {
216 | --[[
217 | EXAMPLE:
218 | {name = 'a', spawncode = 'b'},
219 | ────────────────────────────────────────────────────────────────
220 | 'a' is the title that shows in the menu
221 | 'b' is the spawn code for uniform that will be spawned
222 | ]]
223 | {name = 'LSPD', spawncode = 's_m_y_cop_01'},
224 | {name = 'BCSO', spawncode = 's_m_y_sheriff_01'},
225 | {name = 'SAHP', spawncode = 's_m_y_hwaycop_01'},
226 | {name = 'SWAT', spawncode = 's_m_y_swat_01'},
227 | {name = 'Undercover', spawncode = 's_m_m_ciasec_01'},
228 | }
229 |
230 | --This determines if the LEO Loadouts section will be visible
231 | Config.DisplayLEOLoadouts = true
232 |
233 | --These are the weapon loadouts available via the loadouts
234 | Config.LEOLoadouts = {
235 | --[[
236 | EXAMPLE:
237 | a = {
238 | {weapon = 'b', components = 'c', 'c'},
239 | },
240 | ────────────────────────────────────────────────────────────────
241 | 'a' is the title of the Loadout
242 | 'b' is the weapon which you want to be added [A link to weapon names can be found below]
243 | 'c' is the components which you want to be added to the weapon [A link to available weapon components can be found below]
244 |
245 | Weapon Names https://forum.fivem.net/t/list-of-weapon-spawn-names-after-hours/90750
246 | Weapon Components https://wiki.rage.mp/index.php?title=Weapons_Components
247 | ]]
248 | ['Standard'] = {
249 | {weapon = 'weapon_flashlight', components = {''}},
250 | {weapon = 'weapon_combatpistol', components = {'component_at_pi_flsh'}},
251 | {weapon = 'weapon_stungun', components = {''}},
252 | {weapon = 'weapon_carbinerifle', components = {'component_at_ar_flsh', 'component_at_scope_medium', 'component_at_ar_afgrip'}},
253 | {weapon = 'weapon_pumpshotgun', components = {'component_at_ar_flsh'}},
254 | {weapon = 'weapon_fireextinguisher', components = {''}},
255 | {weapon = 'weapon_flare', components = {''}},
256 | },
257 |
258 | ['SWAT'] = {
259 | {weapon = 'weapon_flashlight', components = {''}},
260 | {weapon = 'weapon_combatpistol', components = {'component_at_pi_flsh'}},
261 | {weapon = 'weapon_stungun', components = {''}},
262 | {weapon = 'weapon_smg', components = {'component_at_ar_flsh', 'component_ar_scope_macro_02'}},
263 | {weapon = 'weapon_carbinerifle', components = {'component_at_ar_flsh', 'component_at_scope_medium', 'component_at_ar_afgrip'}},
264 | {weapon = 'weapon_pumpshotgun', components = {'component_at_ar_flsh'}},
265 | {weapon = 'weapon_sniperrifle', components = {'comonent_at_scope_max'}},
266 | {weapon = 'weapon_bzgas', components = {''}},
267 | {weapon = 'weapon_fireextinguisher', components = {''}},
268 | {weapon = 'weapon_flare', components = {''}},
269 | }
270 | }
271 |
272 | --This determines if the LEO vehicles section if available
273 | Config.ShowLEOVehicles = true
274 |
275 | --This determines if the vehicle spawn codes are displayed next to the name
276 | Config.ShowLEOSpawnCode = true
277 |
278 | --These are the LEO vehicles which are avaiable via the menu
279 | Config.LEOVehiclesCategories = {
280 | --[[
281 | EXAMPLE:
282 | ['a'] = {
283 | {name = 'b', spawncode = 'c', livery = d, extras = {e, e}},
284 | }
285 | ────────────────────────────────────────────────────────────────
286 | 'a' is the title of the Category
287 | 'b' is the title of the vehicle that shows in the menu
288 | 'c' is the spawn code for vehicle that will be spawned
289 | d is the number of the livery which you want it to spawn with
290 | e is the number(s) of extra(s) which you want it to spawn with
291 |
292 | **NOTE: Sometimes the sections do NOT display if the order in the config below**
293 | ]]
294 |
295 | ['Police'] = {
296 | {name = 'Police', spawncode = 'police'},
297 | {name = 'Police', spawncode = 'police2'},
298 | {name = 'Police', spawncode = 'police3'},
299 | },
300 |
301 | ['Sheriff'] = {
302 | {name = 'Sheriff', spawncode = 'sheriff'},
303 | {name = 'Sheriff', spawncode = 'sheriff2'},
304 | },
305 |
306 | ['Unmarked'] = {
307 | {name = 'Unmarked', spawncode = 'police4'},
308 | },
309 | }
310 |
311 | --This determines if the ai traffic manager will can accessible
312 | Config.DisplayTrafficManager = true
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 | ---------------------------------------------------------------
331 | -- --
332 | -- Fire Features --
333 | -- --
334 | ---------------------------------------------------------------
335 |
336 | --This sets who can access the Fire menu
337 | --!!! NOTE: If Fire Peds is selected then onlys peds from the Config.FireUniforms will have access to the menu
338 | --Disabled = 0 | Everyone = 1 [Default] | Fire Peds = 2 | Onduty Command = 3 | Ace Permissions = 4
339 | Config.FireAccess = 1
340 |
341 | --This sets if the Hospitalize functions will be visible in the menu
342 | Config.FireHospital = true
343 |
344 | --This is the max time that someone can be hospitalized for (Seconds)
345 | Config.MaxHospitalTime = 300
346 |
347 | --These is the location of the hospital and release point
348 | --I would recommend using a MLO Interior/Ymap for the hospital
349 | Config.HospitalLocation = {
350 | ['Pillbox Hill'] = {
351 | Hospital = {x = 358.34, y = -589.98, z = 28.79, h = 257.19},
352 | Release = {x = 372.78, y = -595.04, z = 28.84, h = 248.29},
353 | },
354 | ['Paleto Bay'] = {
355 | Hospital = {x = -247.34, y = 6332.39, z = 32.42 , h = 226.90},
356 | Release = {x = -247.34, y = 6332.39, z = 32.42 , h = 226.90},
357 | }
358 | }
359 |
360 | --These are the station available via the station menu
361 | Config.FireStations = {
362 | {name = 'Sandy Shores', coords = {x = 1693.57, y = 3582.68, z = 35.62 , h = 227.29}},
363 | {name = 'Paleto Bay', coords = {x = -382.50, y = 6116.76, z = 31.47 , h = 7.29}},
364 |
365 | {name = 'Davis', coords = {x = 201.16, y = -1631.67, z = 29.75, h = 296.67}},
366 | {name = 'Rockford Hill', coords = {x = -636.47, y = -117.02, z = 38.02, h = 79.64}},
367 | {name = 'El Burro Heights', coords = {x = 1191.83, y = -1461.74, z = 34.88, h = 329.54}},
368 | }
369 |
370 | --These are the locations of hospitals avaiable via the hospital menu
371 | Config.HospitalStations = {
372 | {name = 'Sandy Shores', coords = {x = 1839.13, y = 3673.26, z = 34.27 , h = 210.83}},
373 | {name = 'Paleto Bay', coords = {x = -247.34, y = 6332.39, z = 32.42 , h = 226.90}},
374 |
375 | {name = 'Pillbox', coords = {x = 357.19, y = -593.46, z = 28.78, h = 260.70}},
376 | {name = 'Davis', coords = {x = 294.59, y = -1448.17, z = 29.96, h = 320.92}},
377 | }
378 |
379 | --This determines if the LEO Unfiroms section will be visible
380 | Config.DisplayFireUniforms = true
381 |
382 | --These are the Fire uniforms that are available via the loadouts - these will also be the uniforms which will give access to the Fire menu if that option if chosen at Config.FireAccess
383 | Config.FireUniforms = {
384 | --[[
385 | EXAMPLE:
386 | {name = 'a', spawncode = 'b'},
387 | ────────────────────────────────────────────────────────────────
388 | 'a' is the title that shows in the menu
389 | 'b' is the spawn code for uniform that will be spawned
390 | ]]
391 | {name = 'Firefighter', spawncode = 's_m_y_fireman_01'},
392 | {name = 'Paramedic', spawncode = 's_m_m_paramedic_01'},
393 | }
394 |
395 | --This determines if the LEO Loadouts section will be visible
396 | Config.DisplayFireLoadouts = true
397 |
398 | --This determines if the Fire vehicles section if available
399 | Config.ShowFireVehicles = true
400 |
401 | --This determines if the vehicle spawn codes are displayed next to the name
402 | Config.ShowFireSpawnCode = true
403 |
404 | --These are the Fire vehicles which are avaiable via the menu
405 | Config.FireVehicles = {
406 | --[[
407 | EXAMPLE:
408 | {name = 'a', spawncode = 'b', livery = c, extras = {d, d}},
409 | ────────────────────────────────────────────────────────────────
410 | 'a' is the title of the vehicle that shows in the menu
411 | 'b' is the spawn code for vehicle that will be spawned
412 | 'c' is the number of the livery which you want it to spawn with
413 | 'd' is the number(s) of extra(s) which you want it to spawn with
414 |
415 | **NOTE: Sometimes the sections do NOT display if the order in the config below**
416 | ]]
417 |
418 | --These are the Vehicles that will show in the Category and there spawn codes
419 | {name = 'Fire Engine', spawncode = 'firetruk'},
420 | {name = 'Ambulance', spawncode = 'ambulance'},
421 | }
422 |
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 | ---------------------------------------------------------------
440 | -- --
441 | -- Civilian Features --
442 | -- --
443 | ---------------------------------------------------------------
444 |
445 | --This sets who can access the Civlian menu
446 | --!!! NOTE: If Fire Peds is selected then onlys peds from the Config.FireUniforms will have access to the menu
447 | --Disabled = 0 | Everyone = 1 [Default]
448 | Config.CivAccess = 1
449 |
450 | --This determines if the Civilian vehicles section if available
451 | Config.ShowCivVehicles = true
452 |
453 | --This determines if the vehicle spawn codes are displayed next to the name
454 | Config.ShowCivSpawnCode = true
455 |
456 | --These are the Civilian vehicles which are avaiable via the menu
457 | Config.CivVehicles = {
458 | --[[
459 | EXAMPLE:
460 | {name = 'a', spawncode = 'b'},
461 | ────────────────────────────────────────────────────────────────
462 | 'a' is the title of the vehicle that shows in the menu
463 | 'b' is the spawn code for vehicle that will be spawned
464 | ]]
465 |
466 | --These are the Vehicles that will show in the Category and there spawn codes
467 | {name = 'Adder', spawncode = 'adder'},
468 | {name = 'Baller', spawncode = 'baller'},
469 | }
470 |
471 | --This determines if the civilian adverts sections of the menu if visible
472 | --NOTE: When someone sends an advert it will display the company name and then "Advertisement ##", this is the Server ID of the person that sent the advert
473 | Config.ShowCivAdverts = true
474 |
475 | --These are the adverts that are avaiable via the ads menu
476 | --NOTE: You can add additional adverts from https://wiki.gtanet.work/index.php?title=Notification_Pictures
477 | Config.CivAdverts = {
478 | --[[
479 | EXAMPLE:
480 | {name = 'a', loc = 'b', file = 'c'},
481 | ────────────────────────────────────────────────────────────────
482 | 'a' is the title of the Adverts
483 | 'b' is the location for the Advert's Image
484 | 'c' is the file name for the Advert's Image
485 | ]]
486 |
487 |
488 |
489 | -- !!!!! Wouldn't Recommend Changing These Unless You Know What You're Doing !!!!!
490 | -- !!!!! Wouldn't Recommend Changing These Unless You Know What You're Doing !!!!!
491 | -- !!!!! Wouldn't Recommend Changing These Unless You Know What You're Doing !!!!!
492 |
493 | {name = '24/7', loc = 'CHAR_FLOYD', file = '247'},
494 | {name = 'Ammunation', loc = 'CHAR_AMMUNATION', file = 'CHAR_AMMUNATION'},
495 | {name = 'Bugstars', loc = 'CHAR_BUGSTARS', file = 'CHAR_BUGSTARS'},
496 | {name = 'Cluckin\' Bell', loc = 'CHAR_FLOYD', file = 'BELL'},
497 | {name = 'Downtown Cab Co.', loc = 'CHAR_TAXI', file = 'CHAR_TAXI'},
498 | {name = 'Dynasty 8', loc = 'CHAR_FLOYD', file = 'D8'},
499 | {name = 'Fleeca Bank', loc = 'CHAR_BANK_FLEECA', file = 'CHAR_BANK_FLEECA'},
500 | {name = 'Gruppe6', loc = 'CHAR_FLOYD', file = 'GRUPPE6'},
501 | {name = 'Merry Weather', loc = 'CHAR_MP_MERRYWEATHER', file = 'CHAR_MP_MERRYWEATHER'},
502 | {name = 'Limited Gasoline', loc = 'CHAR_FLOYD', file = 'LTD'},
503 | {name = 'Liquor Ace', loc = 'CHAR_FLOYD', file = 'ACE'},
504 | {name = 'Smoke on the Water', loc = 'CHAR_FLOYD', file = 'SOTW'},
505 | {name = 'Pegasus', loc = 'CHAR_PEGASUS_DELIVERY', file = 'CHAR_PEGASUS_DELIVERY'},
506 | {name = 'Los Santos Customs', loc = 'CHAR_LS_CUSTOMS', file = 'CHAR_LS_CUSTOMS'},
507 | {name = 'Los Santos Traffic Info', loc = 'CHAR_LS_TOURIST_BOARD', file = 'CHAR_LS_TOURIST_BOARD'},
508 | {name = 'Los Santos Water and Power', loc = 'CHAR_FLOYD', file = 'LSWP'},
509 | {name = 'Mors Mutual Insurance', loc = 'CHAR_MP_MORS_MUTUAL', file = 'CHAR_MP_MORS_MUTUAL'},
510 | {name = 'PostOP', loc = 'CHAR_FLOYD', file = 'OP'},
511 | {name = 'Vanilla Unicorn', loc = 'CHAR_MP_STRIPCLUB_PR', file = 'CHAR_MP_STRIPCLUB_PR'},
512 | {name = 'Weazel News', loc = 'CHAR_FLOYD', file = 'NEWS'},
513 | {name = 'Facebook', loc = 'CHAR_FACEBOOK', file = 'CHAR_FACEBOOK'},
514 | {name = 'Life Invader', loc = 'CHAR_LIFEINVADER', file = 'CHAR_LIFEINVADER'},
515 | {name = 'YouTube', loc = 'CHAR_YOUTUBE', file = 'CHAR_YOUTUBE'},
516 | }
517 |
518 |
519 |
520 |
521 |
522 |
523 |
524 |
525 |
526 |
527 |
528 |
529 |
530 |
531 |
532 |
533 |
534 | ---------------------------------------------------------------
535 | -- --
536 | -- Vehicle Features --
537 | -- --
538 | ---------------------------------------------------------------
539 |
540 | --This sets when players can access the vehicle menu
541 | --Disabled = 0 | All the Time = 1 [Default] | When in Vehicle = 2
542 | Config.VehicleAccess = 1
543 |
544 | --This determines if the vehicle options are avaiable, these include: Fix, Clean, Delete
545 | Config.VehicleOptions = true
546 |
547 |
548 |
549 |
550 |
551 |
552 |
553 |
554 |
555 |
556 |
557 |
558 |
559 |
560 |
561 |
562 |
563 | ---------------------------------------------------------------
564 | -- --
565 | -- Emote Features --
566 | -- --
567 | ---------------------------------------------------------------
568 |
569 | --This sets which players can access the emote menu
570 | --Disabled = 0 | Everyone = 1 [Default]
571 | Config.EmoteAccess = 1
572 |
573 | --This sets if a help message is displayed when playing an emote
574 | Config.EmoteHelp = true
575 |
576 | --These are the emotes avaiable via the menu and the '/emotes' & '/emote [Emote]' commands
577 | Config.EmotesList = {
578 | {name = 'binoculars', emote = 'WORLD_HUMAN_BINOCULARS'},
579 | {name = 'camera', emote = 'WORLD_HUMAN_PAPARAZZI'},
580 | {name = 'clean', emote = 'WORLD_HUMAN_MAID_CLEAN'},
581 | {name = 'clipboard', emote = 'WORLD_HUMAN_CLIPBOARD'},
582 | {name = 'coffee', emote = 'WORLD_HUMAN_AA_COFFEE'},
583 | {name = 'cheer', emote = 'WORLD_HUMAN_CHEERING'},
584 | {name = 'cop', emote = 'WORLD_HUMAN_COP_IDLES'},
585 | {name = 'film', emote = 'WORLD_HUMAN_MOBILE_FILM_SHOCKING'},
586 | {name = 'fish', emote = 'WORLD_HUMAN_STAND_FISHING'},
587 | {name = 'flex', emote = 'WORLD_HUMAN_MUSCLE_FLEX'},
588 | {name = 'guard', emote = 'WORLD_HUMAN_GUARD_STAND'},
589 | {name = 'hammer', emote = 'WORLD_HUMAN_HAMMERING'},
590 | {name = 'homeless', emote = 'WORLD_HUMAN_BUM_FREEWAY'},
591 | {name = 'impatient', emote = 'WORLD_HUMAN_STAND_IMPATIENT'},
592 | {name = 'jog', emote = 'WORLD_HUMAN_JOG_STANDING'},
593 | {name = 'kneel', emote = 'CODE_HUMAN_MEDIC_KNEEL'},
594 | {name = 'lean', emote = 'WORLD_HUMAN_LEANING'},
595 | {name = 'mechanic', emote = 'WORLD_HUMAN_VEHICLE_MECHANIC'},
596 | {name = 'medic', emote = 'CODE_HUMAN_MEDIC_TEND_TO_DEAD'},
597 | {name = 'music', emote = 'WORLD_HUMAN_MUSICIAN'},
598 | {name = 'notepad', emote = 'CODE_HUMAN_MEDIC_TIME_OF_DEATH'},
599 | {name = 'party', emote = 'WORLD_HUMAN_PARTYING'},
600 | {name = 'phone', emote = 'WORLD_HUMAN_STAND_MOBILE'},
601 | {name = 'phonecall', emote = 'WORLD_HUMAN_STAND_MOBILE_UPRIGHT'},
602 | {name = 'selfie', emote = 'WORLD_HUMAN_TOURIST_MOBILE'},
603 | {name = 'sit', emote = 'WORLD_HUMAN_PICNIC'},
604 | {name = 'sleep', emote = 'WORLD_HUMAN_BUM_SLUMPED'},
605 | {name = 'smoke', emote = 'WORLD_HUMAN_SMOKING'},
606 | {name = 'statue', emote = 'WORLD_HUMAN_HUMAN_STATUE'},
607 | {name = 'stupor', emote = 'WORLD_HUMAN_STUPOR'},
608 | {name = 'sunbathe', emote = 'WORLD_HUMAN_SUNBATHE'},
609 | {name = 'sunbathe2', emote = 'WORLD_HUMAN_SUNBATHE_BACK'},
610 | {name = 'traffic', emote = 'WORLD_HUMAN_CAR_PARK_ATTENDANT'},
611 | {name = 'weed', emote = 'WORLD_HUMAN_SMOKING_POT'},
612 | {name = 'weights', emote = 'WORLD_HUMAN_MUSCLE_FREE_WEIGHTS'},
613 | {name = 'weld', emote = 'WORLD_HUMAN_WELDING'},
614 | {name = 'yoga', emote = 'WORLD_HUMAN_YOGA'},
615 | }
616 |
--------------------------------------------------------------------------------
/functions.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | ─────────────────────────────────────────────────────────────────
3 |
4 | SEM_InteractionMenu (functions.lua) - Created by Scott M
5 | Current Version: v1.7.1 (Sep 2021)
6 |
7 | Support: https://semdevelopment.com/discord
8 |
9 | !!! Change vaules in the 'config.lua' !!!
10 | DO NOT EDIT THIS IF YOU DON'T KNOW WHAT YOU ARE DOING
11 |
12 | ─────────────────────────────────────────────────────────────────
13 | ]]
14 |
15 |
16 |
17 | --General Functions
18 | function Notify(Text)
19 | SetNotificationTextEntry('STRING')
20 | AddTextComponentString(Text)
21 | DrawNotification(true, true)
22 | end
23 |
24 | function NotifyHelp(Text)
25 | SetTextComponentFormat('STRING')
26 | AddTextComponentString(Text)
27 | DisplayHelpTextFromStringLabel(0, 0, 1, -1)
28 | end
29 |
30 | function LoadAnimation(Dict)
31 | while not HasAnimDictLoaded(Dict) do
32 | RequestAnimDict(Dict)
33 | Citizen.Wait(5)
34 | end
35 | end
36 |
37 | function KeyboardInput(TextEntry, MaxStringLenght)
38 | AddTextEntry('FMMC_KEY_TIP1', TextEntry)
39 | DisplayOnscreenKeyboard(1, 'FMMC_KEY_TIP1', '', '', '', '', '', MaxStringLenght)
40 | BlockInput = true
41 |
42 | while UpdateOnscreenKeyboard() ~= 1 and UpdateOnscreenKeyboard() ~= 2 do
43 | Citizen.Wait(0)
44 | end
45 |
46 | if UpdateOnscreenKeyboard() ~= 2 then
47 | local Result = GetOnscreenKeyboardResult()
48 | Citizen.Wait(500)
49 | BlockInput = false
50 | return Result
51 | else
52 | Citizen.Wait(500)
53 | BlockInput = false
54 | return nil
55 | end
56 | end
57 |
58 | function GetClosestPlayer()
59 | local Ped = PlayerPedId()
60 |
61 | for _, Player in ipairs(GetActivePlayers()) do
62 | if GetPlayerPed(Player) ~= GetPlayerPed(-1) then
63 | local Ped2 = GetPlayerPed(Player)
64 | local x, y, z = table.unpack(GetEntityCoords(Ped))
65 | if (GetDistanceBetweenCoords(GetEntityCoords(Ped2), x, y, z) < 2) then
66 | return GetPlayerServerId(Player)
67 | end
68 | end
69 | end
70 |
71 | Notify('~r~No Player Nearby!')
72 | return false
73 | end
74 |
75 | function GetDistance(ID)
76 | local Ped = GetPlayerPed(-1)
77 | local Ped2 = GetPlayerPed(ID)
78 | local x, y, z = table.unpack(GetEntityCoords(Ped))
79 | return GetDistanceBetweenCoords(GetEntityCoords(Ped2), x, y, z)
80 | end
81 |
82 | --LEO Functions
83 | function ToggleRadar()
84 | if Config.Radar ~= 0 then
85 | if IsPedInAnyVehicle(GetPlayerPed(-1)) then
86 | if GetVehicleClass(GetVehiclePedIsIn(GetPlayerPed(-1))) == 18 then
87 | if GetPedInVehicleSeat(GetVehiclePedIsIn(GetPlayerPed(-1)) == -1) then
88 | _MenuPool:CloseAllMenus()
89 | if Config.Radar == 1 then
90 | TriggerEvent('wk:openRemote')
91 | elseif Config.Radar == 2 then
92 | TriggerEvent('wk:radarRC')
93 | end
94 | else
95 | Notify('~o~You need to be in the driver seat')
96 | end
97 | else
98 | Notify('~o~You need to be in a police vehicle')
99 | end
100 | else
101 | Notify('~o~You need to be in a vehicle')
102 | end
103 | end
104 | end
105 |
106 | function EnableShield()
107 | ShieldActive = true
108 | local Ped = GetPlayerPed(-1)
109 | local PedPos = GetEntityCoords(Ped, false)
110 |
111 | if IsPedInAnyVehicle(GetPlayerPed(-1), true) then
112 | Notify('~r~You cannot be in a vehicle when getting your shield out!')
113 | ShieldActive = false
114 | return
115 | end
116 |
117 | RequestAnimDict('combat@gestures@gang@pistol_1h@beckon')
118 | while not HasAnimDictLoaded('combat@gestures@gang@pistol_1h@beckon') do
119 | Citizen.Wait(100)
120 | end
121 |
122 | TaskPlayAnim(Ped, 'combat@gestures@gang@pistol_1h@beckon', '0', 8.0, -8.0, -1, (2 + 16 + 32), 0.0, 0, 0, 0)
123 |
124 | RequestModel(GetHashKey('prop_ballistic_shield'))
125 | while not HasModelLoaded(GetHashKey('prop_ballistic_shield')) do
126 | Citizen.Wait(100)
127 | end
128 |
129 | local shield = CreateObject(GetHashKey('prop_ballistic_shield'), PedPos.x, PedPos.y, PedPos.z, 1, 1, 1)
130 | shieldEntity = shield
131 | AttachEntityToEntity(shieldEntity, Ped, GetEntityBoneIndexByName(Ped, 'IK_L_Hand'), 0.0, -0.05, -0.10, -30.0, 180.0, 40.0, 0, 0, 1, 0, 0, 1)
132 | SetWeaponAnimationOverride(Ped, 'Gang1H')
133 |
134 | if HasPedGotWeapon(Ped, 'weapon_combatpistol', 0) or GetSelectedPedWeapon(Ped) == 'weapon_combatpistol' then
135 | SetCurrentPedWeapon(Ped, 'weapon_combatpistol', 1)
136 | HadPistol = true
137 | else
138 | GiveWeaponToPed(Ped, 'weapon_combatpistol', 300, 0, 1)
139 | SetCurrentPedWeapon(Ped, 'weapon_combatpistol', 1)
140 | HadPistol = false
141 | end
142 | SetEnableHandcuffs(Ped, true)
143 | end
144 |
145 | Citizen.CreateThread(function()
146 | while true do
147 | Citizen.Wait(1)
148 |
149 | if ShieldActive == true then
150 | DisableControlAction(1, 23, true) --F | Enter Vehicle
151 | DisableControlAction(1, 75, true) --F | Exit Vehicle
152 | end
153 | end
154 | end)
155 |
156 | function DisableShield()
157 | local Ped = GetPlayerPed(-1)
158 | DeleteEntity(shieldEntity)
159 | ClearPedTasksImmediately(Ped)
160 | SetWeaponAnimationOverride(Ped, 'Default')
161 | SetCurrentPedWeapon(Ped, 'weapon_unarmed', 1)
162 |
163 | if not HadPistol then
164 | RemoveWeaponFromPed(Ped, 'weapon_combatpistol')
165 | end
166 | SetEnableHandcuffs(Ped, false)
167 | HadPistol = false
168 | ShieldActive = false
169 | end
170 |
171 |
172 |
173 | --Civ Functions
174 | function Ad(Text, Name, Loc, File, ID)
175 | SetNotificationTextEntry('STRING')
176 | AddTextComponentString(Text)
177 | EndTextCommandThefeedPostMessagetext(Loc, File, true, 1, Name, '~b~Advertisement #' .. ID)
178 | DrawNotification(false, true)
179 | end
180 |
181 |
182 |
183 | --Vehicle Functions
184 | function SpawnVehicle(Veh, Name, Livery, Extras)
185 | local Ped = GetPlayerPed( -1 )
186 | if (DoesEntityExist(Ped) and not IsEntityDead(Ped)) then
187 | local pos = GetEntityCoords(Ped)
188 | if (IsPedSittingInAnyVehicle(Ped)) then
189 | local Vehicle = GetVehiclePedIsIn(Ped, false)
190 | if (GetPedInVehicleSeat(Vehicle, -1) == Ped) then
191 | SetEntityAsMissionEntity(Vehicle, true, true )
192 | DeleteVehicle(Vehicle)
193 | end
194 | end
195 | end
196 |
197 | local WaitTime = 0
198 | local Model = GetHashKey(Veh)
199 | RequestModel(Model)
200 | while not HasModelLoaded(Model) do
201 | CancelEvent()
202 | RequestModel(Model)
203 | Citizen.Wait(100)
204 |
205 | WaitTime = WaitTime + 1
206 |
207 | if WaitTime == 600 then
208 | CancelEvent()
209 | Notify('~r~Unable to load vehicle, please contact development!')
210 | return
211 | end
212 | end
213 | local x, y, z = table.unpack(GetEntityCoords(PlayerPedId(), false))
214 | local Vehicle = CreateVehicle(Model, x + 2, y + 2, z + 1, GetEntityHeading(PlayerPedId()), true, false)
215 | SetPedIntoVehicle(PlayerPedId(), Vehicle, -1)
216 | SetVehicleDirtLevel(Vehicle, 0)
217 | SetVehicleModKit(Vehicle, 0)
218 | SetVehicleMod(Vehicle, 23, -1, false)
219 | SetModelAsNoLongerNeeded(Model)
220 | if Livery then
221 | SetVehicleLivery(Vehicle, Livery)
222 | end
223 | if Extras then
224 | for extraId = 0, 30 do
225 | if DoesExtraExist(Vehicle, extraId) then
226 | SetVehicleExtra(Vehicle, extraId, true)
227 | end
228 | end
229 | for _, extra in pairs(Extras) do
230 | SetVehicleExtra(Vehicle, extra, false)
231 | end
232 | end
233 |
234 | if Name then
235 | Notify('~b~Vehicle Spawned: ~g~' .. Name)
236 | else
237 | Notify('~b~Vehicle Spawned!')
238 | end
239 | end
240 |
241 | function DeleteVehicle(entity)
242 | Citizen.InvokeNative( 0xEA386986E786A54F, Citizen.PointerValueIntInitialized(entity))
243 | end
244 |
245 |
246 |
247 | --Ped Functions
248 | function LoadPed(Hash)
249 | Citizen.CreateThread(function()
250 | local Model = GetHashKey(Hash)
251 | RequestModel(Model)
252 |
253 | while not HasModelLoaded(Model) do
254 | Wait(0)
255 | end
256 |
257 | if HasModelLoaded(Model) then
258 | SetPlayerModel(PlayerId(), Model)
259 | else
260 | Notify('The model could not load - please contact development.')
261 | end
262 | end)
263 | end
264 |
265 |
266 |
267 | --Weapon Functions
268 | function GiveWeapon(Hash)
269 | GiveWeaponToPed(GetPlayerPed(-1), GetHashKey(Hash), 999, false)
270 | end
271 |
272 | function AddWeaponComponent(WeaponHash, Component)
273 | if HasPedGotWeapon(GetPlayerPed(-1), GetHashKey(WeaponHash), false) then
274 | GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey(WeaponHash), GetHashKey(Component))
275 | end
276 | end
277 |
278 |
279 |
280 | --Prop Functions
281 | function SpawnProp(Object, Name)
282 | local Player = PlayerPedId()
283 | local Coords = GetEntityCoords(Player)
284 | local Heading = GetEntityHeading(Player)
285 |
286 | RequestModel(Object)
287 | while not HasModelLoaded(Object) do
288 | Citizen.Wait(0)
289 | end
290 |
291 | local OffsetCoords = GetOffsetFromEntityInWorldCoords(Player, 0.0, 0.75, 0.0)
292 | local Prop = CreateObjectNoOffset(Object, OffsetCoords, false, true, false)
293 | SetEntityHeading(Prop, Heading)
294 | PlaceObjectOnGroundProperly(Prop)
295 | SetEntityCollision(Prop, false, true)
296 | SetEntityAlpha(Prop, 100)
297 | FreezeEntityPosition(Prop, true)
298 | SetModelAsNoLongerNeeded(Object)
299 |
300 | Notify('Press ~g~E ~w~to place\nPress ~r~R ~w~to cancel')
301 |
302 | Citizen.CreateThread(function()
303 | while true do
304 | Citizen.Wait(0)
305 |
306 | local OffsetCoords = GetOffsetFromEntityInWorldCoords(Player, 0.0, 0.75, 0.0)
307 | local Heading = GetEntityHeading(Player)
308 |
309 | SetEntityCoordsNoOffset(Prop, OffsetCoords)
310 | SetEntityHeading(Prop, Heading)
311 | PlaceObjectOnGroundProperly(Prop)
312 | DisableControlAction(1, 38, true) --E
313 | DisableControlAction(1, 140, true) --R
314 |
315 |
316 | if IsDisabledControlJustPressed(1, 38) then --E
317 | local PropCoords = GetEntityCoords(Prop)
318 | local PropHeading = GetEntityHeading(Prop)
319 | DeleteObject(Prop)
320 |
321 | RequestModel(Object)
322 | while not HasModelLoaded(Object) do
323 | Citizen.Wait(0)
324 | end
325 |
326 | local Prop = CreateObjectNoOffset(Object, PropCoords, true, true, true)
327 | SetEntityHeading(Prop, PropHeading)
328 | PlaceObjectOnGroundProperly(Prop)
329 | FreezeEntityPosition(Prop, true)
330 | SetEntityInvincible(Prop, true)
331 | SetModelAsNoLongerNeeded(Object)
332 | return
333 | end
334 |
335 | if IsDisabledControlJustPressed(1, 140) then --R
336 | DeleteObject(Prop)
337 | return
338 | end
339 | end
340 | end)
341 | end
342 |
343 | function DeleteProp(Object)
344 | local Hash = GetHashKey(Object)
345 | local x, y, z = table.unpack(GetEntityCoords(PlayerPedId(), true))
346 | if DoesObjectOfTypeExistAtCoords(x, y, z, 1.5, Hash, true) then
347 | local Prop = GetClosestObjectOfType(x, y, z, 1.5, Hash, false, false, false)
348 | DeleteObject(Prop)
349 | Notify('~r~Prop Removed!')
350 | end
351 | end
352 |
353 | function DeleteEntity(Entity)
354 | Citizen.InvokeNative(0xAE3CBE5BF394C9C9, Citizen.PointerValueIntInitialized(Entity))
355 | end
356 |
357 |
358 |
359 | --Emote Functions
360 | function PlayEmote(Emote, Name)
361 | if not DoesEntityExist(GetPlayerPed(-1)) then
362 | return
363 | end
364 |
365 | if IsPedInAnyVehicle(GetPlayerPed(-1)) then
366 | Notify('~r~Please exit the vehicle to use this emote!')
367 | return
368 | end
369 |
370 | TaskStartScenarioInPlace(GetPlayerPed(-1), Emote, 0, true)
371 | Notify('~b~Playing Emote: ~g~' .. Name)
372 | EmotePlaying = true
373 | end
374 |
375 | function CancelEmote()
376 | ClearPedTasks(GetPlayerPed(-1))
377 | Notify('~r~Stopping Emote')
378 | EmotePlaying = false
379 | end
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 | --Menu Restrictions
388 | function LEORestrict()
389 | if Config.LEOAccess == 0 then
390 | return false
391 | elseif Config.LEOAccess == 1 then
392 | return true
393 | elseif Config.LEOAccess == 2 then
394 | local Ped = GetEntityModel(GetPlayerPed(-1))
395 |
396 | for _, LEOPeds in pairs(Config.LEOUniforms) do
397 | local AllowedPed = GetHashKey(LEOPeds.spawncode)
398 |
399 | if Ped == AllowedPed then
400 | return true
401 | end
402 | end
403 | elseif Config.LEOAccess == 3 then
404 | return LEOOnduty
405 | elseif Config.LEOAccess == 4 then
406 | return LEOAce
407 | else
408 | return true
409 | end
410 | end
411 |
412 |
413 |
414 | function FireRestrict()
415 | if Config.FireAccess == 0 then
416 | return false
417 | elseif Config.FireAccess == 1 then
418 | return true
419 | elseif Config.FireAccess == 2 then
420 | local Ped = GetEntityModel(GetPlayerPed(-1))
421 |
422 | for _, FirePeds in pairs(Config.FireUniforms) do
423 | local AllowedPed = GetHashKey(FirePeds.spawncode)
424 |
425 | if Ped == AllowedPed then
426 | return true
427 | end
428 | end
429 | elseif Config.FireAccess == 3 then
430 | return FireOnduty
431 | elseif Config.FireAccess == 4 then
432 | return FireAce
433 | else
434 | return true
435 | end
436 | end
437 |
438 |
439 |
440 | function CivRestrict()
441 | if Config.CivAccess == 0 then
442 | return false
443 | elseif Config.CivAccess == 1 then
444 | return true
445 | else
446 | return true
447 | end
448 | end
449 |
450 |
451 |
452 | function VehicleRestrict()
453 | if Config.VehicleAccess == 0 then
454 | return false
455 | elseif Config.VehicleAccess == 1 then
456 | return true
457 | elseif Config.VehicleAccess == 2 then
458 | if IsPedInAnyVehicle(GetPlayerPed(PlayerId()), false) then
459 | return true
460 | else
461 | return false
462 | end
463 | else
464 | return true
465 | end
466 | end
467 |
468 |
469 |
470 | function EmoteRestrict()
471 | if Config.EmoteAccess == 0 then
472 | return false
473 | elseif Config.EmoteAccess == 1 then
474 | return true
475 | else
476 | return true
477 | end
478 | end
479 |
--------------------------------------------------------------------------------
/fxmanifest.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | ──────────────────────────────────────────────────────────────────
3 |
4 | SEM_InteractionMenu (fxmanifest.lua) - Created by Scott M
5 | Current Version: v1.7.1 (Sep 2021)
6 |
7 | Support: https://semdevelopment.com/discord
8 |
9 | !!! Change vaules in the 'config.lua' !!!
10 | DO NOT EDIT THIS IF YOU DON'T KNOW WHAT YOU ARE DOING
11 |
12 | ──────────────────────────────────────────────────────────────────
13 | ]]
14 |
15 |
16 |
17 | fx_version 'cerulean'
18 | games {'gta5'}
19 |
20 | --DO NOT REMOVE THESE
21 | title 'SEM_InteractionMenu'
22 | description 'Multi Purpose Interaction Menu'
23 | author 'Scott M [SEM Development]'
24 | version 'v1.7.1' --This is required for the version checker, DO NOT change or remove
25 |
26 | client_scripts {
27 | 'dependencies/NativeUI.lua',
28 | 'client.lua',
29 | 'config.lua',
30 | 'functions.lua',
31 | 'menu.lua',
32 | }
33 |
34 | server_scripts {
35 | 'config.lua',
36 | 'server.lua',
37 | 'functions.lua',
38 | }
39 |
40 | exports {
41 | 'IsOndutyLEO',
42 | 'IsOndutyFire',
43 | }
44 |
--------------------------------------------------------------------------------
/menu.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | ───────────────────────────────────────────────────────────────
3 |
4 | SEM_InteractionMenu (menu.lua) - Created by Scott M
5 | Current Version: v1.7.1 (Sep 2021)
6 |
7 | Support | https://semdevelopment.com/discord
8 |
9 | !!! Change vaules in the 'config.lua' !!!
10 | DO NOT EDIT THIS IF YOU DON'T KNOW WHAT YOU ARE DOING
11 |
12 | ───────────────────────────────────────────────────────────────
13 | ]]
14 |
15 |
16 |
17 | local MenuOri = 0
18 | if Config.MenuOrientation == 0 then
19 | MenuOri = 0
20 | elseif Config.MenuOrientation == 1 then
21 | MenuOri = 1320
22 | else
23 | MenuOri = 0
24 | end
25 |
26 |
27 | _MenuPool = NativeUI.CreatePool()
28 | MainMenu = NativeUI.CreateMenu()
29 |
30 |
31 |
32 |
33 |
34 | function Menu()
35 | local MenuTitle = ''
36 | if Config.MenuTitle == 0 then
37 | MenuTitle = 'Interaction Menu'
38 | elseif Config.MenuTitle == 1 then
39 | MenuTitle = GetPlayerName(source)
40 | elseif Config.MenuTitle == 2 then
41 | MenuTitle = Config.MenuTitleCustom
42 | else
43 | MenuTitle = 'Interaction Menu'
44 | end
45 |
46 |
47 |
48 | _MenuPool:Remove()
49 | _MenuPool = NativeUI.CreatePool()
50 | MainMenu = NativeUI.CreateMenu(MenuTitle, GetResourceMetadata(GetCurrentResourceName(), 'title', 0) .. ' ~y~' .. GetResourceMetadata(GetCurrentResourceName(), 'version', 0), MenuOri)
51 | _MenuPool:Add(MainMenu)
52 | MainMenu:SetMenuWidthOffset(Config.MenuWidth)
53 | collectgarbage()
54 |
55 | MainMenu:SetMenuWidthOffset(Config.MenuWidth)
56 | _MenuPool:ControlDisablingEnabled(false)
57 | _MenuPool:MouseControlsEnabled(false)
58 |
59 |
60 |
61 |
62 |
63 | if LEORestrict() then
64 | local LEOMenu = _MenuPool:AddSubMenu(MainMenu, 'LEO Toolbox', 'Law Enforcement Related Menu', true)
65 | LEOMenu:SetMenuWidthOffset(Config.MenuWidth)
66 | local LEOActions = _MenuPool:AddSubMenu(LEOMenu, 'Actions', '', true)
67 | LEOActions:SetMenuWidthOffset(Config.MenuWidth)
68 | local Cuff = NativeUI.CreateItem('Cuff', 'Cuff/Uncuff the closest player')
69 | local Drag = NativeUI.CreateItem('Drag', 'Drag/Undrag the closest player')
70 | local Seat = NativeUI.CreateItem('Seat', 'Place a player in the closest vehicle')
71 | local Unseat = NativeUI.CreateItem('Unseat', 'Remove a player from the closest vehicle')
72 | local Radar = NativeUI.CreateItem('Radar', 'Toggle the radar menu')
73 | local Inventory = NativeUI.CreateItem('Inventory', 'Search the closest player\'s inventory')
74 | local BAC = NativeUI.CreateItem('BAC', 'Test the BAC level of the closest player')
75 | local Jail = NativeUI.CreateItem('Jail', 'Jail a player')
76 | local Unjail = NativeUI.CreateItem('Unjail', 'Unjail a player')
77 | SpikeLengths = {1, 2, 3, 4, 5}
78 | local Spikes = NativeUI.CreateListItem('Deploy Spikes', SpikeLengths, 1, 'Places spike strips on the ground')
79 | local DelSpikes = NativeUI.CreateItem('Remove Spikes', 'Remove spike strips placed on the ground')
80 | local Shield = NativeUI.CreateItem('Toggle Shield', 'Toggle the bulletproof shield')
81 | local CarbineRifle = NativeUI.CreateItem('Toggle Carbine', 'Toggle your carbine rifle')
82 | local Shotgun = NativeUI.CreateItem('Toggle Shotgun', 'Toggle your pump shotgun')
83 | PropsList = {}
84 | for _, Prop in pairs(Config.Props) do
85 | table.insert(PropsList, Prop.name)
86 | end
87 | local Props = NativeUI.CreateListItem('Spawn Props', PropsList, 1, 'Spawn props on the ground')
88 | local RemoveProps = NativeUI.CreateItem('Remove Props', 'Remove the closest prop')
89 | LEOActions:AddItem(Cuff)
90 | LEOActions:AddItem(Drag)
91 | LEOActions:AddItem(Seat)
92 | LEOActions:AddItem(Unseat)
93 | if Config.Radar ~= 0 then
94 | LEOActions:AddItem(Radar)
95 | end
96 | LEOActions:AddItem(Inventory)
97 | LEOActions:AddItem(BAC)
98 | if Config.LEOJail then
99 | LEOActions:AddItem(Jail)
100 | if UnjailAllowed then
101 | LEOActions:AddItem(Unjail)
102 | end
103 | end
104 | LEOActions:AddItem(Spikes)
105 | LEOActions:AddItem(DelSpikes)
106 | LEOActions:AddItem(Shield)
107 | if Config.UnrackWeapons == 1 or Config.UnrackWeapons == 2 then
108 | LEOActions:AddItem(CarbineRifle)
109 | LEOActions:AddItem(Shotgun)
110 | end
111 | if Config.DisplayProps then
112 | LEOActions:AddItem(Props)
113 | LEOActions:AddItem(RemoveProps)
114 | end
115 | Cuff.Activated = function(ParentMenu, SelectedItem)
116 | local player = GetClosestPlayer()
117 | if player ~= false then
118 | TriggerServerEvent('SEM_InteractionMenu:CuffNear', player)
119 | end
120 | end
121 | Drag.Activated = function(ParentMenu, SelectedItem)
122 | local player = GetClosestPlayer()
123 | if player ~= false then
124 | TriggerServerEvent('SEM_InteractionMenu:DragNear', player)
125 | end
126 | end
127 | Seat.Activated = function(ParentMenu, SelectedItem)
128 | local Veh = GetVehiclePedIsIn(Ped, true)
129 |
130 | local player = GetClosestPlayer()
131 | if player ~= false then
132 | TriggerServerEvent('SEM_InteractionMenu:SeatNear', player, Veh)
133 | end
134 | end
135 | Unseat.Activated = function(ParentMenu, SelectedItem)
136 | if IsPedInAnyVehicle(GetPlayerPed(-1), true) then
137 | Notify('~o~You need to be outside of the vehicle')
138 | return
139 | end
140 |
141 | local player = GetClosestPlayer()
142 | if player ~= false then
143 | TriggerServerEvent('SEM_InteractionMenu:UnseatNear', player)
144 | end
145 | end
146 | Radar.Activated = function(ParentMenu, SelectedItem)
147 | ToggleRadar()
148 | end
149 | Inventory.Activated = function(ParentMenu, SelectedItem)
150 | local player = GetClosestPlayer()
151 | if player ~= false then
152 | Notify('~b~Searching ...')
153 | TriggerServerEvent('SEM_InteractionMenu:InventorySearch', player)
154 | end
155 | end
156 | BAC.Activated = function(ParentMenu, SelectedItem)
157 | local player = GetClosestPlayer()
158 | if player ~= false then
159 | Notify('~b~Testing ...')
160 | TriggerServerEvent('SEM_InteractionMenu:BACTest', player)
161 | end
162 | end
163 | Jail.Activated = function(ParentMenu, SelectedItem)
164 | local PlayerID = tonumber(KeyboardInput('Player ID:', 10))
165 | if PlayerID == nil then
166 | Notify('~r~Please enter a player ID')
167 | return
168 | end
169 |
170 | local JailTime = tonumber(KeyboardInput('Time: (Seconds) - Max Time: ' .. Config.MaxJailTime .. ' | Default Time: 30', string.len(Config.MaxJailTime)))
171 | if JailTime == nil then
172 | JailTime = 30
173 | end
174 | if JailTime > Config.MaxJailTime then
175 | Notify('~y~Exceeded Max Time\nMax Time: ' .. Config.MaxJailTime .. ' seconds')
176 | JailTime = Config.MaxJailTime
177 | end
178 |
179 | Notify('Player Jailed for ~b~' .. JailTime .. ' seconds')
180 | TriggerServerEvent('SEM_InteractionMenu:Jail', PlayerID, JailTime)
181 | end
182 | Unjail.Activated = function(ParentMenu, SelectedItem)
183 | local PlayerID = tonumber(KeyboardInput('Player ID:', 10))
184 | if PlayerID == nil then
185 | Notify('~r~Please enter a player ID')
186 | return
187 | end
188 |
189 | TriggerServerEvent('SEM_InteractionMenu:Unjail', PlayerID)
190 | end
191 | DelSpikes.Activated = function(ParentMenu, SelectedItem)
192 | TriggerEvent('SEM_InteractionMenu:Spikes-DeleteSpikes')
193 | end
194 | Shield.Activated = function(ParentMenu, SelectedItem)
195 | if ShieldActive then
196 | DisableShield()
197 | else
198 | EnableShield()
199 | end
200 | end
201 | CarbineRifle.Activated = function(ParentMenu, SelectedItem)
202 | if (GetVehicleClass(GetVehiclePedIsIn(GetPlayerPed(-1))) == 18) then
203 | CarbineEquipped = not CarbineEquipped
204 | ShotgunEquipped = false
205 | elseif (GetVehicleClass(GetVehiclePedIsIn(GetPlayerPed(-1))) ~= 18) then
206 | Notify('~r~You Must be in a Police Vehicle to rack/unrack your Carbine Rifle')
207 | return
208 | end
209 |
210 | if CarbineEquipped then
211 | Notify('~g~Carbine Rifle Equipped')
212 | GiveWeapon('weapon_carbinerifle')
213 | AddWeaponComponent('weapon_carbinerifle', 'component_at_ar_flsh')
214 | AddWeaponComponent('weapon_carbinerifle', 'component_at_ar_afgrip')
215 | else
216 | Notify('~y~Carbine Rifle Unequipped')
217 | RemoveWeaponFromPed(GetPlayerPed(-1), 'weapon_carbinerifle')
218 | end
219 | end
220 | Shotgun.Activated = function(ParentMenu, SelectedItem)
221 | if (GetVehicleClass(GetVehiclePedIsIn(GetPlayerPed(-1))) == 18) then
222 | ShotgunEquipped = not ShotgunEquipped
223 | CarbineEquipped = false
224 | elseif (GetVehicleClass(GetVehiclePedIsIn(GetPlayerPed(-1))) ~= 18) then
225 | Notify('~r~You Must be in a Police Vehicle to rack/unrack your Shotgun')
226 | return
227 | end
228 |
229 | if ShotgunEquipped then
230 | Notify('~g~Shotgun Equipped')
231 | GiveWeapon('weapon_pumpshotgun')
232 | AddWeaponComponent('weapon_pumpshotgun', 'component_at_ar_flsh')
233 | else
234 | Notify('~y~Shotgun Unequipped')
235 | RemoveWeaponFromPed(GetPlayerPed(-1), 'weapon_pumpshotgun')
236 | end
237 | end
238 | LEOActions.OnListSelect = function(sender, item, index)
239 | if item == Spikes then
240 | TriggerEvent('SEM_InteractionMenu:Spikes-SpawnSpikes', tonumber(index))
241 | elseif item == Props then
242 | for _, Prop in pairs(Config.Props) do
243 | if Prop.name == item:IndexToItem(index) then
244 | SpawnProp(Prop.spawncode, Prop.name)
245 | end
246 | end
247 | end
248 | end
249 | RemoveProps.Activated = function(ParentMenu, SelectedItem)
250 | for _, Prop in pairs(Config.Props) do
251 | DeleteProp(Prop.spawncode)
252 | end
253 | end
254 |
255 | if Config.DisplayBackup then
256 | local LEOBackup = _MenuPool:AddSubMenu(LEOMenu, 'Backup', '', true)
257 | LEOBackup:SetMenuWidthOffset(Config.MenuWidth)
258 | --[[
259 | Code 1 Backup | No Lights or Siren
260 | Code 2 Backup | Only Lights
261 | Code 3 Backup | Lights and Siren
262 | Code 99 Backup | All Available Unit Responde Code 3
263 | ]]
264 | local BK1 = NativeUI.CreateItem('Code 1', 'Call Code 1 Backup to your location')
265 | local BK2 = NativeUI.CreateItem('Code 2', 'Call Code 2 Backup to your location')
266 | local BK3 = NativeUI.CreateItem('Code 3', 'Call Code 3 Backup to your location')
267 | local BK99 = NativeUI.CreateItem('Code 99', 'Call Code 99 Backup to your location')
268 | local PanicBTN = NativeUI.CreateItem('~r~Panic Button', 'Officer Panic Button')
269 | LEOBackup:AddItem(BK1)
270 | LEOBackup:AddItem(BK2)
271 | LEOBackup:AddItem(BK3)
272 | LEOBackup:AddItem(BK99)
273 | LEOBackup:AddItem(PanicBTN)
274 | BK1.Activated = function(ParentMenu, SelectedItem)
275 | local Coords = GetEntityCoords(GetPlayerPed(-1))
276 | local Street1, Street2 = GetStreetNameAtCoord(Coords.x, Coords.y, Coords.z)
277 | local StreetName = GetStreetNameFromHashKey(Street1)
278 |
279 | TriggerServerEvent('SEM_InteractionMenu:Backup', 1, StreetName, Coords)
280 | end
281 | BK2.Activated = function(ParentMenu, SelectedItem)
282 | local Coords = GetEntityCoords(GetPlayerPed(-1))
283 | local Street1, Street2 = GetStreetNameAtCoord(Coords.x, Coords.y, Coords.z)
284 | local StreetName = GetStreetNameFromHashKey(Street1)
285 |
286 | TriggerServerEvent('SEM_InteractionMenu:Backup', 2, StreetName, Coords)
287 | end
288 | BK3.Activated = function(ParentMenu, SelectedItem)
289 | local Coords = GetEntityCoords(GetPlayerPed(-1))
290 | local Street1, Street2 = GetStreetNameAtCoord(Coords.x, Coords.y, Coords.z)
291 | local StreetName = GetStreetNameFromHashKey(Street1)
292 |
293 | TriggerServerEvent('SEM_InteractionMenu:Backup', 3, StreetName, Coords)
294 | end
295 | BK99.Activated = function(ParentMenu, SelectedItem)
296 | local Coords = GetEntityCoords(GetPlayerPed(-1))
297 | local Street1, Street2 = GetStreetNameAtCoord(Coords.x, Coords.y, Coords.z)
298 | local StreetName = GetStreetNameFromHashKey(Street1)
299 |
300 | TriggerServerEvent('SEM_InteractionMenu:Backup', 99, StreetName, Coords)
301 | end
302 | PanicBTN.Activated = function(ParentMenu, SelectedItem)
303 | local Coords = GetEntityCoords(GetPlayerPed(-1))
304 | local Street1, Street2 = GetStreetNameAtCoord(Coords.x, Coords.y, Coords.z)
305 | local StreetName = GetStreetNameFromHashKey(Street1)
306 |
307 | TriggerServerEvent('SEM_InteractionMenu:Backup', 'panic', StreetName, Coords)
308 | end
309 | end
310 |
311 | if Config.ShowStations then
312 | local LEOStation = _MenuPool:AddSubMenu(LEOMenu, 'Stations', '', true)
313 | LEOStation:SetMenuWidthOffset(Config.MenuWidth)
314 | for _, Station in pairs(Config.LEOStations) do
315 | local StationCategory = _MenuPool:AddSubMenu(LEOStation, Station.name, '', true)
316 | StationCategory:SetMenuWidthOffset(Config.MenuWidth)
317 | local SetWaypoint = NativeUI.CreateItem('Set Waypoint', 'Set a waypoint to the station')
318 | local Teleport = NativeUI.CreateItem('Teleport', 'Teleport to the station')
319 | StationCategory:AddItem(SetWaypoint)
320 | if Config.AllowStationTeleport then
321 | StationCategory:AddItem(Teleport)
322 | end
323 | SetWaypoint.Activated = function(ParentMenu, SelectedItem)
324 | SetNewWaypoint(Station.coords.x, Station.coords.y)
325 | end
326 | Teleport.Activated = function(ParentMenu, SelectedItem)
327 | SetEntityCoords(PlayerPedId(), Station.coords.x, Station.coords.y, Station.coords.z)
328 | SetEntityHeading(PlayerPedId(), Station.coords.h)
329 | end
330 | end
331 | end
332 |
333 | if Config.DisplayLEOUniforms or Config.DisplayLEOLoadouts then
334 | local LEOLoadouts = _MenuPool:AddSubMenu(LEOMenu, 'Loadouts', '', true)
335 | LEOLoadouts:SetMenuWidthOffset(Config.MenuWidth)
336 | UniformsList = {}
337 | for _, Uniform in pairs(Config.LEOUniforms) do
338 | table.insert(UniformsList, Uniform.name)
339 | end
340 |
341 | LoadoutsList = {}
342 | for Name, Loadout in pairs(Config.LEOLoadouts) do
343 | table.insert(LoadoutsList, Name)
344 | end
345 |
346 | local Uniforms = NativeUI.CreateListItem('Uniforms', UniformsList, 1, 'Spawn LEO uniforms')
347 | local Loadouts = NativeUI.CreateListItem('Loadouts', LoadoutsList, 1, 'Spawn LEO weapon loadouts')
348 | if Config.DisplayLEOUniforms then
349 | LEOLoadouts:AddItem(Uniforms)
350 | end
351 | if Config.DisplayLEOLoadouts then
352 | LEOLoadouts:AddItem(Loadouts)
353 | end
354 | LEOLoadouts.OnListSelect = function(sender, item, index)
355 | if item == Uniforms then
356 | for _, Uniform in pairs(Config.LEOUniforms) do
357 | if Uniform.name == item:IndexToItem(index) then
358 | LoadPed(Uniform.spawncode)
359 | Notify('~b~Uniform Spawned: ~g~' .. Uniform.name)
360 | end
361 | end
362 | end
363 |
364 |
365 |
366 | if item == Loadouts then
367 | for Name, Loadout in pairs(Config.LEOLoadouts) do
368 | if Name == item:IndexToItem(index) then
369 | SetEntityHealth(GetPlayerPed(-1), 200)
370 | RemoveAllPedWeapons(GetPlayerPed(-1), true)
371 | AddArmourToPed(GetPlayerPed(-1), 100)
372 |
373 | for _, Weapon in pairs(Loadout) do
374 | GiveWeapon(Weapon.weapon)
375 |
376 | for _, Component in pairs(Weapon.components) do
377 | AddWeaponComponent(Weapon.weapon, Component)
378 | end
379 | end
380 |
381 | Notify('~b~Loadout Spawned: ~g~' .. Name)
382 | end
383 | end
384 | end
385 | end
386 | end
387 |
388 | if Config.ShowLEOVehicles then
389 | local LEOVehicles = _MenuPool:AddSubMenu(LEOMenu, 'Vehicles', '', true)
390 | LEOVehicles:SetMenuWidthOffset(Config.MenuWidth)
391 |
392 | for Name, Category in pairs(Config.LEOVehiclesCategories) do
393 | local LEOCategory = _MenuPool:AddSubMenu(LEOVehicles, Name, '', true)
394 | LEOCategory:SetMenuWidthOffset(Config.MenuWidth)
395 | for _, Vehicle in pairs(Category) do
396 | local LEOVehicle = NativeUI.CreateItem(Vehicle.name, '')
397 | LEOCategory:AddItem(LEOVehicle)
398 | if Config.ShowLEOSpawnCode then
399 | LEOVehicle:RightLabel(Vehicle.spawncode)
400 | end
401 | LEOVehicle.Activated = function(ParentMenu, SelectedItem)
402 | SpawnVehicle(Vehicle.spawncode, Vehicle.name, Vehicle.livery, Vehicle.extras)
403 | end
404 | end
405 | end
406 | end
407 |
408 | if Config.DisplayTrafficManager then
409 | local LEOTrafficManager = _MenuPool:AddSubMenu(LEOMenu, 'Traffic Manager', '', true)
410 | LEOTrafficManager:SetMenuWidthOffset(Config.MenuWidth)
411 |
412 | TMSize = 10.0
413 | TMSpeed = 0.0
414 | RaduiesNames = {}
415 | Raduies = {
416 | {name = '10m', size = 10.0},
417 | {name = '20m', size = 20.0},
418 | {name = '30m', size = 30.0},
419 | {name = '40m', size = 40.0},
420 | {name = '50m', size = 50.0},
421 | {name = '60m', size = 60.0},
422 | {name = '70m', size = 70.0},
423 | {name = '80m', size = 80.0},
424 | {name = '90m', size = 90.0},
425 | {name = '100m', size = 100.0},
426 | }
427 | SpeedsNames = {}
428 | Speeds = {
429 | {name = '0 mph', speed = 0.0},
430 | {name = '5 mph', speed = 5.0},
431 | {name = '10 mph', speed = 10.0},
432 | {name = '15 mph', speed = 15.0},
433 | {name = '20 mph', speed = 20.0},
434 | {name = '25 mph', speed = 25.0},
435 | {name = '30 mph', speed = 30.0},
436 | {name = '40 mph', speed = 40.0},
437 | {name = '50 mph', speed = 50.0},
438 | }
439 |
440 | for _, RaduisInfo in pairs(Raduies) do
441 | table.insert(RaduiesNames, RaduisInfo.name)
442 | end
443 | for _, SpeedsInfo in pairs(Speeds) do
444 | table.insert(SpeedsNames, SpeedsInfo.name)
445 | end
446 |
447 | local Radius = NativeUI.CreateListItem('Radius', RaduiesNames, 1, '')
448 | local Speed = NativeUI.CreateListItem('Speed', SpeedsNames, 1, '')
449 | local TMCreate = NativeUI.CreateItem('Create Speed Zone', '')
450 | local TMDelete = NativeUI.CreateItem('Delete Speed Zone', '')
451 | LEOTrafficManager:AddItem(Radius)
452 | LEOTrafficManager:AddItem(Speed)
453 | LEOTrafficManager:AddItem(TMCreate)
454 | LEOTrafficManager:AddItem(TMDelete)
455 | Radius.OnListChanged = function(sender, item, index)
456 | TMSize = Raduies[index].size
457 | end
458 | Speed.OnListChanged = function(sender, item, index)
459 | TMSpeed = Speeds[index].speed
460 | end
461 | TMCreate.Activated = function(ParentMenu, SelectedItem)
462 | if Zone == nil then
463 | Zone = AddSpeedZoneForCoord(GetEntityCoords(PlayerPedId()), TMSize, TMSpeed, false)
464 | Area = AddBlipForRadius(GetEntityCoords(PlayerPedId()), TMSize)
465 | SetBlipAlpha(Area, 100)
466 | Notify('~g~Speed Zone Created')
467 | else
468 | Notify('~y~You already have a Speed Zone created')
469 | end
470 | end
471 | TMDelete.Activated = function(ParentMenu, SelectedItem)
472 | if Zone ~= nil then
473 | RemoveSpeedZone(Zone)
474 | RemoveBlip(Area)
475 | Zone = nil
476 | Notify('~r~Speed Zone Deleted')
477 | else
478 | Notify('~y~You don\'t have a Speed Zone')
479 | end
480 | end
481 | end
482 | end
483 |
484 |
485 |
486 |
487 | if FireRestrict() then
488 | local FireMenu = _MenuPool:AddSubMenu(MainMenu, 'Fire Toolbox', 'Fire Related Menu', true)
489 | FireMenu:SetMenuWidthOffset(Config.MenuWidth)
490 | local FireActions = _MenuPool:AddSubMenu(FireMenu, 'Actions', '', true)
491 | FireActions:SetMenuWidthOffset(Config.MenuWidth)
492 | local Drag = NativeUI.CreateItem('Drag', 'Drag/Undrag the closest player')
493 | local Seat = NativeUI.CreateItem('Seat', 'Place a player in the closest vehicle')
494 | local Unseat = NativeUI.CreateItem('Unseat', 'Remove a player from the closest vehicle')
495 | FireActions:AddItem(Drag)
496 | FireActions:AddItem(Seat)
497 | FireActions:AddItem(Unseat)
498 | Drag.Activated = function(ParentMenu, SelectedItem)
499 | local player = GetClosestPlayer()
500 | if player ~= false then
501 | TriggerServerEvent('SEM_InteractionMenu:DragNear', player)
502 | end
503 | end
504 | Seat.Activated = function(ParentMenu, SelectedItem)
505 | local player = GetClosestPlayer()
506 | if player ~= false then
507 | TriggerServerEvent('SEM_InteractionMenu:SeatNear', player, Veh)
508 | end
509 | end
510 | Unseat.Activated = function(ParentMenu, SelectedItem)
511 | if IsPedInAnyVehicle(GetPlayerPed(-1), true) then
512 | Notify('~o~You need to be outside of the vehicle')
513 | return
514 | end
515 |
516 | local player = GetClosestPlayer()
517 | if player ~= false then
518 | TriggerServerEvent('SEM_InteractionMenu:UnseatNear', player)
519 | end
520 | end
521 | if Config.FireHospital then
522 | local HospitalLocations = _MenuPool:AddSubMenu(FireActions, 'Hospitalize', '', true)
523 | HospitalLocations:SetMenuWidthOffset(Config.MenuWidth)
524 | for HospitalName, HospitalInfo in pairs(Config.HospitalLocation) do
525 | local Hospitalize = NativeUI.CreateItem(HospitalName, 'Hospitalize a player')
526 | HospitalLocations:AddItem(Hospitalize)
527 | Hospitalize.Activated = function(ParentMenu, SelectedItem)
528 | local PlayerID = tonumber(KeyboardInput('Player ID:', 10))
529 | if PlayerID == nil then
530 | Notify('~r~Please enter a player ID')
531 | return
532 | end
533 |
534 | local HospitalTime = tonumber(KeyboardInput('Time: (Seconds) - Max Time: ' .. Config.MaxHospitalTime .. ' | Default Time: 30', 3))
535 | if HospitalTime == nil then
536 | HospitalTime = 30
537 | end
538 | if HospitalTime > Config.MaxHospitalTime then
539 | Notify('~y~Exceeded Max Time\nMax Time: ' .. Config.MaxHospitalTime .. ' seconds')
540 | HospitalTime = Config.MaxHospitalTime
541 | end
542 |
543 | Notify('Player Hospitalized for ~b~' .. HospitalTime .. ' seconds')
544 | TriggerServerEvent('SEM_InteractionMenu:Hospitalize', PlayerID, HospitalTime, HospitalInfo)
545 | end
546 | end
547 | local Unhospitalize = NativeUI.CreateItem('Unhospitalize', 'Unhospitalize a player')
548 | if UnhospitalAllowed then
549 | FireActions:AddItem(Unhospitalize)
550 | end
551 | Unhospitalize.Activated = function(ParentMenu, SelectedItem)
552 | local PlayerID = tonumber(KeyboardInput('Player ID:', 10))
553 | if PlayerID == nil then
554 | Notify('~r~Please enter a player ID')
555 | return
556 | end
557 |
558 | TriggerServerEvent('SEM_InteractionMenu:Unhospitalize', PlayerID)
559 | end
560 | end
561 | PropsList = {}
562 | for _, Prop in pairs(Config.Props) do
563 | table.insert(PropsList, Prop.name)
564 | end
565 | local Props = NativeUI.CreateListItem('Spawn Props', PropsList, 1, 'Spawn props on the ground')
566 | local RemoveProps = NativeUI.CreateItem('Remove Props', 'Remove the closest prop')
567 | FireActions:AddItem(Props)
568 | FireActions:AddItem(RemoveProps)
569 | FireActions.OnListSelect = function(sender, item, index)
570 | if item == Props then
571 | for _, Prop in pairs(Config.Props) do
572 | if Prop.name == item:IndexToItem(index) then
573 | SpawnProp(Prop.spawncode, Prop.name)
574 | end
575 | end
576 | end
577 | end
578 | RemoveProps.Activated = function(ParentMenu, SelectedItem)
579 | for _, Prop in pairs(Config.Props) do
580 | DeleteProp(Prop.spawncode)
581 | end
582 | end
583 |
584 | if Config.ShowStations then
585 | local FireEMSStation = _MenuPool:AddSubMenu(FireMenu, 'Stations', '', true)
586 | FireEMSStation:SetMenuWidthOffset(Config.MenuWidth)
587 | local FireStation = _MenuPool:AddSubMenu(FireEMSStation, 'Fire Stations', '', true)
588 | FireStation:SetMenuWidthOffset(Config.MenuWidth)
589 | for _, Station in pairs(Config.FireStations) do
590 | local StationCategory = _MenuPool:AddSubMenu(FireStation, Station.name, '', true)
591 | StationCategory:SetMenuWidthOffset(Config.MenuWidth)
592 | local SetWaypoint = NativeUI.CreateItem('Set Waypoint', 'Set a waypoint to the station')
593 | local Teleport = NativeUI.CreateItem('Teleport', 'Teleport to the station')
594 | StationCategory:AddItem(SetWaypoint)
595 | if Config.AllowStationTeleport then
596 | StationCategory:AddItem(Teleport)
597 | end
598 | SetWaypoint.Activated = function(ParentMenu, SelectedItem)
599 | SetNewWaypoint(Station.coords.x, Station.coords.y)
600 | end
601 | Teleport.Activated = function(ParentMenu, SelectedItem)
602 | SetEntityCoords(PlayerPedId(), Station.coords.x, Station.coords.y, Station.coords.z)
603 | SetEntityHeading(PlayerPedId(), Station.coords.h)
604 | end
605 | end
606 |
607 | local EMSStation = _MenuPool:AddSubMenu(FireEMSStation, 'Hospitals', '', true)
608 | EMSStation:SetMenuWidthOffset(Config.MenuWidth)
609 | for _, Station in pairs(Config.HospitalStations) do
610 | local StationCategory = _MenuPool:AddSubMenu(EMSStation, Station.name, '', true)
611 | StationCategory:SetMenuWidthOffset(Config.MenuWidth)
612 | local SetWaypoint = NativeUI.CreateItem('Set Waypoint', 'Set a waypoint to the hospital')
613 | local Teleport = NativeUI.CreateItem('Teleport', 'Teleport to the hospital')
614 | StationCategory:AddItem(SetWaypoint)
615 | if Config.AllowStationTeleport then
616 | StationCategory:AddItem(Teleport)
617 | end
618 | SetWaypoint.Activated = function(ParentMenu, SelectedItem)
619 | SetNewWaypoint(Station.coords.x, Station.coords.y)
620 | end
621 | Teleport.Activated = function(ParentMenu, SelectedItem)
622 | SetEntityCoords(PlayerPedId(), Station.coords.x, Station.coords.y, Station.coords.z)
623 | SetEntityHeading(PlayerPedId(), Station.coords.h)
624 | end
625 | end
626 | end
627 |
628 | if Config.DisplayFireUniforms or Config.DisplayFireLoadouts then
629 | local FireLoadouts = _MenuPool:AddSubMenu(FireMenu, 'Loadouts', '', true)
630 | FireLoadouts:SetMenuWidthOffset(Config.MenuWidth)
631 | UniformsList = {}
632 | for _, Uniform in pairs(Config.FireUniforms) do
633 | table.insert(UniformsList, Uniform.name)
634 | end
635 |
636 | LoadoutsList = {
637 | 'Clear',
638 | 'Standard',
639 | }
640 | local Uniforms = NativeUI.CreateListItem('Uniforms', UniformsList, 1, 'Spawn Fire uniforms')
641 | local Loadouts = NativeUI.CreateListItem('Loadouts', LoadoutsList, 1, 'Spawns Fire weapon loadouts')
642 | if Config.DisplayFireUniforms then
643 | FireLoadouts:AddItem(Uniforms)
644 | end
645 | if Config.DisplayFireLoadouts then
646 | FireLoadouts:AddItem(Loadouts)
647 | end
648 | FireLoadouts.OnListSelect = function(sender, item, index)
649 | if item == Uniforms then
650 | for _, Uniform in pairs(Config.FireUniforms) do
651 | if Uniform.name == item:IndexToItem(index) then
652 | LoadPed(Uniform.spawncode)
653 | Notify('~b~Uniform Spawned: ~g~' .. Uniform.name)
654 | end
655 | end
656 | end
657 |
658 |
659 |
660 | if item == Loadouts then
661 | local SelectedLoadout = item:IndexToItem(index)
662 | if SelectedLoadout == 'Clear' then
663 | SetEntityHealth(GetPlayerPed(-1), 200)
664 | RemoveAllPedWeapons(GetPlayerPed(-1), true)
665 | Notify('~r~All Weapons Cleared!')
666 | elseif SelectedLoadout == 'Standard' then
667 | SetEntityHealth(GetPlayerPed(-1), 200)
668 | RemoveAllPedWeapons(GetPlayerPed(-1), true)
669 | AddArmourToPed(GetPlayerPed(-1), 100)
670 | GiveWeapon('weapon_flashlight')
671 | GiveWeapon('weapon_fireextinguisher')
672 | GiveWeapon('weapon_flare')
673 | GiveWeapon('weapon_stungun')
674 | Notify('~b~Loadout Spawned: ~g~' .. SelectedLoadout)
675 | end
676 | end
677 | end
678 | end
679 |
680 | if Config.ShowFireVehicles then
681 | local FireVehicles = _MenuPool:AddSubMenu(FireMenu, 'Vehicles', '', true)
682 | FireVehicles:SetMenuWidthOffset(Config.MenuWidth)
683 |
684 | for _, Vehicle in pairs(Config.FireVehicles) do
685 | local FireVehicle = NativeUI.CreateItem(Vehicle.name, '')
686 | FireVehicles:AddItem(FireVehicle)
687 | if Config.ShowFireSpawnCode then
688 | FireVehicle:RightLabel(Vehicle.spawncode)
689 | end
690 | FireVehicle.Activated = function(ParentMenu, SelectedItem)
691 | SpawnVehicle(Vehicle.spawncode, Vehicle.name, Vehicle.livery, Vehicle.extras)
692 | end
693 | end
694 | end
695 | end
696 |
697 |
698 |
699 |
700 | if CivRestrict() then
701 | local CivMenu = _MenuPool:AddSubMenu(MainMenu, 'Civ Toolbox', 'Civilian Related Menu', true)
702 | CivMenu:SetMenuWidthOffset(Config.MenuWidth)
703 | local CivActions = _MenuPool:AddSubMenu(CivMenu, 'Actions', '', true)
704 | CivActions:SetMenuWidthOffset(Config.MenuWidth)
705 | local HU = NativeUI.CreateItem('Hands Up', 'Put your hands up')
706 | local HUK = NativeUI.CreateItem('Hand Up & Kneel', 'Put your hands up and kneel on the ground')
707 | local Inventory = NativeUI.CreateItem('Inventory', 'Set your inventory')
708 | local BAC = NativeUI.CreateItem('BAC', 'Set your BAC level')
709 | local DropWeapon = NativeUI.CreateItem('Drop Weapon', 'Drop your current weapon on the ground')
710 | CivActions:AddItem(HU)
711 | CivActions:AddItem(HUK)
712 | CivActions:AddItem(Inventory)
713 | CivActions:AddItem(BAC)
714 | CivActions:AddItem(DropWeapon)
715 | HU.Activated = function(ParentMenu, SelectedItem)
716 | local Ped = PlayerPedId()
717 | if DoesEntityExist(Ped) and not HandCuffed then
718 | Citizen.CreateThread(function()
719 | LoadAnimation('random@mugging3')
720 | if IsEntityPlayingAnim(Ped, 'random@mugging3', 'handsup_standing_base', 3) or HandCuffed then
721 | ClearPedSecondaryTask(Ped)
722 | SetEnableHandcuffs(Ped, false)
723 | elseif not IsEntityPlayingAnim(Ped, 'random@mugging3', 'handsup_standing_base', 3) or not HandCuffed then
724 | TaskPlayAnim(Ped, 'random@mugging3', 'handsup_standing_base', 8.0, -8, -1, 49, 0, 0, 0, 0)
725 | SetEnableHandcuffs(Ped, true)
726 | end
727 | end)
728 | end
729 | end
730 | HUK.Activated = function(ParentMenu, SelectedItem)
731 | local Ped = PlayerPedId()
732 | if (DoesEntityExist(Ped) and not IsEntityDead(Ped)) and not HandCuffed then
733 | Citizen.CreateThread(function()
734 | LoadAnimation('random@arrests')
735 | if (IsEntityPlayingAnim(Ped, 'random@arrests', 'kneeling_arrest_idle', 3)) then
736 | TaskPlayAnim(Ped, 'random@arrests', 'kneeling_arrest_get_up', 8.0, 1.0, -1, 128, 0, 0, 0, 0)
737 | else
738 | TaskPlayAnim(Ped, 'random@arrests', 'idle_2_hands_up', 8.0, 1.0, -1, 2, 0, 0, 0, 0)
739 | Wait (4000)
740 | TaskPlayAnim(Ped, 'random@arrests', 'kneeling_arrest_idle', 8.0, 1.0, -1, 2, 0, 0, 0, 0)
741 | end
742 | end)
743 | end
744 | end
745 | Inventory.Activated = function(ParentMenu, SelectedItem)
746 | local Items = KeyboardInput('Items:', 75)
747 | if Items == nil or Items == '' then
748 | Notify('~r~No Items Provided!')
749 | return
750 | end
751 |
752 | TriggerServerEvent('SEM_InteractionMenu:InventorySet', Items)
753 | Notify('~g~Inventory Set!')
754 | end
755 | BAC.Activated = function(ParentMenu, SelectedItem)
756 | local BACLevel = KeyboardInput('BAC Level - Legal Limit: 0.08', 5)
757 | if BACLevel == nil or BACLevel == '' then
758 | Notify('~r~No BAC Level Provided!')
759 | return
760 | end
761 |
762 | TriggerServerEvent('SEM_InteractionMenu:BACSet', tonumber(BACLevel))
763 | if tonumber(BACLevel) < 0.08 then
764 | Notify('~b~BAC Level Set: ~g~' .. tostring(BACLevel))
765 | else
766 | Notify('~b~BAC Level Set: ~r~' .. tostring(BACLevel))
767 | end
768 | end
769 | DropWeapon.Activated = function(ParentMenu, SelectedItem)
770 | local CurrentWeapon = GetSelectedPedWeapon(PlayerPedId())
771 | SetCurrentPedWeapon(PlayerPedId(), 'weapon_unarmed', true)
772 | SetPedDropsInventoryWeapon(GetPlayerPed(-1), CurrentWeapon, -2.0, 0.0, 0.5, 30)
773 | Notify('~r~Weapon Dropped!')
774 | end
775 | if Config.ShowCivAdverts then
776 | local CivAdverts = _MenuPool:AddSubMenu(CivMenu, 'Adverts', '', true)
777 | CivAdverts:SetMenuWidthOffset(Config.MenuWidth)
778 | for _, Ad in pairs(Config.CivAdverts) do
779 | local Advert = NativeUI.CreateItem(Ad.name, 'Send an advert for ' .. Ad.name)
780 | CivAdverts:AddItem(Advert)
781 | Advert.Activated = function(ParentMenu, SelectedItem)
782 | local Message = KeyboardInput('Message:', 128)
783 | if Message == nil or Message == '' then
784 | Notify('~r~No Advert Message Provided!')
785 | return
786 | end
787 |
788 | TriggerServerEvent('SEM_InteractionMenu:Ads', Message, Ad.name, Ad.loc, Ad.file)
789 | end
790 | end
791 | end
792 | if Config.ShowCivVehicles then
793 | local CivVehicles = _MenuPool:AddSubMenu(CivMenu, 'Vehicles', '', true)
794 | CivVehicles:SetMenuWidthOffset(Config.MenuWidth)
795 |
796 | for _, Vehicle in pairs(Config.CivVehicles) do
797 | local CivVehicle = NativeUI.CreateItem(Vehicle.name, '')
798 | CivVehicles:AddItem(CivVehicle)
799 | if Config.ShowCivSpawnCode then
800 | CivVehicle:RightLabel(Vehicle.spawncode)
801 | end
802 | CivVehicle.Activated = function(ParentMenu, SelectedItem)
803 | SpawnVehicle(Vehicle.spawncode, Vehicle.name)
804 | end
805 | end
806 | end
807 | end
808 |
809 |
810 |
811 |
812 |
813 | if VehicleRestrict() then
814 | local VehicleMenu = _MenuPool:AddSubMenu(MainMenu, 'Vehicle', 'Vehicle Related Menu', true)
815 | VehicleMenu:SetMenuWidthOffset(Config.MenuWidth)
816 | local Seats = {-1, 0, 1, 2}
817 | local Windows = {'Front', 'Rear', 'All'}
818 | local Doors = {'Driver', 'Passenger', 'Rear Right', 'Rear Left', 'Hood', 'Trunk', 'All'}
819 | local Engine = NativeUI.CreateItem('Toggle Engine', 'Toggle your vehicle\'s engine')
820 | local ILights = NativeUI.CreateItem('Toggle Interior Light', 'Toggle your vehicle\'s interior light')
821 | local Seat = NativeUI.CreateSliderItem('Change Seats', Seats, 1, 'Switch to a different seat')
822 | local Window = NativeUI.CreateListItem('Windows', Windows, 1, 'Open/Close your vehicle\'s windows')
823 | local Door = NativeUI.CreateListItem('Doors', Doors, 1, 'Open/Close your vehicle\'s doors')
824 | local FixVeh = NativeUI.CreateItem('Repair Vehicle', 'Repair your current vehicle')
825 | local CleanVeh = NativeUI.CreateItem('Clean Vehicle', 'Clean your current vehicle')
826 | local DelVeh = NativeUI.CreateItem('~r~Delete Vehicle', 'Delete your current vehicle')
827 | VehicleMenu:AddItem(Engine)
828 | VehicleMenu:AddItem(ILights)
829 | VehicleMenu:AddItem(Seat)
830 | VehicleMenu:AddItem(Window)
831 | VehicleMenu:AddItem(Door)
832 | if Config.VehicleOptions then
833 | VehicleMenu:AddItem(FixVeh)
834 | VehicleMenu:AddItem(CleanVeh)
835 | VehicleMenu:AddItem(DelVeh)
836 | end
837 | Engine.Activated = function(ParentMenu, SelectedItem)
838 | local Vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
839 | if Vehicle ~= nil and Vehicle ~= 0 and GetPedInVehicleSeat(Vehicle, 0) then
840 | SetVehicleEngineOn(Vehicle, (not GetIsVehicleEngineRunning(Vehicle)), false, true)
841 | Notify('~g~Engine Toggled!')
842 | else
843 | Notify('~r~You\'re not in a Vehicle!')
844 | end
845 | end
846 | ILights.Activated = function(ParentMenu, SelectedItem)
847 | local Vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
848 |
849 | if IsPedInVehicle(PlayerPedId(), Vehicle, false) then
850 | if IsVehicleInteriorLightOn(Vehicle) then
851 | SetVehicleInteriorlight(Vehicle, false)
852 | else
853 | SetVehicleInteriorlight(Vehicle, true)
854 | end
855 | else
856 | Notify('~r~You\'re not in a Vehicle!')
857 | end
858 | end
859 | VehicleMenu.OnSliderChange = function(sender, item, index)
860 | if item == Seat then
861 | VehicleSeat = item:IndexToItem(index)
862 | local Veh = GetVehiclePedIsIn(GetPlayerPed(-1),false)
863 | SetPedIntoVehicle(PlayerPedId(), Veh, VehicleSeat)
864 | end
865 | end
866 | VehicleMenu.OnListSelect = function(sender, item, index)
867 | local Ped = GetPlayerPed(-1)
868 | local Veh = GetVehiclePedIsIn(Ped, false)
869 |
870 | if item == Window then
871 | VehicleWindow = item:IndexToItem(index)
872 | if VehicleWindow == 'Front' then
873 | if IsPedInAnyVehicle(Ped, false) then
874 | if (GetPedInVehicleSeat(Veh, -1) == Ped) then
875 | SetEntityAsMissionEntity(Veh, true, true)
876 | if (WindowFrontRolled) then
877 | RollDownWindow(Veh, 0)
878 | RollDownWindow(Veh, 1)
879 | WindowFrontRolled = false
880 | else
881 | RollUpWindow(Veh, 0)
882 | RollUpWindow(Veh, 1)
883 | WindowFrontRolled = true
884 | end
885 | end
886 | end
887 | elseif VehicleWindow == 'Rear' then
888 | if IsPedInAnyVehicle(Ped, false) then
889 | if (GetPedInVehicleSeat(Veh, -1) == Ped) then
890 | SetEntityAsMissionEntity(Veh, true, true)
891 | if (WindowFrontRolled) then
892 | RollDownWindow(Veh, 2)
893 | RollDownWindow(Veh, 3)
894 | WindowFrontRolled = false
895 | else
896 | RollUpWindow(Veh, 2)
897 | RollUpWindow(Veh, 3)
898 | WindowFrontRolled = true
899 | end
900 | end
901 | end
902 | elseif VehicleWindow == 'All' then
903 | if IsPedInAnyVehicle(Ped, false) then
904 | if (GetPedInVehicleSeat(Veh, -1) == Ped) then
905 | SetEntityAsMissionEntity(Veh, true, true)
906 | if (WindowFrontRolled) then
907 | RollDownWindow(Veh, 0)
908 | RollDownWindow(Veh, 1)
909 | RollDownWindow(Veh, 2)
910 | RollDownWindow(Veh, 3)
911 | WindowFrontRolled = false
912 | else
913 | RollUpWindow(Veh, 0)
914 | RollUpWindow(Veh, 1)
915 | RollUpWindow(Veh, 2)
916 | RollUpWindow(Veh, 3)
917 | WindowFrontRolled = true
918 | end
919 | end
920 | end
921 | end
922 | elseif item == Door then
923 | local Doors = {'Driver', 'Passenger', 'Rear Left', 'Rear Right', 'Hood', 'Trunk', 'All'}
924 | VehicleDoor = item:IndexToItem(index)
925 | if VehicleDoor == 'Driver' then
926 | if Veh ~= nil and Veh ~= 0 and Veh ~= 1 then
927 | if GetVehicleDoorAngleRatio(Veh, 0) > 0 then
928 | SetVehicleDoorShut(Veh, 0, false)
929 | else
930 | SetVehicleDoorOpen(Veh, 0, false, false)
931 | end
932 | end
933 | elseif VehicleDoor == 'Passenger' then
934 | if Veh ~= nil and Veh ~= 0 and Veh ~= 1 then
935 | if GetVehicleDoorAngleRatio(Veh, 1) > 0 then
936 | SetVehicleDoorShut(Veh, 1, false)
937 | else
938 | SetVehicleDoorOpen(Veh, 1, false, false)
939 | end
940 | end
941 | elseif VehicleDoor == 'Rear Left' then
942 | if Veh ~= nil and Veh ~= 0 and Veh ~= 1 then
943 | if GetVehicleDoorAngleRatio(Veh, 2) > 0 then
944 | SetVehicleDoorShut(Veh, 2, false)
945 | else
946 | SetVehicleDoorOpen(Veh, 2, false, false)
947 | end
948 | end
949 | elseif VehicleDoor == 'Rear Right' then
950 | if Veh ~= nil and Veh ~= 0 and Veh ~= 1 then
951 | if GetVehicleDoorAngleRatio(Veh, 3) > 0 then
952 | SetVehicleDoorShut(Veh, 3, false)
953 | else
954 | SetVehicleDoorOpen(Veh, 3, false, false)
955 | end
956 | end
957 | elseif VehicleDoor == 'Hood' then
958 | if Veh ~= nil and Veh ~= 0 and Veh ~= 1 then
959 | if GetVehicleDoorAngleRatio(Veh, 4) > 0 then
960 | SetVehicleDoorShut(Veh, 4, false)
961 | else
962 | SetVehicleDoorOpen(Veh, 4, false, false)
963 | end
964 | end
965 | elseif VehicleDoor == 'Trunk' then
966 | if Veh ~= nil and Veh ~= 0 and Veh ~= 1 then
967 | if GetVehicleDoorAngleRatio(Veh, 5) > 0 then
968 | SetVehicleDoorShut(Veh, 5, false)
969 | else
970 | SetVehicleDoorOpen(Veh, 5, false, false)
971 | end
972 | end
973 | elseif VehicleDoor == 'All' then
974 | if Veh ~= nil and Veh ~= 0 and Veh ~= 1 then
975 | if GetVehicleDoorAngleRatio(Veh, 0) > 0 then
976 | SetVehicleDoorShut(Veh, 0, false)
977 | SetVehicleDoorShut(Veh, 1, false)
978 | SetVehicleDoorShut(Veh, 2, false)
979 | SetVehicleDoorShut(Veh, 3, false)
980 | SetVehicleDoorShut(Veh, 4, false)
981 | SetVehicleDoorShut(Veh, 5, false)
982 | else
983 | SetVehicleDoorOpen(Veh, 0, false, false)
984 | SetVehicleDoorOpen(Veh, 1, false, false)
985 | SetVehicleDoorOpen(Veh, 2, false, false)
986 | SetVehicleDoorOpen(Veh, 3, false, false)
987 | SetVehicleDoorOpen(Veh, 4, false, false)
988 | SetVehicleDoorOpen(Veh, 5, false, false)
989 | end
990 | end
991 | end
992 | end
993 | end
994 | FixVeh.Activated = function(ParentMenu, SelectedItem)
995 | local Vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
996 | if Vehicle ~= nil and Vehicle ~= 0 then
997 | SetVehicleEngineHealth(Vehicle, 100)
998 | SetVehicleFixed(Vehicle)
999 | Notify('~g~Vehicle Repaired!')
1000 | else
1001 | Notify('~r~You\'re not in a Vehicle!')
1002 | end
1003 |
1004 | end
1005 | CleanVeh.Activated = function(ParentMenu, SelectedItem)
1006 | local Vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
1007 | if Vehicle ~= nil and Vehicle ~= 0 then
1008 | SetVehicleDirtLevel(Vehicle, 0)
1009 | Notify('~g~Vehicle Cleaned!')
1010 | else
1011 | Notify('~r~You\'re not in a Vehicle!')
1012 | end
1013 | end
1014 | DelVeh.Activated = function(ParentMenu, SelectedItem)
1015 | if (IsPedSittingInAnyVehicle(PlayerPedId())) then
1016 | local Vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
1017 |
1018 | if (GetPedInVehicleSeat(Vehicle, -1) == PlayerPedId()) then
1019 | SetEntityAsMissionEntity(Vehicle, true, true)
1020 | DeleteVehicle(Vehicle)
1021 |
1022 | if (DoesEntityExist(Vehicle)) then
1023 | Notify('~o~Unable to delete vehicle, try again.')
1024 | else
1025 | Notify('~r~Vehicle Deleted!')
1026 | end
1027 | else
1028 | Notify('~r~You must be in the driver\'s seat!')
1029 | end
1030 | else
1031 | Notify('~r~You\'re not in a Vehicle!')
1032 | end
1033 | end
1034 | end
1035 |
1036 |
1037 |
1038 |
1039 |
1040 | if EmoteRestrict() then
1041 | local EmotesList = {}
1042 | for _, Emote in pairs(Config.EmotesList) do
1043 | table.insert(EmotesList, Emote.name)
1044 | end
1045 |
1046 | local EmotesMenu = NativeUI.CreateListItem('Emotes', EmotesList, 1, 'General RP Emotes')
1047 | MainMenu:AddItem(EmotesMenu)
1048 |
1049 | MainMenu.OnListSelect = function(sender, item, index)
1050 | if item == EmotesMenu then
1051 | for _, Emote in pairs(Config.EmotesList) do
1052 | if Emote.name == item:IndexToItem(index) then
1053 | PlayEmote(Emote.emote, Emote.name)
1054 | end
1055 | end
1056 | end
1057 | end
1058 | end
1059 |
1060 |
1061 |
1062 | _MenuPool:RefreshIndex()
1063 | end
1064 |
1065 |
1066 |
1067 | Citizen.CreateThread(function()
1068 | while true do
1069 | Citizen.Wait(0)
1070 |
1071 | _MenuPool:ProcessMenus()
1072 | _MenuPool:ControlDisablingEnabled(false)
1073 | _MenuPool:MouseControlsEnabled(false)
1074 |
1075 | if IsControlJustPressed(1, Config.MenuButton) and GetLastInputMethod(2) then
1076 | if not menuOpen then
1077 | Menu()
1078 | MainMenu:Visible(true)
1079 | else
1080 | _MenuPool:CloseAllMenus()
1081 | end
1082 | end
1083 | end
1084 | end)
1085 |
1086 |
1087 |
1088 | RegisterCommand(Config.Command, function(source, args, rawCommands)
1089 | if Config.OpenMenu == 1 then
1090 | Menu()
1091 | MainMenu:Visible(true)
1092 | end
1093 | end)
1094 |
1095 | Citizen.CreateThread(function()
1096 | if Config.OpenMenu == 1 then
1097 | TriggerEvent('chat:addSuggestion', '/' .. Config.Command, 'Used to open SEM_InteractionMenu')
1098 | end
1099 | end)
1100 |
--------------------------------------------------------------------------------
/server.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | ───────────────────────────────────────────────────────────────
3 |
4 | SEM_InteractionMenu (server.lua) - Created by Scott M
5 | Current Version: v1.7.1 (Sep 2021)
6 |
7 | Support: https://semdevelopment.com/discord
8 |
9 | !!! Change vaules in the 'config.lua' !!!
10 | DO NOT EDIT THIS IF YOU DON'T KNOW WHAT YOU ARE DOING
11 |
12 | ───────────────────────────────────────────────────────────────
13 | ]]
14 |
15 |
16 |
17 | RegisterServerEvent('SEM_InteractionMenu:GlobalChat')
18 | AddEventHandler('SEM_InteractionMenu:GlobalChat', function(Color, Prefix, Message)
19 | TriggerClientEvent('chatMessage', -1, Prefix, Color, Message)
20 | end)
21 |
22 | RegisterServerEvent('SEM_InteractionMenu:CuffNear')
23 | AddEventHandler('SEM_InteractionMenu:CuffNear', function(ID)
24 | if ID == -1 or ID == '-1' then
25 | if source ~= '' then
26 | print('^1[#' .. source .. '] ' .. GetPlayerName(source) .. ' - attempted to cuff all players^7')
27 | DropPlayer(source, '\n[SEM_InteractionMenu] Attempting to cuff all players')
28 | else
29 | print('^1Someone attempted to cuff all players^7')
30 | end
31 |
32 | return
33 | end
34 |
35 | if ID ~= false then
36 | TriggerClientEvent('SEM_InteractionMenu:Cuff', ID)
37 | end
38 | end)
39 |
40 | RegisterServerEvent('SEM_InteractionMenu:DragNear')
41 | AddEventHandler('SEM_InteractionMenu:DragNear', function(ID)
42 | if ID == -1 or ID == '-1' then
43 | if source ~= '' then
44 | print('^1[#' .. source .. '] ' .. GetPlayerName(source) .. ' - attempted to drag all players^7')
45 | DropPlayer(source, '\n[SEM_InteractionMenu] Attempting to drag all players')
46 | else
47 | print('^1Someone attempted to drag all players^7')
48 | end
49 |
50 | return
51 | end
52 |
53 | if ID ~= false and ID ~= source then
54 | TriggerClientEvent('SEM_InteractionMenu:Drag', ID, source)
55 | end
56 | end)
57 |
58 | RegisterServerEvent('SEM_InteractionMenu:SeatNear')
59 | AddEventHandler('SEM_InteractionMenu:SeatNear', function(ID, Vehicle)
60 | TriggerClientEvent('SEM_InteractionMenu:Seat', ID, Vehicle)
61 | end)
62 |
63 | RegisterServerEvent('SEM_InteractionMenu:UnseatNear')
64 | AddEventHandler('SEM_InteractionMenu:UnseatNear', function(ID, Vehicle)
65 | TriggerClientEvent('SEM_InteractionMenu:Unseat', ID, Vehicle)
66 | end)
67 |
68 | RegisterServerEvent('SEM_InteractionMenu:Jail')
69 | AddEventHandler('SEM_InteractionMenu:Jail', function(ID, Time)
70 | if ID == -1 or ID == '-1' then
71 | if source ~= '' then
72 | print('^1[#' .. source .. '] ' .. GetPlayerName(source) .. ' - attempted to jail all players^7')
73 | DropPlayer(source, '\n[SEM_InteractionMenu] Attempting to jail all players')
74 | else
75 | print('^1Someone attempted to jail all players^7')
76 | end
77 |
78 | return
79 | end
80 |
81 | TriggerClientEvent('SEM_InteractionMenu:JailPlayer', ID, Time)
82 | TriggerClientEvent('chatMessage', -1, 'Judge', {86, 96, 252}, GetPlayerName(ID) .. ' has been Jailed for ' .. Time .. ' months(s)')
83 | end)
84 |
85 | RegisterServerEvent('SEM_InteractionMenu:Unjail')
86 | AddEventHandler('SEM_InteractionMenu:Unjail', function(ID)
87 | TriggerClientEvent('SEM_InteractionMenu:UnjailPlayer', ID)
88 | end)
89 |
90 | RegisterServerEvent('SEM_InteractionMenu:Backup')
91 | AddEventHandler('SEM_InteractionMenu:Backup', function(Code, StreetName, Coords)
92 | TriggerClientEvent('SEM_InteractionMenu:CallBackup', -1, Code, StreetName, Coords)
93 | end)
94 |
95 | RegisterServerEvent('SEM_InteractionMenu:Ads')
96 | AddEventHandler('SEM_InteractionMenu:Ads', function(Text, Name, Loc, File)
97 | TriggerClientEvent('SEM_InteractionMenu:SyncAds', -1, Text, Name, Loc, File, source)
98 | end)
99 |
100 | BACList = {}
101 | RegisterServerEvent('SEM_InteractionMenu:BACSet')
102 | AddEventHandler('SEM_InteractionMenu:BACSet', function(BACLevel)
103 | BACList[source] = BACLevel
104 | end)
105 |
106 | RegisterServerEvent('SEM_InteractionMenu:BACTest')
107 | AddEventHandler('SEM_InteractionMenu:BACTest', function(ID)
108 | local BACLevel = BACList[ID]
109 | TriggerClientEvent('SEM_InteractionMenu:BACResult', source, BACLevel)
110 | end)
111 |
112 | Inventories = {}
113 | RegisterServerEvent('SEM_InteractionMenu:InventorySet')
114 | AddEventHandler('SEM_InteractionMenu:InventorySet', function(Items)
115 | Inventories[source] = Items
116 | end)
117 |
118 | RegisterServerEvent('SEM_InteractionMenu:InventorySearch')
119 | AddEventHandler('SEM_InteractionMenu:InventorySearch', function(ID)
120 | local Inventory = Inventories[ID]
121 |
122 | TriggerClientEvent('SEM_InteractionMenu:InventoryResult', source, Inventory)
123 | end)
124 |
125 | RegisterServerEvent('SEM_InteractionMenu:Hospitalize')
126 | AddEventHandler('SEM_InteractionMenu:Hospitalize', function(ID, Time, Location)
127 | if ID == -1 or ID == '-1' then
128 | if source ~= '' then
129 | print('^1[#' .. source .. '] ' .. GetPlayerName(source) .. ' - attempted to hospitalize all players^7')
130 | DropPlayer(source, '\n[SEM_InteractionMenu] Attempting to hospitalize all players')
131 | else
132 | print('^1Someone attempted to hospitalize all players^7')
133 | end
134 |
135 | return
136 | end
137 |
138 | TriggerClientEvent('SEM_InteractionMenu:HospitalizePlayer', ID, Time, Location)
139 | TriggerClientEvent('chatMessage', -1, 'Doctor', {86, 96, 252}, GetPlayerName(ID) .. ' has been Hospitalized for ' .. Time .. ' months(s)')
140 | end)
141 |
142 | RegisterServerEvent('SEM_InteractionMenu:Unhospitalize')
143 | AddEventHandler('SEM_InteractionMenu:Unhospitalize', function(ID)
144 | TriggerClientEvent('SEM_InteractionMenu:UnhospitalizePlayer', ID)
145 | end)
146 |
147 | RegisterServerEvent('SEM_InteractionMenu:LEOPerms')
148 | AddEventHandler('SEM_InteractionMenu:LEOPerms', function()
149 | if IsPlayerAceAllowed(source, 'sem_intmenu.leo') then
150 | TriggerClientEvent('SEM_InteractionMenu:LEOPermsResult', source, true)
151 | else
152 | TriggerClientEvent('SEM_InteractionMenu:LEOPermsResult', source, false)
153 | end
154 | end)
155 |
156 | RegisterServerEvent('SEM_InteractionMenu:FirePerms')
157 | AddEventHandler('SEM_InteractionMenu:FirePerms', function()
158 | if IsPlayerAceAllowed(source, 'sem_intmenu.fire') then
159 | TriggerClientEvent('SEM_InteractionMenu:FirePermsResult', source, true)
160 | else
161 | TriggerClientEvent('SEM_InteractionMenu:FirePermsResult', source, false)
162 | end
163 | end)
164 |
165 | RegisterServerEvent('SEM_InteractionMenu:UnjailPerms')
166 | AddEventHandler('SEM_InteractionMenu:UnjailPerms', function()
167 | if IsPlayerAceAllowed(source, 'sem_intmenu.unjail') then
168 | TriggerClientEvent('SEM_InteractionMenu:UnjailPermsResult', source, true)
169 | else
170 | TriggerClientEvent('SEM_InteractionMenu:UnjailPermsResult', source, false)
171 | end
172 | end)
173 |
174 | RegisterServerEvent('SEM_InteractionMenu:UnhospitalPerms')
175 | AddEventHandler('SEM_InteractionMenu:UnhospitalPerms', function()
176 | if IsPlayerAceAllowed(source, 'sem_intmenu.unhospital') then
177 | TriggerClientEvent('SEM_InteractionMenu:UnhospitalPermsResult', source, true)
178 | else
179 | TriggerClientEvent('SEM_InteractionMenu:UnhospitalPermsResult', source, false)
180 | end
181 | end)
182 |
183 |
184 | local resourceName =
185 | [[^3
186 | _____ ______ _____ _____
187 | / ____| | ___| | \ / |
188 | | (___ | |___ | |\ \ / /| |
189 | \___ \ | ___| | | \ \/ / | |
190 | ____) | | |___ | | \ / | |
191 | \_____/ |______| |__| \__/ |__|^7
192 | InteractionMenu
193 | Created By Scott M
194 | ]]
195 |
196 | Citizen.CreateThread(function()
197 | local currentVersion = GetResourceMetadata(GetCurrentResourceName(), 'version', 0)
198 |
199 | function VersionCheckHTTPRequest()
200 | PerformHttpRequest('https://semdevelopment.com/releases/interactionmenu/info/version.json', VersionCheck, 'GET')
201 | end
202 |
203 | function VersionCheck(err, response, headers)
204 | Citizen.Wait(3000)
205 | if err == 200 then
206 | local data = json.decode(response)
207 |
208 | if Config.VersionChecker == 0 then
209 | print(resourceName)
210 | end
211 |
212 | if currentVersion ~= data.NewestVersion then
213 | if Config.VersionChecker == 0 then
214 | print('\n ^1SEM_InteractionMenu is outdated!^7')
215 | print(' Latest Version: ^2' .. data.NewestVersion .. '^7')
216 | print(' Your Version: ^1' .. currentVersion .. '^7')
217 | print(' Please download the leastest version from ^5' .. data.DownloadLocation .. '^7')
218 |
219 | if data.Changes ~= '' then
220 | print('\n ^5Changes: ^7' .. data.Changes)
221 | end
222 | elseif Config.VersionChecker == 1 then
223 | print('\n^1SEM_InteractionMenu is outdated!^7')
224 | print('Latest Version: ^2' .. data.NewestVersion .. '^7')
225 | print('Please download the leastest version from ^5' .. data.DownloadLocation .. '^7\n')
226 | end
227 | else
228 | print('\n ^2SEM_InteractionMenu is up to date!^7')
229 | end
230 |
231 | print('\n')
232 | else
233 | print('^1SEM_InteractionMenu Version Check Failed!^7')
234 | end
235 |
236 | SetTimeout(60000000, VersionCheckHTTPRequest)
237 | end
238 |
239 | if Config.VersionChecker ~= 2 then
240 | if currentVersion then
241 | VersionCheckHTTPRequest()
242 | else
243 | print('^1SEM_InteractionMenu Version Check Failed!^7')
244 | end
245 | end
246 | end)
247 |
--------------------------------------------------------------------------------
/stream/char_floyd.ytd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sc0ttM/SEM_InteractionMenu/5f24874955458b3e01ae06dabc284da2f1b7c9be/stream/char_floyd.ytd
--------------------------------------------------------------------------------