mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 01:08:54 +00:00
d3aa7e48b4
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.
716 lines
20 KiB
Lua
716 lines
20 KiB
Lua
local pickups = {}
|
|
|
|
CreateThread(function()
|
|
while not Config.Multichar do
|
|
Wait(0)
|
|
if NetworkIsPlayerActive(PlayerId()) then
|
|
exports.spawnmanager:setAutoSpawn(false)
|
|
DoScreenFadeOut(0)
|
|
Wait(500)
|
|
TriggerServerEvent('esx:onPlayerJoined')
|
|
break
|
|
end
|
|
end
|
|
end)
|
|
|
|
RegisterNetEvent("esx:requestModel", function(model)
|
|
ESX.Streaming.RequestModel(model)
|
|
end)
|
|
|
|
RegisterNetEvent('esx:playerLoaded')
|
|
AddEventHandler('esx:playerLoaded', function(xPlayer, isNew, skin)
|
|
ESX.PlayerData = xPlayer
|
|
|
|
if Config.Multichar then
|
|
Wait(3000)
|
|
else
|
|
exports.spawnmanager:spawnPlayer({
|
|
x = ESX.PlayerData.coords.x,
|
|
y = ESX.PlayerData.coords.y,
|
|
z = ESX.PlayerData.coords.z + 0.25,
|
|
heading = ESX.PlayerData.coords.heading,
|
|
model = `mp_m_freemode_01`,
|
|
skipFade = false
|
|
}, function()
|
|
TriggerServerEvent('esx:onPlayerSpawn')
|
|
TriggerEvent('esx:onPlayerSpawn')
|
|
TriggerEvent('esx:restoreLoadout')
|
|
|
|
if isNew then
|
|
TriggerEvent('skinchanger:loadDefaultModel', skin.sex == 0)
|
|
elseif skin then
|
|
TriggerEvent('skinchanger:loadSkin', skin)
|
|
end
|
|
|
|
TriggerEvent('esx:loadingScreenOff')
|
|
ShutdownLoadingScreen()
|
|
ShutdownLoadingScreenNui()
|
|
end)
|
|
end
|
|
|
|
ESX.PlayerLoaded = true
|
|
|
|
while ESX.PlayerData.ped == nil do Wait(20) end
|
|
|
|
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
|
|
|
|
if Config.DisableHealthRegeneration then
|
|
Sleep = false
|
|
SetPlayerHealthRechargeMultiplier(PlayerId, 0.0)
|
|
end
|
|
|
|
if Config.DisableWeaponWheel then
|
|
Sleep = false
|
|
BlockWeaponWheelThisFrame()
|
|
DisableControlAction(0, 37,true)
|
|
end
|
|
|
|
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)
|
|
RemoveAllPickupsOfType(0xF9AFB48F)
|
|
RemoveAllPickupsOfType(0xA9355DCD)
|
|
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)
|
|
|
|
if Config.EnableHud then
|
|
for i=1, #(ESX.PlayerData.accounts) do
|
|
local accountTpl = '<div><img src="img/accounts/' .. ESX.PlayerData.accounts[i].name .. '.png"/> {{money}}</div>'
|
|
ESX.UI.HUD.RegisterElement('account_' .. ESX.PlayerData.accounts[i].name, i, 0, accountTpl, {money = ESX.Math.GroupDigits(ESX.PlayerData.accounts[i].money)})
|
|
end
|
|
|
|
local jobTpl = '<div>{{job_label}}{{grade_label}}</div>'
|
|
|
|
local gradeLabel = ESX.PlayerData.job.grade_label ~= ESX.PlayerData.job.label and ESX.PlayerData.job.grade_label or ''
|
|
if gradeLabel ~= '' then gradeLabel = ' - '..gradeLabel end
|
|
|
|
ESX.UI.HUD.RegisterElement('job', #ESX.PlayerData.accounts, 0, jobTpl, {
|
|
job_label = ESX.PlayerData.job.label,
|
|
grade_label = gradeLabel
|
|
})
|
|
end
|
|
|
|
SetDefaultVehicleNumberPlateTextPattern(-1, Config.CustomAIPlates)
|
|
StartServerSyncLoops()
|
|
end)
|
|
|
|
RegisterNetEvent('esx:onPlayerLogout')
|
|
AddEventHandler('esx:onPlayerLogout', function()
|
|
ESX.PlayerLoaded = false
|
|
if Config.EnableHud then ESX.UI.HUD.Reset() end
|
|
end)
|
|
|
|
RegisterNetEvent('esx:setMaxWeight')
|
|
AddEventHandler('esx:setMaxWeight', function(newMaxWeight) ESX.SetPlayerData("maxWeight", newMaxWeight) end)
|
|
|
|
local function onPlayerSpawn()
|
|
ESX.SetPlayerData('ped', PlayerPedId())
|
|
ESX.SetPlayerData('dead', false)
|
|
end
|
|
|
|
AddEventHandler('playerSpawned', onPlayerSpawn)
|
|
AddEventHandler('esx:onPlayerSpawn', onPlayerSpawn)
|
|
|
|
AddEventHandler('esx:onPlayerDeath', function()
|
|
ESX.SetPlayerData('ped', PlayerPedId())
|
|
ESX.SetPlayerData('dead', true)
|
|
end)
|
|
|
|
AddEventHandler('skinchanger:modelLoaded', function()
|
|
while not ESX.PlayerLoaded do
|
|
Wait(100)
|
|
end
|
|
TriggerEvent('esx:restoreLoadout')
|
|
end)
|
|
|
|
AddEventHandler('esx:restoreLoadout', function()
|
|
ESX.SetPlayerData('ped', PlayerPedId())
|
|
|
|
if not Config.OxInventory then
|
|
local ammoTypes = {}
|
|
RemoveAllPedWeapons(ESX.PlayerData.ped, true)
|
|
|
|
for k,v in ipairs(ESX.PlayerData.loadout) do
|
|
local weaponName = v.name
|
|
local weaponHash = joaat(weaponName)
|
|
|
|
GiveWeaponToPed(ESX.PlayerData.ped, weaponHash, 0, false, false)
|
|
SetPedWeaponTintIndex(ESX.PlayerData.ped, weaponHash, v.tintIndex)
|
|
|
|
local ammoType = GetPedAmmoTypeFromWeapon(ESX.PlayerData.ped, weaponHash)
|
|
|
|
for k2,v2 in ipairs(v.components) do
|
|
local componentHash = ESX.GetWeaponComponent(weaponName, v2).hash
|
|
GiveWeaponComponentToPed(ESX.PlayerData.ped, weaponHash, componentHash)
|
|
end
|
|
|
|
if not ammoTypes[ammoType] then
|
|
AddAmmoToPed(ESX.PlayerData.ped, weaponHash, v.ammo)
|
|
ammoTypes[ammoType] = true
|
|
end
|
|
end
|
|
end
|
|
end)
|
|
|
|
AddStateBagChangeHandler('VehicleProperties', nil, function(bagName, key, value)
|
|
if value then
|
|
Wait(0)
|
|
local NetId = value.NetId
|
|
local Vehicle = NetworkGetEntityFromNetworkId(NetId)
|
|
local Tries = 0
|
|
while Vehicle == 0 do
|
|
Vehicle = NetworkGetEntityFromNetworkId(NetId)
|
|
Wait(100)
|
|
Tries = Tries + 1
|
|
if Tries > 300 then
|
|
break
|
|
end
|
|
end
|
|
if NetworkGetEntityOwner(Vehicle) == PlayerId() then
|
|
ESX.Game.SetVehicleProperties(Vehicle, value)
|
|
end
|
|
end
|
|
end)
|
|
|
|
RegisterNetEvent('esx:setAccountMoney')
|
|
AddEventHandler('esx:setAccountMoney', function(account)
|
|
for i=1, #(ESX.PlayerData.accounts) do
|
|
if ESX.PlayerData.accounts[i].name == account.name then
|
|
ESX.PlayerData.accounts[i] = account
|
|
break
|
|
end
|
|
end
|
|
|
|
ESX.SetPlayerData('accounts', ESX.PlayerData.accounts)
|
|
|
|
if Config.EnableHud then
|
|
ESX.UI.HUD.UpdateElement('account_' .. account.name, {
|
|
money = ESX.Math.GroupDigits(account.money)
|
|
})
|
|
end
|
|
end)
|
|
|
|
if not Config.OxInventory then
|
|
RegisterNetEvent('esx:addInventoryItem')
|
|
AddEventHandler('esx:addInventoryItem', function(item, count, showNotification)
|
|
for k,v in ipairs(ESX.PlayerData.inventory) do
|
|
if v.name == item then
|
|
ESX.UI.ShowInventoryItemNotification(true, v.label, count - v.count)
|
|
ESX.PlayerData.inventory[k].count = count
|
|
break
|
|
end
|
|
end
|
|
|
|
if showNotification then
|
|
ESX.UI.ShowInventoryItemNotification(true, item, count)
|
|
end
|
|
|
|
ESX.ShowInventory()
|
|
end)
|
|
|
|
RegisterNetEvent('esx:removeInventoryItem')
|
|
AddEventHandler('esx:removeInventoryItem', function(item, count, showNotification)
|
|
for k,v in ipairs(ESX.PlayerData.inventory) do
|
|
if v.name == item then
|
|
ESX.UI.ShowInventoryItemNotification(false, v.label, v.count - count)
|
|
ESX.PlayerData.inventory[k].count = count
|
|
break
|
|
end
|
|
end
|
|
|
|
if showNotification then
|
|
ESX.UI.ShowInventoryItemNotification(false, item, count)
|
|
end
|
|
|
|
ESX.ShowInventory()
|
|
end)
|
|
|
|
RegisterNetEvent('esx:addWeapon')
|
|
AddEventHandler('esx:addWeapon', function(weapon, ammo)
|
|
print("[^1ERROR^7] event ^5'esx:addWeapon'^7 Has Been Removed. Please use ^5xPlayer.addWeapon^7 Instead!")
|
|
end)
|
|
|
|
RegisterNetEvent('esx:addWeaponComponent')
|
|
AddEventHandler('esx:addWeaponComponent', function(weapon, weaponComponent)
|
|
print("[^1ERROR^7] event ^5'esx:addWeaponComponent'^7 Has Been Removed. Please use ^5xPlayer.addWeaponComponent^7 Instead!")
|
|
end)
|
|
|
|
RegisterNetEvent('esx:setWeaponAmmo')
|
|
AddEventHandler('esx:setWeaponAmmo', function(weapon, weaponAmmo)
|
|
print("[^1ERROR^7] event ^5'esx:setWeaponAmmo'^7 Has Been Removed. Please use ^5xPlayer.addWeaponAmmo^7 Instead!")
|
|
end)
|
|
|
|
RegisterNetEvent('esx:setWeaponTint')
|
|
AddEventHandler('esx:setWeaponTint', function(weapon, weaponTintIndex)
|
|
SetPedWeaponTintIndex(ESX.PlayerData.ped, joaat(weapon), weaponTintIndex)
|
|
|
|
end)
|
|
|
|
RegisterNetEvent('esx:removeWeapon')
|
|
AddEventHandler('esx:removeWeapon', function(weapon)
|
|
local playerPed = ESX.PlayerData.ped
|
|
RemoveWeaponFromPed(ESX.PlayerData.ped, joaat(weapon))
|
|
SetPedAmmo(ESX.PlayerData.ped, joaat(weapon), 0)
|
|
end)
|
|
|
|
RegisterNetEvent('esx:removeWeaponComponent')
|
|
AddEventHandler('esx:removeWeaponComponent', function(weapon, weaponComponent)
|
|
local componentHash = ESX.GetWeaponComponent(weapon, weaponComponent).hash
|
|
RemoveWeaponComponentFromPed(ESX.PlayerData.ped, joaat(weapon), componentHash)
|
|
end)
|
|
end
|
|
|
|
RegisterNetEvent('esx:setJob')
|
|
AddEventHandler('esx:setJob', function(Job)
|
|
if Config.EnableHud then
|
|
local gradeLabel = Job.grade_label ~= Job.label and Job.grade_label or ''
|
|
if gradeLabel ~= '' then gradeLabel = ' - '..gradeLabel end
|
|
ESX.UI.HUD.UpdateElement('job', {
|
|
job_label = Job.label,
|
|
grade_label = gradeLabel
|
|
})
|
|
end
|
|
ESX.SetPlayerData('job', Job)
|
|
end)
|
|
|
|
if not Config.OxInventory then
|
|
RegisterNetEvent('esx:createPickup')
|
|
AddEventHandler('esx:createPickup', function(pickupId, label, coords, type, name, components, tintIndex)
|
|
local function setObjectProperties(object)
|
|
SetEntityAsMissionEntity(object, true, false)
|
|
PlaceObjectOnGroundProperly(object)
|
|
FreezeEntityPosition(object, true)
|
|
SetEntityCollision(object, false, true)
|
|
|
|
pickups[pickupId] = {
|
|
obj = object,
|
|
label = label,
|
|
inRange = false,
|
|
coords = vector3(coords.x, coords.y, coords.z)
|
|
}
|
|
end
|
|
|
|
if type == 'item_weapon' then
|
|
local weaponHash = joaat(name)
|
|
ESX.Streaming.RequestWeaponAsset(weaponHash)
|
|
local pickupObject = CreateWeaponObject(weaponHash, 50, coords.x, coords.y, coords.z, true, 1.0, 0)
|
|
SetWeaponObjectTintIndex(pickupObject, tintIndex)
|
|
|
|
for k,v in ipairs(components) do
|
|
local component = ESX.GetWeaponComponent(name, v)
|
|
GiveWeaponComponentToWeaponObject(pickupObject, component.hash)
|
|
end
|
|
|
|
setObjectProperties(pickupObject)
|
|
else
|
|
ESX.Game.SpawnLocalObject('prop_money_bag_01', coords, setObjectProperties)
|
|
end
|
|
end)
|
|
|
|
RegisterNetEvent('esx:createMissingPickups')
|
|
AddEventHandler('esx:createMissingPickups', function(missingPickups)
|
|
for pickupId, pickup in pairs(missingPickups) do
|
|
TriggerEvent('esx:createPickup', pickupId, pickup.label, pickup.coords - vector3(0,0, 1.0), pickup.type, pickup.name, pickup.components, pickup.tintIndex)
|
|
end
|
|
end)
|
|
end
|
|
|
|
RegisterNetEvent('esx:registerSuggestions')
|
|
AddEventHandler('esx:registerSuggestions', function(registeredCommands)
|
|
for name,command in pairs(registeredCommands) do
|
|
if command.suggestion then
|
|
TriggerEvent('chat:addSuggestion', ('/%s'):format(name), command.suggestion.help, command.suggestion.arguments)
|
|
end
|
|
end
|
|
end)
|
|
|
|
if not Config.OxInventory then
|
|
RegisterNetEvent('esx:removePickup')
|
|
AddEventHandler('esx:removePickup', function(pickupId)
|
|
if pickups[pickupId] and pickups[pickupId].obj then
|
|
ESX.Game.DeleteObject(pickups[pickupId].obj)
|
|
pickups[pickupId] = nil
|
|
end
|
|
end)
|
|
end
|
|
|
|
-- Pause menu disables HUD display
|
|
if Config.EnableHud then
|
|
CreateThread(function()
|
|
local isPaused = false
|
|
|
|
while true do
|
|
local time = 500
|
|
Wait(time)
|
|
|
|
if IsPauseMenuActive() and not isPaused then
|
|
time = 100
|
|
isPaused = true
|
|
ESX.UI.HUD.SetDisplay(0.0)
|
|
elseif not IsPauseMenuActive() and isPaused then
|
|
time = 100
|
|
isPaused = false
|
|
ESX.UI.HUD.SetDisplay(1.0)
|
|
end
|
|
end
|
|
end)
|
|
|
|
AddEventHandler('esx:loadingScreenOff', function()
|
|
ESX.UI.HUD.SetDisplay(1.0)
|
|
end)
|
|
end
|
|
|
|
function StartServerSyncLoops()
|
|
if not Config.OxInventory then
|
|
-- keep track of ammo
|
|
|
|
CreateThread(function()
|
|
local currentWeapon = {Ammo = 0}
|
|
while ESX.PlayerLoaded do
|
|
local sleep = 1500
|
|
if GetSelectedPedWeapon(ESX.PlayerData.ped) ~= -1569615261 then
|
|
sleep = 1000
|
|
local _,weaponHash = GetCurrentPedWeapon(ESX.PlayerData.ped, true)
|
|
local weapon = ESX.GetWeaponFromHash(weaponHash)
|
|
if weapon then
|
|
local ammoCount = GetAmmoInPedWeapon(ESX.PlayerData.ped, weaponHash)
|
|
if weapon.name ~= currentWeapon.name then
|
|
currentWeapon.Ammo = ammoCount
|
|
currentWeapon.name = weapon.name
|
|
else
|
|
if ammoCount ~= currentWeapon.Ammo then
|
|
currentWeapon.Ammo = ammoCount
|
|
TriggerServerEvent('esx:updateWeaponAmmo', weapon.name, ammoCount)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
Wait(sleep)
|
|
end
|
|
end)
|
|
end
|
|
end
|
|
|
|
if not Config.OxInventory and Config.EnableDefaultInventory then
|
|
RegisterCommand('showinv', function()
|
|
if not ESX.PlayerData.dead then
|
|
ESX.ShowInventory()
|
|
end
|
|
end)
|
|
|
|
RegisterKeyMapping('showinv', TranslateCap('keymap_showinventory'), 'keyboard', 'F2')
|
|
end
|
|
|
|
-- disable wanted level
|
|
if not Config.EnableWantedLevel then
|
|
ClearPlayerWantedLevel(PlayerId())
|
|
SetMaxWantedLevel(0)
|
|
end
|
|
|
|
if not Config.OxInventory then
|
|
CreateThread(function()
|
|
while true do
|
|
local Sleep = 1500
|
|
local playerCoords = GetEntityCoords(ESX.PlayerData.ped)
|
|
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer(playerCoords)
|
|
|
|
for pickupId,pickup in pairs(pickups) do
|
|
local distance = #(playerCoords - pickup.coords)
|
|
|
|
if distance < 5 then
|
|
Sleep = 0
|
|
local label = pickup.label
|
|
|
|
if distance < 1 then
|
|
if IsControlJustReleased(0, 38) then
|
|
if IsPedOnFoot(ESX.PlayerData.ped) and (closestDistance == -1 or closestDistance > 3) and not pickup.inRange then
|
|
pickup.inRange = true
|
|
|
|
local dict, anim = 'weapons@first_person@aim_rng@generic@projectile@sticky_bomb@', 'plant_floor'
|
|
ESX.Streaming.RequestAnimDict(dict)
|
|
TaskPlayAnim(ESX.PlayerData.ped, dict, anim, 8.0, 1.0, 1000, 16, 0.0, false, false, false)
|
|
RemoveAnimDict(dict)
|
|
Wait(1000)
|
|
|
|
TriggerServerEvent('esx:onPickup', pickupId)
|
|
PlaySoundFrontend(-1, 'PICK_UP', 'HUD_FRONTEND_DEFAULT_SOUNDSET', false)
|
|
end
|
|
end
|
|
|
|
label = ('%s~n~%s'):format(label, TranslateCap('threw_pickup_prompt'))
|
|
end
|
|
|
|
ESX.Game.Utils.DrawText3D({
|
|
x = pickup.coords.x,
|
|
y = pickup.coords.y,
|
|
z = pickup.coords.z + 0.25
|
|
}, label, 1.2, 1)
|
|
elseif pickup.inRange then
|
|
pickup.inRange = false
|
|
end
|
|
end
|
|
Wait(Sleep)
|
|
end
|
|
end)
|
|
end
|
|
|
|
----- Admin commnads from esx_adminplus
|
|
|
|
RegisterNetEvent("esx:tpm")
|
|
AddEventHandler("esx:tpm", function()
|
|
local GetEntityCoords = GetEntityCoords
|
|
local GetGroundZFor_3dCoord = GetGroundZFor_3dCoord
|
|
local GetFirstBlipInfoId = GetFirstBlipInfoId
|
|
local DoesBlipExist = DoesBlipExist
|
|
local DoScreenFadeOut = DoScreenFadeOut
|
|
local GetBlipInfoIdCoord = GetBlipInfoIdCoord
|
|
local GetVehiclePedIsIn = GetVehiclePedIsIn
|
|
|
|
ESX.TriggerServerCallback("esx:isUserAdmin", function(admin)
|
|
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 not admin then
|
|
return
|
|
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")
|
|
AddEventHandler("esx:killPlayer", function()
|
|
SetEntityHealth(ESX.PlayerData.ped, 0)
|
|
end)
|
|
|
|
RegisterNetEvent("esx:freezePlayer")
|
|
AddEventHandler("esx:freezePlayer", function(input)
|
|
local player = PlayerId()
|
|
if input == 'freeze' then
|
|
SetEntityCollision(ESX.PlayerData.ped, false)
|
|
FreezeEntityPosition(ESX.PlayerData.ped, true)
|
|
SetPlayerInvincible(player, true)
|
|
elseif input == 'unfreeze' then
|
|
SetEntityCollision(ESX.PlayerData.ped, true)
|
|
FreezeEntityPosition(ESX.PlayerData.ped, false)
|
|
SetPlayerInvincible(player, false)
|
|
end
|
|
end)
|
|
|
|
RegisterNetEvent("esx:GetVehicleType", function(Model, Request)
|
|
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',
|
|
'es_admin2',
|
|
'basic-gamemode',
|
|
'mapmanager',
|
|
'fivem-map-skater',
|
|
'fivem-map-hipster',
|
|
'qb-core',
|
|
'default_spawnpoint',
|
|
}
|
|
|
|
for i=1, #DoNotUse do
|
|
if GetResourceState(DoNotUse[i]) == 'started' or GetResourceState(DoNotUse[i]) == 'starting' then
|
|
print("[^1ERROR^7] YOU ARE USING A RESOURCE THAT WILL BREAK ^1ESX^7, PLEASE REMOVE ^5"..DoNotUse[i].."^7")
|
|
end
|
|
end
|