mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-28 17:01:14 +00:00
Squashed commit of the following:
commit2f61c8b047Merge:87dce0d3a92e8456Author: Benzo <102178921+Benzo00@users.noreply.github.com> Date: Tue Dec 27 19:59:25 2022 +0100 Merge pull request #773 from esx-framework/tony-stark-17-patch-2 refactor: Pass character data to client commit87dce0d3ecMerge:89d3594746de4fcbAuthor: Benzo <102178921+Benzo00@users.noreply.github.com> Date: Tue Dec 27 19:55:19 2022 +0100 Merge pull request #774 from TheFantomas/main refactor(es_extended/client/main.lua): Remove unused variables and so… commit46de4fcb2cAuthor: TheFarFantomas <thefarfantomas@gmail.com> Date: Tue Dec 27 17:10:15 2022 +0100 refactor(es_extended/client/main.lua): Remove unused variables and some comments commita92e8456feAuthor: Tony Stark <76168122+tony-stark-17@users.noreply.github.com> Date: Mon Dec 26 17:15:55 2022 +0530 Update main.lua commit471e19fb53Author: Tony Stark <76168122+tony-stark-17@users.noreply.github.com> Date: Mon Dec 26 16:14:37 2022 +0530 refactor: Pass character data to client commit89d35947c7Merge:66ec0972634a5c74Author: Gellipapa <gellerthorvath0@gmail.com> Date: Thu Dec 22 00:56:10 2022 +0100 Merge pull request #766 from esx-framework/revert-751-develop Revert "refactor playerclass and default hud settings" commit634a5c740fAuthor: Gellipapa <gellerthorvath0@gmail.com> Date: Thu Dec 22 00:52:49 2022 +0100 Revert "refactor playerclass and default hud settings" commit66ec0972a3Merge:619571cfd719a536Author: Gellipapa <gellerthorvath0@gmail.com> Date: Thu Dec 22 00:08:55 2022 +0100 Merge pull request #763 from TheFarFantomas/patch-1 Update esx_multicharacter dependencies commit619571cfaeMerge:1eee8138c1e344e9Author: Gellipapa <gellerthorvath0@gmail.com> Date: Thu Dec 22 00:06:27 2022 +0100 Merge pull request #751 from Rav3n95/develop refactor playerclass and default hud settings commit1eee81382fMerge:5089accbc4e6712cAuthor: Gellipapa <gellerthorvath0@gmail.com> Date: Wed Dec 21 23:51:34 2022 +0100 Merge pull request #589 from SirLamaGott/main feat(esx_skin): update player weight on spawn commit5089accb66Merge:90c5454fbfbaea5dAuthor: Gellipapa <gellerthorvath0@gmail.com> Date: Wed Dec 21 23:50:31 2022 +0100 Merge pull request #764 from bitpredator/main fix:(Italian language correction) commitd719a53666Author: TheFarFantomas <120812953+TheFarFantomas@users.noreply.github.com> Date: Wed Dec 21 21:12:38 2022 +0100 Update esx_multicharacter dependencies commitbfbaea5d90Author: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Wed Dec 21 18:24:25 2022 +0100 fix:(Italian language correction) in the Italian translation some strings were not present commit90c5454f13Merge:b7097cb986ced8e9Author: Benzo <102178921+Benzo00@users.noreply.github.com> Date: Wed Dec 21 15:50:04 2022 +0100 Merge pull request #761 from paarbo/develop fix(legacy.sql): english labels commit86ced8e996Merge:b7097cb9ccfa9195Author: paarbo <35691223+paarbo@users.noreply.github.com> Date: Wed Dec 21 11:39:39 2022 +0000 Merge pull request #1 from paarbo/tr-fr-bk Translated bank related labels commitccfa9195e0Author: paarbo <35691223+paarbo@users.noreply.github.com> Date: Wed Dec 21 11:38:30 2022 +0000 Translated bank related labels commitb7097cb90dMerge:51bd2c70c59f6547Author: P Gergő <69343477+Rav3n95@users.noreply.github.com> Date: Tue Dec 20 22:16:07 2022 +0100 Merge pull request #760 from esx-framework/tony-stark-17-patch-2 Remove Unused code commit51bd2c70bbMerge:1e4f2293cf24e721Author: P Gergő <69343477+Rav3n95@users.noreply.github.com> Date: Tue Dec 20 21:49:02 2022 +0100 Merge pull request #759 from tony-stark-17/tony-stark-17-patch-1 feat: add canClose to context menu commitc59f654755Author: Tony Stark <76168122+tony-stark-17@users.noreply.github.com> Date: Tue Dec 20 23:26:09 2022 +0530 Remove Unused code commitcf24e7212dAuthor: Tony Stark <76168122+tony-stark-17@users.noreply.github.com> Date: Tue Dec 20 23:13:09 2022 +0530 Update Multicharacter to fix issue of closing context menu commit54088abcb6Author: Tony Stark <76168122+tony-stark-17@users.noreply.github.com> Date: Tue Dec 20 23:10:06 2022 +0530 Add canClose function to context menu Added a canClose parameter so that the user cannot close the menu by pressing ESC instead has to be force closed via code. commitd0d2c84186Author: Tony Stark <76168122+tony-stark-17@users.noreply.github.com> Date: Tue Dec 20 23:07:36 2022 +0530 Update UI for canClose function commit1e4f2293c2Author: Taavi <97351942+Taavi-AU@users.noreply.github.com> Date: Tue Dec 20 21:52:30 2022 +0800 context implementation (policejob) (#758) commit6ffecabaf2Author: Benzo <102178921+Benzo00@users.noreply.github.com> Date: Mon Dec 19 20:52:58 2022 +0100 esx_basicneeds rework -Kuuzoo commitad8c7e9d28Author: Benzo <102178921+Benzo00@users.noreply.github.com> Date: Mon Dec 19 18:02:05 2022 +0100 preparing for esx_hud commitc2c8b7881bMerge:6b113751024a1a42Author: Benzo <102178921+Benzo00@users.noreply.github.com> Date: Mon Dec 19 17:47:28 2022 +0100 Merge pull request #756 from ITKewai/main esx_identity: fix NUI not loading on low-end pc commit6b11375109Merge:a982659088b5aee1Author: P Gergő <69343477+Rav3n95@users.noreply.github.com> Date: Mon Dec 19 14:45:06 2022 +0100 Merge pull request #755 from wobozkyng/develop fix(es_extended/client/functions.lua): fix swapped SetVehicleExtra enabled parameter commitc1e344e9b5Author: P Gergő <paldi95@gmail.com> Date: Mon Dec 19 14:30:47 2022 +0100 Fuck property commitea22899afdAuthor: P Gergő <paldi95@gmail.com> Date: Mon Dec 19 14:23:28 2022 +0100 Disable few hud component commit024a1a4247Author: IT-Kewai <44037081+ITKewai@users.noreply.github.com> Date: Sun Dec 18 15:09:18 2022 +0100 esx_identity: fix NUI not loading on low-end pc commit88b5aee197Author: wobozkyng <42249669+wobozkyng@users.noreply.github.com> Date: Sun Dec 18 20:54:33 2022 +0700 fix(es_extended/client/functions.lua): fix swapped SetVehicleExtra enabled parameter commit9c3c225b11Author: P Gergő <69343477+Rav3n95@users.noreply.github.com> Date: Fri Dec 16 17:20:54 2022 +0100 refactor playerclass commita982659021Merge:caccbe49a9562d97Author: P Gergő <69343477+Rav3n95@users.noreply.github.com> Date: Fri Dec 16 16:44:57 2022 +0100 Merge pull request #750 from CommunityRP-FiveM-Server/develop fix typo commita9562d97d4Author: P Gergő <69343477+Rav3n95@users.noreply.github.com> Date: Fri Dec 16 16:44:22 2022 +0100 fix typo commitcaccbe492dMerge:7fa277119a5bef10Author: P Gergő <69343477+Rav3n95@users.noreply.github.com> Date: Fri Dec 16 11:52:38 2022 +0100 Merge pull request #748 from esx-framework/tony-stark-17-patch-1 fix: Fixed notification issue when xPlayer is nil commit7fa27711dbMerge:aa8362e7bdcd5330Author: P Gergő <69343477+Rav3n95@users.noreply.github.com> Date: Fri Dec 16 11:51:05 2022 +0100 Merge pull request #749 from lexinor/patch-2 refactor([SQL]/legacy.sql) : Changed PK in vehicle_sold commitbdcd53307aAuthor: Alessandro Alterno <28725795+lexinor@users.noreply.github.com> Date: Fri Dec 16 10:38:05 2022 +0100 Changed PK in vehicle_sold commit9a5bef1099Author: Tony Stark <76168122+tony-stark-17@users.noreply.github.com> Date: Fri Dec 16 09:34:45 2022 +0530 Update main.lua commit44a0021b7bAuthor: Tony Stark <76168122+tony-stark-17@users.noreply.github.com> Date: Fri Dec 16 09:21:19 2022 +0530 fix: Moved checks to if xPlayer isn't nil commitaa8362e77cMerge:3dd19f54ca0c535eAuthor: P Gergő <69343477+Rav3n95@users.noreply.github.com> Date: Thu Dec 15 21:26:47 2022 +0100 Merge pull request #747 from fivemland/refactor-weapons refactor: es_extended weapon functions commitca0c535ea9Author: Csoki <feketetibi71@gmail.com> Date: Thu Dec 15 20:44:38 2022 +0100 refactor: es_extended weapon functions commit3dd19f5442Merge:0da03b1d3f5a0901Author: P Gergő <69343477+Rav3n95@users.noreply.github.com> Date: Thu Dec 15 17:24:04 2022 +0100 Merge pull request #733 from wobozkyng/main refactor(es_extended\client\main.lua): entity check VehicleProperties Statebag handler commit0da03b1dafMerge:bd8c5844213c68e3Author: P Gergő <69343477+Rav3n95@users.noreply.github.com> Date: Thu Dec 15 16:29:40 2022 +0100 Merge pull request #743 from fivemland/fix-739 fix(es_extended/client/functions.lua): setVehicleProps commitbd8c5844f9Merge:24cc0c98702b64feAuthor: P Gergő <69343477+Rav3n95@users.noreply.github.com> Date: Thu Dec 15 16:29:03 2022 +0100 Merge pull request #745 from johnsoul777/patch-4 Create es.lua commit24cc0c98fcMerge:88fcbc69c26c2036Author: P Gergő <69343477+Rav3n95@users.noreply.github.com> Date: Thu Dec 15 16:27:49 2022 +0100 Merge pull request #744 from fivemland/fix-736 fix(esx_banking): issue #736 commit88fcbc6965Merge:a3bf2f92561740f1Author: P Gergő <69343477+Rav3n95@users.noreply.github.com> Date: Thu Dec 15 16:26:16 2022 +0100 Merge pull request #718 from fivemland/locale-update refactor/feat(es_extended): small refactor and add missing locales commit702b64fe83Author: AL1ƎN <72218928+johnsoul777@users.noreply.github.com> Date: Thu Dec 15 15:57:24 2022 +0100 Create es.lua commitc26c2036a5Author: Csoki <feketetibi71@gmail.com> Date: Thu Dec 15 14:07:13 2022 +0100 fix: 'no object by ID' warning commit82c83cf884Author: Csoki <feketetibi71@gmail.com> Date: Thu Dec 15 13:59:03 2022 +0100 esx_banking: remove unused xPlayer and event handle only if peds enabled commit213c68e3eeAuthor: Csoki <feketetibi71@gmail.com> Date: Thu Dec 15 13:52:14 2022 +0100 fix: setVehicleProps commita3bf2f9280Merge:d667930013281e60Author: P Gergő <69343477+Rav3n95@users.noreply.github.com> Date: Thu Dec 15 13:44:59 2022 +0100 Merge pull request #742 from Rav3n95/main fix text ui again commit13281e6053Author: P Gergő <69343477+Rav3n95@users.noreply.github.com> Date: Thu Dec 15 13:44:25 2022 +0100 fix text ui again commit561740f1ceMerge:bedefd7bd6679300Author: Csoki <feketetibi71@gmail.com> Date: Thu Dec 15 13:43:56 2022 +0100 Merge branch 'develop' into locale-update commitd667930063Merge:fbd544cc14b852deAuthor: P Gergő <69343477+Rav3n95@users.noreply.github.com> Date: Thu Dec 15 13:30:18 2022 +0100 Merge pull request #731 from Taavi-AU/develop context implementation commitfbd544cc37Merge:69a93dab1248c0a5Author: P Gergő <69343477+Rav3n95@users.noreply.github.com> Date: Thu Dec 15 13:28:24 2022 +0100 Merge pull request #711 from bitpredator/main feat:(Italian language translation) commit69a93dab36Merge:555afbcb9f072f99Author: P Gergő <69343477+Rav3n95@users.noreply.github.com> Date: Thu Dec 15 13:27:27 2022 +0100 Merge pull request #728 from TheFantomas/patch-2 Update cs.lua and dont translate some things commit555afbcb9aMerge:abcb11ef44169533Author: P Gergő <69343477+Rav3n95@users.noreply.github.com> Date: Thu Dec 15 13:25:55 2022 +0100 Merge pull request #734 from iSentrie/patch-8 fix(es_extended): allow set account to 0 too commitabcb11ef5eMerge:89194761227532d4Author: Benzo <102178921+Benzo00@users.noreply.github.com> Date: Mon Dec 12 17:49:31 2022 +0100 Merge pull request #735 from Mycroft-Studios/dev refactor(es_extended): Server sided Coord Saving + fix spawning of invalid vehicles commit227532d4b6Author: Mycroft <kaseyfitton@hotmail.co.uk> Date: Fri Dec 9 22:17:47 2022 +0000 fix(es_extended): dont spawn vehicle if non-existant commitbdd56329c7Author: Mycroft <kaseyfitton@hotmail.co.uk> Date: Fri Dec 9 18:15:15 2022 +0000 tweak(es_extended): remove unused event handler commit51280a094cAuthor: Mycroft <kaseyfitton@hotmail.co.uk> Date: Fri Dec 9 01:07:53 2022 +0000 refactor(es_extended): Server sided Coord Saving this is as thread less design that allows both xPlayer.coords and xPlayer.getCoords to correctly function, aswell as removing the need for the client to trigger a server event this is once again, a change that **requires** Onesync **infinity** commit4416953334Author: iSentrie <xvender7@gmail.com> Date: Thu Dec 8 19:03:11 2022 +0200 allow set account to 0 too pretty sure i was done this fix, but someone tend to undo fixes and have broken code over and over again commit3f5a090125Author: wobozkyng <42249669+wobozkyng@users.noreply.github.com> Date: Thu Dec 8 17:55:48 2022 +0700 refactor(es_extended\client\main.lua): entity check VehicleProperties Statebag handler commit1248c0a5cdAuthor: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Tue Dec 6 17:18:32 2022 +0100 feat:(Italian language for esx_skin) commitb55a603e4aAuthor: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Tue Dec 6 16:54:16 2022 +0100 feat:(Italian language for esx_skin) commit13a57c67dbMerge:3fb93998684752c8Author: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Tue Dec 6 16:33:22 2022 +0100 Merge branch 'esx-framework:main' into main commit14b852dee1Author: Taavi <97351942+Taavi-AU@users.noreply.github.com> Date: Mon Dec 5 15:26:49 2022 +0800 closecontext func commitfa8b7d6068Author: Taavi <97351942+Taavi-AU@users.noreply.github.com> Date: Mon Dec 5 15:16:40 2022 +0800 fix _U to TranslateCap commit04ebf295f6Author: Taavi <97351942+Taavi-AU@users.noreply.github.com> Date: Mon Dec 5 15:13:46 2022 +0800 remove closeall func commit25b1660fefAuthor: Taavi <97351942+Taavi-AU@users.noreply.github.com> Date: Mon Dec 5 15:12:46 2022 +0800 inventory context implementation commitd5888d3ff0Author: Taavi <97351942+Taavi-AU@users.noreply.github.com> Date: Mon Dec 5 15:12:03 2022 +0800 remove is menu open check commit88a32d6a6cAuthor: Taavi <97351942+Taavi-AU@users.noreply.github.com> Date: Mon Dec 5 15:02:14 2022 +0800 full context implementation commit9f072f99cfAuthor: TheFantomas <117121911+TheFantomas@users.noreply.github.com> Date: Sun Dec 4 12:16:28 2022 +0100 Update cs.lua and dont translate some things commit89194761e5Merge:e3b331473f54a18bAuthor: Benzo <102178921+Benzo00@users.noreply.github.com> Date: Sun Dec 4 04:46:57 2022 +0100 Merge pull request #722 from Taavi-AU/main context menu implementation commite3b3314706Author: Benzo <102178921+Benzo00@users.noreply.github.com> Date: Sun Dec 4 04:44:43 2022 +0100 refactor(es_extended) removing getshared event commiteb983f1206Author: Benzo <102178921+Benzo00@users.noreply.github.com> Date: Sun Dec 4 04:44:23 2022 +0100 refactor(es_extended) removing getshared event commitb4cfc9cef2Merge:27eeea5243e38873Author: P Gergő <69343477+Rav3n95@users.noreply.github.com> Date: Fri Dec 2 22:32:22 2022 +0100 Merge pull request #720 from johnsoul777/patch-2 New update in spanish commit27eeea5224Merge:684752c8a3d7b381Author: P Gergő <69343477+Rav3n95@users.noreply.github.com> Date: Fri Dec 2 22:31:11 2022 +0100 Merge pull request #721 from johnsoul777/patch-3 Last update in spanish commit3f54a18bc5Author: Taavi <97351942+Taavi-AU@users.noreply.github.com> Date: Thu Dec 1 21:36:16 2022 +0800 forgot sourceItem commit6f4de63488Author: Taavi <97351942+Taavi-AU@users.noreply.github.com> Date: Thu Dec 1 21:21:26 2022 +0800 fix invalid quantity when depositing items into storage commite070b83afdAuthor: Taavi <97351942+Taavi-AU@users.noreply.github.com> Date: Thu Dec 1 21:20:58 2022 +0800 complete context implementation commit5b357be9dcAuthor: Taavi <97351942+Taavi-AU@users.noreply.github.com> Date: Thu Dec 1 21:01:42 2022 +0800 fix typo commit131a9fcd8cAuthor: Taavi <97351942+Taavi-AU@users.noreply.github.com> Date: Thu Dec 1 20:55:09 2022 +0800 context implementation commit724ac6920cAuthor: Taavi <97351942+Taavi-AU@users.noreply.github.com> Date: Thu Dec 1 20:21:08 2022 +0800 context implementation commit90fd8dd22eAuthor: Taavi <97351942+Taavi-AU@users.noreply.github.com> Date: Thu Dec 1 20:17:59 2022 +0800 complete context implementation commit847a0d73b9Author: Taavi <97351942+Taavi-AU@users.noreply.github.com> Date: Thu Dec 1 20:14:08 2022 +0800 update hasExitedMarker (context) commit649ca301a6Author: Taavi <97351942+Taavi-AU@users.noreply.github.com> Date: Thu Dec 1 20:12:13 2022 +0800 complete context implementation commit7282e0f8cfAuthor: Taavi <97351942+Taavi-AU@users.noreply.github.com> Date: Thu Dec 1 19:54:39 2022 +0800 context implementation commitbf7bc4401bAuthor: Taavi <97351942+Taavi-AU@users.noreply.github.com> Date: Wed Nov 30 20:35:49 2022 +0800 add pharmacy items into config for better user friendlyness commit77863a229bAuthor: Taavi <97351942+Taavi-AU@users.noreply.github.com> Date: Wed Nov 30 20:29:16 2022 +0800 context implementation, replace whole commite3671ef0ceAuthor: Taavi <97351942+Taavi-AU@users.noreply.github.com> Date: Wed Nov 30 20:22:57 2022 +0800 context implementation commit805cc7ad3aAuthor: Taavi <97351942+Taavi-AU@users.noreply.github.com> Date: Wed Nov 30 20:22:06 2022 +0800 context implementation commite0c211d7ddAuthor: Taavi <97351942+Taavi-AU@users.noreply.github.com> Date: Wed Nov 30 20:21:36 2022 +0800 context implemenation commit0fca847965Author: Taavi <97351942+Taavi-AU@users.noreply.github.com> Date: Tue Nov 29 17:57:15 2022 +0800 context implementation commit429b454116Author: Taavi <97351942+Taavi-AU@users.noreply.github.com> Date: Tue Nov 29 17:56:12 2022 +0800 min/max config option commit7b7d4db48aAuthor: Taavi <97351942+Taavi-AU@users.noreply.github.com> Date: Tue Nov 29 17:34:52 2022 +0800 remove is menu open check commitd4500ad09bAuthor: Taavi <97351942+Taavi-AU@users.noreply.github.com> Date: Mon Nov 28 16:35:04 2022 +0800 context implementation commita3d7b381d2Author: AL1ƎN <72218928+johnsoul777@users.noreply.github.com> Date: Mon Nov 28 03:13:04 2022 +0100 Last update in spanish Last update in spanish commit43e388739eAuthor: AL1ƎN <72218928+johnsoul777@users.noreply.github.com> Date: Mon Nov 28 03:03:32 2022 +0100 New update in spanish New update in spanish commitc4e6712cb0Merge:33e1bb33c560653bAuthor: John Bronnert <65968077+SirLamaGott@users.noreply.github.com> Date: Sun Nov 27 22:04:55 2022 +0100 Merge branch 'esx-framework:main' into main commitbedefd7b5cAuthor: Csoki <feketetibi71@gmail.com> Date: Sun Nov 27 21:58:04 2022 +0100 es_extended: noclip # add missing locales # refactor noclip methods (thread only if noclip enabled) # format code commitb98de6c2c4Author: Csoki <feketetibi71@gmail.com> Date: Sun Nov 27 21:34:19 2022 +0100 es_extended: refactor esx:GetVehicleType event commita6a411a93aAuthor: Csoki <feketetibi71@gmail.com> Date: Sun Nov 27 21:29:20 2022 +0100 es_extended: add missing locales - tpm commit9a196c3012Author: Csoki <feketetibi71@gmail.com> Date: Sun Nov 27 21:24:53 2022 +0100 esx_garage: update 'hu' locales commit33e1bb331cAuthor: John <johnbronnert@gmail.com> Date: Sun Nov 27 21:16:46 2022 +0100 fix(esx_skin): removed if statement commit3fb93998e6Author: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Sun Nov 27 11:38:52 2022 +0100 feat:(Italian language translation) commitf17fc54e6bAuthor: John <johnbronnert@gmail.com> Date: Tue Oct 25 13:51:13 2022 +0200 feat(esx_skin): update player weight on spawn This updates the max weight on join, if a player has a bag.
This commit is contained in:
+11
-9
@@ -709,11 +709,13 @@ INSERT INTO `vehicle_categories` (`name`, `label`) VALUES
|
||||
--
|
||||
|
||||
CREATE TABLE `vehicle_sold` (
|
||||
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`client` varchar(50) NOT NULL,
|
||||
`model` varchar(50) NOT NULL,
|
||||
`plate` varchar(50) NOT NULL,
|
||||
`soldby` varchar(50) NOT NULL,
|
||||
`date` varchar(50) NOT NULL
|
||||
`date` varchar(50) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
--
|
||||
@@ -1001,20 +1003,20 @@ INSERT INTO `fine_types` (label, amount, category) VALUES
|
||||
--
|
||||
|
||||
INSERT INTO `addon_account` (name, label, shared) VALUES
|
||||
('society_banker','Banque',1),
|
||||
('bank_savings','Livret Bleu',0)
|
||||
('society_banker','Bank',1),
|
||||
('bank_savings','Savings account',0)
|
||||
;
|
||||
|
||||
INSERT INTO `jobs` (name, label) VALUES
|
||||
('banker','Banquier')
|
||||
('banker','Banker')
|
||||
;
|
||||
|
||||
INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES
|
||||
('banker',0,'advisor','Conseiller',10,'{}','{}'),
|
||||
('banker',1,'banker','Banquier',20,'{}','{}'),
|
||||
('banker',2,'business_banker',"Banquier d\'affaire",30,'{}','{}'),
|
||||
('banker',3,'trader','Trader',40,'{}','{}'),
|
||||
('banker',4,'boss','Patron',0,'{}','{}')
|
||||
('banker',0,'advisor','Consultant',10,'{}','{}'),
|
||||
('banker',1,'banker','Banker',20,'{}','{}'),
|
||||
('banker',2,'business_banker',"Investment banker",30,'{}','{}'),
|
||||
('banker',3,'trader','Broker',40,'{}','{}'),
|
||||
('banker',4,'boss','Boss',0,'{}','{}')
|
||||
;
|
||||
|
||||
--
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
AddEventHandler('esx:getSharedObject', function(cb)
|
||||
local Invoke = GetInvokingResource()
|
||||
print(('[^3WARNING^7] ^5%s^7 used ^5esx:getSharedObject^7, this method is deprecated and should not be used! Refer to ^5https://docs.esx-framework.org/tutorials/sharedevent^7 for more info!'):format(Invoke))
|
||||
cb(ESX)
|
||||
end)
|
||||
|
||||
exports('getSharedObject', function()
|
||||
return ESX
|
||||
end)
|
||||
|
||||
@@ -877,7 +877,7 @@ function ESX.Game.SetVehicleProperties(vehicle, props)
|
||||
|
||||
if props.extras ~= nil then
|
||||
for extraId, enabled in pairs(props.extras) do
|
||||
SetVehicleExtra(vehicle, tonumber(extraId), enabled and 0 or 0)
|
||||
SetVehicleExtra(vehicle, tonumber(extraId), enabled and 0 or 1)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1088,22 +1088,26 @@ end
|
||||
|
||||
function ESX.ShowInventory()
|
||||
local playerPed = ESX.PlayerData.ped
|
||||
local elements, currentWeight = {}, 0
|
||||
local elements = {
|
||||
{unselectable = true, icon = 'fas fa-box', title = 'Player Inventory'}
|
||||
}
|
||||
local currentWeight = 0
|
||||
|
||||
for i=1, #(ESX.PlayerData.accounts) do
|
||||
if ESX.PlayerData.accounts[i].money > 0 then
|
||||
local formattedMoney = TranslateCap('locale_currency', ESX.Math.GroupDigits(ESX.PlayerData.accounts[i].money))
|
||||
local canDrop = ESX.PlayerData.accounts[i].name ~= 'bank'
|
||||
|
||||
table.insert(elements, {
|
||||
label = ('%s: <span style="color:green;">%s</span>'):format(ESX.PlayerData.accounts[i].label, formattedMoney),
|
||||
elements[#elements+1] = {
|
||||
icon = 'fas fa-money-bill-wave',
|
||||
title = ('%s: <span style="color:green;">%s</span>'):format(ESX.PlayerData.accounts[i].label, formattedMoney),
|
||||
count = ESX.PlayerData.accounts[i].money,
|
||||
type = 'item_account',
|
||||
value = ESX.PlayerData.accounts[i].name,
|
||||
usable = false,
|
||||
rare = false,
|
||||
canRemove = canDrop
|
||||
})
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1111,15 +1115,16 @@ function ESX.ShowInventory()
|
||||
if v.count > 0 then
|
||||
currentWeight = currentWeight + (v.weight * v.count)
|
||||
|
||||
table.insert(elements, {
|
||||
label = ('%s x%s'):format(v.label, v.count),
|
||||
elements[#elements+1] = {
|
||||
icon = 'fas fa-box',
|
||||
title = ('%s x%s'):format(v.label, v.count),
|
||||
count = v.count,
|
||||
type = 'item_standard',
|
||||
value = v.name,
|
||||
usable = v.usable,
|
||||
rare = v.rare,
|
||||
canRemove = v.canRemove
|
||||
})
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1135,8 +1140,9 @@ function ESX.ShowInventory()
|
||||
label = v.label
|
||||
end
|
||||
|
||||
table.insert(elements, {
|
||||
label = label,
|
||||
elements[#elements+1] = {
|
||||
icon = 'fas fa-gun',
|
||||
title = label,
|
||||
count = 1,
|
||||
type = 'item_weapon',
|
||||
value = v.name,
|
||||
@@ -1145,76 +1151,80 @@ function ESX.ShowInventory()
|
||||
ammo = ammo,
|
||||
canGiveAmmo = (v.ammo ~= nil),
|
||||
canRemove = true
|
||||
})
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
ESX.UI.Menu.CloseAll()
|
||||
elements[#elements+1] = {
|
||||
unselectable = true,
|
||||
icon = "fas fa-weight",
|
||||
title = "Current Weight: "..currentWeight
|
||||
}
|
||||
|
||||
ESX.CloseContext()
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'inventory', {
|
||||
title = TranslateCap('inventory', currentWeight, ESX.PlayerData.maxWeight),
|
||||
align = 'bottom-right',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
menu.close()
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local player, distance = ESX.Game.GetClosestPlayer()
|
||||
elements = {}
|
||||
|
||||
if data.current.usable then
|
||||
table.insert(elements, {
|
||||
label = TranslateCap('use'),
|
||||
elements2 = {}
|
||||
|
||||
if element.usable then
|
||||
elements2[#elements2+1] = {
|
||||
icon = "fas fa-utensils",
|
||||
title = TranslateCap('use'),
|
||||
action = 'use',
|
||||
type = data.current.type,
|
||||
value = data.current.value
|
||||
})
|
||||
type = element.type,
|
||||
value = element.value
|
||||
}
|
||||
end
|
||||
|
||||
if data.current.canRemove then
|
||||
if element.canRemove then
|
||||
if player ~= -1 and distance <= 3.0 then
|
||||
table.insert(elements, {
|
||||
label = TranslateCap('give'),
|
||||
elements2[#elements2+1] = {
|
||||
icon = "fas fa-hands",
|
||||
title = TranslateCap('give'),
|
||||
action = 'give',
|
||||
type = data.current.type,
|
||||
value = data.current.value
|
||||
})
|
||||
type = element.type,
|
||||
value = element.value
|
||||
}
|
||||
end
|
||||
|
||||
table.insert(elements, {
|
||||
label = TranslateCap('remove'),
|
||||
elements2[#elements2+1] = {
|
||||
icon = "fas fa-trash",
|
||||
title = TranslateCap('remove'),
|
||||
action = 'remove',
|
||||
type = data.current.type,
|
||||
value = data.current.value
|
||||
})
|
||||
type = element.type,
|
||||
value = element.value
|
||||
}
|
||||
end
|
||||
|
||||
if data.current.type == 'item_weapon' and data.current.canGiveAmmo and data.current.ammo > 0 and player ~= -1 and
|
||||
distance <= 3.0 then
|
||||
table.insert(elements, {
|
||||
label = TranslateCap('giveammo'),
|
||||
if element.type == 'item_weapon' and element.canGiveAmmo and element.ammo > 0 and player ~= -1 and distance <= 3.0 then
|
||||
elements2[#elements2+1] = {
|
||||
icon = "fas fa-gun",
|
||||
title = TranslateCap('giveammo'),
|
||||
action = 'give_ammo',
|
||||
type = data.current.type,
|
||||
value = data.current.value
|
||||
})
|
||||
type = element.type,
|
||||
value = element.value
|
||||
}
|
||||
end
|
||||
|
||||
table.insert(elements, {
|
||||
label = TranslateCap('return'),
|
||||
elements2[#elements2+1] = {
|
||||
icon = "fas fa-arrow-left",
|
||||
title = TranslateCap('return'),
|
||||
action = 'return'
|
||||
})
|
||||
}
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'inventory_item', {
|
||||
title = data.current.label,
|
||||
align = 'bottom-right',
|
||||
elements = elements
|
||||
}, function(data1, menu1)
|
||||
local item, type = data1.current.value, data1.current.type
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
local item, type = element2.value, element2.type
|
||||
|
||||
if data1.current.action == 'give' then
|
||||
if element2.action == "give" then
|
||||
local playersNearby = ESX.Game.GetPlayersInArea(GetEntityCoords(playerPed), 3.0)
|
||||
|
||||
if #playersNearby > 0 then
|
||||
local players = {}
|
||||
elements = {}
|
||||
elements3 = {
|
||||
{unselectable = true, icon = "fas fa-users", title = "Nearby Players"}
|
||||
}
|
||||
|
||||
for k, playerNearby in ipairs(playersNearby) do
|
||||
players[GetPlayerServerId(playerNearby)] = true
|
||||
@@ -1222,19 +1232,15 @@ function ESX.ShowInventory()
|
||||
|
||||
ESX.TriggerServerCallback('esx:getPlayerNames', function(returnedPlayers)
|
||||
for playerId, playerName in pairs(returnedPlayers) do
|
||||
table.insert(elements, {
|
||||
label = playerName,
|
||||
elements3[#elements3+1] = {
|
||||
icon = "fas fa-user",
|
||||
title = playerName,
|
||||
playerId = playerId
|
||||
})
|
||||
}
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'give_item_to', {
|
||||
title = TranslateCap('give_to'),
|
||||
align = 'bottom-right',
|
||||
elements = elements
|
||||
}, function(data2, menu2)
|
||||
local selectedPlayer, selectedPlayerId = GetPlayerFromServerId(data2.current.playerId),
|
||||
data2.current.playerId
|
||||
ESX.OpenContext("right", elements3, function(menu3,element3)
|
||||
local selectedPlayer, selectedPlayerId = GetPlayerFromServerId(element3.playerId), element3.playerId
|
||||
playersNearby = ESX.Game.GetPlayersInArea(GetEntityCoords(playerPed), 3.0)
|
||||
playersNearby = ESX.Table.Set(playersNearby)
|
||||
|
||||
@@ -1244,62 +1250,58 @@ function ESX.ShowInventory()
|
||||
if IsPedOnFoot(selectedPlayerPed) and not IsPedFalling(selectedPlayerPed) then
|
||||
if type == 'item_weapon' then
|
||||
TriggerServerEvent('esx:giveInventoryItem', selectedPlayerId, type, item, nil)
|
||||
menu2.close()
|
||||
menu1.close()
|
||||
ESX.CloseContext()
|
||||
else
|
||||
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(),
|
||||
'inventory_item_count_give', {
|
||||
title = TranslateCap('amount')
|
||||
}, function(data3, menu3)
|
||||
local quantity = tonumber(data3.value)
|
||||
local elementsG = {
|
||||
{unselectable = true, icon = "fas fa-trash", title = element.title},
|
||||
{icon = "fas fa-tally", title = "Amount.", input = true, inputType = "number", inputPlaceholder = "Amount to give..", inputMin = 1, inputMax = 1000},
|
||||
{icon = "fas fa-check-double", title = "Confirm", val = "confirm"}
|
||||
}
|
||||
|
||||
if quantity and quantity > 0 and data.current.count >= quantity then
|
||||
TriggerServerEvent('esx:giveInventoryItem', selectedPlayerId, type,
|
||||
item, quantity)
|
||||
menu3.close()
|
||||
menu2.close()
|
||||
menu1.close()
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('amount_invalid'))
|
||||
end
|
||||
end, function(data3, menu3)
|
||||
menu3.close()
|
||||
end)
|
||||
ESX.OpenContext("right", elementsG, function(menuG,elementG)
|
||||
local quantity = tonumber(menuG.eles[2].inputValue)
|
||||
|
||||
if quantity and quantity > 0 and element.count >= quantity then
|
||||
TriggerServerEvent('esx:giveInventoryItem', selectedPlayerId, type, item, quantity)
|
||||
ESX.CloseContext()
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('amount_invalid'))
|
||||
end
|
||||
end)
|
||||
end
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('in_vehicle'))
|
||||
end
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('players_nearby'))
|
||||
menu2.close()
|
||||
ESX.CloseContext()
|
||||
end
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
end)
|
||||
end, players)
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('players_nearby'))
|
||||
end
|
||||
elseif data1.current.action == 'remove' then
|
||||
elseif element2.action == "remove" then
|
||||
if IsPedOnFoot(playerPed) and not IsPedFalling(playerPed) then
|
||||
local dict, anim = 'weapons@first_person@aim_rng@generic@projectile@sticky_bomb@', 'plant_floor'
|
||||
ESX.Streaming.RequestAnimDict(dict)
|
||||
|
||||
if type == 'item_weapon' then
|
||||
menu1.close()
|
||||
ESX.CloseContext()
|
||||
TaskPlayAnim(playerPed, dict, anim, 8.0, 1.0, 1000, 16, 0.0, false, false, false)
|
||||
RemoveAnimDict(dict)
|
||||
Wait(1000)
|
||||
TriggerServerEvent('esx:removeInventoryItem', type, item)
|
||||
else
|
||||
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'inventory_item_count_remove', {
|
||||
title = TranslateCap('amount')
|
||||
}, function(data2, menu2)
|
||||
local quantity = tonumber(data2.value)
|
||||
local elementsR = {
|
||||
{unselectable = true, icon = "fas fa-trash", title = element.title},
|
||||
{icon = "fas fa-tally", title = "Amount.", input = true, inputType = "number", inputPlaceholder = "Amount to remove..", inputMin = 1, inputMax = 1000},
|
||||
{icon = "fas fa-check-double", title = "Confirm", val = "confirm"}
|
||||
}
|
||||
|
||||
if quantity and quantity > 0 and data.current.count >= quantity then
|
||||
menu2.close()
|
||||
menu1.close()
|
||||
ESX.OpenContext("right", elementsR, function(menuR,elementR)
|
||||
local quantity = tonumber(menuR.eles[2].inputValue)
|
||||
|
||||
if quantity and quantity > 0 and element.count >= quantity then
|
||||
ESX.CloseContext()
|
||||
TaskPlayAnim(playerPed, dict, anim, 8.0, 1.0, 1000, 16, 0.0, false, false, false)
|
||||
RemoveAnimDict(dict)
|
||||
Wait(1000)
|
||||
@@ -1307,17 +1309,16 @@ function ESX.ShowInventory()
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('amount_invalid'))
|
||||
end
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
end)
|
||||
end
|
||||
end
|
||||
elseif data1.current.action == 'use' then
|
||||
elseif element2.action == "use" then
|
||||
ESX.CloseContext()
|
||||
TriggerServerEvent('esx:useItem', item)
|
||||
elseif data1.current.action == 'return' then
|
||||
ESX.UI.Menu.CloseAll()
|
||||
elseif element2.action == "return" then
|
||||
ESX.CloseContext()
|
||||
ESX.ShowInventory()
|
||||
elseif data1.current.action == 'give_ammo' then
|
||||
elseif element2.action == "give_ammo" then
|
||||
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
|
||||
local closestPed = GetPlayerPed(closestPlayer)
|
||||
local pedAmmo = GetAmmoInPedWeapon(playerPed, joaat(item))
|
||||
@@ -1325,25 +1326,25 @@ function ESX.ShowInventory()
|
||||
if IsPedOnFoot(closestPed) and not IsPedFalling(closestPed) then
|
||||
if closestPlayer ~= -1 and closestDistance < 3.0 then
|
||||
if pedAmmo > 0 then
|
||||
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'inventory_item_count_give', {
|
||||
title = TranslateCap('amountammo')
|
||||
}, function(data2, menu2)
|
||||
local quantity = tonumber(data2.value)
|
||||
local elementsGA = {
|
||||
{unselectable = true, icon = "fas fa-trash", title = element.title},
|
||||
{icon = "fas fa-tally", title = "Amount.", input = true, inputType = "number", inputPlaceholder = "Amount to give..", inputMin = 1, inputMax = 1000},
|
||||
{icon = "fas fa-check-double", title = "Confirm", val = "confirm"}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elementsGA, function(menuGA,elementGA)
|
||||
local quantity = tonumber(menuGA.eles[2].inputValue)
|
||||
|
||||
if quantity and quantity > 0 then
|
||||
if pedAmmo >= quantity then
|
||||
TriggerServerEvent('esx:giveInventoryItem', GetPlayerServerId(closestPlayer),
|
||||
'item_ammo', item, quantity)
|
||||
menu2.close()
|
||||
menu1.close()
|
||||
TriggerServerEvent('esx:giveInventoryItem', GetPlayerServerId(closestPlayer), 'item_ammo', item, quantity)
|
||||
ESX.CloseContext()
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('noammo'))
|
||||
end
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('amount_invalid'))
|
||||
end
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
end)
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('noammo'))
|
||||
@@ -1355,12 +1356,7 @@ function ESX.ShowInventory()
|
||||
ESX.ShowNotification(TranslateCap('in_vehicle'))
|
||||
end
|
||||
end
|
||||
end, function(data1, menu1)
|
||||
ESX.UI.Menu.CloseAll()
|
||||
ESX.ShowInventory()
|
||||
end)
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
+209
-246
@@ -1,5 +1,5 @@
|
||||
local pickups = {}
|
||||
local PlayerBank, PlayerMoney = 0,0
|
||||
|
||||
CreateThread(function()
|
||||
while not Config.Multichar do
|
||||
Wait(0)
|
||||
@@ -52,71 +52,71 @@ AddEventHandler('esx:playerLoaded', function(xPlayer, isNew, skin)
|
||||
|
||||
while ESX.PlayerData.ped == nil do Wait(20) end
|
||||
|
||||
-- enable PVP
|
||||
if Config.EnablePVP then
|
||||
SetCanAttackFriendly(ESX.PlayerData.ped, true, false)
|
||||
NetworkSetFriendlyFireOption(true)
|
||||
end
|
||||
|
||||
CreateThread(function()
|
||||
local SetPlayerHealthRechargeMultiplier = SetPlayerHealthRechargeMultiplier
|
||||
local BlockWeaponWheelThisFrame = BlockWeaponWheelThisFrame
|
||||
local DisableControlAction = DisableControlAction
|
||||
local IsPedArmed = IsPedArmed
|
||||
local SetPlayerLockonRangeOverride = SetPlayerLockonRangeOverride
|
||||
local DisablePlayerVehicleRewards = DisablePlayerVehicleRewards
|
||||
local RemoveAllPickupsOfType = RemoveAllPickupsOfType
|
||||
local HideHudComponentThisFrame = HideHudComponentThisFrame
|
||||
local PlayerId = PlayerId()
|
||||
local DisabledComps = {}
|
||||
for i=1, #(Config.RemoveHudCommonents) do
|
||||
if Config.RemoveHudCommonents[i] then
|
||||
DisabledComps[#DisabledComps + 1] = i
|
||||
end
|
||||
end
|
||||
while true do
|
||||
local Sleep = true
|
||||
CreateThread(function()
|
||||
local SetPlayerHealthRechargeMultiplier = SetPlayerHealthRechargeMultiplier
|
||||
local BlockWeaponWheelThisFrame = BlockWeaponWheelThisFrame
|
||||
local DisableControlAction = DisableControlAction
|
||||
local IsPedArmed = IsPedArmed
|
||||
local SetPlayerLockonRangeOverride = SetPlayerLockonRangeOverride
|
||||
local DisablePlayerVehicleRewards = DisablePlayerVehicleRewards
|
||||
local RemoveAllPickupsOfType = RemoveAllPickupsOfType
|
||||
local HideHudComponentThisFrame = HideHudComponentThisFrame
|
||||
local PlayerId = PlayerId()
|
||||
local DisabledComps = {}
|
||||
for i=1, #(Config.RemoveHudCommonents) do
|
||||
if Config.RemoveHudCommonents[i] then
|
||||
DisabledComps[#DisabledComps + 1] = i
|
||||
end
|
||||
end
|
||||
|
||||
if Config.DisableHealthRegeneration then
|
||||
Sleep = false
|
||||
SetPlayerHealthRechargeMultiplier(PlayerId, 0.0)
|
||||
end
|
||||
while true do
|
||||
local Sleep = true
|
||||
|
||||
if Config.DisableWeaponWheel then
|
||||
Sleep = false
|
||||
BlockWeaponWheelThisFrame()
|
||||
DisableControlAction(0, 37,true)
|
||||
end
|
||||
if Config.DisableHealthRegeneration then
|
||||
Sleep = false
|
||||
SetPlayerHealthRechargeMultiplier(PlayerId, 0.0)
|
||||
end
|
||||
|
||||
if Config.DisableAimAssist then
|
||||
Sleep = false
|
||||
if IsPedArmed(ESX.PlayerData.ped, 4) then
|
||||
SetPlayerLockonRangeOverride(PlayerId, 2.0)
|
||||
end
|
||||
end
|
||||
if Config.DisableWeaponWheel then
|
||||
Sleep = false
|
||||
BlockWeaponWheelThisFrame()
|
||||
DisableControlAction(0, 37,true)
|
||||
end
|
||||
|
||||
if Config.DisableVehicleRewards then
|
||||
Sleep = false
|
||||
DisablePlayerVehicleRewards(PlayerId)
|
||||
if Config.DisableAimAssist then
|
||||
Sleep = false
|
||||
if IsPedArmed(ESX.PlayerData.ped, 4) then
|
||||
SetPlayerLockonRangeOverride(PlayerId, 2.0)
|
||||
end
|
||||
end
|
||||
|
||||
if Config.DisableVehicleRewards then
|
||||
Sleep = false
|
||||
DisablePlayerVehicleRewards(PlayerId)
|
||||
end
|
||||
|
||||
if Config.DisableNPCDrops then
|
||||
Sleep = false
|
||||
RemoveAllPickupsOfType(0xDF711959) -- carbine rifle
|
||||
RemoveAllPickupsOfType(0xF9AFB48F) -- pistol
|
||||
RemoveAllPickupsOfType(0xA9355DCD) -- pumpshotgun
|
||||
end
|
||||
if Config.DisableNPCDrops then
|
||||
Sleep = false
|
||||
RemoveAllPickupsOfType(0xDF711959)
|
||||
RemoveAllPickupsOfType(0xF9AFB48F)
|
||||
RemoveAllPickupsOfType(0xA9355DCD)
|
||||
end
|
||||
|
||||
if #DisabledComps > 0 then
|
||||
Sleep = false
|
||||
for i=1, #(DisabledComps) do
|
||||
HideHudComponentThisFrame(DisabledComps[i])
|
||||
end
|
||||
if #DisabledComps > 0 then
|
||||
Sleep = false
|
||||
for i=1, #(DisabledComps) do
|
||||
HideHudComponentThisFrame(DisabledComps[i])
|
||||
end
|
||||
end
|
||||
|
||||
Wait(Sleep and 1500 or 0)
|
||||
end
|
||||
end)
|
||||
end
|
||||
end)
|
||||
|
||||
if Config.EnableHud then
|
||||
for i=1, #(ESX.PlayerData.accounts) do
|
||||
@@ -203,8 +203,8 @@ AddStateBagChangeHandler('VehicleProperties', nil, function(bagName, key, value)
|
||||
local NetId = value.NetId
|
||||
local Vehicle = NetworkGetEntityFromNetworkId(NetId)
|
||||
local Tries = 0
|
||||
while not DoesEntityExist(Vehicle) do
|
||||
local Vehicle = NetworkGetEntityFromNetworkId(NetId)
|
||||
while Vehicle == 0 do
|
||||
Vehicle = NetworkGetEntityFromNetworkId(NetId)
|
||||
Wait(100)
|
||||
Tries = Tries + 1
|
||||
if Tries > 300 then
|
||||
@@ -250,9 +250,7 @@ if not Config.OxInventory then
|
||||
ESX.UI.ShowInventoryItemNotification(true, item, count)
|
||||
end
|
||||
|
||||
if ESX.UI.Menu.IsOpen('default', 'es_extended', 'inventory') then
|
||||
ESX.ShowInventory()
|
||||
end
|
||||
ESX.ShowInventory()
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx:removeInventoryItem')
|
||||
@@ -269,9 +267,7 @@ if not Config.OxInventory then
|
||||
ESX.UI.ShowInventoryItemNotification(false, item, count)
|
||||
end
|
||||
|
||||
if ESX.UI.Menu.IsOpen('default', 'es_extended', 'inventory') then
|
||||
ESX.ShowInventory()
|
||||
end
|
||||
ESX.ShowInventory()
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx:addWeapon')
|
||||
@@ -438,32 +434,11 @@ function StartServerSyncLoops()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
-- sync current player coords with server
|
||||
CreateThread(function()
|
||||
local previousCoords = vector3(ESX.PlayerData.coords.x, ESX.PlayerData.coords.y, ESX.PlayerData.coords.z)
|
||||
|
||||
while ESX.PlayerLoaded do
|
||||
local playerPed = PlayerPedId()
|
||||
if ESX.PlayerData.ped ~= playerPed then ESX.SetPlayerData('ped', playerPed) end
|
||||
|
||||
if DoesEntityExist(ESX.PlayerData.ped) then
|
||||
local playerCoords = GetEntityCoords(ESX.PlayerData.ped)
|
||||
local distance = #(playerCoords - previousCoords)
|
||||
|
||||
if distance > 1 then
|
||||
previousCoords = playerCoords
|
||||
TriggerServerEvent('esx:updateCoords')
|
||||
end
|
||||
end
|
||||
Wait(1500)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
if not Config.OxInventory and Config.EnableDefaultInventory then
|
||||
RegisterCommand('showinv', function()
|
||||
if not ESX.PlayerData.dead and not ESX.UI.Menu.IsOpen('default', 'es_extended', 'inventory') then
|
||||
if not ESX.PlayerData.dead then
|
||||
ESX.ShowInventory()
|
||||
end
|
||||
end)
|
||||
@@ -537,158 +512,147 @@ AddEventHandler("esx:tpm", function()
|
||||
local GetVehiclePedIsIn = GetVehiclePedIsIn
|
||||
|
||||
ESX.TriggerServerCallback("esx:isUserAdmin", function(admin)
|
||||
if admin then
|
||||
local blipMarker = GetFirstBlipInfoId(8)
|
||||
if not DoesBlipExist(blipMarker) then
|
||||
ESX.ShowNotification('No Waypoint Set.', true, false, 140)
|
||||
return 'marker'
|
||||
end
|
||||
|
||||
-- Fade screen to hide how clients get teleported.
|
||||
DoScreenFadeOut(650)
|
||||
while not IsScreenFadedOut() do
|
||||
Wait(0)
|
||||
end
|
||||
|
||||
local ped, coords = ESX.PlayerData.ped, GetBlipInfoIdCoord(blipMarker)
|
||||
local vehicle = GetVehiclePedIsIn(ped, false)
|
||||
local oldCoords = GetEntityCoords(ped)
|
||||
|
||||
-- Unpack coords instead of having to unpack them while iterating.
|
||||
-- 825.0 seems to be the max a player can reach while 0.0 being the lowest.
|
||||
local x, y, groundZ, Z_START = coords['x'], coords['y'], 850.0, 950.0
|
||||
local found = false
|
||||
if vehicle > 0 then
|
||||
FreezeEntityPosition(vehicle, true)
|
||||
else
|
||||
FreezeEntityPosition(ped, true)
|
||||
end
|
||||
|
||||
for i = Z_START, 0, -25.0 do
|
||||
local z = i
|
||||
if (i % 2) ~= 0 then
|
||||
z = Z_START - i
|
||||
end
|
||||
|
||||
NewLoadSceneStart(x, y, z, x, y, z, 50.0, 0)
|
||||
local curTime = GetGameTimer()
|
||||
while IsNetworkLoadingScene() do
|
||||
if GetGameTimer() - curTime > 1000 then
|
||||
break
|
||||
end
|
||||
Wait(0)
|
||||
end
|
||||
NewLoadSceneStop()
|
||||
SetPedCoordsKeepVehicle(ped, x, y, z)
|
||||
|
||||
while not HasCollisionLoadedAroundEntity(ped) do
|
||||
RequestCollisionAtCoord(x, y, z)
|
||||
if GetGameTimer() - curTime > 1000 then
|
||||
break
|
||||
end
|
||||
Wait(0)
|
||||
end
|
||||
|
||||
-- Get ground coord. As mentioned in the natives, this only works if the client is in render distance.
|
||||
found, groundZ = GetGroundZFor_3dCoord(x, y, z, false)
|
||||
if found then
|
||||
Wait(0)
|
||||
SetPedCoordsKeepVehicle(ped, x, y, groundZ)
|
||||
break
|
||||
end
|
||||
Wait(0)
|
||||
end
|
||||
|
||||
-- Remove black screen once the loop has ended.
|
||||
DoScreenFadeIn(650)
|
||||
if vehicle > 0 then
|
||||
FreezeEntityPosition(vehicle, false)
|
||||
else
|
||||
FreezeEntityPosition(ped, false)
|
||||
end
|
||||
|
||||
if not found then
|
||||
-- If we can't find the coords, set the coords to the old ones.
|
||||
-- We don't unpack them before since they aren't in a loop and only called once.
|
||||
SetPedCoordsKeepVehicle(ped, oldCoords['x'], oldCoords['y'], oldCoords['z'] - 1.0)
|
||||
ESX.ShowNotification('Successfully Teleported', true, false, 140)
|
||||
end
|
||||
|
||||
-- If Z coord was found, set coords in found coords.
|
||||
SetPedCoordsKeepVehicle(ped, x, y, groundZ)
|
||||
ESX.ShowNotification('Successfully Teleported', true, false, 140)
|
||||
if not admin then
|
||||
return
|
||||
end
|
||||
local blipMarker = GetFirstBlipInfoId(8)
|
||||
if not DoesBlipExist(blipMarker) then
|
||||
ESX.ShowNotification(TranslateCap('tpm_nowaypoint'), true, false, 140)
|
||||
return 'marker'
|
||||
end
|
||||
|
||||
-- Fade screen to hide how clients get teleported.
|
||||
DoScreenFadeOut(650)
|
||||
while not IsScreenFadedOut() do
|
||||
Wait(0)
|
||||
end
|
||||
|
||||
local ped, coords = ESX.PlayerData.ped, GetBlipInfoIdCoord(blipMarker)
|
||||
local vehicle = GetVehiclePedIsIn(ped, false)
|
||||
local oldCoords = GetEntityCoords(ped)
|
||||
|
||||
-- Unpack coords instead of having to unpack them while iterating.
|
||||
-- 825.0 seems to be the max a player can reach while 0.0 being the lowest.
|
||||
local x, y, groundZ, Z_START = coords['x'], coords['y'], 850.0, 950.0
|
||||
local found = false
|
||||
FreezeEntityPosition(vehicle > 0 and vehicle or ped, true)
|
||||
|
||||
for i = Z_START, 0, -25.0 do
|
||||
local z = i
|
||||
if (i % 2) ~= 0 then
|
||||
z = Z_START - i
|
||||
end
|
||||
|
||||
NewLoadSceneStart(x, y, z, x, y, z, 50.0, 0)
|
||||
local curTime = GetGameTimer()
|
||||
while IsNetworkLoadingScene() do
|
||||
if GetGameTimer() - curTime > 1000 then
|
||||
break
|
||||
end
|
||||
Wait(0)
|
||||
end
|
||||
NewLoadSceneStop()
|
||||
SetPedCoordsKeepVehicle(ped, x, y, z)
|
||||
|
||||
while not HasCollisionLoadedAroundEntity(ped) do
|
||||
RequestCollisionAtCoord(x, y, z)
|
||||
if GetGameTimer() - curTime > 1000 then
|
||||
break
|
||||
end
|
||||
Wait(0)
|
||||
end
|
||||
|
||||
-- Get ground coord. As mentioned in the natives, this only works if the client is in render distance.
|
||||
found, groundZ = GetGroundZFor_3dCoord(x, y, z, false)
|
||||
if found then
|
||||
Wait(0)
|
||||
SetPedCoordsKeepVehicle(ped, x, y, groundZ)
|
||||
break
|
||||
end
|
||||
Wait(0)
|
||||
end
|
||||
|
||||
-- Remove black screen once the loop has ended.
|
||||
DoScreenFadeIn(650)
|
||||
FreezeEntityPosition(vehicle > 0 and vehicle or ped, false)
|
||||
|
||||
if not found then
|
||||
-- If we can't find the coords, set the coords to the old ones.
|
||||
-- We don't unpack them before since they aren't in a loop and only called once.
|
||||
SetPedCoordsKeepVehicle(ped, oldCoords['x'], oldCoords['y'], oldCoords['z'] - 1.0)
|
||||
ESX.ShowNotification(TranslateCap('tpm_success'), true, false, 140)
|
||||
end
|
||||
|
||||
-- If Z coord was found, set coords in found coords.
|
||||
SetPedCoordsKeepVehicle(ped, x, y, groundZ)
|
||||
ESX.ShowNotification(TranslateCap('tpm_success'), true, false, 140)
|
||||
end)
|
||||
end)
|
||||
|
||||
local noclip = false
|
||||
local noclip_pos = vector3(0, 0, 70)
|
||||
local heading = 0
|
||||
|
||||
local function noclipThread()
|
||||
while noclip do
|
||||
SetEntityCoordsNoOffset(ESX.PlayerData.ped, noclip_pos.x, noclip_pos.y, noclip_pos.z, 0, 0, 0)
|
||||
|
||||
if IsControlPressed(1, 34) then
|
||||
heading = heading + 1.5
|
||||
if heading > 360 then
|
||||
heading = 0
|
||||
end
|
||||
|
||||
SetEntityHeading(ESX.PlayerData.ped, heading)
|
||||
end
|
||||
|
||||
if IsControlPressed(1, 9) then
|
||||
heading = heading - 1.5
|
||||
if heading < 0 then
|
||||
heading = 360
|
||||
end
|
||||
|
||||
SetEntityHeading(ESX.PlayerData.ped, heading)
|
||||
end
|
||||
|
||||
if IsControlPressed(1, 8) then
|
||||
noclip_pos = GetOffsetFromEntityInWorldCoords(ESX.PlayerData.ped, 0.0, 1.0, 0.0)
|
||||
end
|
||||
|
||||
if IsControlPressed(1, 32) then
|
||||
noclip_pos = GetOffsetFromEntityInWorldCoords(ESX.PlayerData.ped, 0.0, -1.0, 0.0)
|
||||
end
|
||||
|
||||
if IsControlPressed(1, 27) then
|
||||
noclip_pos = GetOffsetFromEntityInWorldCoords(ESX.PlayerData.ped, 0.0, 0.0, 1.0)
|
||||
end
|
||||
|
||||
if IsControlPressed(1, 173) then
|
||||
noclip_pos = GetOffsetFromEntityInWorldCoords(ESX.PlayerData.ped, 0.0, 0.0, -1.0)
|
||||
end
|
||||
Wait(0)
|
||||
end
|
||||
end
|
||||
|
||||
RegisterNetEvent("esx:noclip")
|
||||
AddEventHandler("esx:noclip", function(input)
|
||||
ESX.TriggerServerCallback("esx:isUserAdmin", function(admin)
|
||||
if admin then
|
||||
local player = PlayerId()
|
||||
|
||||
local msg = "disabled"
|
||||
if(noclip == false)then
|
||||
noclip_pos = GetEntityCoords(ESX.PlayerData.ped, false)
|
||||
end
|
||||
|
||||
noclip = not noclip
|
||||
|
||||
if(noclip)then
|
||||
msg = "enabled"
|
||||
end
|
||||
|
||||
TriggerEvent("chatMessage", "Noclip has been ^2^*" .. msg)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
local heading = 0
|
||||
CreateThread(function()
|
||||
while true do
|
||||
local Sleep = 1500
|
||||
|
||||
if(noclip)then
|
||||
Sleep = 0
|
||||
SetEntityCoordsNoOffset(ESX.PlayerData.ped, noclip_pos.x, noclip_pos.y, noclip_pos.z, 0, 0, 0)
|
||||
|
||||
if(IsControlPressed(1, 34))then
|
||||
heading = heading + 1.5
|
||||
if(heading > 360)then
|
||||
heading = 0
|
||||
end
|
||||
|
||||
SetEntityHeading(ESX.PlayerData.ped, heading)
|
||||
end
|
||||
|
||||
if(IsControlPressed(1, 9))then
|
||||
heading = heading - 1.5
|
||||
if(heading < 0)then
|
||||
heading = 360
|
||||
end
|
||||
|
||||
SetEntityHeading(ESX.PlayerData.ped, heading)
|
||||
end
|
||||
|
||||
if(IsControlPressed(1, 8))then
|
||||
noclip_pos = GetOffsetFromEntityInWorldCoords(ESX.PlayerData.ped, 0.0, 1.0, 0.0)
|
||||
end
|
||||
|
||||
if(IsControlPressed(1, 32))then
|
||||
noclip_pos = GetOffsetFromEntityInWorldCoords(ESX.PlayerData.ped, 0.0, -1.0, 0.0)
|
||||
end
|
||||
|
||||
if(IsControlPressed(1, 27))then
|
||||
noclip_pos = GetOffsetFromEntityInWorldCoords(ESX.PlayerData.ped, 0.0, 0.0, 1.0)
|
||||
end
|
||||
|
||||
if(IsControlPressed(1, 173))then
|
||||
noclip_pos = GetOffsetFromEntityInWorldCoords(ESX.PlayerData.ped, 0.0, 0.0, -1.0)
|
||||
end
|
||||
if not admin then
|
||||
return
|
||||
end
|
||||
Wait(Sleep)
|
||||
end
|
||||
|
||||
if not noclip then
|
||||
noclip_pos = GetEntityCoords(ESX.PlayerData.ped, false)
|
||||
heading = GetEntityHeading(ESX.PlayerData.ped)
|
||||
end
|
||||
|
||||
noclip = not noclip
|
||||
if noclip then
|
||||
CreateThread(noclipThread)
|
||||
end
|
||||
|
||||
ESX.ShowNotification(TranslateCap('noclip_message', noclip and "enabled" or "disabled"), true, false, 140)
|
||||
end)
|
||||
end)
|
||||
|
||||
RegisterNetEvent("esx:killPlayer")
|
||||
@@ -705,34 +669,33 @@ AddEventHandler("esx:freezePlayer", function(input)
|
||||
SetPlayerInvincible(player, true)
|
||||
elseif input == 'unfreeze' then
|
||||
SetEntityCollision(ESX.PlayerData.ped, true)
|
||||
FreezeEntityPosition(ESX.PlayerData.ped, false)
|
||||
FreezeEntityPosition(ESX.PlayerData.ped, false)
|
||||
SetPlayerInvincible(player, false)
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterNetEvent("esx:GetVehicleType", function(Model, Request)
|
||||
local Model = Model
|
||||
local VehicleType = GetVehicleClassFromName(Model)
|
||||
local type = "automobile"
|
||||
if VehicleType == 15 then
|
||||
type = "heli"
|
||||
elseif VehicleType == 16 then
|
||||
type = "plane"
|
||||
elseif VehicleType == 14 then
|
||||
type = "boat"
|
||||
elseif VehicleType == 11 then
|
||||
type = "trailer"
|
||||
elseif VehicleType == 21 then
|
||||
type = "train"
|
||||
elseif VehicleType == 13 or VehicleType == 8 then
|
||||
type = "bike"
|
||||
end
|
||||
if Model == `submersible` or Model == `submersible2` then
|
||||
type = "submarine"
|
||||
end
|
||||
TriggerServerEvent("esx:ReturnVehicleType", type, Request)
|
||||
end)
|
||||
if not IsModelInCdimage(Model) then
|
||||
return TriggerServerEvent("esx:ReturnVehicleType", false, Request)
|
||||
end
|
||||
|
||||
if Model == `submersible` or Model == `submersible2` then
|
||||
return TriggerServerEvent("esx:ReturnVehicleType", "submarine", Request)
|
||||
end
|
||||
|
||||
local VehicleType = GetVehicleClassFromName(Model)
|
||||
local types = {
|
||||
[8] = "bike",
|
||||
[11] = "trailer",
|
||||
[13] = "bike",
|
||||
[14] = "boat",
|
||||
[15] = "heli",
|
||||
[16] = "plane",
|
||||
[21] = "train",
|
||||
}
|
||||
|
||||
TriggerServerEvent("esx:ReturnVehicleType", types[VehicleType] or "automobile", Request)
|
||||
end)
|
||||
|
||||
local DoNotUse = {
|
||||
'essentialmode',
|
||||
|
||||
@@ -4,6 +4,16 @@ for i = 48, 57 do table.insert(Charset, string.char(i)) end
|
||||
for i = 65, 90 do table.insert(Charset, string.char(i)) end
|
||||
for i = 97, 122 do table.insert(Charset, string.char(i)) end
|
||||
|
||||
local weaponsByName = {}
|
||||
local weaponsByHash = {}
|
||||
|
||||
CreateThread(function()
|
||||
for index, weapon in pairs(Config.Weapons) do
|
||||
weaponsByName[weapon.name] = index
|
||||
weaponsByHash[joaat(weapon.name)] = weapon
|
||||
end
|
||||
end)
|
||||
|
||||
function ESX.GetRandomString(length)
|
||||
math.randomseed(GetGameTimer())
|
||||
|
||||
@@ -17,19 +27,16 @@ end
|
||||
function ESX.GetWeapon(weaponName)
|
||||
weaponName = string.upper(weaponName)
|
||||
|
||||
for k,v in ipairs(Config.Weapons) do
|
||||
if v.name == weaponName then
|
||||
return k, v
|
||||
end
|
||||
end
|
||||
assert(weaponsByName[weaponName], "Invalid weapon name!")
|
||||
|
||||
local index = weaponsByName[weaponName]
|
||||
return index, Config.Weapons[index]
|
||||
end
|
||||
|
||||
function ESX.GetWeaponFromHash(weaponHash)
|
||||
for k,v in ipairs(Config.Weapons) do
|
||||
if joaat(v.name) == weaponHash then
|
||||
return v
|
||||
end
|
||||
end
|
||||
weaponHash = type(weaponHash) == "string" and joaat(weaponHash) or weaponHash
|
||||
|
||||
return weaponsByHash[weaponHash]
|
||||
end
|
||||
|
||||
function ESX.GetWeaponList()
|
||||
@@ -39,24 +46,21 @@ end
|
||||
function ESX.GetWeaponLabel(weaponName)
|
||||
weaponName = string.upper(weaponName)
|
||||
|
||||
for k,v in ipairs(Config.Weapons) do
|
||||
if v.name == weaponName then
|
||||
return v.label
|
||||
end
|
||||
end
|
||||
assert(weaponsByName[weaponName], "Invalid weapon name!")
|
||||
|
||||
local index = weaponsByName[weaponName]
|
||||
return Config.Weapons[index].label or ""
|
||||
end
|
||||
|
||||
function ESX.GetWeaponComponent(weaponName, weaponComponent)
|
||||
weaponName = string.upper(weaponName)
|
||||
local weapons = Config.Weapons
|
||||
|
||||
for k,v in ipairs(Config.Weapons) do
|
||||
if v.name == weaponName then
|
||||
for k2,v2 in ipairs(v.components) do
|
||||
if v2.name == weaponComponent then
|
||||
return v2
|
||||
end
|
||||
end
|
||||
assert(weaponsByName[weaponName], "Invalid weapon name!")
|
||||
local weapon = Config.Weapons[weaponsByName[weaponName]]
|
||||
|
||||
for _, component in ipairs(weapon.components) do
|
||||
if component.name == weaponComponent then
|
||||
return component
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -19,7 +19,7 @@ Config.Accounts = {
|
||||
Config.StartingAccountMoney = {bank = 50000}
|
||||
|
||||
Config.EnableSocietyPayouts = false -- pay from the society account that the player is employed at? Requirement: esx_society
|
||||
Config.EnableHud = true -- enable the default hud? Display current job and accounts (black, bank & cash)
|
||||
Config.EnableHud = false -- enable the default hud? Display current job and accounts (black, bank & cash)
|
||||
Config.MaxWeight = 24 -- the max inventory weight without backpack
|
||||
Config.PaycheckInterval = 7 * 60000 -- how often to recieve pay checks in milliseconds
|
||||
Config.EnableDebug = false -- Use Debug options?
|
||||
|
||||
+338
-207
@@ -1,228 +1,359 @@
|
||||
Locales['cs'] = {
|
||||
-- Inventory
|
||||
['inventory'] = 'inventář %s / %s',
|
||||
['use'] = 'použít',
|
||||
['give'] = 'dát',
|
||||
['remove'] = 'zahodit',
|
||||
['return'] = 'zpět',
|
||||
['give_to'] = 'dát',
|
||||
['amount'] = 'množství',
|
||||
['giveammo'] = 'dát munici',
|
||||
['amountammo'] = 'množství munice',
|
||||
['noammo'] = 'nemáte dostatek munice!',
|
||||
['gave_item'] = 'dali jste %sx %s %s',
|
||||
['received_item'] = 'obdrželi jste %sx %s od %s',
|
||||
['gave_weapon'] = 'dal jsi %s hráči %s',
|
||||
['gave_weapon_ammo'] = 'dal jsi ~o~%sx %s za %s to %s',
|
||||
['gave_weapon_withammo'] = 'dal jwi %s s ~o~%sx %s to %s',
|
||||
['gave_weapon_hasalready'] = '%s již má %s',
|
||||
['gave_weapon_noweapon'] = '%s nemá tuhle zbraň',
|
||||
['received_weapon'] = 'obdrzel jsi %s od %s',
|
||||
['received_weapon_ammo'] = 'obdrzel jsi ~o~%sx %s za tvůj %s od %s',
|
||||
['received_weapon_withammo'] = 'obdzel jsi %s s ~o~%sx %s od %s',
|
||||
['received_weapon_hasalready'] = '%s se pokusil ti dat %s, ale jiz tento predmet jednou mas',
|
||||
['received_weapon_noweapon'] = '%s se pokusil ti dat naboje pro %s, ale tuhle zbran nemas',
|
||||
['gave_account_money'] = 'dali jste $%s (%s) %s',
|
||||
['received_account_money'] = 'obdrželi jste $%s (%s) od %s',
|
||||
['amount_invalid'] = 'neplatné množství',
|
||||
['players_nearby'] = 'žádní hráči poblíž',
|
||||
['ex_inv_lim'] = 'akce není možná, překročen limit inventáře pro %s',
|
||||
['imp_invalid_quantity'] = 'akce není možná, neplatný počet',
|
||||
['imp_invalid_amount'] = 'akce není možná, neplatné množství',
|
||||
['threw_standard'] = 'vyhodil jsi %sx %s',
|
||||
['threw_account'] = 'vyhodil jsi $%s %s',
|
||||
['threw_weapon'] = 'vzhodil jsi %s',
|
||||
['threw_weapon_ammo'] = 'vyhodil jsi %s s ~o~%sx %s',
|
||||
['threw_weapon_already'] = 'jiz stejnou zbraan mas',
|
||||
['threw_cannot_pickup'] = 'tohle nemuzes sebrat, protoze tvuj inventar je plny',
|
||||
['threw_pickup_prompt'] = 'stiskni E po zvednuti',
|
||||
['inventory'] = 'Inventář ( Váha %s / %s )',
|
||||
['use'] = 'Použít',
|
||||
['give'] = 'Darovat',
|
||||
['remove'] = 'Odhodit',
|
||||
['return'] = 'Vrátit',
|
||||
['give_to'] = 'Darováno',
|
||||
['amount'] = 'Počet',
|
||||
['giveammo'] = 'Podat náboje',
|
||||
['amountammo'] = 'Počet nábojů',
|
||||
['noammo'] = 'Nedostatek!',
|
||||
['gave_item'] = 'Daroval %sx %s pro %s',
|
||||
['received_item'] = 'Získáno %sx %s od %s',
|
||||
['gave_weapon'] = 'Předání %s pro %s',
|
||||
['gave_weapon_ammo'] = 'Darování ~o~%sx %s do %s pro %s',
|
||||
['gave_weapon_withammo'] = 'Darování %s s ~o~%sx %s pro %s',
|
||||
['gave_weapon_hasalready'] = '%s již vlastní %s',
|
||||
['gave_weapon_noweapon'] = '%s nemá tuto zbraň',
|
||||
['received_weapon'] = 'Obdrženo %s od %s',
|
||||
['received_weapon_ammo'] = 'Obdrženo ~o~%sx %s pro zbraň %s od %s',
|
||||
['received_weapon_withammo'] = 'Obdrženo %s s ~o~%sx %s od %s',
|
||||
['received_weapon_hasalready'] = '%s se snažil darovat %s, ale již tuto zbraň máš',
|
||||
['received_weapon_noweapon'] = '%s se snažil ti dát náboje %s, ale nemáš potřebnou zbrań',
|
||||
['gave_account_money'] = 'Darováno $%s (%s) pro %s',
|
||||
['received_account_money'] = 'Získáno $%s (%s) od %s',
|
||||
['amount_invalid'] = 'Špatné množství',
|
||||
['players_nearby'] = 'Žádný hráč není poblíž',
|
||||
['ex_inv_lim'] = 'Nelze sebrat,protože máš plné kapsy %s',
|
||||
['imp_invalid_quantity'] = 'Neplatné množství',
|
||||
['imp_invalid_amount'] = 'Nelze provést, neplatné množství',
|
||||
['threw_standard'] = 'Zahozeno %sx %s',
|
||||
['threw_account'] = 'Zahozeno $%s %s',
|
||||
['threw_weapon'] = 'Zahozeno %s',
|
||||
['threw_weapon_ammo'] = 'Zahozeno %s s ~o~%sx %s',
|
||||
['threw_weapon_already'] = 'Již vlastníš tuto zbraň',
|
||||
['threw_cannot_pickup'] = 'Kapsy máš plné, nemůžeš sebrat!',
|
||||
['threw_pickup_prompt'] = 'Zmáčkni E pro sebrání!',
|
||||
|
||||
-- Key mapping
|
||||
['keymap_showinventory'] = 'zobrazit inventar',
|
||||
['keymap_showinventory'] = 'Otevřít inventář',
|
||||
|
||||
-- Salary related
|
||||
['received_salary'] = 'obdrželi jste výplatu: $%s',
|
||||
['received_help'] = 'obdrželi jste sociální dávku: $%s',
|
||||
['company_nomoney'] = 'společnost u které jste zaměstananí nemá peníze na váš plat',
|
||||
['received_paycheck'] = 'obdržena výplata',
|
||||
['bank'] = 'bankovní účet',
|
||||
['account_bank'] = 'banka',
|
||||
['account_black_money'] = 'spinave penize',
|
||||
['account_money'] = 'kapesne',
|
||||
['received_salary'] = 'Obdržel jsi: $%s',
|
||||
['received_help'] = 'Obdržel jsi svůj podíl: $%s',
|
||||
['company_nomoney'] = 'Firma kde pracujete je příliš chudá, aby vám zaplatila',
|
||||
['received_paycheck'] = 'Obdržena platba',
|
||||
['bank'] = 'Banka',
|
||||
['account_bank'] = 'V bance',
|
||||
['account_black_money'] = 'Špináve peníze',
|
||||
['account_money'] = 'V kapse',
|
||||
|
||||
['act_imp'] = 'akce není možná',
|
||||
['in_vehicle'] = 'nemůže nic dát osobě ve vozidle',
|
||||
['act_imp'] = 'Nelze provést',
|
||||
['in_vehicle'] = 'Nelze provést, hráč je v autě',
|
||||
|
||||
-- Commands
|
||||
['command_car'] = 'spawn an vehicle',
|
||||
['command_car_car'] = 'vehicle spawn name or hash',
|
||||
['command_cardel'] = 'delete vehicle in proximity',
|
||||
['command_cardel_radius'] = 'optional, delete every vehicle within the specified radius',
|
||||
['command_clear'] = 'clear chat',
|
||||
['command_clearall'] = 'clear chat for all players',
|
||||
['command_clearinventory'] = 'clear player inventory',
|
||||
['command_clearloadout'] = 'clear a player loadout',
|
||||
['command_giveaccountmoney'] = 'give account money',
|
||||
['command_giveaccountmoney_account'] = 'valid account name',
|
||||
['command_giveaccountmoney_amount'] = 'amount to add',
|
||||
['command_giveaccountmoney_invalid'] = 'invalid account name',
|
||||
['command_giveitem'] = 'give an item to a player',
|
||||
['command_giveitem_item'] = 'item name',
|
||||
['command_giveitem_count'] = 'item count',
|
||||
['command_giveweapon'] = 'give a weapon to a player',
|
||||
['command_giveweapon_weapon'] = 'weapon name',
|
||||
['command_giveweapon_ammo'] = 'ammo count',
|
||||
['command_giveweapon_hasalready'] = 'player already has that weapon',
|
||||
['command_giveweaponcomponent'] = 'give weapon component',
|
||||
['command_giveweaponcomponent_component'] = 'component name',
|
||||
['command_giveweaponcomponent_invalid'] = 'invalid weapon component',
|
||||
['command_giveweaponcomponent_hasalready'] = 'player already has that weapon component',
|
||||
['command_giveweaponcomponent_missingweapon'] = 'player does not have that weapon',
|
||||
['command_save'] = 'save a player to database',
|
||||
['command_saveall'] = 'save all players to database',
|
||||
['command_setaccountmoney'] = 'set account money for a player',
|
||||
['command_setaccountmoney_amount'] = 'amount of money to set',
|
||||
['command_setcoords'] = 'teleport to coordinates',
|
||||
['command_setcoords_x'] = 'x axis',
|
||||
['command_setcoords_y'] = 'y axis',
|
||||
['command_setcoords_z'] = 'z axis',
|
||||
['command_setjob'] = 'set job for a player',
|
||||
['command_setjob_job'] = 'job name',
|
||||
['command_setjob_grade'] = 'job grade',
|
||||
['command_setjob_invalid'] = 'the job, grade or both are invalid',
|
||||
['command_setgroup'] = 'set player group',
|
||||
['command_setgroup_group'] = 'group name',
|
||||
['commanderror_argumentmismatch'] = 'argument count mismatch (passed %s, wanted %s)',
|
||||
['commanderror_argumentmismatch_number'] = 'argument #%s type mismatch (passed string, wanted number)',
|
||||
['commanderror_invaliditem'] = 'invalid item name',
|
||||
['commanderror_invalidweapon'] = 'invalid weapon',
|
||||
['commanderror_console'] = 'that command can not be run from console',
|
||||
['commanderror_invalidcommand'] = '/%s is not an valid command!',
|
||||
['commanderror_invalidplayerid'] = 'there is no player online matching that server id',
|
||||
['commandgeneric_playerid'] = 'player id',
|
||||
['command_giveammo_noweapon_found'] = '%s does not have that weapon',
|
||||
['command_giveammo_weapon'] = 'Weapon name',
|
||||
['command_giveammo_ammo'] = 'Ammo Quantity',
|
||||
['command_bring'] = 'Přivolat si hráče k sobě',
|
||||
['command_car'] = 'Spawnout vozidlo',
|
||||
['command_car_car'] = 'Zadej jméno vozidla nebo spawnname',
|
||||
['command_cardel'] = 'Odstranění vozidla v okolí',
|
||||
['command_cardel_radius'] = 'Odstranění vozidla v určeném dosahu',
|
||||
['command_clear'] = 'Vymazat text v chatu',
|
||||
['command_clearall'] = 'Vymazat chet pro všechny hráče',
|
||||
['command_clearinventory'] = 'Vymazat všechny věci z invetáře hráče',
|
||||
['command_clearloadout'] = 'Vymazat všechny zbraně z inventáře hráče',
|
||||
['command_freeze'] = 'Zmrazit hráče',
|
||||
['command_unfreeze'] = 'Odmrazit hráče',
|
||||
['command_giveaccountmoney'] = 'Poslat peníze na účet ',
|
||||
['command_giveaccountmoney_account'] = 'Převést peníze na účet',
|
||||
['command_giveaccountmoney_amount'] = 'Částka k poslání',
|
||||
['command_giveaccountmoney_invalid'] = 'Neplátné jméno',
|
||||
['command_giveitem'] = 'Darovat věc hráči',
|
||||
['command_giveitem_item'] = 'Název věci',
|
||||
['command_giveitem_count'] = 'Množství',
|
||||
['command_giveweapon'] = 'Dát zbraň hráči',
|
||||
['command_giveweapon_weapon'] = 'Název zbraně',
|
||||
['command_giveweapon_ammo'] = 'Množství náboje',
|
||||
['command_giveweapon_hasalready'] = 'Hráč již má tuto zbraň',
|
||||
['command_giveweaponcomponent'] = 'Darovat přídavek na zbraň',
|
||||
['command_giveweaponcomponent_component'] = 'Název zbraně',
|
||||
['command_giveweaponcomponent_invalid'] = 'Špatné jméno přídavku',
|
||||
['command_giveweaponcomponent_hasalready'] = 'Hráč již má tento přídavek',
|
||||
['command_giveweaponcomponent_missingweapon'] = 'Hráč nemá tuto zbrań',
|
||||
['command_goto'] = 'Teleportování sebe k hráči',
|
||||
['command_kill'] = 'Zabití hráče',
|
||||
['command_save'] = 'Uložení dat hráče',
|
||||
['command_saveall'] = 'Uložení veškerých dat hráče',
|
||||
['command_setaccountmoney'] = 'Nastavení určeného počtu peněz',
|
||||
['command_setaccountmoney_amount'] = 'Počet peněz',
|
||||
['command_setcoords'] = 'Teleportování na určené souřadnice',
|
||||
['command_setcoords_x'] = 'Hodnota X',
|
||||
['command_setcoords_y'] = 'Hodnota Y',
|
||||
['command_setcoords_z'] = 'Hodnota Z',
|
||||
['command_setjob'] = 'Nastavit práci hráči',
|
||||
['command_setjob_job'] = 'Název práce',
|
||||
['command_setjob_grade'] = 'Pozice ve firmě',
|
||||
['command_setjob_invalid'] = 'Špatné zadání práce,hodnosti nebo i obou hodnot',
|
||||
['command_setgroup'] = 'Nastavení práv hráči',
|
||||
['command_setgroup_group'] = 'Název skupiny',
|
||||
['commanderror_argumentmismatch'] = 'Chybný počet hodnot (správně %s, potřebných %s)',
|
||||
['commanderror_argumentmismatch_number'] = 'Chybně zadaná hodnot #%s (správně, špatně)',
|
||||
['commanderror_invaliditem'] = 'Špatný předmět',
|
||||
['commanderror_invalidweapon'] = 'Špatná zbraň',
|
||||
['commanderror_console'] = 'příkaz nelze být zpracován v konzoli',
|
||||
['commanderror_invalidcommand'] = 'Špatný příakz - /%s',
|
||||
['commanderror_invalidplayerid'] = 'Hráč není dostupný',
|
||||
['commandgeneric_playerid'] = 'Id hráče',
|
||||
['command_giveammo_noweapon_found'] = '%s nemá tuto zbraň',
|
||||
['command_giveammo_weapon'] = 'Název zbraně',
|
||||
['command_giveammo_ammo'] = 'Počet nábojů',
|
||||
|
||||
-- Locale settings
|
||||
['locale_digit_grouping_symbol'] = ' ',
|
||||
['locale_currency'] = '$%s',
|
||||
['locale_digit_grouping_symbol'] = ',',
|
||||
['locale_currency'] = '£%s',
|
||||
|
||||
-- Weapons
|
||||
['weapon_knife'] = 'nuz',
|
||||
['weapon_nightstick'] = 'policejni obusek',
|
||||
['weapon_hammer'] = 'kladivo',
|
||||
['weapon_bat'] = 'basseballka',
|
||||
['weapon_golfclub'] = 'gollfova hul',
|
||||
['weapon_crowbar'] = 'pacidlo',
|
||||
['weapon_pistol'] = 'pistole',
|
||||
['weapon_combatpistol'] = 'utocna pistole',
|
||||
['weapon_appistol'] = 'ap pistole',
|
||||
['weapon_pistol50'] = 'pistole .50',
|
||||
['weapon_microsmg'] = 'micro smg',
|
||||
['weapon_smg'] = 'smg',
|
||||
['weapon_assaultsmg'] = 'utocne smg',
|
||||
['weapon_assaultrifle'] = 'utocna puska',
|
||||
['weapon_carbinerifle'] = 'carbine puska',
|
||||
['weapon_advancedrifle'] = 'pokrocily puska',
|
||||
['weapon_mg'] = 'mg',
|
||||
['weapon_combatmg'] = 'utocne mg',
|
||||
['weapon_pumpshotgun'] = 'pumpovana brokovnice',
|
||||
['weapon_sawnoffshotgun'] = 'upilovana brokovnice',
|
||||
['weapon_assaultshotgun'] = 'utocna brokovnice',
|
||||
['weapon_bullpupshotgun'] = 'bullpup brokovnice',
|
||||
['weapon_stungun'] = 'tazer',
|
||||
['weapon_sniperrifle'] = 'sniperka',
|
||||
['weapon_heavysniper'] = 'tezka sniperka',
|
||||
['weapon_grenadelauncher'] = 'launcher granatu',
|
||||
['weapon_rpg'] = 'raketomet',
|
||||
['weapon_minigun'] = 'minigun',
|
||||
['weapon_grenade'] = 'granat',
|
||||
['weapon_stickybomb'] = 'lepkava bomba',
|
||||
['weapon_smokegrenade'] = 'kourovy granat',
|
||||
['weapon_bzgas'] = 'bz gas',
|
||||
['weapon_molotov'] = 'molotov koktejl',
|
||||
['weapon_fireextinguisher'] = 'hasicak',
|
||||
['weapon_petrolcan'] = 'kanystr',
|
||||
['weapon_ball'] = 'koule',
|
||||
['weapon_snspistol'] = 'sns pistole',
|
||||
['weapon_bottle'] = 'lahev',
|
||||
['weapon_gusenberg'] = 'gusenberguv zametac',
|
||||
['weapon_specialcarbine'] = 'specialni karabina',
|
||||
['weapon_heavypistol'] = 'tezka pistole',
|
||||
['weapon_bullpuprifle'] = 'bullpup puska',
|
||||
['weapon_dagger'] = 'dyka',
|
||||
['weapon_vintagepistol'] = 'velmi stara pistole',
|
||||
['weapon_firework'] = 'ohnostroj',
|
||||
['weapon_musket'] = 'musketa',
|
||||
['weapon_heavyshotgun'] = 'tezka brokovnice',
|
||||
['weapon_marksmanrifle'] = 'puska strelce',
|
||||
['weapon_hominglauncher'] = 'navadeci launcher',
|
||||
['weapon_proxmine'] = 'mina na blizko',
|
||||
['weapon_snowball'] = 'snehova koule',
|
||||
['weapon_flaregun'] = 'svetlice',
|
||||
['weapon_combatpdw'] = 'utocne pdw',
|
||||
['weapon_marksmanpistol'] = 'pistole strelce',
|
||||
['weapon_knuckle'] = 'knuckledusters',
|
||||
['weapon_hatchet'] = 'sekerka',
|
||||
['weapon_railgun'] = 'vlakovy launcher',
|
||||
['weapon_machete'] = 'maceta',
|
||||
['weapon_machinepistol'] = 'kulomet',
|
||||
['weapon_switchblade'] = 'vystrelovaci nuz',
|
||||
['weapon_revolver'] = 'tezky revolver',
|
||||
['weapon_dbshotgun'] = 'dvouhlavnova brokovnice',
|
||||
['weapon_compactrifle'] = 'kompaktni puska',
|
||||
['weapon_autoshotgun'] = 'automaticka brokovnice',
|
||||
['weapon_battleaxe'] = 'bojova sekera',
|
||||
['weapon_compactlauncher'] = 'kompaktni launcher',
|
||||
['weapon_minismg'] = 'mini smg',
|
||||
['weapon_pipebomb'] = 'dymkova bomba',
|
||||
['weapon_poolcue'] = 'kulecnikove tago',
|
||||
['weapon_wrench'] = 'klic na trubky',
|
||||
['weapon_flashlight'] = 'baterka',
|
||||
['gadget_parachute'] = 'padak',
|
||||
['weapon_flare'] = 'svetlice',
|
||||
['weapon_doubleaction'] = 'dvojhlavnovy revolver',
|
||||
|
||||
-- Melee
|
||||
['weapon_dagger'] = 'Dýka',
|
||||
['weapon_bat'] = 'Baseballová pálka',
|
||||
['weapon_battleaxe'] = 'Bitevní sekera',
|
||||
['weapon_bottle'] = 'Rozbitá lahve',
|
||||
['weapon_crowbar'] = 'Páčidlo',
|
||||
['weapon_flashlight'] = 'Baterka',
|
||||
['weapon_golfclub'] = 'Golfová hůl',
|
||||
['weapon_hammer'] = 'Kladivo',
|
||||
['weapon_hatchet'] = 'Sekera',
|
||||
['weapon_knife'] = 'Nůž',
|
||||
['weapon_knuckle'] = 'Boxer',
|
||||
['weapon_machete'] = 'Mačeta',
|
||||
['weapon_nightstick'] = 'Policejní obušek',
|
||||
['weapon_wrench'] = 'Francouzský klíč',
|
||||
['weapon_poolcue'] = 'Kulečníkové tágo',
|
||||
['weapon_stone_hatchet'] = 'Kamenná sekera',
|
||||
['weapon_switchblade'] = 'Vystřelovací nůž',
|
||||
|
||||
-- Handguns
|
||||
['weapon_appistol'] = 'AP pistol',
|
||||
['weapon_ceramicpistol'] = 'Ceramic pistol',
|
||||
['weapon_combatpistol'] = 'Combat pistol',
|
||||
['weapon_doubleaction'] = 'Double-Action Revolver',
|
||||
['weapon_navyrevolver'] = 'Navy Revolver',
|
||||
['weapon_flaregun'] = 'Flaregun',
|
||||
['weapon_gadgetpistol'] = 'Gadget Pistol',
|
||||
['weapon_heavypistol'] = 'Heavy Pistol',
|
||||
['weapon_revolver'] = 'Heavy Revolver',
|
||||
['weapon_revolver_mk2'] = 'Heavy Revolver MK2',
|
||||
['weapon_marksmanpistol'] = 'Marksman Pistol',
|
||||
['weapon_pistol'] = 'Pistol',
|
||||
['weapon_pistol_mk2'] = 'Pistol MK2',
|
||||
['weapon_pistol50'] = 'Pistol .50',
|
||||
['weapon_snspistol'] = 'SNS Pistol',
|
||||
['weapon_snspistol_mk2'] = 'SNS Pistol MK2',
|
||||
['weapon_stungun'] = 'Taser',
|
||||
['weapon_raypistol'] = 'Up-N-Atomizer',
|
||||
['weapon_vintagepistol'] = 'Vintage Pistol',
|
||||
|
||||
-- Shotguns
|
||||
['weapon_assaultshotgun'] = 'Assault Shotgun',
|
||||
['weapon_autoshotgun'] = 'Auto Shotgun',
|
||||
['weapon_bullpupshotgun'] = 'Bullpup Shotgun',
|
||||
['weapon_combatshotgun'] = 'Combat Shotgun',
|
||||
['weapon_dbshotgun'] = 'Double Barrel Shotgun',
|
||||
['weapon_heavyshotgun'] = 'Heavy Shotgun',
|
||||
['weapon_musket'] = 'Musket',
|
||||
['weapon_pumpshotgun'] = 'Pump Shotgun',
|
||||
['weapon_pumpshotgun_mk2'] = 'Pump Shotgun MK2',
|
||||
['weapon_sawnoffshotgun'] = 'Sawed Off Shotgun',
|
||||
|
||||
-- SMG & LMG
|
||||
['weapon_assaultsmg'] = 'Assault SMG',
|
||||
['weapon_combatmg'] = 'Combat MG',
|
||||
['weapon_combatmg_mk2'] = 'Combat MG MK2',
|
||||
['weapon_combatpdw'] = 'Combat PDW',
|
||||
['weapon_gusenberg'] = 'Gusenberg Sweeper',
|
||||
['weapon_machinepistol'] = 'Machine Pistol',
|
||||
['weapon_mg'] = 'MG',
|
||||
['weapon_microsmg'] = 'Micro SMG',
|
||||
['weapon_minismg'] = 'Mini SMG',
|
||||
['weapon_smg'] = 'SMG',
|
||||
['weapon_smg_mk2'] = 'SMG MK2',
|
||||
['weapon_raycarbine'] = 'Unholy Hellbringer',
|
||||
|
||||
-- Rifles
|
||||
['weapon_advancedrifle'] = 'Advanced Rifle',
|
||||
['weapon_assaultrifle'] = 'Assault Rifle',
|
||||
['weapon_assaultrifle_mk2'] = 'Assault Rifle MK2',
|
||||
['weapon_bullpuprifle'] = 'Bullpup Rifle',
|
||||
['weapon_bullpuprifle_mk2'] = 'Bullpup Rifle MK2',
|
||||
['weapon_carbinerifle'] = 'Carbine Rifle',
|
||||
['weapon_carbinerifle_mk2'] = 'Carbine Rifle MK2',
|
||||
['weapon_compactrifle'] = 'Compact Rifle',
|
||||
['weapon_militaryrifle'] = 'Military Rifle',
|
||||
['weapon_specialcarbine'] = 'Special Carbine',
|
||||
['weapon_specialcarbine_mk2'] = 'Special Carbine MK2',
|
||||
|
||||
-- Sniper
|
||||
['weapon_heavysniper'] = 'Heavy Sniper',
|
||||
['weapon_heavysniper_mk2'] = 'Heavy Sniper MK2',
|
||||
['weapon_marksmanrifle'] = 'Marksman Rifle',
|
||||
['weapon_marksmanrifle_mk2'] = 'Marksman Rifle MK2',
|
||||
['weapon_sniperrifle'] = 'Sniper Rifle',
|
||||
|
||||
-- Heavy / Launchers
|
||||
['weapon_compactlauncher'] = 'Compact Launcher',
|
||||
['weapon_firework'] = 'Firework Launcher',
|
||||
['weapon_grenadelauncher'] = 'Grenade Launcher',
|
||||
['weapon_hominglauncher'] = 'Homing Launcher',
|
||||
['weapon_minigun'] = 'Minigun',
|
||||
['weapon_railgun'] = 'Railgun',
|
||||
['weapon_rpg'] = 'Rocket Launcher',
|
||||
['weapon_rayminigun'] = 'Widowmaker',
|
||||
|
||||
-- Criminal Enterprises DLC
|
||||
['weapon_metaldetector'] = 'Detektor kovu',
|
||||
['weapon_precisionrifle'] = 'Precision Rifle',
|
||||
['weapon_tactilerifle'] = 'Service Carbine',
|
||||
|
||||
-- Thrown
|
||||
['weapon_ball'] = 'Míček',
|
||||
['weapon_bzgas'] = 'Smrtící slzný plyn',
|
||||
['weapon_flare'] = 'Světlice',
|
||||
['weapon_grenade'] = 'Granát',
|
||||
['weapon_petrolcan'] = 'Kanistr',
|
||||
['weapon_hazardcan'] = 'Hazardous Jerrycan',
|
||||
['weapon_molotov'] = 'Molotův koktejl',
|
||||
['weapon_proxmine'] = 'Pohybová mina',
|
||||
['weapon_pipebomb'] = 'Trubková bomba',
|
||||
['weapon_snowball'] = 'Sněhová koule',
|
||||
['weapon_stickybomb'] = 'C4',
|
||||
['weapon_smokegrenade'] = 'Slzný plyn',
|
||||
|
||||
-- Special
|
||||
['weapon_fireextinguisher'] = 'Hasící přístroj',
|
||||
['weapon_digiscanner'] = 'Skener',
|
||||
['weapon_garbagebag'] = 'Odpadkový pytel',
|
||||
['weapon_handcuffs'] = 'Pouta',
|
||||
['gadget_nightvision'] = 'Noční vidění',
|
||||
['gadget_parachute'] = 'Padák',
|
||||
|
||||
-- Weapon Components
|
||||
['component_clip_default'] = 'zakladni rukojet',
|
||||
['component_clip_extended'] = 'prodloucena rukojet',
|
||||
['component_knuckle_base'] = 'base Model',
|
||||
['component_knuckle_pimp'] = 'the Pimp',
|
||||
['component_knuckle_ballas'] = 'the Ballas',
|
||||
['component_knuckle_dollar'] = 'the Hustler',
|
||||
['component_knuckle_diamond'] = 'the Rock',
|
||||
['component_knuckle_hate'] = 'the Hater',
|
||||
['component_knuckle_love'] = 'the Lover',
|
||||
['component_knuckle_player'] = 'the Player',
|
||||
['component_knuckle_king'] = 'the King',
|
||||
['component_knuckle_vagos'] = 'the Vagos',
|
||||
|
||||
['component_luxary_finish'] = 'luxary Weapon Finish',
|
||||
|
||||
['component_handle_default'] = 'default Handle',
|
||||
['component_handle_vip'] = 'vIP Handle',
|
||||
['component_handle_bodyguard'] = 'bodyguard Handle',
|
||||
|
||||
['component_vip_finish'] = 'vIP Finish',
|
||||
['component_bodyguard_finish'] = 'bodyguard Finish',
|
||||
|
||||
['component_camo_finish'] = 'digital Camo',
|
||||
['component_camo_finish2'] = 'brushstroke Camo',
|
||||
['component_camo_finish3'] = 'woodland Camo',
|
||||
['component_camo_finish4'] = 'skull Camo',
|
||||
['component_camo_finish5'] = 'sessanta Nove Camo',
|
||||
['component_camo_finish6'] = 'perseus Camo',
|
||||
['component_camo_finish7'] = 'leopard Camo',
|
||||
['component_camo_finish8'] = 'zebra Camo',
|
||||
['component_camo_finish9'] = 'geometric Camo',
|
||||
['component_camo_finish10'] = 'boom Camo',
|
||||
['component_camo_finish11'] = 'patriotic Camo',
|
||||
|
||||
['component_camo_slide_finish'] = 'digital Slide Camo',
|
||||
['component_camo_slide_finish2'] = 'brushstroke Slide Camo',
|
||||
['component_camo_slide_finish3'] = 'woodland Slide Camo',
|
||||
['component_camo_slide_finish4'] = 'skull Slide Camo',
|
||||
['component_camo_slide_finish5'] = 'sessanta Nove Slide Camo',
|
||||
['component_camo_slide_finish6'] = 'perseus Slide Camo',
|
||||
['component_camo_slide_finish7'] = 'leopard Slide Camo',
|
||||
['component_camo_slide_finish8'] = 'zebra Slide Camo',
|
||||
['component_camo_slide_finish9'] = 'geometric Slide Camo',
|
||||
['component_camo_slide_finish10'] = 'boom Slide Camo',
|
||||
['component_camo_slide_finish11'] = 'patriotic Slide Camo',
|
||||
|
||||
['component_clip_default'] = 'default Magazine',
|
||||
['component_clip_extended'] = 'extended Magazine',
|
||||
['component_clip_drum'] = 'drum Magazine',
|
||||
['component_clip_box'] = 'krabice s naboji',
|
||||
['component_flashlight'] = 'baterka',
|
||||
['component_scope'] = 'zamerovac',
|
||||
['component_scope_advanced'] = 'pokrocily zamerovac',
|
||||
['component_suppressor'] = 'tlumic',
|
||||
['component_grip'] = 'rukojet',
|
||||
['component_luxary_finish'] = 'luxusni vzhled zbrane',
|
||||
['component_clip_box'] = 'box Magazine',
|
||||
|
||||
['component_scope_holo'] = 'holographic Scope',
|
||||
['component_scope_small'] = 'small Scope',
|
||||
['component_scope_medium'] = 'medium Scope',
|
||||
['component_scope_large'] = 'large Scope',
|
||||
['component_scope'] = 'mounted Scope',
|
||||
['component_scope_advanced'] = 'advanced Scope',
|
||||
['component_ironsights'] = 'ironsights',
|
||||
|
||||
['component_suppressor'] = 'suppressor',
|
||||
['component_compensator'] = 'compensator',
|
||||
|
||||
['component_muzzle_flat'] = 'flat Muzzle Brake',
|
||||
['component_muzzle_tactical'] = 'tactical Muzzle Brake',
|
||||
['component_muzzle_fat'] = 'fat-End Muzzle Brake',
|
||||
['component_muzzle_precision'] = 'precision Muzzle Brake',
|
||||
['component_muzzle_heavy'] = 'heavy Duty Muzzle Brake',
|
||||
['component_muzzle_slanted'] = 'slanted Muzzle Brake',
|
||||
['component_muzzle_split'] = 'split-End Muzzle Brake',
|
||||
['component_muzzle_squared'] = 'squared Muzzle Brake',
|
||||
|
||||
['component_flashlight'] = 'flashlight',
|
||||
['component_grip'] = 'grip',
|
||||
|
||||
['component_barrel_default'] = 'default Barrel',
|
||||
['component_barrel_heavy'] = 'heavy Barrel',
|
||||
|
||||
['component_ammo_tracer'] = 'tracer Ammo',
|
||||
['component_ammo_incendiary'] = 'incendiary Ammo',
|
||||
['component_ammo_hollowpoint'] = 'hollowpoint Ammo',
|
||||
['component_ammo_fmj'] = 'fMJ Ammo',
|
||||
['component_ammo_armor'] = 'armor Piercing Ammo',
|
||||
['component_ammo_explosive'] = 'armor Piercing Incendiary Ammo',
|
||||
|
||||
['component_shells_default'] = 'default Shells',
|
||||
['component_shells_incendiary'] = 'dragons Breath Shells',
|
||||
['component_shells_armor'] = 'steel Buckshot Shells',
|
||||
['component_shells_hollowpoint'] = 'flechette Shells',
|
||||
['component_shells_explosive'] = 'explosive Slug Shells',
|
||||
|
||||
-- Weapon Ammo
|
||||
['ammo_rounds'] = 'naboj(e)',
|
||||
['ammo_shells'] = 'patrona(y)',
|
||||
['ammo_charge'] = 'naboj(e)',
|
||||
['ammo_petrol'] = 'galonu paliva',
|
||||
['ammo_firework'] = 'ohnostroj(e)',
|
||||
['ammo_rockets'] = 'raketa(y)',
|
||||
['ammo_grenadelauncher'] = 'granat(y)',
|
||||
['ammo_grenade'] = 'granat(y)',
|
||||
['ammo_stickybomb'] = 'bomba(y)',
|
||||
['ammo_pipebomb'] = 'bomba(y)',
|
||||
['ammo_smokebomb'] = 'bomba(y)',
|
||||
['ammo_molotov'] = 'koktejl(y)',
|
||||
['ammo_proxmine'] = 'mina(y)',
|
||||
['ammo_bzgas'] = 'kanystr(y)',
|
||||
['ammo_ball'] = 'koule',
|
||||
['ammo_snowball'] = 'snehova(e) koule',
|
||||
['ammo_flare'] = 'svetlice',
|
||||
['ammo_flaregun'] = 'svetlice',
|
||||
['ammo_rounds'] = 'round(s)',
|
||||
['ammo_shells'] = 'shell(s)',
|
||||
['ammo_charge'] = 'charge',
|
||||
['ammo_petrol'] = 'gallons of fuel',
|
||||
['ammo_firework'] = 'firework(s)',
|
||||
['ammo_rockets'] = 'rocket(s)',
|
||||
['ammo_grenadelauncher'] = 'grenade(s)',
|
||||
['ammo_grenade'] = 'grenade(s)',
|
||||
['ammo_stickybomb'] = 'bomb(s)',
|
||||
['ammo_pipebomb'] = 'bomb(s)',
|
||||
['ammo_smokebomb'] = 'bomb(s)',
|
||||
['ammo_molotov'] = 'cocktail(s)',
|
||||
['ammo_proxmine'] = 'mine(s)',
|
||||
['ammo_bzgas'] = 'can(s)',
|
||||
['ammo_ball'] = 'ball(s)',
|
||||
['ammo_snowball'] = 'snowball(s)',
|
||||
['ammo_flare'] = 'flare(s)',
|
||||
['ammo_flaregun'] = 'flare(s)',
|
||||
|
||||
-- Weapon Tints
|
||||
['tint_default'] = 'zakladni skin',
|
||||
['tint_green'] = 'zeleny skin',
|
||||
['tint_gold'] = 'zlaty skin',
|
||||
['tint_pink'] = 'ruzovy skin',
|
||||
['tint_army'] = 'armadni skin',
|
||||
['tint_lspd'] = 'modry skin',
|
||||
['tint_orange'] = 'oranzovy skin',
|
||||
['tint_platinum'] = 'platinovy skin',
|
||||
['tint_default'] = 'default skin',
|
||||
['tint_green'] = 'green skin',
|
||||
['tint_gold'] = 'gold skin',
|
||||
['tint_pink'] = 'pink skin',
|
||||
['tint_army'] = 'army skin',
|
||||
['tint_lspd'] = 'blue skin',
|
||||
['tint_orange'] = 'orange skin',
|
||||
['tint_platinum'] = 'platinum skin',
|
||||
}
|
||||
|
||||
@@ -108,6 +108,12 @@ Locales['en'] = {
|
||||
['command_giveammo_noweapon_found'] = '%s does not have that weapon',
|
||||
['command_giveammo_weapon'] = 'Weapon name',
|
||||
['command_giveammo_ammo'] = 'Ammo Quantity',
|
||||
['tpm_nowaypoint'] = 'No Waypoint Set.',
|
||||
['tpm_success'] = 'Successfully Teleported',
|
||||
|
||||
['noclip_message'] = 'Noclip has been %s',
|
||||
['enabled'] = '~g~enabled~s~',
|
||||
['disabled'] = '~r~disabled~s~',
|
||||
|
||||
-- Locale settings
|
||||
['locale_digit_grouping_symbol'] = ',',
|
||||
|
||||
@@ -105,9 +105,15 @@ Locales["hu"] = {
|
||||
["commanderror_invalidcommand"] = "Érvénytelen parancs - /%s",
|
||||
["commanderror_invalidplayerid"] = "Megadott játékos nem online.",
|
||||
["commandgeneric_playerid"] = "Játékos Szerver Id",
|
||||
['command_giveammo_noweapon_found'] = '%s does not have that weapon',
|
||||
['command_giveammo_weapon'] = 'Weapon name',
|
||||
['command_giveammo_ammo'] = 'Ammo Quantity',
|
||||
['command_giveammo_noweapon_found'] = 'Nincs ilyen fegyvered: %s',
|
||||
['command_giveammo_weapon'] = 'Fegyver név',
|
||||
['command_giveammo_ammo'] = 'Lőszer mennyiség',
|
||||
['tpm_nowaypoint'] = 'Nincs kijelölve pozíció!',
|
||||
['tpm_success'] = 'Sikeres teleportálás',
|
||||
|
||||
['noclip_message'] = 'Noclip %s',
|
||||
['enabled'] = '~g~engedélyezve~s~',
|
||||
['disabled'] = '~r~letiltva~s~',
|
||||
|
||||
-- Locale settings
|
||||
["locale_digit_grouping_symbol"] = ",",
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
local SetTimeout = SetTimeout
|
||||
local GetPlayerPed = GetPlayerPed
|
||||
local DoesEntityExist = DoesEntityExist
|
||||
local GetEntityCoords = GetEntityCoords
|
||||
local GetEntityHeading = GetEntityHeading
|
||||
|
||||
function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory, weight, job, loadout, name, coords)
|
||||
local targetOverrides = Config.PlayerFunctionOverride and Core.PlayerFunctionOverrides[Config.PlayerFunctionOverride] or {}
|
||||
|
||||
@@ -31,7 +37,6 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
|
||||
end
|
||||
|
||||
function self.setCoords(coords)
|
||||
self.updateCoords(coords)
|
||||
local Ped = GetPlayerPed(self.source)
|
||||
local vector = type(coords) == "vector4" and coords or type(coords) == "vector3" and vector4(coords, 0.0) or
|
||||
vec(coords.x, coords.y, coords.z, coords.heading or 0.0)
|
||||
@@ -40,10 +45,23 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
|
||||
end
|
||||
|
||||
function self.updateCoords()
|
||||
local Ped = GetPlayerPed(self.source)
|
||||
local coords = GetEntityCoords(Ped)
|
||||
local heading = GetEntityHeading(Ped)
|
||||
self.coords = {x = ESX.Math.Round(coords.x, 1), y = ESX.Math.Round(coords.y, 1), z = ESX.Math.Round(coords.z, 1), heading = ESX.Math.Round(heading or 0.0, 1)}
|
||||
SetTimeout(1000,function()
|
||||
local Ped = GetPlayerPed(self.source)
|
||||
if DoesEntityExist(Ped) then
|
||||
local coords = GetEntityCoords(Ped)
|
||||
local distance = #(coords - vector3(self.coords.x, self.coords.y, self.coords.z))
|
||||
if distance > 1.5 then
|
||||
local heading = GetEntityHeading(Ped)
|
||||
self.coords = {
|
||||
x = coords.x,
|
||||
y = coords.y,
|
||||
z = coords.z,
|
||||
heading = heading or 0.0
|
||||
}
|
||||
end
|
||||
end
|
||||
self.updateCoords()
|
||||
end)
|
||||
end
|
||||
|
||||
function self.getCoords(vector)
|
||||
@@ -187,7 +205,7 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
|
||||
print(('[^1ERROR^7] Tried To Set Account ^5%s^0 For Player ^5%s^0 To An Invalid Number -> ^5%s^7'):format(accountName, self.playerId, money))
|
||||
return
|
||||
end
|
||||
if money > 0 then
|
||||
if money >= 0 then
|
||||
local account = self.getAccount(accountName)
|
||||
|
||||
if account then
|
||||
|
||||
@@ -14,11 +14,6 @@ Core.Pickups = {}
|
||||
Core.PickupId = 0
|
||||
Core.PlayerFunctionOverrides = {}
|
||||
|
||||
AddEventHandler('esx:getSharedObject', function(cb)
|
||||
local Invoke = GetInvokingResource()
|
||||
print(('[^3WARNING^7] ^5%s^7 used ^5esx:getSharedObject^7, this method is deprecated and should not be used, On 30/11/2022 esx:getSharedObject will come to EOL and be fully removed! Refer to ^5https://docs.esx-framework.org/tutorials/sharedevent^7 for more info!'):format(Invoke))
|
||||
cb(ESX)
|
||||
end)
|
||||
|
||||
exports('getSharedObject', function()
|
||||
return ESX
|
||||
|
||||
@@ -308,6 +308,10 @@ function loadESXPlayer(identifier, playerId, isNew)
|
||||
maxWeight = xPlayer.getMaxWeight(),
|
||||
money = xPlayer.getMoney(),
|
||||
sex = xPlayer.get("sex") or "m",
|
||||
firstName = xPlayer.get("firstName") or "John",
|
||||
lastName = xPlayer.get("lastName") or "Doe",
|
||||
dateofbirth = xPlayer.get("dateofbirth") or "01/01/2000",
|
||||
height = xPlayer.get("height") or 120,
|
||||
dead = false
|
||||
}, isNew,
|
||||
userData.skin)
|
||||
@@ -317,7 +321,7 @@ function loadESXPlayer(identifier, playerId, isNew)
|
||||
else
|
||||
exports.ox_inventory:setPlayerInventory(xPlayer, userData.inventory)
|
||||
end
|
||||
|
||||
xPlayer.updateCoords()
|
||||
xPlayer.triggerEvent('esx:registerSuggestions', Core.RegisteredCommands)
|
||||
print(('[^2INFO^0] Player ^5"%s"^0 has connected to the server. ID: ^5%s^7'):format(xPlayer.getName(), playerId))
|
||||
end
|
||||
@@ -359,16 +363,6 @@ AddEventHandler('esx:playerLogout', function(playerId, cb)
|
||||
TriggerClientEvent("esx:onPlayerLogout", playerId)
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx:updateCoords')
|
||||
AddEventHandler('esx:updateCoords', function()
|
||||
local source = source
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
|
||||
if xPlayer then
|
||||
xPlayer.updateCoords()
|
||||
end
|
||||
end)
|
||||
|
||||
if not Config.OxInventory then
|
||||
RegisterNetEvent('esx:updateWeaponAmmo')
|
||||
AddEventHandler('esx:updateWeaponAmmo', function(weaponName, ammoCount)
|
||||
|
||||
@@ -61,23 +61,29 @@ end
|
||||
---@param heading number
|
||||
---@param Properties table
|
||||
---@param cb function
|
||||
function ESX.OneSync.SpawnVehicle(model, coords, heading, Properties, cb)
|
||||
model = type(model) == 'string' and joaat(model) or model
|
||||
Properties = Properties or {}
|
||||
local vector = type(coords) == "vector3" and coords or vec(coords.x, coords.y, coords.z)
|
||||
TriggerClientEvent("esx:requestModel", -1, model)
|
||||
CreateThread(function()
|
||||
local xPlayer = ESX.OneSync.GetClosestPlayer(vector, 200)
|
||||
ESX.GetVehicleType(model, xPlayer.id, function(Type)
|
||||
local SpawnedEntity = CreateVehicleServerSetter(model, Type, vector, heading)
|
||||
Wait(250)
|
||||
local NetworkId = NetworkGetNetworkIdFromEntity(SpawnedEntity)
|
||||
Properties.NetId = NetworkId
|
||||
Entity(SpawnedEntity).state:set('VehicleProperties', Properties, true)
|
||||
cb(NetworkId)
|
||||
end)
|
||||
end)
|
||||
end
|
||||
function ESX.OneSync.SpawnVehicle(model, coords, heading, Properties, cb)
|
||||
local veh_model = type(model) == 'string' and joaat(model) or model
|
||||
Properties = Properties or {}
|
||||
local vector = type(coords) == "vector3" and coords or vec(coords.x, coords.y, coords.z)
|
||||
TriggerClientEvent("esx:requestModel", -1, model)
|
||||
CreateThread(function()
|
||||
local xPlayer = ESX.OneSync.GetClosestPlayer(vector, 300)
|
||||
ESX.GetVehicleType(veh_model, xPlayer.id, function(Type)
|
||||
if Type then
|
||||
local SpawnedEntity = CreateVehicleServerSetter(veh_model, Type, vector, heading)
|
||||
local NetworkId = NetworkGetNetworkIdFromEntity(SpawnedEntity)
|
||||
while not DoesEntityExist(SpawnedEntity) do
|
||||
Wait(100)
|
||||
end
|
||||
Properties.NetId = NetworkId
|
||||
Entity(SpawnedEntity).state:set('VehicleProperties', Properties, true)
|
||||
cb(NetworkId)
|
||||
else
|
||||
print(('[^1ERROR^7] Tried to spawn invalid vehicle - ^5%s^7!'):format(model))
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
---@param model number|string
|
||||
|
||||
@@ -352,8 +352,11 @@
|
||||
}
|
||||
|
||||
function Close() {
|
||||
$.post(`https://${GetParentResourceName()}/closed`)
|
||||
Closed()
|
||||
$.post(`https://${GetParentResourceName()}/closed`,(retVal)=>{
|
||||
if(retVal){
|
||||
Closed()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
window.addEventListener("message", (e) => {
|
||||
@@ -437,4 +440,4 @@
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -12,10 +12,11 @@ function Post(fn,...)
|
||||
})
|
||||
end
|
||||
|
||||
function Open(position,eles,onSelect,onClose)
|
||||
function Open(position,eles,onSelect,onClose,canClose)
|
||||
activeMenu = {
|
||||
position = position,
|
||||
eles = eles,
|
||||
canClose = canClose,
|
||||
onSelect = onSelect,
|
||||
onClose = onClose
|
||||
}
|
||||
@@ -74,11 +75,11 @@ end)
|
||||
-- NUI Callbacks
|
||||
-- [ closed | selected | changed ]
|
||||
|
||||
RegisterNUICallback("closed",function()
|
||||
if not activeMenu then
|
||||
return
|
||||
RegisterNUICallback("closed",function(data,cb)
|
||||
if not activeMenu or (activeMenu and not activeMenu.canClose) then
|
||||
return cb(false)
|
||||
end
|
||||
|
||||
cb(true)
|
||||
Closed()
|
||||
end)
|
||||
|
||||
@@ -266,4 +267,4 @@ if Debug then
|
||||
|
||||
exports["esx_context"]:Open(position,eles,onSelect,onClose)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -44,7 +44,10 @@ if not Config.UseDeferrals then
|
||||
|
||||
RegisterNetEvent('esx_identity:showRegisterIdentity', function()
|
||||
TriggerEvent('esx_skin:resetFirstSpawn')
|
||||
|
||||
while not ready do
|
||||
print('Waiting for esx_identity NUI..')
|
||||
Wait(100)
|
||||
end
|
||||
if not ESX.PlayerData.dead then setGuiState(true) end
|
||||
end)
|
||||
|
||||
@@ -66,4 +69,4 @@ if not Config.UseDeferrals then
|
||||
end
|
||||
end, data)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -373,29 +373,27 @@ else
|
||||
|
||||
ESX.RegisterServerCallback('esx_identity:registerIdentity', function(source, cb, data)
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
|
||||
if not checkNameFormat(data.firstname) then
|
||||
xPlayer.showNotification(TranslateCap('invalid_firstname_format'), "error")
|
||||
return cb(false)
|
||||
end
|
||||
if not checkNameFormat(data.lastname) then
|
||||
xPlayer.showNotification(TranslateCap('invalid_lastname_format'), "error")
|
||||
return cb(false)
|
||||
end
|
||||
if not checkSexFormat(data.sex) then
|
||||
xPlayer.showNotification(TranslateCap('invalid_sex_format'), "error")
|
||||
return cb(false)
|
||||
end
|
||||
if not checkDOBFormat(data.dateofbirth) then
|
||||
xPlayer.showNotification(TranslateCap('invalid_dob_format'), "error")
|
||||
return cb(false)
|
||||
end
|
||||
if not checkHeightFormat(data.height) then
|
||||
xPlayer.showNotification(TranslateCap('invalid_height_format'), "error")
|
||||
return cb(false)
|
||||
end
|
||||
|
||||
if xPlayer then
|
||||
if not checkNameFormat(data.firstname) then
|
||||
TriggerClientEvent('esx:showNotification',source,TranslateCap('invalid_firstname_format'), "error")
|
||||
return cb(false)
|
||||
end
|
||||
if not checkNameFormat(data.lastname) then
|
||||
TriggerClientEvent('esx:showNotification',source,TranslateCap('invalid_lastname_format'), "error")
|
||||
return cb(false)
|
||||
end
|
||||
if not checkSexFormat(data.sex) then
|
||||
TriggerClientEvent('esx:showNotification',source,TranslateCap('invalid_sex_format'), "error")
|
||||
return cb(false)
|
||||
end
|
||||
if not checkDOBFormat(data.dateofbirth) then
|
||||
TriggerClientEvent('esx:showNotification',source,TranslateCap('invalid_dob_format'), "error")
|
||||
return cb(false)
|
||||
end
|
||||
if not checkHeightFormat(data.height) then
|
||||
TriggerClientEvent('esx:showNotification',source,TranslateCap('invalid_height_format'), "error")
|
||||
return cb(false)
|
||||
end
|
||||
if xPlayer then
|
||||
if alreadyRegistered[xPlayer.identifier] then
|
||||
xPlayer.showNotification(TranslateCap('already_registered'), "error")
|
||||
return cb(false)
|
||||
|
||||
@@ -35,7 +35,6 @@ if ESX.GetConfig().Multichar then
|
||||
RenderScriptCams(true, false, 1, true, true)
|
||||
SetCamCoord(cam, offset.x, offset.y, offset.z)
|
||||
PointCamAtCoord(cam, Config.Spawn.x, Config.Spawn.y, Config.Spawn.z + 1.3)
|
||||
ESX.UI.Menu.CloseAll()
|
||||
ESX.UI.HUD.SetDisplay(0.0)
|
||||
StartLoop()
|
||||
ShutdownLoadingScreen()
|
||||
@@ -164,7 +163,7 @@ if ESX.GetConfig().Multichar then
|
||||
elseif Action.action == "return" then
|
||||
SelectCharacterMenu(Characters, slots)
|
||||
end
|
||||
end, nil, true)
|
||||
end, nil, false)
|
||||
end
|
||||
|
||||
function SelectCharacterMenu(Characters, slots)
|
||||
@@ -212,7 +211,7 @@ if ESX.GetConfig().Multichar then
|
||||
SetPedAoBlobRendering(playerPed, true)
|
||||
ResetEntityAlpha(playerPed)
|
||||
end
|
||||
end, nil, true)
|
||||
end, nil, false)
|
||||
end
|
||||
RegisterNetEvent('esx_multicharacter:SetupUI')
|
||||
AddEventHandler('esx_multicharacter:SetupUI', function(data, slots)
|
||||
|
||||
@@ -5,7 +5,7 @@ description 'Official Multicharacter System For ESX Legacy'
|
||||
version '1.8.5'
|
||||
lua54 'yes'
|
||||
|
||||
dependencies {'es_extended', 'esx_menu_default', 'esx_identity', 'esx_skin'}
|
||||
dependencies {'es_extended', 'esx_context', 'esx_identity', 'esx_skin'}
|
||||
|
||||
shared_scripts {'@es_extended/imports.lua', '@es_extended/locale.lua', 'locales/*.lua', 'config.lua'}
|
||||
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
Locales["es"] = {
|
||||
["male"] = "Hombre",
|
||||
["female"] = "Mujer",
|
||||
["delete_label"] = "¿Quieres borrar a %s %s?",
|
||||
["select_char"] = "Seleccionar personaje",
|
||||
["select_char_description"] = "Select a character to play as.",
|
||||
["select_char_description"] = "Selecciona un personaje para jugar.",
|
||||
["create_char"] = "Crear nuevo personaje",
|
||||
["char_play"] = "Jugar este personaje",
|
||||
["char_play_description"] = "Continúe hacia la ciudad.",
|
||||
["char_disabled"] = "Este personaje está deshabilitado",
|
||||
["char_disabled_description"] = "Este personaje es inutilizable.",
|
||||
["char_delete"] = "Borrar este personaje",
|
||||
["cancel"] = "Cancelar",
|
||||
["confirm"] = "Confirmar",
|
||||
["char_delete_description"] = "Eliminar permanentemente este personaje.",
|
||||
["character"] = "Personaje: %s",
|
||||
["return"] = "Volver",
|
||||
["return_description"] = "Volver a la selección de personajes.",
|
||||
["command_setslots"] = "Establecer el numero de espacios de un jugador",
|
||||
["command_remslots"] = "Elimina espacios multipersonaje de un jugador",
|
||||
["command_enablechar"] = "Habilita el personaje de un jugador",
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
local lastSkin, cam, isCameraActive
|
||||
local firstSpawn, zoomOffset, camOffset, heading, skinLoaded = true, 0.0, 0.0, 90.0, false
|
||||
|
||||
RegisterNetEvent('esx:playerLoaded')
|
||||
AddEventHandler('esx:playerLoaded', function(xPlayer, isNew, skin)
|
||||
TriggerServerEvent('esx_skin:setWeight', skin)
|
||||
end)
|
||||
|
||||
function OpenMenu(submitCb, cancelCb, restrict)
|
||||
local playerPed = PlayerPedId()
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
Locales['it'] = {
|
||||
['skin_menu'] = 'Menu Skin',
|
||||
['use_rotate_view'] = 'usa ~INPUT_FRONTEND_LS~ e ~INPUT_CHARACTER_WHEEL~ per ruotare la visuale.',
|
||||
['skin'] = 'cambia skin',
|
||||
['saveskin'] = 'salvare la skin',
|
||||
}
|
||||
@@ -19,6 +19,22 @@ AddEventHandler('esx_skin:save', function(skin)
|
||||
})
|
||||
end)
|
||||
|
||||
RegisterServerEvent('esx_skin:setWeight')
|
||||
AddEventHandler('esx_skin:setWeight', function(skin)
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
|
||||
if not ESX.GetConfig().OxInventory then
|
||||
local defaultMaxWeight = ESX.GetConfig().MaxWeight
|
||||
local backpackModifier = Config.BackpackWeight[skin.bags_1]
|
||||
|
||||
if backpackModifier then
|
||||
xPlayer.setMaxWeight(defaultMaxWeight + backpackModifier)
|
||||
else
|
||||
xPlayer.setMaxWeight(defaultMaxWeight)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterServerEvent('esx_skin:responseSaveSkin')
|
||||
AddEventHandler('esx_skin:responseSaveSkin', function(skin)
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
|
||||
@@ -1,21 +1,19 @@
|
||||
Debug = ESX.GetConfig().EnableDebug
|
||||
local IsShowing = false
|
||||
local isShowing = false
|
||||
---@param message string
|
||||
---@param Type string
|
||||
local function TextUI(message, type)
|
||||
IsShowing = true
|
||||
---@param typ string
|
||||
local function TextUI(message, typ)
|
||||
isShowing = true
|
||||
SendNUIMessage({
|
||||
action = 'show',
|
||||
message = message and message or 'ESX-TextUI',
|
||||
type = type == 0 and "info" or type
|
||||
type = type(typ) == "string" and typ or 'info'
|
||||
})
|
||||
end
|
||||
|
||||
local function HideUI()
|
||||
if not IsShowing then
|
||||
return
|
||||
end
|
||||
IsShowing = false
|
||||
if not isShowing then return end
|
||||
isShowing = false
|
||||
SendNUIMessage({
|
||||
action = 'hide'
|
||||
})
|
||||
|
||||
@@ -11,63 +11,59 @@ end)
|
||||
|
||||
|
||||
function OpenAmbulanceActionsMenu()
|
||||
local elements = {{label = TranslateCap('cloakroom'), value = 'cloakroom'}}
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-shirt", title = "Ambulance Actions"},
|
||||
{icon = "fas fa-shirt", title = TranslateCap('cloakroom'), value = 'cloakroom'}
|
||||
}
|
||||
|
||||
if Config.EnablePlayerManagement and ESX.PlayerData.job.grade_name == 'boss' then
|
||||
table.insert(elements, {label = TranslateCap('boss_actions'), value = 'boss_actions'})
|
||||
elements[#elements+1] = {
|
||||
icon = "fas fa-ambulance",
|
||||
title = TranslateCap('boss_actions'),
|
||||
value = 'boss_actions'
|
||||
}
|
||||
end
|
||||
|
||||
ESX.UI.Menu.CloseAll()
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'ambulance_actions', {
|
||||
title = TranslateCap('ambulance'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
if data.current.value == 'cloakroom' then
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
if element.value == 'cloakroom' then
|
||||
OpenCloakroomMenu()
|
||||
elseif data.current.value == 'boss_actions' then
|
||||
elseif element.value == 'boss_actions' then
|
||||
TriggerEvent('esx_society:openBossMenu', 'ambulance', function(data, menu)
|
||||
menu.close()
|
||||
end, {wash = false})
|
||||
end
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end
|
||||
|
||||
function OpenMobileAmbulanceActionsMenu()
|
||||
ESX.UI.Menu.CloseAll()
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-ambulance", title = TranslateCap('ambulance')},
|
||||
{icon = "fas fa-ambulance", title = TranslateCap('ems_menu'), value = "citizen_interaction"}
|
||||
}
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'mobile_ambulance_actions', {
|
||||
title = TranslateCap('ambulance'),
|
||||
align = 'top-left',
|
||||
elements = {
|
||||
{label = TranslateCap('ems_menu'), value = 'citizen_interaction'}
|
||||
}}, function(data, menu)
|
||||
if data.current.value == 'citizen_interaction' then
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'citizen_interaction', {
|
||||
title = TranslateCap('ems_menu_title'),
|
||||
align = 'top-left',
|
||||
elements = {
|
||||
{label = TranslateCap('ems_menu_revive'), value = 'revive'},
|
||||
{label = TranslateCap('ems_menu_small'), value = 'small'},
|
||||
{label = TranslateCap('ems_menu_big'), value = 'big'},
|
||||
{label = TranslateCap('ems_menu_putincar'), value = 'put_in_vehicle'},
|
||||
{label = TranslateCap('ems_menu_search'), value = 'search'}
|
||||
}}, function(data, menu)
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
if element.value == "citizen_interaction" then
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-ambulance", title = element.title},
|
||||
{icon = "fas fa-syringe", title = TranslateCap('ems_menu_revive'), value = "revive"},
|
||||
{icon = "fas fa-bandage", title = TranslateCap('ems_menu_small'), value = "small"},
|
||||
{icon = "fas fa-bandage", title = TranslateCap('ems_menu_big'), value = "big"},
|
||||
{icon = "fas fa-car", title = TranslateCap('ems_menu_putincar'), value = "put_in_vehicle"},
|
||||
{icon = "fas fa-syringe", title = TranslateCap('ems_menu_search'), value = "search"},
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
if isBusy then return end
|
||||
|
||||
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
|
||||
|
||||
if data.current.value == 'search' then
|
||||
if element2.value == 'search' then
|
||||
TriggerServerEvent('esx_ambulancejob:svsearch')
|
||||
elseif closestPlayer == -1 or closestDistance > 1.0 then
|
||||
ESX.ShowNotification(TranslateCap('no_players'))
|
||||
else
|
||||
if data.current.value == 'revive' then
|
||||
if element2.value == 'revive' then
|
||||
revivePlayer(closestPlayer)
|
||||
elseif data.current.value == 'small' then
|
||||
elseif element2.value == 'small' then
|
||||
ESX.TriggerServerCallback('esx_ambulancejob:getItemAmount', function(quantity)
|
||||
if quantity > 0 then
|
||||
local closestPlayerPed = GetPlayerPed(closestPlayer)
|
||||
@@ -94,8 +90,7 @@ function OpenMobileAmbulanceActionsMenu()
|
||||
end
|
||||
end, 'bandage')
|
||||
|
||||
elseif data.current.value == 'big' then
|
||||
|
||||
elseif element2.value == 'big' then
|
||||
ESX.TriggerServerCallback('esx_ambulancejob:getItemAmount', function(quantity)
|
||||
if quantity > 0 then
|
||||
local closestPlayerPed = GetPlayerPed(closestPlayer)
|
||||
@@ -121,18 +116,12 @@ function OpenMobileAmbulanceActionsMenu()
|
||||
ESX.ShowNotification(TranslateCap('not_enough_medikit'))
|
||||
end
|
||||
end, 'medikit')
|
||||
|
||||
elseif data.current.value == 'put_in_vehicle' then
|
||||
elseif element2.value == 'put_in_vehicle' then
|
||||
TriggerServerEvent('esx_ambulancejob:putInVehicle', GetPlayerServerId(closestPlayer))
|
||||
end
|
||||
end
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end
|
||||
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end
|
||||
|
||||
@@ -328,7 +317,7 @@ end)
|
||||
|
||||
AddEventHandler('esx_ambulancejob:hasExitedMarker', function(hospital, part, partNum)
|
||||
if not isInShopMenu then
|
||||
ESX.UI.Menu.CloseAll()
|
||||
ESX.CloseContext()
|
||||
end
|
||||
ESX.HideUI()
|
||||
CurrentAction = nil
|
||||
@@ -411,14 +400,14 @@ AddEventHandler('esx_ambulancejob:putInVehicle', function()
|
||||
end)
|
||||
|
||||
function OpenCloakroomMenu()
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'cloakroom', {
|
||||
title = TranslateCap('cloakroom'),
|
||||
align = 'top-left',
|
||||
elements = {
|
||||
{label = TranslateCap('ems_clothes_civil'), value = 'citizen_wear'},
|
||||
{label = TranslateCap('ems_clothes_ems'), value = 'ambulance_wear'},
|
||||
}}, function(data, menu)
|
||||
if data.current.value == 'citizen_wear' then
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-shirt", title = TranslateCap('cloakroom')},
|
||||
{icon = "fas fa-shirt", title = TranslateCap('ems_clothes_civil'), value = "citizen_wear"},
|
||||
{icon = "fas fa-shirt", title = TranslateCap('ems_clothes_ems'), value = "ambulance_wear"},
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
if element.value == "citizen_wear" then
|
||||
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
|
||||
TriggerEvent('skinchanger:loadSkin', skin)
|
||||
isOnDuty = false
|
||||
@@ -432,7 +421,7 @@ function OpenCloakroomMenu()
|
||||
print("[^2INFO^7] Off Duty")
|
||||
end
|
||||
end)
|
||||
elseif data.current.value == 'ambulance_wear' then
|
||||
elseif element.value == "ambulance_wear" then
|
||||
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
|
||||
if skin.sex == 0 then
|
||||
TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_male)
|
||||
@@ -450,29 +439,38 @@ function OpenCloakroomMenu()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
menu.close()
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end
|
||||
|
||||
function OpenPharmacyMenu()
|
||||
ESX.UI.Menu.CloseAll()
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-pills", title = TranslateCap('pharmacy_menu_title')}
|
||||
}
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'pharmacy', {
|
||||
title = TranslateCap('pharmacy_menu_title'),
|
||||
align = 'top-left',
|
||||
elements = {
|
||||
{label = TranslateCap('pharmacy_take', TranslateCap('medikit')), item = 'medikit', type = 'slider', value = 1, min = 1, max = 100},
|
||||
{label = TranslateCap('pharmacy_take', TranslateCap('bandage')), item = 'bandage', type = 'slider', value = 1, min = 1, max = 100}
|
||||
}}, function(data, menu)
|
||||
if Config.Debug then
|
||||
print("[^2INFO^7] Attempting to Give Item - ^5" .. tostring(data.current.item) .. "^7")
|
||||
end
|
||||
TriggerServerEvent('esx_ambulancejob:giveItem', data.current.item, data.current.value)
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
for k,v in pairs(Config.PharmacyItems) do
|
||||
elements[#elements+1] = {
|
||||
icon = "fas fa-pills",
|
||||
title = v.title,
|
||||
item = v.item
|
||||
}
|
||||
end
|
||||
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-pills", title = element.title},
|
||||
{title = "Amount", input = true, inputType = "number", inputMin = 1, inputMax = 100, inputPlaceholder = "Amount to buy.."},
|
||||
{icon = "fas fa-check-double", title = "Confirm", val = "confirm"}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
local amount = menu2.eles[2].inputValue
|
||||
if Config.Debug then
|
||||
print("[^2INFO^7] Attempting to Give Item - ^5" .. tostring(element.item) .. "^7")
|
||||
end
|
||||
TriggerServerEvent('esx_ambulancejob:giveItem', element.item, amount)
|
||||
end, function(menu)
|
||||
OpenPharmacyMenu()
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ end)
|
||||
|
||||
function OnPlayerDeath()
|
||||
isDead = true
|
||||
ESX.UI.Menu.CloseAll()
|
||||
ESX.CloseContext()
|
||||
ClearTimecycleModifier()
|
||||
SetTimecycleModifier("REDMIST_blend")
|
||||
SetTimecycleModifierStrength(0.7)
|
||||
@@ -115,7 +115,7 @@ end
|
||||
|
||||
RegisterNetEvent('esx_ambulancejob:useItem')
|
||||
AddEventHandler('esx_ambulancejob:useItem', function(itemName)
|
||||
ESX.UI.Menu.CloseAll()
|
||||
ESX.CloseContext()
|
||||
|
||||
if itemName == 'medikit' then
|
||||
local lib, anim = 'anim@heists@narcotics@funding@gang_idle', 'gang_chatting_idle01' -- TODO better animations
|
||||
|
||||
@@ -2,16 +2,15 @@ local spawnedVehicles = {}
|
||||
|
||||
function OpenVehicleSpawnerMenu(type, hospital, part, partNum)
|
||||
local playerCoords = GetEntityCoords(PlayerPedId())
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-car", title = TranslateCap('garage_title')},
|
||||
{icon = "fas fa-car", title = TranslateCap('garage_storeditem'), action = 'garage'},
|
||||
{icon = "fas fa-car", title = TranslateCap('garage_storeitem'), action = 'store_garage'},
|
||||
{icon = "fas fa-car", title = TranslateCap('garage_buyitem'), action = 'buy_vehicle'}
|
||||
}
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle', {
|
||||
title = TranslateCap('garage_title'),
|
||||
align = 'top-left',
|
||||
elements = {
|
||||
{label = TranslateCap('garage_storeditem'), action = 'garage'},
|
||||
{label = TranslateCap('garage_storeitem'), action = 'store_garage'},
|
||||
{label = TranslateCap('garage_buyitem'), action = 'buy_vehicle'}
|
||||
}}, function(data, menu)
|
||||
if data.current.action == 'buy_vehicle' then
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
if element.action == "buy_vehicle" then
|
||||
local shopElements = {}
|
||||
local authorizedVehicles = Config.AuthorizedVehicles[type][ESX.PlayerData.job.grade_name]
|
||||
local shopCoords = Config.Hospitals[hospital][part][partNum].InsideShop
|
||||
@@ -21,23 +20,30 @@ function OpenVehicleSpawnerMenu(type, hospital, part, partNum)
|
||||
if IsModelInCdimage(vehicle.model) then
|
||||
local vehicleLabel = GetLabelText(GetDisplayNameFromVehicleModel(vehicle.model))
|
||||
|
||||
table.insert(shopElements, {
|
||||
label = ('%s - <span style="color:green;">%s</span>'):format(vehicleLabel, TranslateCap('shop_item', ESX.Math.GroupDigits(vehicle.price))),
|
||||
shopElements[#shopElements+1] = {
|
||||
icon = 'fas fa-car',
|
||||
title = ('%s - <span style="color:green;">%s</span>'):format(vehicleLabel, TranslateCap('shop_item', ESX.Math.GroupDigits(vehicle.price))),
|
||||
name = vehicleLabel,
|
||||
model = vehicle.model,
|
||||
price = vehicle.price,
|
||||
props = vehicle.props,
|
||||
type = type
|
||||
})
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
if #shopElements > 0 then
|
||||
OpenShopMenu(shopElements, playerCoords, shopCoords)
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('garage_notauthorized'))
|
||||
end
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('garage_notauthorized'))
|
||||
end
|
||||
elseif data.current.action == 'garage' then
|
||||
local garage = {}
|
||||
elseif element.action == "garage" then
|
||||
local garage = {
|
||||
{unselectable = true, icon = "fas fa-car", title = "Garage"}
|
||||
}
|
||||
|
||||
ESX.TriggerServerCallback('esx_vehicleshop:retrieveJobVehicles', function(jobVehicles)
|
||||
if #jobVehicles > 0 then
|
||||
@@ -56,42 +62,37 @@ function OpenVehicleSpawnerMenu(type, hospital, part, partNum)
|
||||
label = label .. ('<span style="color:darkred;">%s</span>'):format(TranslateCap('garage_notstored'))
|
||||
end
|
||||
|
||||
table.insert(garage, {
|
||||
label = label,
|
||||
garage[#garage+1] = {
|
||||
icon = 'fas fa-car',
|
||||
title = label,
|
||||
stored = v.stored,
|
||||
model = props.model,
|
||||
plate = props.plate
|
||||
})
|
||||
}
|
||||
|
||||
allVehicleProps[props.plate] = props
|
||||
end
|
||||
end
|
||||
|
||||
if #garage > 0 then
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_garage', {
|
||||
title = TranslateCap('garage_title'),
|
||||
align = 'top-left',
|
||||
elements = garage
|
||||
}, function(data2, menu2)
|
||||
if data2.current.stored == 1 then
|
||||
ESX.OpenContext("right", garage, function(menuG,elementG)
|
||||
if elementG.stored == 1 then
|
||||
local foundSpawn, spawnPoint = GetAvailableVehicleSpawnPoint(hospital, part, partNum)
|
||||
|
||||
if foundSpawn then
|
||||
menu2.close()
|
||||
ESX.CloseContext()
|
||||
|
||||
ESX.Game.SpawnVehicle(data2.current.model, spawnPoint.coords, spawnPoint.heading, function(vehicle)
|
||||
local vehicleProps = allVehicleProps[data2.current.plate]
|
||||
ESX.Game.SpawnVehicle(elementG.model, spawnPoint.coords, spawnPoint.heading, function(vehicle)
|
||||
local vehicleProps = allVehicleProps[elementG.plate]
|
||||
ESX.Game.SetVehicleProperties(vehicle, vehicleProps)
|
||||
|
||||
TriggerServerEvent('esx_vehicleshop:setJobVehicleState', data2.current.plate, false)
|
||||
TriggerServerEvent('esx_vehicleshop:setJobVehicleState', elementG.plate, false)
|
||||
ESX.ShowNotification(TranslateCap('garage_released'))
|
||||
end)
|
||||
end
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('garage_notavailable'))
|
||||
end
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
end)
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('garage_empty'))
|
||||
@@ -100,11 +101,9 @@ function OpenVehicleSpawnerMenu(type, hospital, part, partNum)
|
||||
ESX.ShowNotification(TranslateCap('garage_empty'))
|
||||
end
|
||||
end, type)
|
||||
elseif data.current.action == 'store_garage' then
|
||||
elseif element.action == "store_garage" then
|
||||
StoreNearbyVehicle(playerCoords)
|
||||
end
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end
|
||||
|
||||
@@ -198,84 +197,71 @@ end
|
||||
function OpenShopMenu(elements, restoreCoords, shopCoords)
|
||||
local playerPed = PlayerPedId()
|
||||
isInShopMenu = true
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-car", title = element.title},
|
||||
{icon = "fas fa-eye", title = "View", value = "view"}
|
||||
}
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_shop', {
|
||||
title = TranslateCap('vehicleshop_title'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_shop_confirm', {
|
||||
title = TranslateCap('vehicleshop_confirm', data.current.name, data.current.price),
|
||||
align = 'top-left',
|
||||
elements = {
|
||||
{label = TranslateCap('confirm_no'), value = 'no'},
|
||||
{label = TranslateCap('confirm_yes'), value = 'yes'}
|
||||
}}, function(data2, menu2)
|
||||
if data2.current.value == 'yes' then
|
||||
local newPlate = exports['esx_vehicleshop']:GeneratePlate()
|
||||
local vehicle = GetVehiclePedIsIn(playerPed, false)
|
||||
local props = ESX.Game.GetVehicleProperties(vehicle)
|
||||
props.plate = newPlate
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
if element2.value == "view" then
|
||||
DeleteSpawnedVehicles()
|
||||
WaitForVehicleToLoad(element.model)
|
||||
|
||||
ESX.TriggerServerCallback('esx_ambulancejob:buyJobVehicle', function(bought)
|
||||
if bought then
|
||||
ESX.ShowNotification(TranslateCap('vehicleshop_bought', data.current.name, ESX.Math.GroupDigits(data.current.price)))
|
||||
ESX.Game.SpawnLocalVehicle(element.model, shopCoords, 0.0, function(vehicle)
|
||||
table.insert(spawnedVehicles, vehicle)
|
||||
TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
|
||||
FreezeEntityPosition(vehicle, true)
|
||||
SetModelAsNoLongerNeeded(element.model)
|
||||
|
||||
if element.props then
|
||||
ESX.Game.SetVehicleProperties(vehicle, element.props)
|
||||
end
|
||||
end)
|
||||
|
||||
local elements3 = {
|
||||
{unselectable = true, icon = "fas fa-car", title = element.title},
|
||||
{icon = "fas fa-check-double", title = "Buy", value = "buy"},
|
||||
{icon = "fas fa-eye", title = "Stop Viewing", value = "stop"}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements3, function(menu3,element3)
|
||||
if element3.value == 'stop' then
|
||||
isInShopMenu = false
|
||||
ESX.UI.Menu.CloseAll()
|
||||
ESX.CloseContext()
|
||||
|
||||
DeleteSpawnedVehicles()
|
||||
FreezeEntityPosition(playerPed, false)
|
||||
SetEntityVisible(playerPed, true)
|
||||
|
||||
ESX.Game.Teleport(playerPed, restoreCoords)
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('vehicleshop_money'))
|
||||
menu2.close()
|
||||
elseif element3.value == "buy" then
|
||||
local newPlate = exports['esx_vehicleshop']:GeneratePlate()
|
||||
local vehicle = GetVehiclePedIsIn(playerPed, false)
|
||||
local props = ESX.Game.GetVehicleProperties(vehicle)
|
||||
props.plate = newPlate
|
||||
|
||||
ESX.TriggerServerCallback('esx_ambulancejob:buyJobVehicle', function (bought)
|
||||
if bought then
|
||||
ESX.ShowNotification(TranslateCap('vehicleshop_bought', element.name, ESX.Math.GroupDigits(element.price)))
|
||||
|
||||
isInShopMenu = false
|
||||
ESX.CloseContext()
|
||||
DeleteSpawnedVehicles()
|
||||
FreezeEntityPosition(playerPed, false)
|
||||
SetEntityVisible(playerPed, true)
|
||||
|
||||
ESX.Game.Teleport(playerPed, restoreCoords)
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('vehicleshop_money'))
|
||||
ESX.CloseContext()
|
||||
end
|
||||
end, props, element.type)
|
||||
end
|
||||
end, props, data.current.type)
|
||||
else
|
||||
menu2.close()
|
||||
end
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
end)
|
||||
end, function(data, menu)
|
||||
isInShopMenu = false
|
||||
ESX.UI.Menu.CloseAll()
|
||||
|
||||
DeleteSpawnedVehicles()
|
||||
FreezeEntityPosition(playerPed, false)
|
||||
SetEntityVisible(playerPed, true)
|
||||
|
||||
ESX.Game.Teleport(playerPed, restoreCoords)
|
||||
end, function(data, menu)
|
||||
DeleteSpawnedVehicles()
|
||||
WaitForVehicleToLoad(data.current.model)
|
||||
|
||||
ESX.Game.SpawnLocalVehicle(data.current.model, shopCoords, 0.0, function(vehicle)
|
||||
table.insert(spawnedVehicles, vehicle)
|
||||
TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
|
||||
FreezeEntityPosition(vehicle, true)
|
||||
SetModelAsNoLongerNeeded(data.current.model)
|
||||
|
||||
if data.current.props then
|
||||
ESX.Game.SetVehicleProperties(vehicle, data.current.props)
|
||||
end)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
WaitForVehicleToLoad(elements[1].model)
|
||||
ESX.Game.SpawnLocalVehicle(elements[1].model, shopCoords, 0.0, function(vehicle)
|
||||
table.insert(spawnedVehicles, vehicle)
|
||||
TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
|
||||
FreezeEntityPosition(vehicle, true)
|
||||
SetModelAsNoLongerNeeded(elements[1].model)
|
||||
|
||||
if elements[1].props then
|
||||
ESX.Game.SetVehicleProperties(vehicle, elements[1].props)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
CreateThread(function()
|
||||
|
||||
@@ -35,6 +35,17 @@ Config.RespawnPoints = {
|
||||
{coords = vector3(1836.03, 3670.99, 34.28), heading = 296.06} -- Sandy Shores
|
||||
}
|
||||
|
||||
Config.PharmacyItems = {
|
||||
{
|
||||
title = "Medikit",
|
||||
item = "medikit"
|
||||
},
|
||||
{
|
||||
title = "Bandage",
|
||||
item = "bandage"
|
||||
},
|
||||
}
|
||||
|
||||
Config.Hospitals = {
|
||||
|
||||
CentralLosSantos = {
|
||||
|
||||
@@ -72,40 +72,54 @@ function OpenCustomersMenu()
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
local customer = element.data
|
||||
if element2.value == "deposit" then
|
||||
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'customer_deposit_amount', {
|
||||
title = TranslateCap('amount')
|
||||
}, function(data2, menu2)
|
||||
local amount = tonumber(data2.value)
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-scroll", title = TranslateCap('amount')},
|
||||
{title = "Amount", input = true, inputType = "number", inputMin = 1, inputMax = 250000, inputPlaceholder = "Amount to bill.."},
|
||||
{icon = "fas fa-check-double", title = "Confirm", val = "confirm"}
|
||||
}
|
||||
|
||||
if amount == nil then
|
||||
ESX.ShowNotification(TranslateCap('invalid_amount'))
|
||||
else
|
||||
menu2.close()
|
||||
TriggerServerEvent('esx_bankerjob:customerDeposit', customer.source, amount)
|
||||
ESX.ShowNotification("You have deposited $"..amount.." into "..element.title.."s account.")
|
||||
OpenCustomersMenu()
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
if element.val == "confirm" then
|
||||
local amount = tonumber(menu.eles[2].inputValue)
|
||||
|
||||
if amount == nil then
|
||||
ESX.ShowNotification(TranslateCap('invalid_amount'))
|
||||
else
|
||||
ESX.CloseContext()
|
||||
TriggerServerEvent('esx_bankerjob:customerDeposit', customer.source, amount)
|
||||
ESX.ShowNotification("You have deposited $"..amount.." into "..element.title.."s account.")
|
||||
OpenCustomersMenu()
|
||||
end
|
||||
end
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
OpenCustomersMenu()
|
||||
end, function(menu)
|
||||
CurrentAction = 'bank_actions_menu'
|
||||
CurrentActionMsg = TranslateCap('press_input_context_to_open_menu')
|
||||
CurrentActionData = {}
|
||||
end)
|
||||
elseif element2.value == "withdraw" then
|
||||
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'customer_withdraw_amount', {
|
||||
title = TranslateCap('amount')
|
||||
}, function(data2, menu2)
|
||||
local amount = tonumber(data2.value)
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-scroll", title = TranslateCap('amount')},
|
||||
{title = "Amount", input = true, inputType = "number", inputMin = 1, inputMax = 250000, inputPlaceholder = "Amount to bill.."},
|
||||
{icon = "fas fa-check-double", title = "Confirm", val = "confirm"}
|
||||
}
|
||||
|
||||
if amount == nil then
|
||||
ESX.ShowNotification(TranslateCap('invalid_amount'))
|
||||
else
|
||||
menu2.close()
|
||||
TriggerServerEvent('esx_bankerjob:customerWithdraw', customer.source, amount)
|
||||
ESX.ShowNotification("You have withdrawn $"..amount.." from "..element.title.."s account.")
|
||||
OpenCustomersMenu()
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
if element.val == "confirm" then
|
||||
local amount = tonumber(menu.eles[2].inputValue)
|
||||
|
||||
if amount == nil then
|
||||
ESX.ShowNotification(TranslateCap('invalid_amount'))
|
||||
else
|
||||
ESX.CloseContext()
|
||||
TriggerServerEvent('esx_bankerjob:customerWithdraw', customer.source, amount)
|
||||
ESX.ShowNotification("You have withdrawn $"..amount.." from "..element.title.."s account.")
|
||||
OpenCustomersMenu()
|
||||
end
|
||||
end
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
OpenCustomersMenu()
|
||||
end, function(menu)
|
||||
CurrentAction = 'bank_actions_menu'
|
||||
CurrentActionMsg = TranslateCap('press_input_context_to_open_menu')
|
||||
CurrentActionData = {}
|
||||
end)
|
||||
end
|
||||
end, function(menu)
|
||||
@@ -122,26 +136,34 @@ function OpenCustomersMenu()
|
||||
end
|
||||
|
||||
function CreateBillingDialog()
|
||||
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'billing', {
|
||||
title = TranslateCap('bill_amount')
|
||||
}, function(data, menu)
|
||||
local amount = tonumber(data.value)
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-scroll", title = TranslateCap('bill_amount')},
|
||||
{title = "Amount", input = true, inputType = "number", inputMin = 1, inputMax = 250000, inputPlaceholder = "Amount to bill.."},
|
||||
{icon = "fas fa-check-double", title = "Confirm", val = "confirm"}
|
||||
}
|
||||
|
||||
if amount == nil then
|
||||
ESX.ShowNotification(TranslateCap('invalid_amount'))
|
||||
else
|
||||
menu.close()
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
if element.val == "confirm" then
|
||||
local amount = tonumber(menu.eles[2].inputValue)
|
||||
|
||||
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
|
||||
|
||||
if closestPlayer == -1 or closestDistance > 5.0 then
|
||||
ESX.ShowNotification(TranslateCap('no_player_nearby'))
|
||||
if amount == nil then
|
||||
ESX.ShowNotification(TranslateCap('invalid_amount'))
|
||||
else
|
||||
TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(closestPlayer), 'society_banker', 'Bank', amount)
|
||||
ESX.CloseContext()
|
||||
|
||||
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
|
||||
|
||||
if closestPlayer == -1 or closestDistance > 5.0 then
|
||||
ESX.ShowNotification(TranslateCap('no_player_nearby'))
|
||||
else
|
||||
TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(closestPlayer), 'society_banker', 'Bank', amount)
|
||||
end
|
||||
end
|
||||
end
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end, function(menu)
|
||||
CurrentAction = 'bank_actions_menu'
|
||||
CurrentActionMsg = TranslateCap('press_input_context_to_open_menu')
|
||||
CurrentActionData = {}
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
@@ -115,7 +115,6 @@ local function StartThread()
|
||||
local atm = GetClosestObjectOfType(_GetEntityCoords, 8.0, Config.AtmModels[i], false)
|
||||
if atm ~= 0 then
|
||||
local atmOffset = GetOffsetFromEntityInWorldCoords(atm, 0.0, -0.7, 0.0)
|
||||
local atmHeading = GetEntityHeading(atm)
|
||||
local atmDistance = #(_GetEntityCoords - atmOffset)
|
||||
if not isInAtmMarker and atmDistance <= 1.5 then
|
||||
isInAtmMarker = true
|
||||
@@ -197,11 +196,14 @@ RegisterNetEvent('esx_banking:closebanking', function()
|
||||
CloseUi()
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx_banking:PedHandler', function(netIdTable)
|
||||
local npc
|
||||
for i = 1, #netIdTable do
|
||||
npc = NetworkGetEntityFromNetworkId(netIdTable[i])
|
||||
TaskStartScenarioInPlace(npc, Config.Peds[i].Scenario, 0, true)
|
||||
local function loadNPC(index, netID)
|
||||
CreateThread(function()
|
||||
while not NetworkDoesEntityExistWithNetworkId(netID) do
|
||||
Wait(1)
|
||||
end
|
||||
local npc = NetworkGetEntityFromNetworkId(netID)
|
||||
|
||||
TaskStartScenarioInPlace(npc, Config.Peds[index].Scenario, 0, true)
|
||||
SetEntityProofs(npc, true, true, true, true, true, true, true, true)
|
||||
SetBlockingOfNonTemporaryEvents(npc, true)
|
||||
FreezeEntityPosition(npc, true)
|
||||
@@ -209,6 +211,12 @@ RegisterNetEvent('esx_banking:PedHandler', function(netIdTable)
|
||||
SetPedCanRagdoll(npc, false)
|
||||
SetEntityAsMissionEntity(npc, true, true)
|
||||
SetEntityDynamic(npc, false)
|
||||
end)
|
||||
end
|
||||
|
||||
RegisterNetEvent('esx_banking:PedHandler', function(netIdTable)
|
||||
for i = 1, #netIdTable do
|
||||
loadNPC(i, netIdTable[i])
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -242,4 +250,4 @@ AddEventHandler('onResourceStop', function(resource)
|
||||
if isInMenu then
|
||||
CloseUi()
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
@@ -22,10 +22,11 @@ AddEventHandler('onResourceStop', function(resourceName)
|
||||
if Config.EnablePeds then BANK.DeletePeds() end
|
||||
end)
|
||||
|
||||
AddEventHandler('esx:playerLoaded', function(playerId, xPlayer)
|
||||
if not Config.EnablePeds then return end
|
||||
TriggerClientEvent('esx_banking:PedHandler', playerId, netIdTable)
|
||||
end)
|
||||
if Config.EnablePeds then
|
||||
AddEventHandler('esx:playerLoaded', function(playerId)
|
||||
TriggerClientEvent('esx_banking:PedHandler', playerId, netIdTable)
|
||||
end)
|
||||
end
|
||||
|
||||
-- event
|
||||
RegisterServerEvent('esx_banking:doingType')
|
||||
|
||||
@@ -6,7 +6,6 @@ AddEventHandler('esx_basicneeds:resetStatus', function()
|
||||
TriggerEvent('esx_status:set', 'thirst', 500000)
|
||||
end)
|
||||
|
||||
|
||||
RegisterNetEvent('esx_basicneeds:healPlayer')
|
||||
AddEventHandler('esx_basicneeds:healPlayer', function()
|
||||
-- restore hunger & thirst
|
||||
@@ -27,11 +26,10 @@ AddEventHandler('esx:onPlayerSpawn', function(spawn)
|
||||
TriggerEvent('esx_basicneeds:resetStatus')
|
||||
end
|
||||
|
||||
IsDead = false
|
||||
IsDead = false
|
||||
end)
|
||||
|
||||
AddEventHandler('esx_status:loaded', function(status)
|
||||
|
||||
TriggerEvent('esx_status:registerStatus', 'hunger', 1000000, '#CFAD0F', function(status)
|
||||
return Config.Visible
|
||||
end, function(status)
|
||||
@@ -43,7 +41,6 @@ AddEventHandler('esx_status:loaded', function(status)
|
||||
end, function(status)
|
||||
status.remove(75)
|
||||
end)
|
||||
|
||||
end)
|
||||
|
||||
AddEventHandler('esx_status:onTick', function(data)
|
||||
@@ -74,11 +71,18 @@ AddEventHandler('esx_basicneeds:isEating', function(cb)
|
||||
cb(IsAnimated)
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx_basicneeds:onEat')
|
||||
AddEventHandler('esx_basicneeds:onEat', function(prop_name)
|
||||
RegisterNetEvent('esx_basicneeds:onUse')
|
||||
AddEventHandler('esx_basicneeds:onUse', function(type, prop_name)
|
||||
if not IsAnimated then
|
||||
prop_name = prop_name or 'prop_cs_burger_01'
|
||||
local anim = {dict = 'mp_player_inteat@burger', name = 'mp_player_int_eat_burger_fp', settings = {8.0, -8, -1, 49, 0, 0, 0, 0}}
|
||||
IsAnimated = true
|
||||
if type == 'food' then
|
||||
prop_name = prop_name or 'prop_cs_burger_01'
|
||||
anim = {dict = 'mp_player_inteat@burger', name = 'mp_player_int_eat_burger_fp', settings = {8.0, -8, -1, 49, 0, 0, 0, 0}}
|
||||
elseif type == 'drink' then
|
||||
prop_name = prop_name or 'prop_ld_flow_bottle'
|
||||
anim = {dict = 'mp_player_intdrink', name = 'loop_bottle', settings = {1.0, -1.0, 2000, 0, 1, true, true, true}}
|
||||
end
|
||||
|
||||
CreateThread(function()
|
||||
local playerPed = PlayerPedId()
|
||||
@@ -87,9 +91,9 @@ AddEventHandler('esx_basicneeds:onEat', function(prop_name)
|
||||
local boneIndex = GetPedBoneIndex(playerPed, 18905)
|
||||
AttachEntityToEntity(prop, playerPed, boneIndex, 0.12, 0.028, 0.001, 10.0, 175.0, 0.0, true, true, false, true, 1, true)
|
||||
|
||||
ESX.Streaming.RequestAnimDict('mp_player_inteat@burger', function()
|
||||
TaskPlayAnim(playerPed, 'mp_player_inteat@burger', 'mp_player_int_eat_burger_fp', 8.0, -8, -1, 49, 0, 0, 0, 0)
|
||||
RemoveAnimDict('mp_player_inteat@burger')
|
||||
ESX.Streaming.RequestAnimDict(anim.dict, function()
|
||||
TaskPlayAnim(playerPed, anim.dict, anim.name, anim.settings[1], anim.settings[2], anim.settings[3], anim.settings[4], anim.settings[5], anim.settings[6], anim.settings[7], anim.settings[8])
|
||||
RemoveAnimDict(anim.dict)
|
||||
|
||||
Wait(3000)
|
||||
IsAnimated = false
|
||||
@@ -97,33 +101,28 @@ AddEventHandler('esx_basicneeds:onEat', function(prop_name)
|
||||
DeleteObject(prop)
|
||||
end)
|
||||
end)
|
||||
|
||||
end
|
||||
end)
|
||||
|
||||
-- Backwards compatibility
|
||||
RegisterNetEvent('esx_basicneeds:onEat')
|
||||
AddEventHandler('esx_basicneeds:onEat', function(prop_name)
|
||||
local Invoke = GetInvokingResource()
|
||||
print(('[^3WARNING^7] ^5%s^7 used ^5esx_basicneeds:onEat^7, this method is deprecated and should not be used! Refer to ^5https://docs.esx-framework.org/tutorials/basicneeds^7 for more info!'):format(Invoke))
|
||||
|
||||
if not prop_name then
|
||||
prop_name = 'prop_cs_burger_01'
|
||||
end
|
||||
TriggerEvent('esx_basicneeds:onUse', 'food', prop_name)
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx_basicneeds:onDrink')
|
||||
AddEventHandler('esx_basicneeds:onDrink', function(prop_name)
|
||||
if not IsAnimated then
|
||||
prop_name = prop_name or 'prop_ld_flow_bottle'
|
||||
IsAnimated = true
|
||||
local Invoke = GetInvokingResource()
|
||||
print(('[^3WARNING^7] ^5%s^7 used ^5esx_basicneeds:onDrink^7, this method is deprecated and should not be used! Refer to ^5https://docs.esx-framework.org/tutorials/basicneeds^7 for more info!'):format(Invoke))
|
||||
|
||||
CreateThread(function()
|
||||
local playerPed = PlayerPedId()
|
||||
local x,y,z = table.unpack(GetEntityCoords(playerPed))
|
||||
local prop = CreateObject(joaat(prop_name), x, y, z + 0.2, true, true, true)
|
||||
local boneIndex = GetPedBoneIndex(playerPed, 18905)
|
||||
AttachEntityToEntity(prop, playerPed, boneIndex, 0.12, 0.028, 0.001, 10.0, 175.0, 0.0, true, true, false, true, 1, true)
|
||||
|
||||
ESX.Streaming.RequestAnimDict('mp_player_intdrink', function()
|
||||
TaskPlayAnim(playerPed, 'mp_player_intdrink', 'loop_bottle', 1.0, -1.0, 2000, 0, 1, true, true, true)
|
||||
RemoveAnimDict('mp_player_intdrink')
|
||||
|
||||
Wait(3000)
|
||||
IsAnimated = false
|
||||
ClearPedSecondaryTask(playerPed)
|
||||
DeleteObject(prop)
|
||||
end)
|
||||
end)
|
||||
|
||||
end
|
||||
if not prop_name then
|
||||
prop_name = 'prop_ld_flow_bottle'
|
||||
end
|
||||
TriggerEvent('esx_basicneeds:onUse', 'drink', prop_name)
|
||||
end)
|
||||
|
||||
@@ -2,15 +2,17 @@ Config = {}
|
||||
Config.Locale = GetConvar('esx:locale', 'en')
|
||||
Config.Visible = true
|
||||
|
||||
Config.Food = {
|
||||
Config.Items = {
|
||||
["bread"] = {
|
||||
type = "food",
|
||||
prop= "prop_cs_burger_01",
|
||||
status = 200000,
|
||||
remove = true
|
||||
}
|
||||
}
|
||||
|
||||
Config.Drinks = {
|
||||
},
|
||||
|
||||
["water"] = {
|
||||
type = "drink",
|
||||
prop = "prop_ld_flow_bottle",
|
||||
status = 100000,
|
||||
remove = true
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Locales['de'] = {
|
||||
['used_bread'] = 'du hast 1x Brot gegessen',
|
||||
['used_water'] = 'du hast 1x Wasser getrunken',
|
||||
}
|
||||
['used_food'] = 'Du hast 1x %s gegessen.',
|
||||
['used_drink'] = 'Du hast 1x %s getrunken.',
|
||||
['got_healed'] = 'Du wurdest geheilt.'
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Locales['en'] = {
|
||||
['used_eat'] = 'you have used 1x %s',
|
||||
['used_drink'] = 'you have used 1x %s',
|
||||
['used_food'] = 'You have eaten 1x %s',
|
||||
['used_drink'] = 'You have drinked 1x %s',
|
||||
['got_healed'] = 'You have been healed.'
|
||||
}
|
||||
|
||||
@@ -1,34 +1,28 @@
|
||||
CreateThread(function()
|
||||
for k,v in pairs(Config.Food) do
|
||||
for k,v in pairs(Config.Items) do
|
||||
ESX.RegisterUsableItem(k, function(source)
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
if v.remove then
|
||||
xPlayer.removeInventoryItem(k,1)
|
||||
end
|
||||
TriggerClientEvent("esx_status:add",source,"hunger",v.status)
|
||||
TriggerClientEvent('esx_basicneeds:onEat',source)
|
||||
xPlayer.showNotification(TranslateCap('used_eat', ESX.GetItemLabel(k)))
|
||||
end)
|
||||
end
|
||||
end)
|
||||
|
||||
CreateThread(function()
|
||||
for k,v in pairs(Config.Drinks) do
|
||||
ESX.RegisterUsableItem(k, function(source)
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
if v.remove then
|
||||
xPlayer.removeInventoryItem(k,1)
|
||||
if v.type == "food" then
|
||||
TriggerClientEvent("esx_status:add", source, "hunger", v.status)
|
||||
TriggerClientEvent('esx_basicneeds:onUse', source, v.type)
|
||||
xPlayer.showNotification(TranslateCap('used_food', ESX.GetItemLabel(k)))
|
||||
elseif v.type == "drink" then
|
||||
TriggerClientEvent("esx_status:add", source, "thirst", v.status)
|
||||
TriggerClientEvent('esx_basicneeds:onUse', source, v.type)
|
||||
xPlayer.showNotification(TranslateCap('used_drink', ESX.GetItemLabel(k)))
|
||||
else
|
||||
print(string.format('^1[ERROR]^0 %s has no correct type defined.', k))
|
||||
end
|
||||
TriggerClientEvent("esx_status:add",source,"thirst",v.status)
|
||||
TriggerClientEvent('esx_basicneeds:onDrink',source)
|
||||
xPlayer.showNotification(TranslateCap('used_drink', ESX.GetItemLabel(k)))
|
||||
end)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
ESX.RegisterCommand('heal', 'admin', function(xPlayer, args, showError)
|
||||
args.playerId.triggerEvent('esx_basicneeds:healPlayer')
|
||||
args.playerId.showNotification('You have been healed.')
|
||||
args.playerId.showNotification(TranslateCap('got_healed'))
|
||||
end, true, {help = 'Heal a player, or yourself - restores thirst, hunger and health.', validate = true, arguments = {
|
||||
{name = 'playerId', help = 'the player id', type = 'player'}
|
||||
}})
|
||||
|
||||
@@ -27,7 +27,7 @@ function ShowBillsMenu()
|
||||
end
|
||||
|
||||
RegisterCommand('showbills', function()
|
||||
if not isDead and not ESX.UI.Menu.IsOpen('default', GetCurrentResourceName(), 'billing') then
|
||||
if not isDead then
|
||||
ShowBillsMenu()
|
||||
end
|
||||
end, false)
|
||||
|
||||
@@ -5,97 +5,96 @@ function OpenBoatShop(shop)
|
||||
isInShopMenu = true
|
||||
|
||||
local playerPed = PlayerPedId()
|
||||
local elements = {}
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-ship", title = TranslateCap('boat_shop')}
|
||||
}
|
||||
|
||||
for k,v in ipairs(Config.Vehicles) do
|
||||
table.insert(elements, {
|
||||
label = ('%s - <span style="color:green;">$%s</span>'):format(v.label, ESX.Math.GroupDigits(v.price)),
|
||||
elements[#elements+1] = {
|
||||
icon = "fas fa-ship",
|
||||
title = ('%s - <span style="color:green;">$%s</span>'):format(v.label, ESX.Math.GroupDigits(v.price)),
|
||||
name = v.label,
|
||||
model = v.model,
|
||||
price = v.price,
|
||||
props = v.props or nil
|
||||
})
|
||||
}
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'boat_shop', {
|
||||
title = TranslateCap('boat_shop'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function (data, menu)
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'boat_shop_confirm', {
|
||||
title = TranslateCap('boat_shop_confirm', data.current.name, ESX.Math.GroupDigits(data.current.price)),
|
||||
align = 'top-left',
|
||||
elements = {
|
||||
{label = TranslateCap('confirm_no'), value = 'no'},
|
||||
{label = TranslateCap('confirm_yes'), value = 'yes'}
|
||||
}}, function (data2, menu2)
|
||||
if data2.current.value == 'yes' then
|
||||
local plate = exports['esx_vehicleshop']:GeneratePlate()
|
||||
local vehicle = GetVehiclePedIsIn(playerPed, false)
|
||||
local props = ESX.Game.GetVehicleProperties(vehicle)
|
||||
props.plate = plate
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-ship", title = element.title},
|
||||
{icon = "fas fa-eye", title = "View", val = "view"}
|
||||
}
|
||||
|
||||
ESX.TriggerServerCallback('esx_boat:buyBoat', function(bought)
|
||||
if bought then
|
||||
ESX.ShowNotification(TranslateCap('boat_shop_bought', data.current.name, ESX.Math.GroupDigits(data.current.price)))
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
if element2.val == "view" then
|
||||
DeleteSpawnedVehicles()
|
||||
|
||||
DeleteSpawnedVehicles()
|
||||
isInShopMenu = false
|
||||
ESX.UI.Menu.CloseAll()
|
||||
ESX.Game.SpawnLocalVehicle(element.model, shop.Inside, shop.Inside.w, function (vehicle)
|
||||
table.insert(spawnedVehicles, vehicle)
|
||||
TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
|
||||
FreezeEntityPosition(vehicle, true)
|
||||
|
||||
CurrentAction = 'boat_shop'
|
||||
CurrentActionMsg = TranslateCap('boat_shop_open')
|
||||
|
||||
FreezeEntityPosition(playerPed, false)
|
||||
SetEntityVisible(playerPed, true)
|
||||
SetEntityCoords(playerPed, shop.Outside.x, shop.Outside.y, shop.Outside.z)
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('boat_shop_nomoney'))
|
||||
menu2.close()
|
||||
if element.props then
|
||||
ESX.Game.SetVehicleProperties(vehicle, element.props)
|
||||
end
|
||||
end, props)
|
||||
else
|
||||
menu2.close()
|
||||
end
|
||||
end, function (data2, menu2)
|
||||
menu2.close()
|
||||
end)
|
||||
end, function (data, menu)
|
||||
menu.close()
|
||||
isInShopMenu = false
|
||||
DeleteSpawnedVehicles()
|
||||
|
||||
local elements3 = {
|
||||
{unselectable = true, icon = "fas fa-ship", title = element.title},
|
||||
{icon = "fas fa-check-double", title = "Buy", value = "buy"},
|
||||
{icon = "fas fa-eye", title = "Stop Viewing", value = "stop"}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements3, function(menu3,element3)
|
||||
if element3.value == "buy" then
|
||||
local plate = exports['esx_vehicleshop']:GeneratePlate()
|
||||
local vehicle = GetVehiclePedIsIn(playerPed, false)
|
||||
local props = ESX.Game.GetVehicleProperties(vehicle)
|
||||
props.plate = plate
|
||||
|
||||
ESX.TriggerServerCallback('esx_boat:buyBoat', function(bought)
|
||||
if bought then
|
||||
ESX.ShowNotification(TranslateCap('boat_shop_bought', element.name, ESX.Math.GroupDigits(element.price)))
|
||||
|
||||
DeleteSpawnedVehicles()
|
||||
isInShopMenu = false
|
||||
ESX.CloseContext()
|
||||
|
||||
CurrentAction = 'boat_shop'
|
||||
CurrentActionMsg = TranslateCap('boat_shop_open')
|
||||
|
||||
FreezeEntityPosition(playerPed, false)
|
||||
SetEntityVisible(playerPed, true)
|
||||
SetEntityCoords(playerPed, shop.Outside.x, shop.Outside.y, shop.Outside.z)
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('boat_shop_nomoney'))
|
||||
ESX.CloseContext()
|
||||
end
|
||||
end, props)
|
||||
elseif element3.value == "stop" then
|
||||
isInShopMenu = false
|
||||
DeleteSpawnedVehicles()
|
||||
|
||||
CurrentAction = 'boat_shop'
|
||||
CurrentActionMsg = TranslateCap('boat_shop_open')
|
||||
|
||||
FreezeEntityPosition(playerPed, false)
|
||||
SetEntityVisible(playerPed, true)
|
||||
SetEntityCoords(playerPed, shop.Outside.x, shop.Outside.y, shop.Outside.z)
|
||||
ESX.CloseContext()
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end
|
||||
end, function(menu)
|
||||
isInShopMenu = false
|
||||
CurrentAction = 'boat_shop'
|
||||
CurrentActionMsg = TranslateCap('boat_shop_open')
|
||||
end)
|
||||
end, function(menu)
|
||||
isInShopMenu = false
|
||||
CurrentAction = 'boat_shop'
|
||||
CurrentActionMsg = TranslateCap('boat_shop_open')
|
||||
|
||||
FreezeEntityPosition(playerPed, false)
|
||||
SetEntityVisible(playerPed, true)
|
||||
SetEntityCoords(playerPed, shop.Outside.x, shop.Outside.y, shop.Outside.z)
|
||||
end, function (data, menu)
|
||||
DeleteSpawnedVehicles()
|
||||
|
||||
ESX.Game.SpawnLocalVehicle(data.current.model, shop.Inside, shop.Inside.w, function (vehicle)
|
||||
table.insert(spawnedVehicles, vehicle)
|
||||
TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
|
||||
FreezeEntityPosition(vehicle, true)
|
||||
|
||||
if data.current.props then
|
||||
ESX.Game.SetVehicleProperties(vehicle, data.current.props)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
-- spawn first vehicle
|
||||
DeleteSpawnedVehicles()
|
||||
|
||||
ESX.Game.SpawnLocalVehicle(Config.Vehicles[1].model, shop.Inside, shop.Inside.w, function (vehicle)
|
||||
table.insert(spawnedVehicles, vehicle)
|
||||
TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
|
||||
FreezeEntityPosition(vehicle, true)
|
||||
|
||||
if Config.Vehicles[1].props then
|
||||
ESX.Game.SetVehicleProperties(vehicle, Config.Vehicles[1].props)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
@@ -105,24 +104,22 @@ function OpenBoatGarage(garage)
|
||||
ESX.ShowNotification(TranslateCap('garage_noboats'))
|
||||
else
|
||||
-- get all available boats
|
||||
local elements = {}
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-ship", title = TranslateCap('garage')}
|
||||
}
|
||||
for i=1, #ownedBoats, 1 do
|
||||
ownedBoats[i] = json.decode(ownedBoats[i])
|
||||
|
||||
table.insert(elements, {
|
||||
label = getVehicleLabelFromHash(ownedBoats[i].model),
|
||||
elements[#elements+1] = {
|
||||
icon = "fas fa-ship",
|
||||
title = getVehicleLabelFromHash(ownedBoats[i].model),
|
||||
vehicleProps = ownedBoats[i]
|
||||
})
|
||||
}
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'boat_garage', {
|
||||
title = TranslateCap('garage'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function (data, menu)
|
||||
-- make sure the spawn point isn't blocked
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local playerPed = PlayerPedId()
|
||||
local vehicleProps = data.current.vehicleProps
|
||||
local vehicleProps = element.vehicleProps
|
||||
|
||||
if ESX.Game.IsSpawnPointClear(garage.SpawnPoint, 4.0) then
|
||||
TriggerServerEvent('esx_boat:takeOutVehicle', vehicleProps.plate)
|
||||
@@ -133,13 +130,11 @@ function OpenBoatGarage(garage)
|
||||
ESX.Game.SetVehicleProperties(vehicle, vehicleProps)
|
||||
end)
|
||||
|
||||
menu.close()
|
||||
ESX.CloseContext()
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('garage_blocked'))
|
||||
end
|
||||
end, function (data, menu)
|
||||
menu.close()
|
||||
|
||||
end, function(menu)
|
||||
CurrentAction = 'garage_out'
|
||||
CurrentActionMsg = TranslateCap('garage_open')
|
||||
end)
|
||||
@@ -148,33 +143,36 @@ function OpenBoatGarage(garage)
|
||||
end
|
||||
|
||||
function OpenLicenceMenu(shop)
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'boat_license', {
|
||||
title = TranslateCap('license_menu'),
|
||||
align = 'top-left',
|
||||
elements = {
|
||||
{label = TranslateCap('license_buy_no'), value = 'no'},
|
||||
{label = TranslateCap('license_buy_yes', ESX.Math.GroupDigits(Config.LicensePrice)), value = 'yes'}
|
||||
}}, function (data, menu)
|
||||
if data.current.value == 'yes' then
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-ship", title = TranslateCap('license_menu')},
|
||||
{icon = "fas fa-ship", title = "Purchase Boat License"}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-ship", title = element.title},
|
||||
{icon = "fas fa-check-double", title = TranslateCap('license_buy_yes'), val = "yes"},
|
||||
{icon = "fas fa-window-close", title = TranslateCap('license_buy_no'), val = "no"}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
ESX.TriggerServerCallback('esx_boat:buyBoatLicense', function (boughtLicense)
|
||||
if boughtLicense then
|
||||
ESX.ShowNotification(TranslateCap('license_bought', ESX.Math.GroupDigits(Config.LicensePrice)))
|
||||
menu.close()
|
||||
ESX.CloseContext()
|
||||
|
||||
OpenBoatShop(shop) -- parse current shop
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('license_nomoney'))
|
||||
end
|
||||
end)
|
||||
else
|
||||
CurrentAction = 'boat_shop'
|
||||
end, function(menu)
|
||||
CurrentAction = 'boat_shop'
|
||||
CurrentActionMsg = TranslateCap('boat_shop_open')
|
||||
menu.close()
|
||||
end
|
||||
end, function (data, menu)
|
||||
CurrentAction = 'boat_shop'
|
||||
end)
|
||||
end, function(menu)
|
||||
CurrentAction = 'boat_shop'
|
||||
CurrentActionMsg = TranslateCap('boat_shop_open')
|
||||
menu.close()
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ end)
|
||||
|
||||
AddEventHandler('esx_boat:hasExitedMarker', function()
|
||||
if not isInShopMenu then
|
||||
ESX.UI.Menu.CloseAll()
|
||||
ESX.CloseContext()
|
||||
end
|
||||
|
||||
CurrentAction = nil
|
||||
|
||||
@@ -33,18 +33,18 @@ function OpenShopMenu()
|
||||
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
if element2.value == "yes" then
|
||||
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'outfit_name', {
|
||||
title = TranslateCap('name_outfit')
|
||||
}, function(data3, menu3)
|
||||
menu3.close()
|
||||
local elements3 = {
|
||||
{unselectable = true, icon = "fas fa-shirt", title = TranslateCap('name_outfit')},
|
||||
{title = "Outfit Name", input = true, inputType = "text", inputPlaceholder = "Outfit name in wardrobe.."},
|
||||
{icon = "fas fa-check-circle", title = "Confirm", value = "confirm"}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements3, function(menu3,element3)
|
||||
TriggerEvent('skinchanger:getSkin', function(skin)
|
||||
ESX.CloseContext()
|
||||
TriggerServerEvent('esx_clotheshop:saveOutfit', data3.value, skin)
|
||||
TriggerServerEvent('esx_clotheshop:saveOutfit', menu3.eles[2].inputValue, skin)
|
||||
ESX.ShowNotification(TranslateCap('saved_outfit'))
|
||||
end)
|
||||
end, function(data3, menu3)
|
||||
menu3.close()
|
||||
end)
|
||||
elseif element2.value == "no" then
|
||||
ESX.CloseContext()
|
||||
|
||||
@@ -21,7 +21,6 @@ CreateThread(function()
|
||||
inZoneDrugShop = false
|
||||
if menuOpen then
|
||||
menuOpen=false
|
||||
ESX.UI.Menu.CloseAll()
|
||||
end
|
||||
end
|
||||
|
||||
@@ -62,36 +61,39 @@ CreateThread(function ()
|
||||
end)
|
||||
|
||||
function OpenDrugShop()
|
||||
ESX.UI.Menu.CloseAll()
|
||||
local elements = {}
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-cannabis", title = TranslateCap('dealer_title')}
|
||||
}
|
||||
menuOpen = true
|
||||
|
||||
for k, v in pairs(ESX.GetPlayerData().inventory) do
|
||||
local price = Config.DrugDealerItems[v.name]
|
||||
|
||||
if price and v.count > 0 then
|
||||
table.insert(elements, {
|
||||
label = ('%s - <span style="color:green;">%s</span>'):format(v.label, TranslateCap('dealer_item', ESX.Math.GroupDigits(price))),
|
||||
elements[#elements+1] = {
|
||||
icon = "fas fa-shopping-basket",
|
||||
title = ('%s - <span style="color:green;">%s</span>'):format(v.label, TranslateCap('dealer_item', ESX.Math.GroupDigits(price))),
|
||||
name = v.name,
|
||||
price = price,
|
||||
|
||||
-- menu properties
|
||||
type = 'slider',
|
||||
value = 1,
|
||||
min = 1,
|
||||
max = v.count
|
||||
})
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'drug_shop', {
|
||||
title = TranslateCap('dealer_title'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
TriggerServerEvent('esx_drugs:sellDrug', data.current.name, data.current.value)
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-shopping-basket", title = element.title},
|
||||
{icon = "fas fa-shopping-basket", title = "Amount", input = true, inputType = "number", inputPlaceholder = "Amount you want to sell", inputMin = Config.SellMenu.Min, inputMax = Config.SellMenu.Max},
|
||||
{icon = "fas fa-check-double", title = "Confirm", val = "confirm"}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
local amount = menu2.eles[2].inputValue
|
||||
ESX.CloseContext()
|
||||
TriggerServerEvent('esx_drugs:sellDrug', element.name, amount)
|
||||
end, function(menu)
|
||||
menuOpen = false
|
||||
end)
|
||||
end, function(menu)
|
||||
menuOpen = false
|
||||
end)
|
||||
end
|
||||
@@ -99,7 +101,7 @@ end
|
||||
AddEventHandler('onResourceStop', function(resource)
|
||||
if resource == GetCurrentResourceName() then
|
||||
if menuOpen then
|
||||
ESX.UI.Menu.CloseAll()
|
||||
ESX.CloseContext()
|
||||
end
|
||||
end
|
||||
end)
|
||||
@@ -109,39 +111,20 @@ function OpenBuyLicenseMenu(licenseName)
|
||||
local license = Config.LicensePrices[licenseName]
|
||||
|
||||
local elements = {
|
||||
{
|
||||
label = TranslateCap('license_no'),
|
||||
value = 'no'
|
||||
},
|
||||
|
||||
{
|
||||
label = ('%s - <span style="color:green;">%s</span>'):format(license.label, TranslateCap('dealer_item', ESX.Math.GroupDigits(license.price))),
|
||||
value = licenseName,
|
||||
price = license.price,
|
||||
licenseName = license.label
|
||||
}
|
||||
{unselectable = true, title = TranslateCap('purchase_license')},
|
||||
{title = ('%s - <span style="color:green;">%s</span>'):format(license.label, TranslateCap('dealer_item', ESX.Math.GroupDigits(license.price))), value = licenseName, price = license.price, licenseName = license.label}
|
||||
}
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'license_shop', {
|
||||
title = TranslateCap('license_title'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
|
||||
if data.current.value ~= 'no' then
|
||||
ESX.TriggerServerCallback('esx_drugs:buyLicense', function(boughtLicense)
|
||||
if boughtLicense then
|
||||
ESX.ShowNotification(TranslateCap('license_bought', data.current.licenseName, ESX.Math.GroupDigits(data.current.price)))
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('license_bought_fail', data.current.licenseName))
|
||||
end
|
||||
end, data.current.value)
|
||||
else
|
||||
menu.close()
|
||||
end
|
||||
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
ESX.TriggerServerCallback('esx_drugs:buyLicense', function(boughtLicense)
|
||||
if boughtLicense then
|
||||
ESX.CloseContext()
|
||||
ESX.ShowNotification(TranslateCap('license_bought', element.licenseName, ESX.Math.GroupDigits(element.price)))
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('license_bought_fail', element.licenseName))
|
||||
end
|
||||
end, element.value)
|
||||
end, function(menu)
|
||||
menuOpen = false
|
||||
end)
|
||||
end
|
||||
|
||||
@@ -31,3 +31,10 @@ Config.Marker = {
|
||||
Size = vector3(1.5,1.5,1.0),
|
||||
Type = 1,
|
||||
}
|
||||
|
||||
-- min amount of Config.DrugDealerItems to sell
|
||||
-- max amount of Config.DrugDealerItems to sell
|
||||
Config.SellMenu = {
|
||||
Min = 1,
|
||||
Max = 50
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
Locales["hu"] = {
|
||||
["parking_blip_name"] = 'Garázs',
|
||||
["Impound_blip_name"] = 'Lefoglaltak',
|
||||
["access_parking"] = 'Nyomd meg az [E] gombot a parkoló eléréshez.',
|
||||
["access_parking"] = 'Nyomd meg az [E] gombot a parkoló megtekintéséhez.',
|
||||
["access_Impound"] = 'Nyomd meg az [E] gombot a lefoglaltak megtekintéséhez.',
|
||||
["park_veh"] = 'Nyomd meg az [E] gombot a jármű parkolásához.',
|
||||
["not_owning_veh"] = 'Ez a jármű nem a te tulajdonod!',
|
||||
['veh_released'] = 'Jármű sikeresen kivéve.',
|
||||
['veh_released'] = 'Sikeresen kivetted a járművet.',
|
||||
['veh_Impound_released'] = 'Jármű sikeresen kiváltva a legfolalásból.',
|
||||
['veh_stored'] = 'Jármű sikeresen tárolva',
|
||||
['veh_impounded'] = 'Lefoglalt jármű',
|
||||
['no_veh_parking'] = 'Nincsenek itt tárolt járművek-',
|
||||
['veh_impounded'] = 'Lefoglalt jármű megjelölve a térképen',
|
||||
['no_veh_parking'] = 'Nincsenek itt tárolt járművek.',
|
||||
['no_veh_impounded'] = 'Nincs lefoglalt jármű.',
|
||||
['no_veh_Impound'] = 'nincs lefoglalt járműved.',
|
||||
['veh_model'] = 'Model',
|
||||
|
||||
@@ -38,7 +38,6 @@ AddEventHandler('esx_garage:setImpound', function(Impound, vehicleProps)
|
||||
})
|
||||
|
||||
xPlayer.showNotification(TranslateCap('veh_impounded'))
|
||||
|
||||
end)
|
||||
|
||||
|
||||
|
||||
@@ -27,17 +27,14 @@ RegisterNetEvent('esx:setJob',function(job)
|
||||
end)
|
||||
|
||||
function OpenMenu()
|
||||
ESX.UI.Menu.CloseAll()
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-shirt", title = TranslateCap('cloakroom')},
|
||||
{icon = "fas fa-shirt", title = TranslateCap('job_wear'), value = "job_wear"},
|
||||
{icon = "fas fa-shirt", title = TranslateCap('citizen_wear'), value = "citizen_wear"},
|
||||
}
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'cloakroom',
|
||||
{
|
||||
title = TranslateCap('cloakroom'),
|
||||
elements = {
|
||||
{label = TranslateCap('job_wear'), value = 'job_wear'},
|
||||
{label = TranslateCap('citizen_wear'), value = 'citizen_wear'}
|
||||
}
|
||||
}, function(data, menu)
|
||||
if data.current.value == 'citizen_wear' then
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
if element.value == "citizen_wear" then
|
||||
onDuty = false
|
||||
ESX.ShowNotification(TranslateCap('offduty'),"success")
|
||||
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
|
||||
@@ -49,7 +46,7 @@ function OpenMenu()
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
elseif data.current.value == 'job_wear' then
|
||||
elseif element.value == "job_wear" then
|
||||
onDuty = true
|
||||
ESX.ShowNotification(TranslateCap('onduty'), "success")
|
||||
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
|
||||
@@ -68,10 +65,6 @@ function OpenMenu()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
menu.close()
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
@@ -268,9 +268,9 @@ Locales['es'] = {
|
||||
['stickers'] = 'calcomanías',
|
||||
|
||||
-- Xenon Colors
|
||||
['mintgreen'] = 'Mint Green',
|
||||
['goldenshower'] = 'Golden Shower',
|
||||
['ponypink'] = 'Pony Pink',
|
||||
['hotpink'] = 'Hot Pink',
|
||||
['blacklight'] = 'Blacklight',
|
||||
['mintgreen'] = 'Menta verde',
|
||||
['goldenshower'] = 'Baño de oro',
|
||||
['ponypink'] = 'Poni rosa',
|
||||
['hotpink'] = 'Rosa caliente',
|
||||
['blacklight'] = 'Luz negra',
|
||||
}
|
||||
|
||||
@@ -54,44 +54,41 @@ end
|
||||
|
||||
function OpenMechanicActionsMenu()
|
||||
local elements = {
|
||||
{label = TranslateCap('vehicle_list'), value = 'vehicle_list'},
|
||||
{label = TranslateCap('work_wear'), value = 'cloakroom'},
|
||||
{label = TranslateCap('civ_wear'), value = 'cloakroom2'},
|
||||
{label = TranslateCap('deposit_stock'), value = 'put_stock'},
|
||||
{label = TranslateCap('withdraw_stock'), value = 'get_stock'}
|
||||
{unselectable = true, icon = "fas fa-gear", title = TranslateCap('mechanic')},
|
||||
{icon = "fas fa-car", title = TranslateCap('vehicle_list'), value = 'vehicle_list'},
|
||||
{icon = "fas fa-shirt", title = TranslateCap('work_wear'), value = 'cloakroom'},
|
||||
{icon = "fas fa-shirt", title = TranslateCap('civ_wear'), value = 'cloakroom2'},
|
||||
{icon = "fas fa-box", title = TranslateCap('deposit_stock'), value = 'put_stock'},
|
||||
{icon = "fas fa-box", title = TranslateCap('withdraw_stock'), value = 'get_stock'}
|
||||
}
|
||||
|
||||
if Config.EnablePlayerManagement and ESX.PlayerData.job and ESX.PlayerData.job.grade_name == 'boss' then
|
||||
table.insert(elements, {label = TranslateCap('boss_actions'), value = 'boss_actions'})
|
||||
elements[#elements+1] = {
|
||||
icon = 'fas fa-boss',
|
||||
title = TranslateCap('boss_actions'),
|
||||
value = 'boss_actions'
|
||||
}
|
||||
end
|
||||
|
||||
ESX.UI.Menu.CloseAll()
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'mechanic_actions', {
|
||||
title = TranslateCap('mechanic'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
if data.current.value == 'vehicle_list' then
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
if element.value == 'vehicle_list' then
|
||||
if Config.EnableSocietyOwnedVehicles then
|
||||
|
||||
local elements = {}
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-car", title = TranslateCap('service_vehicle')}
|
||||
}
|
||||
|
||||
ESX.TriggerServerCallback('esx_society:getVehiclesInGarage', function(vehicles)
|
||||
for i=1, #vehicles, 1 do
|
||||
table.insert(elements, {
|
||||
label = GetDisplayNameFromVehicleModel(vehicles[i].model) .. ' [' .. vehicles[i].plate .. ']',
|
||||
elements2[#elements2+1] = {
|
||||
icon = 'fas fa-car',
|
||||
title = GetDisplayNameFromVehicleModel(vehicles[i].model) .. ' [' .. vehicles[i].plate .. ']',
|
||||
value = vehicles[i]
|
||||
})
|
||||
}
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_spawner', {
|
||||
title = TranslateCap('service_vehicle'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
menu.close()
|
||||
local vehicleProps = data.current.value
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
ESX.CloseContext()
|
||||
local vehicleProps = element.value
|
||||
|
||||
ESX.Game.SpawnVehicle(vehicleProps.model, Config.Zones.VehicleSpawnPoint.Pos, 270.0, function(vehicle)
|
||||
ESX.Game.SetVehicleProperties(vehicle, vehicleProps)
|
||||
@@ -100,38 +97,35 @@ function OpenMechanicActionsMenu()
|
||||
end)
|
||||
|
||||
TriggerServerEvent('esx_society:removeVehicleFromGarage', 'mechanic', vehicleProps)
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end, 'mechanic')
|
||||
|
||||
else
|
||||
|
||||
local elements = {
|
||||
{label = TranslateCap('flat_bed'), value = 'flatbed'},
|
||||
{label = TranslateCap('tow_truck'), value = 'towtruck2'}
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-car", title = TranslateCap('service_vehicle')},
|
||||
{icon = "fas fa-truck", title = TranslateCap('flat_bed'), value = 'flatbed'},
|
||||
{icon = "fas fa-truck", title = TranslateCap('tow_truck'), value = 'towtruck2'}
|
||||
}
|
||||
|
||||
if Config.EnablePlayerManagement and ESX.PlayerData.job and (ESX.PlayerData.job.grade_name == 'boss' or ESX.PlayerData.job.grade_name == 'chief' or ESX.PlayerData.job.grade_name == 'experimente') then
|
||||
table.insert(elements, {label = 'SlamVan', value = 'slamvan3'})
|
||||
elements2[#elements2+1] = {
|
||||
icon = 'fas fa-truck',
|
||||
title = 'Slamvan',
|
||||
value = 'slamvan3'
|
||||
}
|
||||
end
|
||||
|
||||
ESX.UI.Menu.CloseAll()
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'spawn_vehicle', {
|
||||
title = TranslateCap('service_vehicle'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
if Config.MaxInService == -1 then
|
||||
ESX.Game.SpawnVehicle(data.current.value, Config.Zones.VehicleSpawnPoint.Pos, 90.0, function(vehicle)
|
||||
ESX.CloseContext()
|
||||
ESX.Game.SpawnVehicle(element2.value, Config.Zones.VehicleSpawnPoint.Pos, 90.0, function(vehicle)
|
||||
local playerPed = PlayerPedId()
|
||||
TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
|
||||
end)
|
||||
else
|
||||
ESX.TriggerServerCallback('esx_service:enableService', function(canTakeService, maxInService, inServiceCount)
|
||||
if canTakeService then
|
||||
ESX.Game.SpawnVehicle(data.current.value, Config.Zones.VehicleSpawnPoint.Pos, 90.0, function(vehicle)
|
||||
ESX.CloseContext()
|
||||
ESX.Game.SpawnVehicle(element2.value, Config.Zones.VehicleSpawnPoint.Pos, 90.0, function(vehicle)
|
||||
local playerPed = PlayerPedId()
|
||||
TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
|
||||
end)
|
||||
@@ -140,16 +134,10 @@ function OpenMechanicActionsMenu()
|
||||
end
|
||||
end, 'mechanic')
|
||||
end
|
||||
|
||||
menu.close()
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
OpenMechanicActionsMenu()
|
||||
end)
|
||||
|
||||
end
|
||||
elseif data.current.value == 'cloakroom' then
|
||||
menu.close()
|
||||
elseif element.value == 'cloakroom' then
|
||||
ESX.CloseContext()
|
||||
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
|
||||
if skin.sex == 0 then
|
||||
TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_male)
|
||||
@@ -157,27 +145,24 @@ function OpenMechanicActionsMenu()
|
||||
TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_female)
|
||||
end
|
||||
end)
|
||||
elseif data.current.value == 'cloakroom2' then
|
||||
menu.close()
|
||||
elseif element.value == 'cloakroom2' then
|
||||
ESX.CloseContext()
|
||||
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
|
||||
TriggerEvent('skinchanger:loadSkin', skin)
|
||||
end)
|
||||
|
||||
elseif Config.OxInventory and (data.current.value == 'put_stock' or data.current.value == 'get_stock') then
|
||||
elseif Config.OxInventory and (element.value == 'put_stock' or element.value == 'get_stock') then
|
||||
exports.ox_inventory:openInventory('stash', 'society_mechanic')
|
||||
return ESX.UI.Menu.CloseAll()
|
||||
elseif data.current.value == 'put_stock' then
|
||||
return ESX.CloseContext()
|
||||
elseif element.value == 'put_stock' then
|
||||
OpenPutStocksMenu()
|
||||
elseif data.current.value == 'get_stock' then
|
||||
elseif element.value == 'get_stock' then
|
||||
OpenGetStocksMenu()
|
||||
elseif data.current.value == 'boss_actions' then
|
||||
elseif element.value == 'boss_actions' then
|
||||
TriggerEvent('esx_society:openBossMenu', 'mechanic', function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
|
||||
end, function(menu)
|
||||
CurrentAction = 'mechanic_actions_menu'
|
||||
CurrentActionMsg = TranslateCap('open_actions')
|
||||
CurrentActionData = {}
|
||||
@@ -187,29 +172,21 @@ end
|
||||
function OpenMechanicHarvestMenu()
|
||||
if Config.EnablePlayerManagement and ESX.PlayerData.job and ESX.PlayerData.job.grade_name ~= 'recrue' then
|
||||
local elements = {
|
||||
{label = TranslateCap('gas_can'), value = 'gaz_bottle'},
|
||||
{label = TranslateCap('repair_tools'), value = 'fix_tool'},
|
||||
{label = TranslateCap('body_work_tools'), value = 'caro_tool'}
|
||||
{unselectable = true, icon = "fas fa-gear", title = "Mechanic Harvest Menu"},
|
||||
{icon = "fas fa-gear", title = TranslateCap('gas_can'), value = 'gaz_bottle'},
|
||||
{icon = "fas fa-gear", title = TranslateCap('repair_tools'), value = 'fix_tool'},
|
||||
{icon = "fas fa-gear", title = TranslateCap('body_work_tools'), value = 'caro_tool'}
|
||||
}
|
||||
|
||||
ESX.UI.Menu.CloseAll()
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'mechanic_harvest', {
|
||||
title = TranslateCap('harvest'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
menu.close()
|
||||
|
||||
if data.current.value == 'gaz_bottle' then
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
if element.value == 'gaz_bottle' then
|
||||
TriggerServerEvent('esx_mechanicjob:startHarvest')
|
||||
elseif data.current.value == 'fix_tool' then
|
||||
elseif element.value == 'fix_tool' then
|
||||
TriggerServerEvent('esx_mechanicjob:startHarvest2')
|
||||
elseif data.current.value == 'caro_tool' then
|
||||
elseif element.value == 'caro_tool' then
|
||||
TriggerServerEvent('esx_mechanicjob:startHarvest3')
|
||||
end
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end, function(menu)
|
||||
CurrentAction = 'mechanic_harvest_menu'
|
||||
CurrentActionMsg = TranslateCap('harvest_menu')
|
||||
CurrentActionData = {}
|
||||
@@ -222,30 +199,21 @@ end
|
||||
function OpenMechanicCraftMenu()
|
||||
if Config.EnablePlayerManagement and ESX.PlayerData.job and ESX.PlayerData.job.grade_name ~= 'recrue' then
|
||||
local elements = {
|
||||
{label = TranslateCap('blowtorch'), value = 'blow_pipe'},
|
||||
{label = TranslateCap('repair_kit'), value = 'fix_kit'},
|
||||
{label = TranslateCap('body_kit'), value = 'caro_kit'}
|
||||
{unselectable = true, icon = "fas fa-gear", title = "Mechanic Craft Menu"},
|
||||
{icon = "fas fa-gear", title = TranslateCap('blowtorch'), value = 'blow_pipe'},
|
||||
{icon = "fas fa-gear", title = TranslateCap('repair_kit'), value = 'fix_kit'},
|
||||
{icon = "fas fa-gear", title = TranslateCap('body_kit'), value = 'caro_kit'}
|
||||
}
|
||||
|
||||
ESX.UI.Menu.CloseAll()
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'mechanic_craft', {
|
||||
title = TranslateCap('craft'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
menu.close()
|
||||
|
||||
if data.current.value == 'blow_pipe' then
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
if element.value == 'blow_pipe' then
|
||||
TriggerServerEvent('esx_mechanicjob:startCraft')
|
||||
elseif data.current.value == 'fix_kit' then
|
||||
elseif element.value == 'fix_kit' then
|
||||
TriggerServerEvent('esx_mechanicjob:startCraft2')
|
||||
elseif data.current.value == 'caro_kit' then
|
||||
elseif element.value == 'caro_kit' then
|
||||
TriggerServerEvent('esx_mechanicjob:startCraft3')
|
||||
end
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
|
||||
end, function(menu)
|
||||
CurrentAction = 'mechanic_craft_menu'
|
||||
CurrentActionMsg = TranslateCap('craft_menu')
|
||||
CurrentActionData = {}
|
||||
@@ -256,27 +224,29 @@ function OpenMechanicCraftMenu()
|
||||
end
|
||||
|
||||
function OpenMobileMechanicActionsMenu()
|
||||
ESX.UI.Menu.CloseAll()
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-gear", title = TranslateCap('mechanic')},
|
||||
{icon = "fas fa-gear", title = TranslateCap('billing'), value = 'billing'},
|
||||
{icon = "fas fa-gear", title = TranslateCap('hijack'), value = 'hijack_vehicle'},
|
||||
{icon = "fas fa-gear", title = TranslateCap('repair'), value = 'fix_vehicle'},
|
||||
{icon = "fas fa-gear", title = TranslateCap('clean'), value = 'clean_vehicle'},
|
||||
{icon = "fas fa-gear", title = TranslateCap('imp_veh'), value = 'del_vehicle'},
|
||||
{icon = "fas fa-gear", title = TranslateCap('flat_bed'), value = 'dep_vehicle'},
|
||||
{icon = "fas fa-gear", title = TranslateCap('place_objects'), value = 'object_spawner'}
|
||||
}
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'mobile_mechanic_actions', {
|
||||
title = TranslateCap('mechanic'),
|
||||
align = 'top-left',
|
||||
elements = {
|
||||
{label = TranslateCap('billing'), value = 'billing'},
|
||||
{label = TranslateCap('hijack'), value = 'hijack_vehicle'},
|
||||
{label = TranslateCap('repair'), value = 'fix_vehicle'},
|
||||
{label = TranslateCap('clean'), value = 'clean_vehicle'},
|
||||
{label = TranslateCap('imp_veh'), value = 'del_vehicle'},
|
||||
{label = TranslateCap('flat_bed'), value = 'dep_vehicle'},
|
||||
{label = TranslateCap('place_objects'), value = 'object_spawner'}
|
||||
}}, function(data, menu)
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
if isBusy then return end
|
||||
|
||||
if data.current.value == 'billing' then
|
||||
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'billing', {
|
||||
title = TranslateCap('invoice_amount')
|
||||
}, function(data, menu)
|
||||
local amount = tonumber(data.value)
|
||||
if element.value == "billing" then
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-scroll", title = element.title},
|
||||
{title = "Amount", input = true, inputType = "number", inputMin = 1, inputMax = 250000, inputPlaceholder = "Amount to bill.."},
|
||||
{icon = "fas fa-check-double", title = "Confirm", value = "confirm"}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
local amount = tonumber(menu2.eles[2].inputValue)
|
||||
|
||||
if amount == nil or amount < 0 then
|
||||
ESX.ShowNotification(TranslateCap('amount_invalid'), "error")
|
||||
@@ -289,10 +259,8 @@ function OpenMobileMechanicActionsMenu()
|
||||
TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(closestPlayer), 'society_mechanic', TranslateCap('mechanic'), amount)
|
||||
end
|
||||
end
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
elseif data.current.value == 'hijack_vehicle' then
|
||||
elseif element.value == "hijack_vehicle" then
|
||||
local playerPed = PlayerPedId()
|
||||
local vehicle = ESX.Game.GetVehicleInDirection()
|
||||
local coords = GetEntityCoords(playerPed)
|
||||
@@ -318,7 +286,7 @@ function OpenMobileMechanicActionsMenu()
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('no_vehicle_nearby'))
|
||||
end
|
||||
elseif data.current.value == 'fix_vehicle' then
|
||||
elseif element.value == "fix_vehicle" then
|
||||
local playerPed = PlayerPedId()
|
||||
local vehicle = ESX.Game.GetVehicleInDirection()
|
||||
local coords = GetEntityCoords(playerPed)
|
||||
@@ -346,7 +314,7 @@ function OpenMobileMechanicActionsMenu()
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('no_vehicle_nearby'))
|
||||
end
|
||||
elseif data.current.value == 'clean_vehicle' then
|
||||
elseif element.value == "clean_vehicle" then
|
||||
local playerPed = PlayerPedId()
|
||||
local vehicle = ESX.Game.GetVehicleInDirection()
|
||||
local coords = GetEntityCoords(playerPed)
|
||||
@@ -371,7 +339,7 @@ function OpenMobileMechanicActionsMenu()
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('no_vehicle_nearby'))
|
||||
end
|
||||
elseif data.current.value == 'del_vehicle' then
|
||||
elseif element.value == "del_vehicle" then
|
||||
local playerPed = PlayerPedId()
|
||||
|
||||
if IsPedSittingInAnyVehicle(playerPed) then
|
||||
@@ -393,7 +361,7 @@ function OpenMobileMechanicActionsMenu()
|
||||
ESX.ShowNotification(TranslateCap('must_near'))
|
||||
end
|
||||
end
|
||||
elseif data.current.value == 'dep_vehicle' then
|
||||
elseif element.value == "dep_vehicle" then
|
||||
local playerPed = PlayerPedId()
|
||||
local vehicle = GetVehiclePedIsIn(playerPed, true)
|
||||
|
||||
@@ -459,7 +427,7 @@ function OpenMobileMechanicActionsMenu()
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('imp_flatbed'))
|
||||
end
|
||||
elseif data.current.value == 'object_spawner' then
|
||||
elseif element.value == "object_spawner" then
|
||||
local playerPed = PlayerPedId()
|
||||
|
||||
if IsPedSittingInAnyVehicle(playerPed) then
|
||||
@@ -467,14 +435,14 @@ function OpenMobileMechanicActionsMenu()
|
||||
return
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'mobile_mechanic_actions_spawn', {
|
||||
title = TranslateCap('objects'),
|
||||
align = 'top-left',
|
||||
elements = {
|
||||
{label = TranslateCap('roadcone'), value = 'prop_roadcone02a'},
|
||||
{label = TranslateCap('toolbox'), value = 'prop_toolchest_01'}
|
||||
}}, function(data2, menu2)
|
||||
local model = data2.current.value
|
||||
local elements2 = {
|
||||
{unselectable= true, icon = "fas fa-object", title = TranslateCap('objects')},
|
||||
{icon = "fas fa-object", title = TranslateCap('roadcone'), value = 'prop_roadcone02a'},
|
||||
{icon = "fas fa-object", title = TranslateCap('toolbox'), value = 'prop_toolchest_01'}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements2, function(menuObj,elementObj)
|
||||
local model = elementObj.value
|
||||
local coords = GetEntityCoords(playerPed)
|
||||
local forward = GetEntityForwardVector(playerPed)
|
||||
local x, y, z = table.unpack(coords + forward * 1.0)
|
||||
@@ -489,100 +457,92 @@ function OpenMobileMechanicActionsMenu()
|
||||
SetEntityHeading(obj, GetEntityHeading(playerPed))
|
||||
PlaceObjectOnGroundProperly(obj)
|
||||
end)
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
end)
|
||||
end
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end
|
||||
|
||||
function OpenGetStocksMenu()
|
||||
ESX.TriggerServerCallback('esx_mechanicjob:getStockItems', function(items)
|
||||
local elements = {}
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-box", title = TranslateCap('mechanic_stock')}
|
||||
}
|
||||
|
||||
for i=1, #items, 1 do
|
||||
table.insert(elements, {
|
||||
label = 'x' .. items[i].count .. ' ' .. items[i].label,
|
||||
elements[#elements+1] = {
|
||||
icon = 'fas fa-box',
|
||||
title = 'x' .. items[i].count .. ' ' .. items[i].label,
|
||||
value = items[i].name
|
||||
})
|
||||
}
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'stocks_menu', {
|
||||
title = TranslateCap('mechanic_stock'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
local itemName = data.current.value
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local itemName = element.value
|
||||
|
||||
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'stocks_menu_get_item_count', {
|
||||
title = TranslateCap('quantity')
|
||||
}, function(data2, menu2)
|
||||
local count = tonumber(data2.value)
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-box", title = element.title},
|
||||
{title = "Amount", input = true, inputType = "number", inputMin = 1, inputMax = 100, inputPlaceholder = "Amount to withdraw.."},
|
||||
{icon = "fas fa-check-double", title = "Confirm", value = "confirm"}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
local count = tonumber(menu2.eles[2].inputValue)
|
||||
|
||||
if count == nil then
|
||||
ESX.ShowNotification(TranslateCap('invalid_quantity'))
|
||||
else
|
||||
menu2.close()
|
||||
menu.close()
|
||||
ESX.CloseContext()
|
||||
TriggerServerEvent('esx_mechanicjob:getStockItem', itemName, count)
|
||||
|
||||
Wait(1000)
|
||||
OpenGetStocksMenu()
|
||||
end
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
end)
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
function OpenPutStocksMenu()
|
||||
ESX.TriggerServerCallback('esx_mechanicjob:getPlayerInventory', function(inventory)
|
||||
local elements = {}
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-box", title = TranslateCap('inventory')}
|
||||
}
|
||||
|
||||
for i=1, #inventory.items, 1 do
|
||||
local item = inventory.items[i]
|
||||
|
||||
if item.count > 0 then
|
||||
table.insert(elements, {
|
||||
label = item.label .. ' x' .. item.count,
|
||||
elements[#elements+1] = {
|
||||
icon = 'fas fa-box',
|
||||
title = item.label .. ' x' .. item.count,
|
||||
type = 'item_standard',
|
||||
value = item.name
|
||||
})
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'stocks_menu', {
|
||||
title = TranslateCap('inventory'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
local itemName = data.current.value
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local itemName = element.value
|
||||
|
||||
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'stocks_menu_put_item_count', {
|
||||
title = TranslateCap('quantity')
|
||||
}, function(data2, menu2)
|
||||
local count = tonumber(data2.value)
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-box", title = element.title},
|
||||
{title = "Amount", input = true, inputType = "number", inputMin = 1, inputMax = 100, inputPlaceholder = "Amount to deposit.."},
|
||||
{icon = "fas fa-check-double", title = "Confirm", value = "confirm"}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
local count = tonumber(menu2.eles[2].inputValue)
|
||||
|
||||
if count == nil then
|
||||
ESX.ShowNotification(TranslateCap('invalid_quantity'))
|
||||
else
|
||||
menu2.close()
|
||||
menu.close()
|
||||
ESX.CloseContext()
|
||||
TriggerServerEvent('esx_mechanicjob:putStockItems', itemName, count)
|
||||
|
||||
Wait(1000)
|
||||
OpenPutStocksMenu()
|
||||
end
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
end)
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end)
|
||||
end
|
||||
@@ -738,7 +698,7 @@ AddEventHandler('esx_mechanicjob:hasExitedMarker', function(zone)
|
||||
end
|
||||
|
||||
CurrentAction = nil
|
||||
ESX.UI.Menu.CloseAll()
|
||||
ESX.CloseContext()
|
||||
end)
|
||||
|
||||
AddEventHandler('esx_mechanicjob:hasEnteredEntityZone', function(entity)
|
||||
|
||||
@@ -50,30 +50,38 @@ function OpenCloakroomMenu()
|
||||
local grade = ESX.PlayerData.job.grade_name
|
||||
|
||||
local elements = {
|
||||
{label = TranslateCap('citizen_wear'), value = 'citizen_wear'},
|
||||
{label = TranslateCap('bullet_wear'), uniform = 'bullet_wear'},
|
||||
{label = TranslateCap('gilet_wear'), uniform = 'gilet_wear'},
|
||||
{label = TranslateCap('police_wear'), uniform = grade}
|
||||
{unselectable = true, icon = "fas fa-shirt", title = TranslateCap("cloakroom")},
|
||||
{icon = "fas fa-shirt", title = TranslateCap('citizen_wear'), value = 'citizen_wear'},
|
||||
{icon = "fas fa-shirt", title = TranslateCap('bullet_wear'), uniform = 'bullet_wear'},
|
||||
{icon = "fas fa-shirt", title = TranslateCap('gilet_wear'), uniform = 'gilet_wear'},
|
||||
{icon = "fas fa-shirt", title = TranslateCap('police_wear'), uniform = grade}
|
||||
}
|
||||
|
||||
if Config.EnableCustomPeds then
|
||||
for k,v in ipairs(Config.CustomPeds.shared) do
|
||||
table.insert(elements, {label = v.label, value = 'freemode_ped', maleModel = v.maleModel, femaleModel = v.femaleModel})
|
||||
elements[#elements+1] = {
|
||||
icon = "fas fa-shirt",
|
||||
title = v.label,
|
||||
value = 'freemode_ped',
|
||||
maleModel = v.maleModel,
|
||||
femaleModel = v.femaleModel
|
||||
}
|
||||
end
|
||||
|
||||
for k,v in ipairs(Config.CustomPeds[grade]) do
|
||||
table.insert(elements, {label = v.label, value = 'freemode_ped', maleModel = v.maleModel, femaleModel = v.femaleModel})
|
||||
elements[#elements+1] = {
|
||||
icon = "fas fa-shirt",
|
||||
title = v.label,
|
||||
value = 'freemode_ped',
|
||||
maleModel = v.maleModel,
|
||||
femaleModel = v.femaleModel
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
ESX.UI.Menu.CloseAll()
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'cloakroom', {
|
||||
title = TranslateCap('cloakroom'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
cleanPlayer(playerPed)
|
||||
local data = {current = element}
|
||||
|
||||
if data.current.value == 'citizen_wear' then
|
||||
if Config.EnableCustomPeds then
|
||||
@@ -194,9 +202,7 @@ function OpenCloakroomMenu()
|
||||
end)
|
||||
end)
|
||||
end
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
|
||||
end, function(menu)
|
||||
CurrentAction = 'menu_cloakroom'
|
||||
CurrentActionMsg = TranslateCap('open_cloackroom')
|
||||
CurrentActionData = {}
|
||||
@@ -207,28 +213,24 @@ function OpenArmoryMenu(station)
|
||||
local elements
|
||||
if Config.OxInventory then
|
||||
exports.ox_inventory:openInventory('stash', {id = 'society_police', owner = station})
|
||||
return ESX.UI.Menu.CloseAll()
|
||||
return ESX.CloseContext()
|
||||
else
|
||||
elements = {
|
||||
{label = TranslateCap('buy_weapons'), value = 'buy_weapons'}
|
||||
{unselectable = true, icon = "fas fa-gun", title = TranslateCap('armory')},
|
||||
{icon = "fas fa-gun", title = TranslateCap('buy_weapons'), value = 'buy_weapons'}
|
||||
|
||||
}
|
||||
|
||||
if Config.EnableArmoryManagement then
|
||||
table.insert(elements, {label = TranslateCap('get_weapon'), value = 'get_weapon'})
|
||||
table.insert(elements, {label = TranslateCap('put_weapon'), value = 'put_weapon'})
|
||||
table.insert(elements, {label = TranslateCap('remove_object'), value = 'get_stock'})
|
||||
table.insert(elements, {label = TranslateCap('deposit_object'), value = 'put_stock'})
|
||||
table.insert(elements, {icon = "fas fa-gun", title = TranslateCap('get_weapon'), value = 'get_weapon'})
|
||||
table.insert(elements, {icon = "fas fa-gun", title = TranslateCap('put_weapon'), value = 'put_weapon'})
|
||||
table.insert(elements, {icon = "fas fa-box", title = TranslateCap('remove_object'), value = 'get_stock'})
|
||||
table.insert(elements, {icon = "fas fa-box", title = TranslateCap('deposit_object'), value = 'put_stock'})
|
||||
end
|
||||
end
|
||||
|
||||
ESX.UI.Menu.CloseAll()
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'armory', {
|
||||
title = TranslateCap('armory'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local data = {current = element}
|
||||
if data.current.value == 'get_weapon' then
|
||||
OpenGetWeaponMenu()
|
||||
elseif data.current.value == 'put_weapon' then
|
||||
@@ -240,10 +242,7 @@ function OpenArmoryMenu(station)
|
||||
elseif data.current.value == 'get_stock' then
|
||||
OpenGetStocksMenu()
|
||||
end
|
||||
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
|
||||
end, function(menu)
|
||||
CurrentAction = 'menu_armory'
|
||||
CurrentActionMsg = TranslateCap('open_armory')
|
||||
CurrentActionData = {station = station}
|
||||
@@ -251,39 +250,41 @@ function OpenArmoryMenu(station)
|
||||
end
|
||||
|
||||
function OpenPoliceActionsMenu()
|
||||
ESX.UI.Menu.CloseAll()
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-police", title = "Police"},
|
||||
{icon = "fas fa-user", title = TranslateCap('citizen_interaction'), value = 'citizen_interaction'},
|
||||
{icon = "fas fa-car", title = TranslateCap('vehicle_interaction'), value = 'vehicle_interaction'},
|
||||
{icon = "fas fa-object", title = TranslateCap('object_spawner'), value = 'object_spawner'}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local data = {current = element}
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'police_actions', {
|
||||
title = 'Police',
|
||||
align = 'top-left',
|
||||
elements = {
|
||||
{label = TranslateCap('citizen_interaction'), value = 'citizen_interaction'},
|
||||
{label = TranslateCap('vehicle_interaction'), value = 'vehicle_interaction'},
|
||||
{label = TranslateCap('object_spawner'), value = 'object_spawner'}
|
||||
}}, function(data, menu)
|
||||
if data.current.value == 'citizen_interaction' then
|
||||
local elements = {
|
||||
{label = TranslateCap('id_card'), value = 'identity_card'},
|
||||
{label = TranslateCap('search'), value = 'search'},
|
||||
{label = TranslateCap('handcuff'), value = 'handcuff'},
|
||||
{label = TranslateCap('drag'), value = 'drag'},
|
||||
{label = TranslateCap('put_in_vehicle'), value = 'put_in_vehicle'},
|
||||
{label = TranslateCap('out_the_vehicle'), value = 'out_the_vehicle'},
|
||||
{label = TranslateCap('fine'), value = 'fine'},
|
||||
{label = TranslateCap('unpaid_bills'), value = 'unpaid_bills'}
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-user", title = element.title},
|
||||
{icon = "fas fa-idkyet", title = TranslateCap('id_card'), value = 'identity_card'},
|
||||
{icon = "fas fa-idkyet", title = TranslateCap('search'), value = 'search'},
|
||||
{icon = "fas fa-idkyet", title = TranslateCap('handcuff'), value = 'handcuff'},
|
||||
{icon = "fas fa-idkyet", title = TranslateCap('drag'), value = 'drag'},
|
||||
{icon = "fas fa-idkyet", title = TranslateCap('put_in_vehicle'), value = 'put_in_vehicle'},
|
||||
{icon = "fas fa-idkyet", title = TranslateCap('out_the_vehicle'), value = 'out_the_vehicle'},
|
||||
{icon = "fas fa-idkyet", title = TranslateCap('fine'), value = 'fine'},
|
||||
{icon = "fas fa-idkyet", title = TranslateCap('unpaid_bills'), value = 'unpaid_bills'}
|
||||
}
|
||||
|
||||
if Config.EnableLicenses then
|
||||
table.insert(elements, {label = TranslateCap('license_check'), value = 'license'})
|
||||
elements2[#elements2+1] = {
|
||||
icon = "fas fa-scroll",
|
||||
title = TranslateCap('license_check'),
|
||||
value = 'license'
|
||||
}
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'citizen_interaction', {
|
||||
title = TranslateCap('citizen_interaction'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data2, menu2)
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
|
||||
if closestPlayer ~= -1 and closestDistance <= 3.0 then
|
||||
local data2 = {current = element2}
|
||||
local action = data2.current.value
|
||||
|
||||
if action == 'identity_card' then
|
||||
@@ -308,33 +309,36 @@ function OpenPoliceActionsMenu()
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('no_players_nearby'))
|
||||
end
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
end, function(menu)
|
||||
OpenPoliceActionsMenu()
|
||||
end)
|
||||
elseif data.current.value == 'vehicle_interaction' then
|
||||
local elements = {}
|
||||
local elements3 = {
|
||||
{unselectable = true, icon = "fas fa-car", title = element.title}
|
||||
}
|
||||
local playerPed = PlayerPedId()
|
||||
local vehicle = ESX.Game.GetVehicleInDirection()
|
||||
|
||||
if DoesEntityExist(vehicle) then
|
||||
table.insert(elements, {label = TranslateCap('vehicle_info'), value = 'vehicle_infos'})
|
||||
table.insert(elements, {label = TranslateCap('pick_lock'), value = 'hijack_vehicle'})
|
||||
table.insert(elements, {label = TranslateCap('impound'), value = 'impound'})
|
||||
elements3[#elements3+1] = {icon = "fas fa-car", title = TranslateCap('vehicle_info'), value = 'vehicle_infos'}
|
||||
elements3[#elements3+1] = {icon = "fas fa-car", title = TranslateCap('pick_lock'), value = 'hijack_vehicle'}
|
||||
elements3[#elements3+1] = {icon = "fas fa-car", title = TranslateCap('impound'), value = 'impound'}
|
||||
end
|
||||
|
||||
table.insert(elements, {label = TranslateCap('search_database'), value = 'search_database'})
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_interaction', {
|
||||
title = TranslateCap('vehicle_interaction'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data2, menu2)
|
||||
elements3[#elements3+1] = {
|
||||
icon = "fas fa-scroll",
|
||||
title = TranslateCap('search_database'),
|
||||
value = 'search_database'
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements3, function(menu3,element3)
|
||||
local data2 = {current = element3}
|
||||
local coords = GetEntityCoords(playerPed)
|
||||
vehicle = ESX.Game.GetVehicleInDirection()
|
||||
action = data2.current.value
|
||||
|
||||
if action == 'search_database' then
|
||||
LookupVehicle()
|
||||
LookupVehicle(element3)
|
||||
elseif DoesEntityExist(vehicle) then
|
||||
if action == 'vehicle_infos' then
|
||||
local vehicleData = ESX.Game.GetVehicleProperties(vehicle)
|
||||
@@ -350,7 +354,6 @@ function OpenPoliceActionsMenu()
|
||||
ESX.ShowNotification(TranslateCap('vehicle_unlocked'))
|
||||
end
|
||||
elseif action == 'impound' then
|
||||
-- is the script busy?
|
||||
if currentTask.busy then
|
||||
return
|
||||
end
|
||||
@@ -362,10 +365,9 @@ function OpenPoliceActionsMenu()
|
||||
currentTask.task = ESX.SetTimeout(10000, function()
|
||||
ClearPedTasks(playerPed)
|
||||
ImpoundVehicle(vehicle)
|
||||
Wait(100) -- sleep the entire script to let stuff sink back to reality
|
||||
Wait(100)
|
||||
end)
|
||||
|
||||
-- keep track of that vehicle!
|
||||
CreateThread(function()
|
||||
while currentTask.busy do
|
||||
Wait(1000)
|
||||
@@ -384,21 +386,21 @@ function OpenPoliceActionsMenu()
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('no_vehicles_nearby'))
|
||||
end
|
||||
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
end, function(menu)
|
||||
OpenPoliceActionsMenu()
|
||||
end)
|
||||
elseif data.current.value == 'object_spawner' then
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'citizen_interaction', {
|
||||
title = TranslateCap('traffic_interaction'),
|
||||
align = 'top-left',
|
||||
elements = {
|
||||
{label = TranslateCap('cone'), model = 'prop_roadcone02a'},
|
||||
{label = TranslateCap('barrier'), model = 'prop_barrier_work05'},
|
||||
{label = TranslateCap('spikestrips'), model = 'p_ld_stinger_s'},
|
||||
{label = TranslateCap('box'), model = 'prop_boxpile_07d'},
|
||||
{label = TranslateCap('cash'), model = 'hei_prop_cash_crate_half_full'}
|
||||
}}, function(data2, menu2)
|
||||
elseif data.current.value == "object_spawner" then
|
||||
local elements4 = {
|
||||
{unselectable = true, icon = "fas fa-object", title = element.title},
|
||||
{icon = "fas fa-cone", title = TranslateCap('cone'), model = 'prop_roadcone02a'},
|
||||
{icon = "fas fa-cone", title = TranslateCap('barrier'), model = 'prop_barrier_work05'},
|
||||
{icon = "fas fa-cone", title = TranslateCap('spikestrips'), model = 'p_ld_stinger_s'},
|
||||
{icon = "fas fa-cone", title = TranslateCap('box'), model = 'prop_boxpile_07d'},
|
||||
{icon = "fas fa-cone", title = TranslateCap('cash'), model = 'hei_prop_cash_crate_half_full'}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements4, function(menu4,element4)
|
||||
local data2 = {current = element4}
|
||||
local playerPed = PlayerPedId()
|
||||
local coords, forward = GetEntityCoords(playerPed), GetEntityForwardVector(playerPed)
|
||||
local objectCoords = (coords + forward * 1.0)
|
||||
@@ -407,46 +409,40 @@ function OpenPoliceActionsMenu()
|
||||
SetEntityHeading(obj, GetEntityHeading(playerPed))
|
||||
PlaceObjectOnGroundProperly(obj)
|
||||
end)
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
end, function(menu)
|
||||
OpenPoliceActionsMenu()
|
||||
end)
|
||||
end
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end
|
||||
|
||||
function OpenIdentityCardMenu(player)
|
||||
ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data)
|
||||
local elements = {
|
||||
{label = TranslateCap('name', data.name)},
|
||||
{label = TranslateCap('job', ('%s - %s'):format(data.job, data.grade))}
|
||||
{icon = "fas fa-user", title = TranslateCap('name', data.name)},
|
||||
{icon = "fas fa-user", title = TranslateCap('job', ('%s - %s'):format(data.job, data.grade))}
|
||||
}
|
||||
|
||||
if Config.EnableESXIdentity then
|
||||
table.insert(elements, {label = TranslateCap('sex', TranslateCap(data.sex))})
|
||||
table.insert(elements, {label = TranslateCap('dob', data.dob)})
|
||||
table.insert(elements, {label = TranslateCap('height', data.height)})
|
||||
elements[#elements+1] = {icon = "fas fa-user", title = TranslateCap('sex', TranslateCap(data.sex))}
|
||||
elements[#elements+1] = {icon = "fas fa-user", title = TranslateCap('sex', TranslateCap(data.sex))}
|
||||
elements[#elements+1] = {icon = "fas fa-user", title = TranslateCap('height', data.height)}
|
||||
end
|
||||
|
||||
if Config.EnableESXOptionalneeds and data.drunk then
|
||||
table.insert(elements, {label = TranslateCap('bac', data.drunk)})
|
||||
elements[#elements+1] = {title = TranslateCap('bac', data.drunk)}
|
||||
end
|
||||
|
||||
if data.licenses then
|
||||
table.insert(elements, {label = TranslateCap('license_label')})
|
||||
elements[#elements+1] = {title = TranslateCap('license_label')}
|
||||
|
||||
for i=1, #data.licenses, 1 do
|
||||
table.insert(elements, {label = data.licenses[i].label})
|
||||
elements[#elements+1] = {title = data.licenses[i].label}
|
||||
end
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'citizen_interaction', {
|
||||
title = TranslateCap('citizen_interaction'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, nil, function(data, menu)
|
||||
menu.close()
|
||||
ESX.OpenContext("right", elements, nil, function(menu)
|
||||
OpenPoliceActionsMenu()
|
||||
end)
|
||||
end, GetPlayerServerId(player))
|
||||
end
|
||||
@@ -454,21 +450,23 @@ end
|
||||
function OpenBodySearchMenu(player)
|
||||
if Config.OxInventory then
|
||||
exports.ox_inventory:openInventory('player', GetPlayerServerId(player))
|
||||
return ESX.UI.Menu.CloseAll()
|
||||
return ESX.CloseContext()
|
||||
end
|
||||
|
||||
ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data)
|
||||
local elements = {}
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-user", title = TranslateCap('search')}
|
||||
}
|
||||
|
||||
for i=1, #data.accounts, 1 do
|
||||
if data.accounts[i].name == 'black_money' and data.accounts[i].money > 0 then
|
||||
table.insert(elements, {
|
||||
label = TranslateCap('confiscate_dirty', ESX.Math.Round(data.accounts[i].money)),
|
||||
elements[#elements+1] = {
|
||||
icon = "fas fa-money",
|
||||
title = TranslateCap('confiscate_dirty', ESX.Math.Round(data.accounts[i].money)),
|
||||
value = 'black_money',
|
||||
itemType = 'item_account',
|
||||
amount = data.accounts[i].money
|
||||
})
|
||||
|
||||
}
|
||||
break
|
||||
end
|
||||
end
|
||||
@@ -476,78 +474,72 @@ function OpenBodySearchMenu(player)
|
||||
table.insert(elements, {label = TranslateCap('guns_label')})
|
||||
|
||||
for i=1, #data.weapons, 1 do
|
||||
table.insert(elements, {
|
||||
label = TranslateCap('confiscate_weapon', ESX.GetWeaponLabel(data.weapons[i].name), data.weapons[i].ammo),
|
||||
elements[#elements+1] = {
|
||||
icon = "fas fa-gun",
|
||||
title = TranslateCap('confiscate_weapon', ESX.GetWeaponLabel(data.weapons[i].name), data.weapons[i].ammo),
|
||||
value = data.weapons[i].name,
|
||||
itemType = 'item_weapon',
|
||||
amount = data.weapons[i].ammo
|
||||
})
|
||||
}
|
||||
end
|
||||
|
||||
table.insert(elements, {label = TranslateCap('inventory_label')})
|
||||
elements[#elements+1] = {title = TranslateCap('inventory_label')}
|
||||
|
||||
for i=1, #data.inventory, 1 do
|
||||
if data.inventory[i].count > 0 then
|
||||
table.insert(elements, {
|
||||
label = TranslateCap('confiscate_inv', data.inventory[i].count, data.inventory[i].label),
|
||||
elements[#elements+1] = {
|
||||
icon = "fas fa-box",
|
||||
title = TranslateCap('confiscate_inv', data.inventory[i].count, data.inventory[i].label),
|
||||
value = data.inventory[i].name,
|
||||
itemType = 'item_standard',
|
||||
amount = data.inventory[i].count
|
||||
})
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'body_search', {
|
||||
title = TranslateCap('search'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local data = {current = element}
|
||||
if data.current.value then
|
||||
TriggerServerEvent('esx_policejob:confiscatePlayerItem', GetPlayerServerId(player), data.current.itemType, data.current.value, data.current.amount)
|
||||
OpenBodySearchMenu(player)
|
||||
end
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end, GetPlayerServerId(player))
|
||||
end
|
||||
|
||||
function OpenFineMenu(player)
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'fine', {
|
||||
title = TranslateCap('fine'),
|
||||
align = 'top-left',
|
||||
elements = {
|
||||
{label = TranslateCap('traffic_offense'), value = 0},
|
||||
{label = TranslateCap('minor_offense'), value = 1},
|
||||
{label = TranslateCap('average_offense'), value = 2},
|
||||
{label = TranslateCap('major_offense'), value = 3}
|
||||
}}, function(data, menu)
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-scroll", title = TranslateCap('fine')},
|
||||
{icon = "fas fa-scroll", title = TranslateCap('traffic_offense'), value = 0},
|
||||
{icon = "fas fa-scroll", title = TranslateCap('minor_offense'), value = 1},
|
||||
{icon = "fas fa-scroll", title = TranslateCap('average_offense'), value = 2},
|
||||
{icon = "fas fa-scroll", title = TranslateCap('major_offense'), value = 3}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local data = {current = element}
|
||||
OpenFineCategoryMenu(player, data.current.value)
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end
|
||||
|
||||
function OpenFineCategoryMenu(player, category)
|
||||
ESX.TriggerServerCallback('esx_policejob:getFineList', function(fines)
|
||||
local elements = {}
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-scroll", title = TranslateCap('fine')}
|
||||
}
|
||||
|
||||
for k,fine in ipairs(fines) do
|
||||
table.insert(elements, {
|
||||
label = ('%s <span style="color:green;">%s</span>'):format(fine.label, TranslateCap('armory_item', ESX.Math.GroupDigits(fine.amount))),
|
||||
elements[#elements+1] = {
|
||||
icon = "fas fa-scroll",
|
||||
title = ('%s <span style="color:green;">%s</span>'):format(fine.label, TranslateCap('armory_item', ESX.Math.GroupDigits(fine.amount))),
|
||||
value = fine.id,
|
||||
amount = fine.amount,
|
||||
fineLabel = fine.label
|
||||
})
|
||||
}
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'fine_category', {
|
||||
title = TranslateCap('fine'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
menu.close()
|
||||
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local data = {current = element}
|
||||
if Config.EnablePlayerManagement then
|
||||
TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(player), 'society_police', TranslateCap('fine_total', data.current.fineLabel), data.current.amount)
|
||||
else
|
||||
@@ -557,65 +549,63 @@ function OpenFineCategoryMenu(player, category)
|
||||
ESX.SetTimeout(300, function()
|
||||
OpenFineCategoryMenu(player, category)
|
||||
end)
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end, category)
|
||||
end
|
||||
|
||||
function LookupVehicle()
|
||||
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'lookup_vehicle', {
|
||||
title = TranslateCap('search_database_title'),
|
||||
}, function(data, menu)
|
||||
function LookupVehicle(elementF)
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-car", title = elementF.title},
|
||||
{title = "Enter Plate", input = true, inputType = "text", inputPlaceholder = "ABC 123"},
|
||||
{icon = "fas fa-check-double", title = "Lookup Plate", value = "lookup"}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local data = {value = menu.eles[2].inputValue}
|
||||
local length = string.len(data.value)
|
||||
if not data.value or length < 2 or length > 8 then
|
||||
ESX.ShowNotification(TranslateCap('search_database_error_invalid'))
|
||||
else
|
||||
ESX.TriggerServerCallback('esx_policejob:getVehicleInfos', function(retrivedInfo)
|
||||
local elements = {{label = TranslateCap('plate', retrivedInfo.plate)}}
|
||||
menu.close()
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-car", title = element.title},
|
||||
{unselectable = true, icon = "fas fa-car", title = TranslateCap('plate', retrivedInfo.plate)}
|
||||
}
|
||||
|
||||
if not retrivedInfo.owner then
|
||||
table.insert(elements, {label = TranslateCap('owner_unknown')})
|
||||
elements[#elements+1] = {unselectable = true, icon = "fas fa-user", title = TranslateCap('owner_unknown')}
|
||||
else
|
||||
table.insert(elements, {label = TranslateCap('owner', retrivedInfo.owner)})
|
||||
elements[#elements+1] = {unselectable = true, icon = "fas fa-user", title = TranslateCap('owner', retrivedInfo.owner)}
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_infos', {
|
||||
title = TranslateCap('vehicle_info'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, nil, function(data2, menu2)
|
||||
menu2.close()
|
||||
ESX.OpenContext("right", elements, nil, function(menu)
|
||||
OpenPoliceActionsMenu()
|
||||
end)
|
||||
end, data.value)
|
||||
|
||||
end
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end
|
||||
|
||||
function ShowPlayerLicense(player)
|
||||
local elements = {}
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-scroll", title = TranslateCap('license_revoke')}
|
||||
}
|
||||
|
||||
ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(playerData)
|
||||
if playerData.licenses then
|
||||
for i=1, #playerData.licenses, 1 do
|
||||
if playerData.licenses[i].label and playerData.licenses[i].type then
|
||||
table.insert(elements, {
|
||||
label = playerData.licenses[i].label,
|
||||
elements[#elements+1] = {
|
||||
icon = "fas fa-scroll",
|
||||
title = playerData.licenses[i].label,
|
||||
type = playerData.licenses[i].type
|
||||
})
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'manage_license', {
|
||||
title = TranslateCap('license_revoke'),
|
||||
align = 'top-left',
|
||||
elements = elements,
|
||||
}, function(data, menu)
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local data = {current = element}
|
||||
ESX.ShowNotification(TranslateCap('licence_you_revoked', data.current.label, playerData.name))
|
||||
TriggerServerEvent('esx_policejob:message', GetPlayerServerId(player), TranslateCap('license_revoked', data.current.label))
|
||||
|
||||
@@ -624,85 +614,77 @@ function ShowPlayerLicense(player)
|
||||
ESX.SetTimeout(300, function()
|
||||
ShowPlayerLicense(player)
|
||||
end)
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
|
||||
end, GetPlayerServerId(player))
|
||||
end
|
||||
|
||||
function OpenUnpaidBillsMenu(player)
|
||||
local elements = {}
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-scroll", title = TranslateCap('unpaid_bills')}
|
||||
}
|
||||
|
||||
ESX.TriggerServerCallback('esx_billing:getTargetBills', function(bills)
|
||||
for k,bill in ipairs(bills) do
|
||||
table.insert(elements, {
|
||||
label = ('%s - <span style="color:red;">%s</span>'):format(bill.label, TranslateCap('armory_item', ESX.Math.GroupDigits(bill.amount))),
|
||||
elements[#elements+1] = {
|
||||
unselectable = true,
|
||||
icon = "fas fa-scroll",
|
||||
title = ('%s - <span style="color:red;">%s</span>'):format(bill.label, TranslateCap('armory_item', ESX.Math.GroupDigits(bill.amount))),
|
||||
billId = bill.id
|
||||
})
|
||||
}
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'billing', {
|
||||
title = TranslateCap('unpaid_bills'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, nil, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
ESX.OpenContext("right", elements, nil, nil)
|
||||
end, GetPlayerServerId(player))
|
||||
end
|
||||
|
||||
function OpenVehicleInfosMenu(vehicleData)
|
||||
ESX.TriggerServerCallback('esx_policejob:getVehicleInfos', function(retrivedInfo)
|
||||
local elements = {{label = TranslateCap('plate', retrivedInfo.plate)}}
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-car", title = TranslateCap('vehicle_info')},
|
||||
{icon = "fas fa-car", title = TranslateCap('plate', retrivedInfo.plate)}
|
||||
|
||||
}
|
||||
|
||||
if not retrivedInfo.owner then
|
||||
table.insert(elements, {label = TranslateCap('owner_unknown')})
|
||||
elements[#elements+1] = {unselectable = true, icon = "fas fa-user", title = TranslateCap('owner_unknown')}
|
||||
else
|
||||
table.insert(elements, {label = TranslateCap('owner', retrivedInfo.owner)})
|
||||
elements[#elements+1] = {unselectable = true, icon = "fas fa-user", title = TranslateCap('owner', retrivedInfo.owner)}
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_infos', {
|
||||
title = TranslateCap('vehicle_info'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, nil, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
ESX.OpenContext("right", elements, nil, nil)
|
||||
end, vehicleData.plate)
|
||||
end
|
||||
|
||||
function OpenGetWeaponMenu()
|
||||
ESX.TriggerServerCallback('esx_policejob:getArmoryWeapons', function(weapons)
|
||||
local elements = {}
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-gun", title = TranslateCap('get_weapon_menu')}
|
||||
}
|
||||
|
||||
for i=1, #weapons, 1 do
|
||||
if weapons[i].count > 0 then
|
||||
table.insert(elements, {
|
||||
label = 'x' .. weapons[i].count .. ' ' .. ESX.GetWeaponLabel(weapons[i].name),
|
||||
elements[#elements+1] = {
|
||||
icon = "fas fa-gun",
|
||||
title = 'x' .. weapons[i].count .. ' ' .. ESX.GetWeaponLabel(weapons[i].name),
|
||||
value = weapons[i].name
|
||||
})
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'armory_get_weapon', {
|
||||
title = TranslateCap('get_weapon_menu'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
menu.close()
|
||||
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local data = {current = element}
|
||||
ESX.TriggerServerCallback('esx_policejob:removeArmoryWeapon', function()
|
||||
ESX.CloseContext()
|
||||
OpenGetWeaponMenu()
|
||||
end, data.current.value)
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
function OpenPutWeaponMenu()
|
||||
local elements = {}
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-gun", title = TranslateCap('put_weapon_menu')}
|
||||
}
|
||||
local playerPed = PlayerPedId()
|
||||
local weaponList = ESX.GetWeaponList()
|
||||
|
||||
@@ -710,30 +692,27 @@ function OpenPutWeaponMenu()
|
||||
local weaponHash = joaat(weaponList[i].name)
|
||||
|
||||
if HasPedGotWeapon(playerPed, weaponHash, false) and weaponList[i].name ~= 'WEAPON_UNARMED' then
|
||||
table.insert(elements, {
|
||||
label = weaponList[i].label,
|
||||
elements[#elements+1] = {
|
||||
icon = "fas fa-gun",
|
||||
title = weaponList[i].label,
|
||||
value = weaponList[i].name
|
||||
})
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'armory_put_weapon', {
|
||||
title = TranslateCap('put_weapon_menu'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
menu.close()
|
||||
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local data = {current = element}
|
||||
ESX.TriggerServerCallback('esx_policejob:addArmoryWeapon', function()
|
||||
ESX.CloseContext()
|
||||
OpenPutWeaponMenu()
|
||||
end, data.current.value, true)
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end
|
||||
|
||||
function OpenBuyWeaponsMenu()
|
||||
local elements = {}
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-gun", title = TranslateCap('armory_weapontitle')}
|
||||
}
|
||||
local playerPed = PlayerPedId()
|
||||
|
||||
for k,v in ipairs(Config.AuthorizedWeapons[ESX.PlayerData.job.grade_name]) do
|
||||
@@ -757,15 +736,16 @@ function OpenBuyWeaponsMenu()
|
||||
end
|
||||
end
|
||||
|
||||
table.insert(components, {
|
||||
label = label,
|
||||
components[#components+1] = {
|
||||
icon = "fas fa-gun",
|
||||
title = label,
|
||||
componentLabel = component.label,
|
||||
hash = component.hash,
|
||||
name = component.name,
|
||||
price = v.components[i],
|
||||
hasComponent = hasComponent,
|
||||
componentNum = i
|
||||
})
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -782,21 +762,19 @@ function OpenBuyWeaponsMenu()
|
||||
end
|
||||
end
|
||||
|
||||
table.insert(elements, {
|
||||
label = label,
|
||||
elements[#elements+1] = {
|
||||
icon = "fas fa-gun",
|
||||
title = label,
|
||||
weaponLabel = weapon.label,
|
||||
name = weapon.name,
|
||||
components = components,
|
||||
price = v.price,
|
||||
hasWeapon = hasWeapon
|
||||
})
|
||||
}
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'armory_buy_weapons', {
|
||||
title = TranslateCap('armory_weapontitle'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local data = {current = element}
|
||||
if data.current.hasWeapon then
|
||||
if #data.current.components > 0 then
|
||||
OpenWeaponComponentShop(data.current.components, data.current.name, menu)
|
||||
@@ -815,17 +793,13 @@ function OpenBuyWeaponsMenu()
|
||||
end
|
||||
end, data.current.name, 1)
|
||||
end
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end
|
||||
|
||||
function OpenWeaponComponentShop(components, weaponName, parentShop)
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'armory_buy_weapons_components', {
|
||||
title = TranslateCap('armory_componenttitle'),
|
||||
align = 'top-left',
|
||||
elements = components
|
||||
}, function(data, menu)
|
||||
|
||||
ESX.OpenContext("right", components, function(menu,element)
|
||||
local data = {current = element}
|
||||
if data.current.hasComponent then
|
||||
ESX.ShowNotification(TranslateCap('armory_hascomponent'))
|
||||
else
|
||||
@@ -843,96 +817,94 @@ function OpenWeaponComponentShop(components, weaponName, parentShop)
|
||||
end
|
||||
end, weaponName, 2, data.current.componentNum)
|
||||
end
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end
|
||||
|
||||
function OpenGetStocksMenu()
|
||||
ESX.TriggerServerCallback('esx_policejob:getStockItems', function(items)
|
||||
local elements = {}
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-box", title = TranslateCap('police_stock')}
|
||||
}
|
||||
|
||||
for i=1, #items, 1 do
|
||||
table.insert(elements, {
|
||||
label = 'x' .. items[i].count .. ' ' .. items[i].label,
|
||||
elements[#elements+1] = {
|
||||
icon = "fas fa-box",
|
||||
title = 'x' .. items[i].count .. ' ' .. items[i].label,
|
||||
value = items[i].name
|
||||
})
|
||||
}
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'stocks_menu', {
|
||||
title = TranslateCap('police_stock'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local data = {current = element}
|
||||
local itemName = data.current.value
|
||||
|
||||
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'stocks_menu_get_item_count', {
|
||||
title = TranslateCap('quantity')
|
||||
}, function(data2, menu2)
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-box", title = element.title},
|
||||
{title = TranslateCap('quantity'), input = true, inputType = "number", inputMin = 1, inputMax = 150, inputPlaceholder = "Amount to withdraw.."},
|
||||
{icon = "fas fa-check-double", title = "Confirm", value = "confirm"}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
local data2 = {value = menu2.eles[2].inputValue}
|
||||
local count = tonumber(data2.value)
|
||||
|
||||
if not count then
|
||||
ESX.ShowNotification(TranslateCap('quantity_invalid'))
|
||||
else
|
||||
menu2.close()
|
||||
menu.close()
|
||||
ESX.CloseContext()
|
||||
TriggerServerEvent('esx_policejob:getStockItem', itemName, count)
|
||||
|
||||
Wait(300)
|
||||
OpenGetStocksMenu()
|
||||
end
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
end)
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
function OpenPutStocksMenu()
|
||||
ESX.TriggerServerCallback('esx_policejob:getPlayerInventory', function(inventory)
|
||||
local elements = {}
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-box", title = TranslateCap('inventory')}
|
||||
}
|
||||
|
||||
for i=1, #inventory.items, 1 do
|
||||
local item = inventory.items[i]
|
||||
|
||||
if item.count > 0 then
|
||||
table.insert(elements, {
|
||||
label = item.label .. ' x' .. item.count,
|
||||
elements[#elements+1] = {
|
||||
icon = "fas fa-box",
|
||||
title = item.label .. ' x' .. item.count,
|
||||
type = 'item_standard',
|
||||
value = item.name
|
||||
})
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'stocks_menu', {
|
||||
title = TranslateCap('inventory'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local data = {current = element}
|
||||
local itemName = data.current.value
|
||||
|
||||
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'stocks_menu_put_item_count', {
|
||||
title = TranslateCap('quantity')
|
||||
}, function(data2, menu2)
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-box", title = element.title},
|
||||
{title = TranslateCap('quantity'), input = true, inputType = "number", inputMin = 1, inputMax = 150, inputPlaceholder = "Amount to withdraw.."},
|
||||
{icon = "fas fa-check-double", title = "Confirm", value = "confirm"}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
local data2 = {value = menu2.eles[2].inputValue}
|
||||
local count = tonumber(data2.value)
|
||||
|
||||
if not count then
|
||||
ESX.ShowNotification(TranslateCap('quantity_invalid'))
|
||||
else
|
||||
menu2.close()
|
||||
menu.close()
|
||||
ESX.CloseContext()
|
||||
TriggerServerEvent('esx_policejob:putStockItems', itemName, count)
|
||||
|
||||
Wait(300)
|
||||
OpenPutStocksMenu()
|
||||
end
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
end)
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end)
|
||||
end
|
||||
@@ -993,7 +965,7 @@ end)
|
||||
|
||||
AddEventHandler('esx_policejob:hasExitedMarker', function(station, part, partNum)
|
||||
if not isInShopMenu then
|
||||
ESX.UI.Menu.CloseAll()
|
||||
ESX.CloseContext()
|
||||
end
|
||||
|
||||
CurrentAction = nil
|
||||
@@ -1437,7 +1409,7 @@ ESX.RegisterInput("police:interact", "(ESX PoliceJob) Interact", "keyboard", "E"
|
||||
elseif CurrentAction == 'delete_vehicle' then
|
||||
ESX.Game.DeleteVehicle(CurrentActionData.vehicle)
|
||||
elseif CurrentAction == 'menu_boss_actions' then
|
||||
ESX.UI.Menu.CloseAll()
|
||||
ESX.CloseContext()
|
||||
TriggerEvent('esx_society:openBossMenu', 'police', function(data, menu)
|
||||
menu.close()
|
||||
|
||||
|
||||
@@ -3,16 +3,15 @@ local spawnedVehicles = {}
|
||||
|
||||
function OpenVehicleSpawnerMenu(type, station, part, partNum)
|
||||
local playerCoords = GetEntityCoords(PlayerPedId())
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-car", title = TranslateCap('garage_title')},
|
||||
{icon = "fas fa-car", title = TranslateCap('garage_storeditem'), action = 'garage'},
|
||||
{icon = "fas fa-car", title = TranslateCap('garage_storeitem'), action = 'store_garage'},
|
||||
{icon = "fas fa-car", title = TranslateCap('garage_buyitem'), action = 'buy_vehicle'}
|
||||
}
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle', {
|
||||
title = TranslateCap('garage_title'),
|
||||
align = 'top-left',
|
||||
elements = {
|
||||
{label = TranslateCap('garage_storeditem'), action = 'garage'},
|
||||
{label = TranslateCap('garage_storeitem'), action = 'store_garage'},
|
||||
{label = TranslateCap('garage_buyitem'), action = 'buy_vehicle'}
|
||||
}}, function(data, menu)
|
||||
if data.current.action == 'buy_vehicle' then
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
if element.action == "buy_vehicle" then
|
||||
local shopElements = {}
|
||||
local shopCoords = Config.PoliceStations[station][part][partNum].InsideShop
|
||||
local authorizedVehicles = Config.AuthorizedVehicles[type][ESX.PlayerData.job.grade_name]
|
||||
@@ -23,14 +22,15 @@ function OpenVehicleSpawnerMenu(type, station, part, partNum)
|
||||
if IsModelInCdimage(vehicle.model) then
|
||||
local vehicleLabel = GetLabelText(GetDisplayNameFromVehicleModel(vehicle.model))
|
||||
|
||||
table.insert(shopElements, {
|
||||
label = ('%s - <span style="color:green;">%s</span>'):format(vehicleLabel, TranslateCap('shop_item', ESX.Math.GroupDigits(vehicle.price))),
|
||||
shopElements[#shopElements+1] = {
|
||||
icon = 'fas fa-car',
|
||||
title = ('%s - <span style="color:green;">%s</span>'):format(vehicleLabel, TranslateCap('shop_item', ESX.Math.GroupDigits(vehicle.price))),
|
||||
name = vehicleLabel,
|
||||
model = vehicle.model,
|
||||
price = vehicle.price,
|
||||
props = vehicle.props,
|
||||
type = type
|
||||
})
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -45,8 +45,10 @@ function OpenVehicleSpawnerMenu(type, station, part, partNum)
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('garage_notauthorized'))
|
||||
end
|
||||
elseif data.current.action == 'garage' then
|
||||
local garage = {}
|
||||
elseif element.action == "garage" then
|
||||
local garage = {
|
||||
{unselectable = true, icon = "fas fa-car", title = "Garage"}
|
||||
}
|
||||
|
||||
ESX.TriggerServerCallback('esx_vehicleshop:retrieveJobVehicles', function(jobVehicles)
|
||||
if #jobVehicles > 0 then
|
||||
@@ -65,42 +67,37 @@ function OpenVehicleSpawnerMenu(type, station, part, partNum)
|
||||
label = label .. ('<span style="color:darkred;">%s</span>'):format(TranslateCap('garage_notstored'))
|
||||
end
|
||||
|
||||
table.insert(garage, {
|
||||
label = label,
|
||||
garage[#garage+1] = {
|
||||
icon = 'fas fa-car',
|
||||
title = label,
|
||||
stored = v.stored,
|
||||
model = props.model,
|
||||
plate = props.plate
|
||||
})
|
||||
}
|
||||
|
||||
allVehicleProps[props.plate] = props
|
||||
end
|
||||
end
|
||||
|
||||
if #garage > 0 then
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_garage', {
|
||||
title = TranslateCap('garage_title'),
|
||||
align = 'top-left',
|
||||
elements = garage
|
||||
}, function(data2, menu2)
|
||||
if data2.current.stored == 1 then
|
||||
ESX.OpenContext("right", garage, function(menuG,elementG)
|
||||
if elementG.stored == 1 then
|
||||
local foundSpawn, spawnPoint = GetAvailableVehicleSpawnPoint(station, part, partNum)
|
||||
|
||||
if foundSpawn then
|
||||
menu2.close()
|
||||
ESX.CloseContext()
|
||||
|
||||
ESX.Game.SpawnVehicle(data2.current.model, spawnPoint.coords, spawnPoint.heading, function(vehicle)
|
||||
local vehicleProps = allVehicleProps[data2.current.plate]
|
||||
ESX.Game.SpawnVehicle(elementG.model, spawnPoint.coords, spawnPoint.heading, function(vehicle)
|
||||
local vehicleProps = allVehicleProps[elementG.plate]
|
||||
ESX.Game.SetVehicleProperties(vehicle, vehicleProps)
|
||||
|
||||
TriggerServerEvent('esx_vehicleshop:setJobVehicleState', data2.current.plate, false)
|
||||
TriggerServerEvent('esx_vehicleshop:setJobVehicleState', elementG.plate, false)
|
||||
ESX.ShowNotification(TranslateCap('garage_released'))
|
||||
end)
|
||||
end
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('garage_notavailable'))
|
||||
end
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
end)
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('garage_empty'))
|
||||
@@ -109,11 +106,9 @@ function OpenVehicleSpawnerMenu(type, station, part, partNum)
|
||||
ESX.ShowNotification(TranslateCap('garage_empty'))
|
||||
end
|
||||
end, type)
|
||||
elseif data.current.action == 'store_garage' then
|
||||
elseif element.action == "store_garage" then
|
||||
StoreNearbyVehicle(playerCoords)
|
||||
end
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end
|
||||
|
||||
@@ -207,85 +202,74 @@ end
|
||||
function OpenShopMenu(elements, restoreCoords, shopCoords)
|
||||
local playerPed = PlayerPedId()
|
||||
isInShopMenu = true
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-car", title = element.title},
|
||||
{icon = "fas fa-eye", title = "View", value = "view"}
|
||||
}
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_shop', {
|
||||
title = TranslateCap('vehicleshop_title'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_shop_confirm', {
|
||||
title = TranslateCap('vehicleshop_confirm', data.current.name, data.current.price),
|
||||
align = 'top-left',
|
||||
elements = {
|
||||
{label = TranslateCap('confirm_no'), value = 'no'},
|
||||
{label = TranslateCap('confirm_yes'), value = 'yes'}
|
||||
}}, function(data2, menu2)
|
||||
if data2.current.value == 'yes' then
|
||||
local newPlate = exports['esx_vehicleshop']:GeneratePlate()
|
||||
local vehicle = GetVehiclePedIsIn(playerPed, false)
|
||||
local props = ESX.Game.GetVehicleProperties(vehicle)
|
||||
props.plate = newPlate
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
if element2.value == "view" then
|
||||
DeleteSpawnedVehicles()
|
||||
WaitForVehicleToLoad(element.model)
|
||||
|
||||
ESX.TriggerServerCallback('esx_policejob:buyJobVehicle', function (bought)
|
||||
if bought then
|
||||
ESX.ShowNotification(TranslateCap('vehicleshop_bought', data.current.name, ESX.Math.GroupDigits(data.current.price)))
|
||||
ESX.Game.SpawnLocalVehicle(element.model, shopCoords, 0.0, function(vehicle)
|
||||
table.insert(spawnedVehicles, vehicle)
|
||||
TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
|
||||
FreezeEntityPosition(vehicle, true)
|
||||
SetModelAsNoLongerNeeded(element.model)
|
||||
|
||||
if element.props then
|
||||
ESX.Game.SetVehicleProperties(vehicle, element.props)
|
||||
end
|
||||
end)
|
||||
|
||||
local elements3 = {
|
||||
{unselectable = true, icon = "fas fa-car", title = element.title},
|
||||
{icon = "fas fa-check-double", title = "Buy", value = "buy"},
|
||||
{icon = "fas fa-eye", title = "Stop Viewing", value = "stop"}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements3, function(menu3,element3)
|
||||
if element3.value == 'stop' then
|
||||
isInShopMenu = false
|
||||
ESX.UI.Menu.CloseAll()
|
||||
ESX.CloseContext()
|
||||
|
||||
DeleteSpawnedVehicles()
|
||||
FreezeEntityPosition(playerPed, false)
|
||||
SetEntityVisible(playerPed, true)
|
||||
|
||||
ESX.Game.Teleport(playerPed, restoreCoords)
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('vehicleshop_money'))
|
||||
menu2.close()
|
||||
elseif element3.value == "buy" then
|
||||
local newPlate = exports['esx_vehicleshop']:GeneratePlate()
|
||||
local vehicle = GetVehiclePedIsIn(playerPed, false)
|
||||
local props = ESX.Game.GetVehicleProperties(vehicle)
|
||||
props.plate = newPlate
|
||||
|
||||
ESX.TriggerServerCallback('esx_policejob:buyJobVehicle', function (bought)
|
||||
if bought then
|
||||
ESX.ShowNotification(TranslateCap('vehicleshop_bought', element.name, ESX.Math.GroupDigits(element.price)))
|
||||
|
||||
isInShopMenu = false
|
||||
ESX.CloseContext()
|
||||
DeleteSpawnedVehicles()
|
||||
FreezeEntityPosition(playerPed, false)
|
||||
SetEntityVisible(playerPed, true)
|
||||
|
||||
ESX.Game.Teleport(playerPed, restoreCoords)
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('vehicleshop_money'))
|
||||
ESX.CloseContext()
|
||||
end
|
||||
end, props, element.type)
|
||||
end
|
||||
end, props, data.current.type)
|
||||
else
|
||||
menu2.close()
|
||||
end
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
end)
|
||||
end, function(data, menu)
|
||||
isInShopMenu = false
|
||||
ESX.UI.Menu.CloseAll()
|
||||
|
||||
DeleteSpawnedVehicles()
|
||||
FreezeEntityPosition(playerPed, false)
|
||||
SetEntityVisible(playerPed, true)
|
||||
|
||||
ESX.Game.Teleport(playerPed, restoreCoords)
|
||||
end, function(data, menu)
|
||||
DeleteSpawnedVehicles()
|
||||
WaitForVehicleToLoad(data.current.model)
|
||||
|
||||
ESX.Game.SpawnLocalVehicle(data.current.model, shopCoords, 0.0, function(vehicle)
|
||||
table.insert(spawnedVehicles, vehicle)
|
||||
TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
|
||||
FreezeEntityPosition(vehicle, true)
|
||||
SetModelAsNoLongerNeeded(data.current.model)
|
||||
|
||||
if data.current.props then
|
||||
ESX.Game.SetVehicleProperties(vehicle, data.current.props)
|
||||
end)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
WaitForVehicleToLoad(elements[1].model)
|
||||
ESX.Game.SpawnLocalVehicle(elements[1].model, shopCoords, 0.0, function(vehicle)
|
||||
table.insert(spawnedVehicles, vehicle)
|
||||
TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
|
||||
FreezeEntityPosition(vehicle, true)
|
||||
SetModelAsNoLongerNeeded(elements[1].model)
|
||||
|
||||
if elements[1].props then
|
||||
ESX.Game.SetVehicleProperties(vehicle, elements[1].props)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
CreateThread(function()
|
||||
while true do
|
||||
Wait(0)
|
||||
|
||||
@@ -0,0 +1,217 @@
|
||||
Locales['es'] = {
|
||||
--- CCTV Strings ------
|
||||
|
||||
["take_picture"] = "Tomar foto",
|
||||
["rot_left_right"] = "Izquierda/Derecha",
|
||||
["rot_up_down"] = "Arriba/Abajo",
|
||||
["zoom"] = "Zoom +/-",
|
||||
["zoom_level"] = "Nivel de Zoom: %s %%",
|
||||
["night_vision"] = "Alternar Visión Nocturna",
|
||||
["clipboard"] = "Enlace copiado al ~b~Portapapeles",
|
||||
["picture_taken"] = "¡Foto tomada!",
|
||||
["please_wait"] = "Espere antes de tomar otra ~b~Foto",
|
||||
["exit"] = "Salir",
|
||||
|
||||
--- Furniture Strings ------
|
||||
|
||||
["height"] = "Altura",
|
||||
["rotate"] = "Rotación",
|
||||
["place"] = "Colocar mueble",
|
||||
["delete_furni"] = "Borrar",
|
||||
["confirm_buy"] = "¿Quieres comprar %s?",
|
||||
["price"] = "Precio: $%s",
|
||||
["yes"] = "Si",
|
||||
["no"] = "No",
|
||||
["action"] = "¡ Tu %s ~b~%s~s~ !",
|
||||
["bought_furni"] = "¡ Has ~g~comprado~s~ un ~b~%s~s~ !",
|
||||
["edited_furni"] = "¡ Has editado ~b~%s~s~ !",
|
||||
["cannot_buy"] = "¡~r~No puedes~s~ comprar esto!",
|
||||
["cannot_edit"] = "¡Usted ~r~no puede~s~ editar esto!",
|
||||
["store_title"] = "Tienda - %s",
|
||||
["back"] = "Volver",
|
||||
["edit_title"] = "Edición - %s",
|
||||
["move_title"] = "Mover",
|
||||
["delete_confirm"] = "¡Borrado ~b~%s~s~!",
|
||||
["delete_error"] = "No se puede borrar ~b~%s~s~!",
|
||||
["owned_furni"] = "Mobiliario propio",
|
||||
["menu_stores"] = "Tiendas de muebles",
|
||||
["menu_stores_desc"] = "Comprar mueble",
|
||||
["menu_reset"] = "Reiniciar",
|
||||
["menu_reset_desc"] = "Limpia todos los muebles",
|
||||
["menu_edit"] = "Editar",
|
||||
["menu_edit_desc"] = "Mover y/o Eliminar muebles",
|
||||
["furni_command"] = "muebles",
|
||||
["furni_command_desc"] = "Abrir menú de muebles",
|
||||
["furni_command_permission"] = "~r~No~s~ puede acceder a este menú.",
|
||||
["furni_reset_success"] = "¡Todos los muebles reiniciados!",
|
||||
["furni_cannot_afford"] = "¡Usted no puede permitirse el lujo de hacer esto!",
|
||||
["furni_reset_error"] = "~r~No puede~s~ ¡Restablecer esta propiedad!",
|
||||
["furni_management"] = "Administrar muebles",
|
||||
|
||||
--------- Key Strings ---------------
|
||||
|
||||
["you_granted"] = 'Se le han otorgado llaves a ~b~%s~s~.',
|
||||
["already_has"] = "¡Este jugador ya tiene llaves!",
|
||||
["do_not_own"] = 'Usted ~r~no~s~ es dueño de esta propiedad.',
|
||||
["key_revoked"] = 'Su llave de acceso a ~b~%s~s~. ha sido ~r~revocada~s~',
|
||||
["no_keys"] = "¡Este jugador no tiene llaves!",
|
||||
["nearby"] = "Jugadores cercanos",
|
||||
["gave_key"] = "Entrega de llaves a %s!",
|
||||
["key_cannot_give"] = "No puedes darle a este jugador una ~r~Llave",
|
||||
["remove_title"] = "Eliminar llaves del jugador",
|
||||
["key_revoke_success"] = "Revocación de llaves de ~b~%s~s~.",
|
||||
["key_revoke_error"] = "No puede ~b~quitar~s~ las ~r~llave~s~ a esta persona",
|
||||
["key_management"] = "Gestión de llaves",
|
||||
["key_management_desc"] = "Controlar el acceso a la propiedad.",
|
||||
["give_keys"] = "Dar llaves",
|
||||
["remove_keys"] = "Quitar llaves",
|
||||
|
||||
--------- Real Estate Strings ---------------
|
||||
|
||||
["office_blip"] = "Oficina de %s",
|
||||
["actions"] = "Acciones Inmobiliarias",
|
||||
["property_create"] = "Crear propiedad",
|
||||
["property_manage"] = "Administrar propiedades",
|
||||
["realestate_command"] = "realestatequickmenu",
|
||||
["realestate_command_desc"] = "(ESX Property) Abrir acciones rápidas inmobiliarias",
|
||||
["enter_office"] = "~b~Entrando~a~la oficina.",
|
||||
["enter_office_error"] = "¡Usted ~r~no puede~s~ entrar en la oficina!",
|
||||
["exit_office"] = "~b~Saliendo~s~ de la oficina.",
|
||||
["exit_office_error"] = "¡Usted ~r~no puede~s~ salir de la oficina!",
|
||||
["realestate_textui"] = "Presione ~b~[E]~s~ para acceder ~b~%s",
|
||||
|
||||
------------Command Strings-------------------------------
|
||||
|
||||
["refresh_name"] = "property:refresh",
|
||||
["refresh_desc"] = "Actualizar al estado de inicio del servidor",
|
||||
["save_name"] = "property:save",
|
||||
["save_desc"] = "Forzar guardar propiedades",
|
||||
["create_name"] = "property:create",
|
||||
["create_desc"] = "Crear una nueva propiedad",
|
||||
["admin_name"] = "property:admin",
|
||||
["admin_desc"] = "Administrar/ver todas las propiedades",
|
||||
|
||||
---------- Property Actions Menu -------------------------
|
||||
|
||||
["knocking"] = "Alguien Está ~b~Llamando~s~ A La Puerta.",
|
||||
["name_edit"] = "Editar nombre de propiedad",
|
||||
["name"] = "Nombre",
|
||||
["confirm"] = "Confirmar",
|
||||
["name_edit_success"] = "Ha establecido el nombre de la propiedad a ~b~%s~s~.",
|
||||
["name_edit_error"] = "No puede establecer el nombre de la propiedad a ~r~%s~s~.",
|
||||
["door_locked"] = "Puerta: cerrada",
|
||||
["door_unlocked"] = "Puerta: abierta",
|
||||
["name_manage"] = "Administrar nombre",
|
||||
["name_manage_desc"] = "Establezca el nombre de la propiedad.",
|
||||
["sell_title"] = "Vender",
|
||||
["sell_desc"] = "Vender esta propiedad por $%s",
|
||||
["raid_title"] = "Redada",
|
||||
["raid_desc"] = "Forzar la entrada a la propiedad.",
|
||||
["cctv_title"] = "CCTV",
|
||||
["cctv_desc"] = "Compruebe el circuito cerrado de televisión.",
|
||||
["inventory_title"] = "Inventario",
|
||||
["inventory_desc"] = "Cambiar la posición del inventario de propiedad.",
|
||||
["wardrobe_title"] = "Armario",
|
||||
["wardrobe_desc"] = "Cambiar la posición del armario de la propiedad.",
|
||||
["furniture_title"] = "Muebles",
|
||||
["furniture_desc"] = "Cambiar Posición de Mobiliario de Propiedad.",
|
||||
["enter_title"] = "Entrar",
|
||||
["knock_title"] = "Tocar la puerta",
|
||||
["buy_title"] = "Comprar",
|
||||
["buy_desc"] = "Compre esta propiedad por $%s",
|
||||
["sellplayer_title"] = "Vender al jugador",
|
||||
["sellplayer_desc"] = "Vender esta propiedad por $%s",
|
||||
["view_title"] = "Vista previa del interior",
|
||||
["exit_title"] = "Salir",
|
||||
["property_editing_error"] = "Actualmente está editando la propiedad.",
|
||||
["unlock_error"] = "No puede ~b~desbloquear~s~ esta propiedad",
|
||||
["lock_error"] = "No puede ~bloquear~a~ esta propiedad",
|
||||
["prep_raid"] = "¡~b~Preparando~s~ Redada!",
|
||||
["raiding"] = "Asaltando...",
|
||||
["cancel_raiding"] = "¡Redada ~r~Cancelada~s~!",
|
||||
["cannot_raid"] = "No puedes ~b~Asaltar~s~ esta propiedad.",
|
||||
["storage_pos_textui"] = "Presione ~b~[G]~s~ para establecer la posición del inventario",
|
||||
["storage_pos_success"] = "Posición del ~b~Inventario~s~ establecida.",
|
||||
["storage_pos_error"] = "~r~No se puede~s~ establecer la posición de ~b~inventario~s~.",
|
||||
["wardrobe_pos_textui"] = "Presione ~b~[G]~s~ para establecer la posición del Armario",
|
||||
["wardrobe_pos_success"] = "Posición del ~b~Armario~s~ establecida.",
|
||||
["wardrobe_pos_error"] = "~r~No se puede~s~ establecer la posición de ~b~armario~s~.",
|
||||
["please_finish"] = "Finalice la configuración de posición de ~b~%s~s~",
|
||||
["cannot_afford"] = "¡Usted no puede comprar esta propiedad!",
|
||||
["select_player"] = "Seleccionar jugador",
|
||||
["cannot_sell"] = "¡No se puede vender a este jugador!",
|
||||
["knock_on_door"] = "Llamando a la puerta...",
|
||||
["nobody_home"] = "Parece que nadie está en casa...",
|
||||
|
||||
---------- General Strings ----------------
|
||||
|
||||
["enabled"] = "Activado",
|
||||
["disabled"] = "Desactivado",
|
||||
["exiting"] = "Saliendo de la propiedad...",
|
||||
["entering"] = "Entrando a la propiedad...",
|
||||
["shell_disabled"] = "¡Este interior usa shells, que están deshabilitados!",
|
||||
["access_textui"] = "Pulsa ~b~[E]~s~ para acceder ~b~%s",
|
||||
["raid_notify_error"] = "Necesitas ~b~ %sx %s~s~ para poder asaltar!",
|
||||
["raid_notify_success"] = "¡Su propiedad está siendo actualmente ~b~Asaltada!",
|
||||
|
||||
--------------- Garage Strings --------------
|
||||
|
||||
["store_success"] = "Vehículo ~b~¡Almacenado!",
|
||||
["store_error"] = "¡No puede almacenar este vehículo!",
|
||||
["property_garage"] = "Garaje de propiedad",
|
||||
["retriving_notify"] = "Sacando ~b~%s~s~ ...",
|
||||
["cannot_access"] = "¡No puede acceder a este garaje!",
|
||||
["store_textui"] = "Pulsa ~b~[E]~s~ para almacenar ~b~%s",
|
||||
["garage_not_enabled"] = 'Garaje No Habilitado En Esta Propiedad.',
|
||||
["cannot_access_property"] = '~r~No puede~s~ Acceder a esta propiedad.',
|
||||
|
||||
----------------- Creation Menu Strings ----------------
|
||||
|
||||
["menu_title"] = "Creación de propiedad",
|
||||
["element_title1"] = "Número de calle",
|
||||
["element_description1"] = "Establezca el número de calle de la propiedad.",
|
||||
["element_title2"] = "Precio",
|
||||
["element_description2"] = "Fijar el Precio de la Propiedad.",
|
||||
["element_title3"] = "Interior",
|
||||
["element_description3"] = "Seleccione un interior para la propiedad",
|
||||
["element_title4"] = "Garaje",
|
||||
["element_description4"] = "(Opcional) Administrar la configuración del garaje",
|
||||
["element_title5"] = "CCTV",
|
||||
["element_description5"] = "(Opcional) Administrar la configuración de CCTV",
|
||||
["element_title6"] = "Entrada",
|
||||
["element_description6"] = "Establezca la ubicación de entrada de la propiedad.",
|
||||
["element_create_title"] = "Crear propiedad",
|
||||
["element_create_desc_1"] = "¡Complete todas las entradas requeridas!",
|
||||
["entrance_set_title"] = "Entrada establecida.",
|
||||
["entrance_set_description"] = "Entrada: %s, %s, %s",
|
||||
["interior_set_title"] = "Interior seleccionado.",
|
||||
["interior_set_description"] = "Selected: %s",
|
||||
["ipl_title"] = "Interiores IPL",
|
||||
["types_title"] = "Tipos de interiores",
|
||||
["ipl_description"] = "Interiores nativos de GTA, Hecho por R*",
|
||||
["shell_title"] = "Interiores personalizados",
|
||||
["shell_description"] = "Interiores personalizados, hechos por Ti",
|
||||
["cctv_settings"] = "Ajustes CCTV",
|
||||
["garage_settings"] = "Configuración del garaje",
|
||||
["toggle_title"] = "Alternar uso",
|
||||
["toggle_description"] = "Estado actual: %s",
|
||||
["cctv_set_title"] = "Establecer angulo de CCTV",
|
||||
["cctv_set_description"] = "Establece el angulo de las cámaras para tus direcciones de Cámaras",
|
||||
["back_description"] = "Volver a la creación de propiedad.",
|
||||
["garage_set_title"] = "Establecer posición de garaje",
|
||||
["garage_set_description"] = "Establece la posición del garaje de la propiedad.",
|
||||
["garage_textui"] = "Presione ~b~[E]~s~ para establecer la posición",
|
||||
["cctv_textui_1"] = "Presione ~b~[E]~s~ para establecer el ángulo",
|
||||
["cctv_textui_2"] = "Presione ~b~[E]~s~ para establecer la rotación máxima a la derecha",
|
||||
["cctv_textui_3"] = "Presione ~b~[E]~s~ para establecer la rotación máxima a la izquierda",
|
||||
["create_success"] = "¡Propiedad creada!",
|
||||
["missing_data"] = "¡Complete todas las entradas requeridas!",
|
||||
|
||||
-- Saving Translations
|
||||
["server_restart"] = "Reinicio del servidor",
|
||||
["server_shutdown"] = "Apagado del servidor",
|
||||
["manual_save"] = "Guardado manual (solicitado por %s)",
|
||||
["resource_stop"] = "Detención de recurso",
|
||||
["force_save"] = "Forzar guardado (solicitado por %s)",
|
||||
["interval_saving"] = "Intervalo de Guardado"
|
||||
}
|
||||
@@ -2,49 +2,39 @@ local hasAlreadyEnteredMarker, lastZone
|
||||
local currentAction, currentActionMsg, currentActionData = nil, nil, {}
|
||||
|
||||
function OpenShopMenu(zone)
|
||||
local elements = {}
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-shopping-basket", title = TranslateCap('shop') }
|
||||
}
|
||||
|
||||
for i=1, #Config.Zones[zone].Items, 1 do
|
||||
local item = Config.Zones[zone].Items[i]
|
||||
|
||||
table.insert(elements, {
|
||||
label = ('%s - <span style="color:green;">%s</span>'):format(item.label, TranslateCap('shop_item', ESX.Math.GroupDigits(item.price))),
|
||||
elements[#elements+1] = {
|
||||
icon = "fas fa-shopping-basket",
|
||||
title = ('%s - <span style="color:green;">%s</span>'):format(item.label, TranslateCap('shop_item', ESX.Math.GroupDigits(item.price))),
|
||||
itemLabel = item.label,
|
||||
item = item.name,
|
||||
price = item.price,
|
||||
|
||||
-- menu properties
|
||||
value = 1,
|
||||
type = 'slider',
|
||||
min = 1,
|
||||
max = 100
|
||||
})
|
||||
item = item.name,
|
||||
price = item.price
|
||||
}
|
||||
end
|
||||
|
||||
ESX.UI.Menu.CloseAll()
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-shopping-basket", title = element.title},
|
||||
{icon = "fas fa-shopping-basket", title = "Amount", input = true, inputType = "number", inputPlaceholder = "Amount you want to buy", inputMin = 1, inputMax = 25},
|
||||
{icon = "fas fa-check-double", title = "Confirm", val = "confirm"}
|
||||
}
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'shop', {
|
||||
title = TranslateCap('shop'),
|
||||
align = 'bottom-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'shop_confirm', {
|
||||
title = TranslateCap('shop_confirm', data.current.value, data.current.itemLabel, ESX.Math.GroupDigits(data.current.price * data.current.value)),
|
||||
align = 'bottom-left',
|
||||
elements = {
|
||||
{label = TranslateCap('no'), value = 'no'},
|
||||
{label = TranslateCap('yes'), value = 'yes'}
|
||||
}}, function(data2, menu2)
|
||||
if data2.current.value == 'yes' then
|
||||
TriggerServerEvent('esx_shops:buyItem', data.current.item, data.current.value, zone)
|
||||
end
|
||||
|
||||
menu2.close()
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
local amount = menu2.eles[2].inputValue
|
||||
ESX.CloseContext()
|
||||
TriggerServerEvent('esx_shops:buyItem', element.item, amount, zone)
|
||||
end, function(menu)
|
||||
currentAction = 'shop_menu'
|
||||
currentActionMsg = TranslateCap('press_menu')
|
||||
currentActionData = {zone = zone}
|
||||
end)
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
|
||||
end, function(menu)
|
||||
currentAction = 'shop_menu'
|
||||
currentActionMsg = TranslateCap('press_menu')
|
||||
currentActionData = {zone = zone}
|
||||
@@ -59,7 +49,7 @@ end)
|
||||
|
||||
AddEventHandler('esx_shops:hasExitedMarker', function(zone)
|
||||
currentAction = nil
|
||||
ESX.UI.Menu.CloseAll()
|
||||
ESX.CloseContext()
|
||||
end)
|
||||
|
||||
-- Create Blips
|
||||
|
||||
@@ -3,4 +3,4 @@ Config = {}
|
||||
Config.StatusMax = 1000000
|
||||
Config.TickTime = 1000
|
||||
Config.UpdateInterval = 30000
|
||||
Config.Display = true -- Enable the esx_status bars (disable if you are using another HUD)
|
||||
Config.Display = false -- Enable the esx_status bars (disable if you are using another HUD)
|
||||
|
||||
@@ -238,15 +238,18 @@ function OpenMobileTaxiActionsMenu()
|
||||
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
if element.value == "billing" then
|
||||
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'billing', {
|
||||
title = TranslateCap('invoice_amount')
|
||||
}, function(data, menu)
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-taxi", title = element.title},
|
||||
{title = "Amount", input = true, inputType = "number", inputMin = 1, inputMax = 250000, inputPlaceholder = "Amount to bill.."},
|
||||
{icon = "fas fa-check-double", title = "Confirm", value = "confirm"}
|
||||
}
|
||||
|
||||
local amount = tonumber(data.value)
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
local amount = tonumber(menu2.eles[2].inputValue)
|
||||
if amount == nil then
|
||||
ESX.ShowNotification(TranslateCap('amount_invalid'))
|
||||
else
|
||||
menu.close()
|
||||
ESX.CloseContext()
|
||||
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
|
||||
if closestPlayer == -1 or closestDistance > 3.0 then
|
||||
ESX.ShowNotification(TranslateCap('no_players_near'))
|
||||
@@ -256,8 +259,6 @@ function OpenMobileTaxiActionsMenu()
|
||||
ESX.ShowNotification(TranslateCap('billing_sent'))
|
||||
end
|
||||
end
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
elseif element.value == "start_job" then
|
||||
if OnJob then
|
||||
@@ -322,24 +323,24 @@ function OpenGetStocksMenu()
|
||||
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local itemName = element.value
|
||||
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'stocks_menu_get_item_count', {
|
||||
title = TranslateCap('quantity')
|
||||
}, function(data2, menu2)
|
||||
local count = tonumber(data2.value)
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-box", title = element.title},
|
||||
{title = "Amount", input = true, inputType = "number", inputMin = 1, inputMax = 100, inputPlaceholder = "Amount to withdraw.."},
|
||||
{icon = "fas fa-check-double", title = "Confirm", value = "confirm"}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
local count = tonumber(menu2.eles[2].inputValue)
|
||||
|
||||
if count == nil then
|
||||
ESX.ShowNotification(TranslateCap('quantity_invalid'))
|
||||
else
|
||||
menu2.close()
|
||||
ESX.CloseContext()
|
||||
|
||||
-- todo: refresh on callback
|
||||
TriggerServerEvent('esx_taxijob:getStockItem', itemName, count)
|
||||
|
||||
Wait(1000)
|
||||
OpenGetStocksMenu()
|
||||
end
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
end)
|
||||
end)
|
||||
end, function(menu)
|
||||
@@ -370,24 +371,24 @@ function OpenPutStocksMenu()
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local itemName = element.value
|
||||
|
||||
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'stocks_menu_put_item_count', {
|
||||
title = TranslateCap('quantity')
|
||||
}, function(data2, menu2)
|
||||
local count = tonumber(data2.value)
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-box", title = element.title},
|
||||
{title = "Amount", input = true, inputType = "number", inputMin = 1, inputMax = 100, inputPlaceholder = "Amount to deposit.."},
|
||||
{icon = "fas fa-check-double", title = "Confirm", value = "confirm"}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
local count = tonumber(menu2.eles[2].inputValue)
|
||||
|
||||
if count == nil then
|
||||
ESX.ShowNotification(TranslateCap('quantity_invalid'))
|
||||
else
|
||||
menu2.close()
|
||||
else
|
||||
ESX.CloseContext()
|
||||
|
||||
-- todo: refresh on callback
|
||||
TriggerServerEvent('esx_taxijob:putStockItems', itemName, count)
|
||||
Wait(1000)
|
||||
OpenPutStocksMenu()
|
||||
end
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
end)
|
||||
end)
|
||||
end, function(menu)
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
Locales['it'] = {
|
||||
-- cloakroom
|
||||
['cloakroom_menu'] = 'guardaroba',
|
||||
['cloakroom_prompt'] = 'premi [E] per accedere al guardaroba.',
|
||||
['wear_citizen'] = 'abbigliamento cittadino',
|
||||
['wear_work'] = 'abiti da lavoro',
|
||||
|
||||
-- garage
|
||||
['spawner_prompt'] = 'premi [E] per accedere al garage.',
|
||||
["vehicle_spawned"] = "generato con successo un ~b~Taxi!",
|
||||
['store_veh'] = 'premi [E] per depositare il veicolo',
|
||||
['spawn_veh'] = 'genera veicolo',
|
||||
['spawnpoint_blocked'] = 'un veicolo blocca lo spawnpoint!',
|
||||
['only_taxi'] = 'puoi depositare solo taxi.',
|
||||
['empty_garage'] = 'nessun veicolo nel garage!',
|
||||
|
||||
['taking_service'] = 'prendi servizio: Taxi/Uber',
|
||||
['full_service'] = 'servizio completo: ',
|
||||
['amount_invalid'] = 'importo non valido',
|
||||
['press_to_open'] = 'premi [E] per accedere al menu',
|
||||
['billing'] = 'fattura',
|
||||
['billing_sent'] = 'la fattura è stata registrata!',
|
||||
['invoice_amount'] = 'importo fattura',
|
||||
['no_players_near'] = 'nessun giocatore nelle vicinanze',
|
||||
['start_job'] = 'inizia / interrompi la guida di lavori NPC',
|
||||
['drive_search_pass'] = 'guida alla ricerca di passeggeri',
|
||||
['customer_found'] = 'hai trovato un cliente avvicinati a lui',
|
||||
['client_unconcious'] = 'il tuo cliente è ~r~incosciente, cercane un altro',
|
||||
['arrive_dest'] = 'sei arrivato a destinazione',
|
||||
['take_me_to_near'] = 'portami a %s, vicino a %s',
|
||||
['take_me_to'] = 'portami a %s',
|
||||
['close_to_client'] = 'sei troppo lontano dal cliente, avvicinati a lui',
|
||||
['return_to_veh'] = 'torna al tuo veicolo per continuare la missione',
|
||||
['must_in_taxi'] = 'devi essere in un taxi per iniziare la missione',
|
||||
['must_in_vehicle'] = 'devi essere in un veicolo per iniziare la missione',
|
||||
['not_in_taxi'] = 'Hai lasciato il taxi mentre eri in missione!',
|
||||
['have_earned'] = 'hai guadagnato $%s',
|
||||
['comp_earned'] = '- la tua azienda ha guadagnato $%s \n - hai guadagnato $%s',
|
||||
['deposit_stock'] = 'deposito',
|
||||
['take_stock' ] = 'prendi',
|
||||
['empty_stock'] = 'deposito vuoto!',
|
||||
['empty_your_inventory'] = 'Svuota il tuo inventario!' ,
|
||||
['boss_actions'] = 'Azioni del capo',
|
||||
['mission_complete'] = 'missione completata',
|
||||
['quantity' ] = 'quantità',
|
||||
['quantity_invalid'] = 'questa quantità non è valida!',
|
||||
['inventory'] = 'inventario',
|
||||
['taxi_client'] = 'cliente taxi',
|
||||
['have_withdrawn'] = 'hai prelevato x%s %s',
|
||||
['have_deposited'] = 'hai depositato x%s %s',
|
||||
['player_cannot_hold'] = '~r~non hai abbastanza spazio libero nel tuo inventario!',
|
||||
['blip_taxi'] = 'Downtown Cab Co.',
|
||||
['phone_taxi' ] = ' downtown Cab Co.',
|
||||
['taxi' ] = 'taxi',
|
||||
['taxi_stock'] = 'deposito dei taxi',
|
||||
['menu_return'] = 'Ritorno'
|
||||
}
|
||||
@@ -99,12 +99,13 @@ end)
|
||||
RegisterNetEvent('esx_taxijob:putStockItems')
|
||||
AddEventHandler('esx_taxijob:putStockItems', function(itemName, count)
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
|
||||
local sourceItem = xPlayer.getInventoryItem(itemName)
|
||||
|
||||
if xPlayer.job.name == 'taxi' then
|
||||
TriggerEvent('esx_addoninventory:getSharedInventory', 'society_taxi', function(inventory)
|
||||
local item = inventory.getItem(itemName)
|
||||
|
||||
if item.count > 0 then
|
||||
if sourceItem.count >= count and count > 0 then
|
||||
xPlayer.removeInventoryItem(itemName, count)
|
||||
inventory.addItem(itemName, count)
|
||||
xPlayer.showNotification(TranslateCap('have_deposited', count, item.label))
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
Locales['it'] = {
|
||||
['male'] = "Maschio",
|
||||
['female'] = "Femmina",
|
||||
['delete_label'] = "Cancella %s %s?",
|
||||
['select_char'] = "Seleziona Personaggio",
|
||||
["select_char_description"] = "Seleziona il personaggio con cui vuoi giocare.",
|
||||
['create_char'] = "Crea un nuovo personaggio",
|
||||
['char_play'] = "Gioca questo personaggio",
|
||||
['char_disabled'] = "Questo personaggio è disabilitato",
|
||||
['char_delete'] = "Cancella questo personaggio",
|
||||
['cancel'] = "Annulla",
|
||||
['confirm'] = "Conferma",
|
||||
['command_setslots'] = "Imposta il numero di slot di personaggi di un giocatore",
|
||||
['command_remslots'] = "Rimuovi il numero di slot di personaggi di un giocatore",
|
||||
['command_enablechar'] = "Abilita un personaggio di un giocatore",
|
||||
['command_disablechar'] = "Disabilita un personaggio di un giocatore",
|
||||
['command_charslot'] = "Numero dello slot del personaggio",
|
||||
['command_identifier'] = "Identifier del giocatore",
|
||||
['command_slots'] = "# di slot",
|
||||
['slotsadd'] = "Hai aggiunto %s slot a %s",
|
||||
['slotsedit'] = "Hai impostato %s slot a %s",
|
||||
['slotsrem'] = "Hai rimosso gli slot a %s",
|
||||
['charenabled'] = "Hai abilitato il %s° personaggio di %s",
|
||||
['chardisabled'] = "Hai disabilitato il %s° personaggio di %s",
|
||||
['charnotfound'] = "Il personaggio %s di %s non esiste",
|
||||
['return_description'] ="Ritorna alla selezione dei personaggi" ,
|
||||
['char_play_description'] ="continua a giocare con questo personaggio",
|
||||
['char_delete_description'] = "elimina il personaggio selezionato",
|
||||
['return'] = "ritorna indietro",
|
||||
}
|
||||
Reference in New Issue
Block a user