mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-03 11:48:53 +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.
317 lines
10 KiB
Lua
317 lines
10 KiB
Lua
local mp_m_freemode_01 = `mp_m_freemode_01`
|
|
local mp_f_freemode_01 = `mp_f_freemode_01`
|
|
if ESX.GetConfig().Multichar then
|
|
|
|
CreateThread(function()
|
|
while not ESX.PlayerLoaded do
|
|
Wait(0)
|
|
if NetworkIsPlayerActive(PlayerId()) then
|
|
exports.spawnmanager:setAutoSpawn(false)
|
|
DoScreenFadeOut(0)
|
|
while not GetResourceState('esx_context') == 'started' do
|
|
Wait(0)
|
|
end
|
|
TriggerEvent("esx_multicharacter:SetupCharacters")
|
|
break
|
|
end
|
|
end
|
|
end)
|
|
|
|
local canRelog, cam, spawned = true, nil, nil
|
|
local Characters = {}
|
|
|
|
RegisterNetEvent('esx_multicharacter:SetupCharacters')
|
|
AddEventHandler('esx_multicharacter:SetupCharacters', function()
|
|
ESX.PlayerLoaded = false
|
|
ESX.PlayerData = {}
|
|
spawned = false
|
|
cam = CreateCam("DEFAULT_SCRIPTED_CAMERA", true)
|
|
local playerPed = PlayerPedId()
|
|
SetEntityCoords(playerPed, Config.Spawn.x, Config.Spawn.y, Config.Spawn.z, true, false, false, false)
|
|
SetEntityHeading(playerPed, Config.Spawn.w)
|
|
local offset = GetOffsetFromEntityInWorldCoords(playerPed, 0, 1.7, 0.4)
|
|
DoScreenFadeOut(0)
|
|
SetCamActive(cam, true)
|
|
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.HUD.SetDisplay(0.0)
|
|
StartLoop()
|
|
ShutdownLoadingScreen()
|
|
ShutdownLoadingScreenNui()
|
|
TriggerEvent('esx:loadingScreenOff')
|
|
Wait(200)
|
|
TriggerServerEvent("esx_multicharacter:SetupCharacters")
|
|
end)
|
|
|
|
StartLoop = function()
|
|
hidePlayers = true
|
|
MumbleSetVolumeOverride(PlayerId(), 0.0)
|
|
CreateThread(function()
|
|
local keys = {18, 27, 172, 173, 174, 175, 176, 177, 187, 188, 191, 201, 108, 109}
|
|
while hidePlayers do
|
|
DisableAllControlActions(0)
|
|
for i = 1, #keys do
|
|
EnableControlAction(0, keys[i], true)
|
|
end
|
|
SetEntityVisible(PlayerPedId(), 0, 0)
|
|
SetLocalPlayerVisibleLocally(1)
|
|
SetPlayerInvincible(PlayerId(), 1)
|
|
ThefeedHideThisFrame()
|
|
HideHudComponentThisFrame(11)
|
|
HideHudComponentThisFrame(12)
|
|
HideHudComponentThisFrame(21)
|
|
HideHudAndRadarThisFrame()
|
|
Wait(0)
|
|
local vehicles = GetGamePool('CVehicle')
|
|
for i = 1, #vehicles do
|
|
SetEntityLocallyInvisible(vehicles[i])
|
|
end
|
|
end
|
|
local playerId, playerPed = PlayerId(), PlayerPedId()
|
|
MumbleSetVolumeOverride(playerId, -1.0)
|
|
SetEntityVisible(playerPed, 1, 0)
|
|
SetPlayerInvincible(playerId, 0)
|
|
FreezeEntityPosition(playerPed, false)
|
|
Wait(10000)
|
|
canRelog = true
|
|
end)
|
|
CreateThread(function()
|
|
local playerPool = {}
|
|
while hidePlayers do
|
|
local players = GetActivePlayers()
|
|
for i = 1, #players do
|
|
local player = players[i]
|
|
if player ~= PlayerId() and not playerPool[player] then
|
|
playerPool[player] = true
|
|
NetworkConcealPlayer(player, true, true)
|
|
end
|
|
end
|
|
Wait(500)
|
|
end
|
|
for k in pairs(playerPool) do
|
|
NetworkConcealPlayer(k, false, false)
|
|
end
|
|
end)
|
|
end
|
|
|
|
SetupCharacter = function(index)
|
|
if spawned == false then
|
|
exports.spawnmanager:spawnPlayer({
|
|
x = Config.Spawn.x,
|
|
y = Config.Spawn.y,
|
|
z = Config.Spawn.z,
|
|
heading = Config.Spawn.w,
|
|
model = Characters[index].model or mp_m_freemode_01,
|
|
skipFade = true
|
|
}, function()
|
|
canRelog = false
|
|
if Characters[index] then
|
|
local skin = Characters[index].skin or Config.Default
|
|
if not Characters[index].model then
|
|
if Characters[index].sex == TranslateCap('female') then skin.sex = 1 else skin.sex = 0 end
|
|
end
|
|
TriggerEvent('skinchanger:loadSkin', skin)
|
|
end
|
|
DoScreenFadeIn(600)
|
|
end)
|
|
repeat Wait(200) until not IsScreenFadedOut()
|
|
|
|
elseif Characters[index] and Characters[index].skin then
|
|
if Characters[spawned] and Characters[spawned].model then
|
|
RequestModel(Characters[index].model)
|
|
while not HasModelLoaded(Characters[index].model) do
|
|
RequestModel(Characters[index].model)
|
|
Wait(0)
|
|
end
|
|
SetPlayerModel(PlayerId(), Characters[index].model)
|
|
SetModelAsNoLongerNeeded(Characters[index].model)
|
|
end
|
|
TriggerEvent('skinchanger:loadSkin', Characters[index].skin)
|
|
end
|
|
spawned = index
|
|
local playerPed = PlayerPedId()
|
|
FreezeEntityPosition(PlayerPedId(), true)
|
|
SetPedAoBlobRendering(playerPed, true)
|
|
SetEntityAlpha(playerPed, 255)
|
|
SendNUIMessage({
|
|
action = "openui",
|
|
character = Characters[spawned]
|
|
})
|
|
end
|
|
|
|
function CharacterOptions(Characters, slots, SelectedCharacter)
|
|
local elements = {{title = TranslateCap('character', Characters[SelectedCharacter.value].firstname .. " ".. Characters[SelectedCharacter.value].lastname),icon = "fa-regular fa-user", unselectable = true},
|
|
{title = TranslateCap('return'), unselectable = false,icon = "fa-solid fa-arrow-left",description = TranslateCap('return_description'), action = "return"}}
|
|
if not Characters[SelectedCharacter.value].disabled then
|
|
elements[3] = {title = TranslateCap('char_play'), description = TranslateCap('char_play_description'), icon ="fa-solid fa-play",action = 'play', value = SelectedCharacter.value}
|
|
else
|
|
elements[3] = {title = TranslateCap('char_disabled'), value = SelectedCharacter.value, icon ="fa-solid fa-xmark", description = TranslateCap('char_disabled_description'),}
|
|
end
|
|
if Config.CanDelete then elements[4] = {title = TranslateCap('char_delete'),icon ="fa-solid fa-xmark",description = TranslateCap('char_delete_description'), action = 'delete', value = SelectedCharacter.value} end
|
|
ESX.OpenContext("left", elements, function(element, Action)
|
|
if Action.action == "play" then
|
|
SendNUIMessage({
|
|
action = "closeui"
|
|
})
|
|
ESX.CloseContext()
|
|
TriggerServerEvent('esx_multicharacter:CharacterChosen', Action.value, false)
|
|
elseif Action.action == "delete" then
|
|
ESX.CloseContext()
|
|
TriggerServerEvent('esx_multicharacter:DeleteCharacter', Action.value)
|
|
spawned = false
|
|
elseif Action.action == "return" then
|
|
SelectCharacterMenu(Characters, slots)
|
|
end
|
|
end, nil, false)
|
|
end
|
|
|
|
function SelectCharacterMenu(Characters, slots)
|
|
local Character = next(Characters)
|
|
local elements = {{title = TranslateCap('select_char') , icon = "fa-solid fa-users", description = TranslateCap('select_char_description') , unselectable = true}}
|
|
for k,v in pairs(Characters) do
|
|
if not v.model and v.skin then
|
|
if v.skin.model then v.model = v.skin.model elseif v.skin.sex == 1 then v.model = mp_f_freemode_01 else v.model = mp_m_freemode_01 end
|
|
end
|
|
if spawned == false then SetupCharacter(Character) end
|
|
local label = v.firstname..' '..v.lastname
|
|
if Characters[k].disabled then
|
|
elements[#elements+1] = {title = label,icon = "fa-regular fa-user", value = v.id}
|
|
else
|
|
elements[#elements+1] = {title = label,icon = "fa-regular fa-user", value = v.id}
|
|
end
|
|
end
|
|
if #elements - 1 < slots then
|
|
elements[#elements+1] = {title = TranslateCap('create_char'), icon = "fa-solid fa-plus", value = (#elements+1), new = true}
|
|
end
|
|
|
|
ESX.OpenContext("left", elements, function(menu, SelectedCharacter)
|
|
if SelectedCharacter.new then
|
|
ESX.CloseContext()
|
|
local GetSlot = function()
|
|
for i = 1, slots do
|
|
if not Characters[i] then
|
|
return i
|
|
end
|
|
end
|
|
end
|
|
local slot = GetSlot()
|
|
TriggerServerEvent('esx_multicharacter:CharacterChosen', slot, true)
|
|
TriggerEvent('esx_identity:showRegisterIdentity')
|
|
local playerPed = PlayerPedId()
|
|
SetPedAoBlobRendering(playerPed, false)
|
|
SetEntityAlpha(playerPed, 0)
|
|
SendNUIMessage({
|
|
action = "closeui"
|
|
})
|
|
else
|
|
CharacterOptions(Characters,slots, SelectedCharacter)
|
|
SetupCharacter(SelectedCharacter.value)
|
|
local playerPed = PlayerPedId()
|
|
SetPedAoBlobRendering(playerPed, true)
|
|
ResetEntityAlpha(playerPed)
|
|
end
|
|
end, nil, false)
|
|
end
|
|
RegisterNetEvent('esx_multicharacter:SetupUI')
|
|
AddEventHandler('esx_multicharacter:SetupUI', function(data, slots)
|
|
DoScreenFadeOut(0)
|
|
Characters = data
|
|
slots = slots
|
|
local Character = next(Characters)
|
|
exports.spawnmanager:forceRespawn()
|
|
|
|
if not Character then
|
|
SendNUIMessage({
|
|
action = "closeui"
|
|
})
|
|
exports.spawnmanager:spawnPlayer({
|
|
x = Config.Spawn.x,
|
|
y = Config.Spawn.y,
|
|
z = Config.Spawn.z,
|
|
heading = Config.Spawn.w,
|
|
model = mp_m_freemode_01,
|
|
skipFade = true
|
|
}, function()
|
|
canRelog = false
|
|
DoScreenFadeIn(400)
|
|
Wait(400)
|
|
local playerPed = PlayerPedId()
|
|
SetPedAoBlobRendering(playerPed, false)
|
|
SetEntityAlpha(playerPed, 0)
|
|
TriggerServerEvent('esx_multicharacter:CharacterChosen', 1, true)
|
|
TriggerEvent('esx_identity:showRegisterIdentity')
|
|
end)
|
|
else
|
|
SelectCharacterMenu(Characters, slots)
|
|
end
|
|
end)
|
|
|
|
RegisterNetEvent('esx:playerLoaded')
|
|
AddEventHandler('esx:playerLoaded', function(playerData, isNew, skin)
|
|
local spawn = playerData.coords or Config.Spawn
|
|
if isNew or not skin or #skin == 1 then
|
|
local finished = false
|
|
skin = Config.Default[playerData.sex]
|
|
skin.sex = playerData.sex == "m" and 0 or 1
|
|
local model = skin.sex == 0 and mp_m_freemode_01 or mp_f_freemode_01
|
|
RequestModel(model)
|
|
while not HasModelLoaded(model) do
|
|
RequestModel(model)
|
|
Wait(0)
|
|
end
|
|
SetPlayerModel(PlayerId(), model)
|
|
SetModelAsNoLongerNeeded(model)
|
|
TriggerEvent('skinchanger:loadSkin', skin, function()
|
|
local playerPed = PlayerPedId()
|
|
SetPedAoBlobRendering(playerPed, true)
|
|
ResetEntityAlpha(playerPed)
|
|
TriggerEvent('esx_skin:openSaveableMenu', function()
|
|
finished = true end, function() finished = true
|
|
end)
|
|
end)
|
|
repeat Wait(200) until finished
|
|
end
|
|
DoScreenFadeOut(100)
|
|
|
|
SetCamActive(cam, false)
|
|
RenderScriptCams(false, false, 0, true, true)
|
|
cam = nil
|
|
local playerPed = PlayerPedId()
|
|
FreezeEntityPosition(playerPed, true)
|
|
SetEntityCoordsNoOffset(playerPed, spawn.x, spawn.y, spawn.z, false, false, false, true)
|
|
SetEntityHeading(playerPed, spawn.heading)
|
|
if not isNew then TriggerEvent('skinchanger:loadSkin', skin or Characters[spawned].skin) end
|
|
Wait(400)
|
|
DoScreenFadeIn(400)
|
|
repeat Wait(200) until not IsScreenFadedOut()
|
|
TriggerServerEvent('esx:onPlayerSpawn')
|
|
TriggerEvent('esx:onPlayerSpawn')
|
|
TriggerEvent('playerSpawned')
|
|
TriggerEvent('esx:restoreLoadout')
|
|
Characters, hidePlayers = {}, false
|
|
end)
|
|
|
|
RegisterNetEvent('esx:onPlayerLogout')
|
|
AddEventHandler('esx:onPlayerLogout', function()
|
|
DoScreenFadeOut(500)
|
|
Wait(1000)
|
|
spawned = false
|
|
TriggerEvent("esx_multicharacter:SetupCharacters")
|
|
TriggerEvent('esx_skin:resetFirstSpawn')
|
|
end)
|
|
|
|
if Config.Relog then
|
|
RegisterCommand('relog', function(source, args, rawCommand)
|
|
if canRelog == true then
|
|
canRelog = false
|
|
TriggerServerEvent('esx_multicharacter:relog')
|
|
ESX.SetTimeout(10000, function()
|
|
canRelog = true
|
|
end)
|
|
end
|
|
end)
|
|
end
|
|
|
|
end
|