From 1ebb812b1c641c2be197b8c7ce689588bbef64a5 Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Mon, 14 Jun 2021 20:56:19 +1000 Subject: [PATCH 1/7] Update readme.md --- readme.md | 49 +++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/readme.md b/readme.md index a28acaf..8d930b4 100644 --- a/readme.md +++ b/readme.md @@ -1,17 +1,9 @@ ### Requirements -#### [ESX Legacy](https://github.com/esx-framework/es_extended/tree/legacy) -- Minimum commit: 89f8d87 -- Legacy is an update from v1 Final with bug fixes, optimisations and some new features -#### [MySQL Async](https://github.com/brouznouf/fivem-mysql-async/releases/tag/3.3.2) -- Minimum commit: ec81359 -#### [ESX Identity](https://github.com/esx-framework/esx_identity) -- Minimum commit: 5d28b23 -- Required for character registration -#### [ESX Skin](https://github.com/esx-framework/esx_skin) -- Minimum commit: 3a81208 -- If you wish to use other resources, you will need to adjust events in multicharacter -#### [Spawnmanager](https://github.com/citizenfx/cfx-server-data/tree/master/resources/%5Bmanagers%5D/spawnmanager) -- Required for spawning as well as ESX Legacy +- [ESX Legacy](https://github.com/esx-framework/es_extended/tree/legacy) +- [MySQL Async](https://github.com/brouznouf/fivem-mysql-async/releases/tag/3.3.2) +- [ESX Identity](https://github.com/esx-framework/esx_identity) +- [ESX Skin](https://github.com/esx-framework/esx_skin) +- [Spawnmanager](https://github.com/citizenfx/cfx-server-data/tree/master/resources/%5Bmanagers%5D/spawnmanager) ### Installation - Modify your ESX config with `Config.Multichar = true` @@ -19,6 +11,26 @@ - All owner and identifier columns should be set to `VARCHAR(60)` to ensure correct data entry - Use the `varchar` command from the console to update your SQL tables - Once you have used the command you should just remove it for sanity's sake + +### Conflicts +* The following resources should not be used with ESX Legacy and can result in errors + - **essentialsmode** + - basic-gamemode + - fivem-map-skater + - fivem-map-hipster + - default_spawnpoint + - cui_character (or other resources that modify spawn behaviour) + +### Common issues +#### Black screen / loading scripts + - Download and run all requirements + - Ensure none of the conflicting resources are enabled +#### mysql-async duplicate entry + - You have not increased the VARCHAR size of your tables (use the command) + +#### The menu interface is esx_menu_default - you can use any version if you want a different appearance +![image](https://user-images.githubusercontent.com/65407488/119010385-592a8c80-b9d7-11eb-9aa1-eb7051004843.png) + ### Relogging - Modify the config with `Config.Relog = true` - Use the latest version of [ESX Status](https://github.com/esx-framework/esx_status) @@ -41,17 +53,6 @@ AddEventHandler('esx:onPlayerLogout', function() end) ``` -#### The menu interface is esx_menu_default - you can use any version if you want a different appearance -![image](https://user-images.githubusercontent.com/65407488/119010385-592a8c80-b9d7-11eb-9aa1-eb7051004843.png) - -## Conflicts -* The following resources should not be used with ESX Legacy and can result in errors - - **essentialsmode** - - basic-gamemode - - fivem-map-skater - - fivem-map-hipster - - default_spawnpoint - ### Notes - This resource is not compatible with ExtendedMode or previous versions of ESX - Legacy, skin, and identity must be updated to at least the minimum commits specified above From 8821e803bfaf9188280e55d6c28ef9be6fae7dab Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Wed, 16 Jun 2021 10:49:54 +1000 Subject: [PATCH 2/7] fix(client/main): Trigger the restoreLoadout event --- client/main.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/client/main.lua b/client/main.lua index 1952744..12ef7e6 100644 --- a/client/main.lua +++ b/client/main.lua @@ -290,6 +290,7 @@ if ESX.GetConfig().Multichar then TriggerServerEvent('esx:onPlayerSpawn') TriggerEvent('esx:onPlayerSpawn') TriggerEvent('playerSpawned') + TriggerEvent('esx:restoreLoadout') playerPed = PlayerPedId() FreezeEntityPosition(playerPed, false) SetEntityHeading(PlayerPed, spawn.heading) From dbb8444daae512f377c0550c88046d16e3845438 Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Wed, 16 Jun 2021 11:06:34 +1000 Subject: [PATCH 3/7] Update readme.md --- readme.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/readme.md b/readme.md index 8d930b4..1531c08 100644 --- a/readme.md +++ b/readme.md @@ -32,13 +32,10 @@ ![image](https://user-images.githubusercontent.com/65407488/119010385-592a8c80-b9d7-11eb-9aa1-eb7051004843.png) ### Relogging -- Modify the config with `Config.Relog = true` -- Use the latest version of [ESX Status](https://github.com/esx-framework/esx_status) -- If you have any threads running with `while true do` I recommend using `while ESX.PlayerLoaded do` instead - - For threads that are triggered by a spawn/load event this will ensure they do not start a second time - - You can clear loops that may break after ESX.PlayerData is cleared - - For an example, refer to my [boilerplate](https://github.com/thelindat/esx_legacy_boilerplate/blob/main/client.lua) -- Add the following event to any resources that will benefit from clearing ESX.PlayerData +- Do not enable this setting if you do not intend to properly set up relog support +- Requires the latest update for ESX Status (prevents multiple status ticks from running) +- Add the following events to resources that require support for relogging, or +- Add them to [@esx/imports.lua](https://github.com/esx-framework/es_extended/blob/legacy/imports.lua) (and use the imports in your resources) ```lua RegisterNetEvent('esx:playerLoaded') AddEventHandler('esx:playerLoaded', function(xPlayer) @@ -52,6 +49,10 @@ AddEventHandler('esx:onPlayerLogout', function() ESX.PlayerData = {} end) ``` +- Any threads using ESX.PlayerData in a loop should check if ESX.PlayerLoaded is true + - This ensures the resource does not error after relogging, or while on character selection + - Setup correctly you can break your loops and trigger them again after loading + - Refer to my [boilerplate](https://github.com/thelindat/esx_legacy_boilerplate) for more information and usage examples ### Notes - This resource is not compatible with ExtendedMode or previous versions of ESX From 11fa70ac545e688fff6684b2e046ae6cc0c64410 Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Wed, 16 Jun 2021 11:44:36 +1000 Subject: [PATCH 4/7] Update config.lua --- config.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/config.lua b/config.lua index d19cb5b..5612106 100644 --- a/config.lua +++ b/config.lua @@ -6,6 +6,7 @@ Config.Spawn = vector4(-113.7, 565.3, 196, 0) -------------------- -- Do not use unless you are prepared to adjust your resources to correctly reset data +-- Information: https://github.com/thelindat/esx_multicharacter#relogging Config.Relog = false -------------------- From 273c333cfef7f4664707631a97f9548de0a322e3 Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Fri, 18 Jun 2021 10:37:13 +1000 Subject: [PATCH 5/7] fix(server/main): Check if job/grade exist --- server/main.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/server/main.lua b/server/main.lua index 87c10aa..84127c9 100644 --- a/server/main.lua +++ b/server/main.lua @@ -27,16 +27,20 @@ if ESX.GetConfig().Multichar == true then }, function(result) local characters = {} for i=1, #result, 1 do - local job = ESX.Jobs[result[i].job] - local grade = ESX.Jobs[job.name].grades[tostring(result[i].job_grade)].label + local job, grade = result[1].job, tostring(result[1].job_grade) + if ESX.Jobs[job] and ESX.Jobs[job].grades[grade] then + grade = ESX.Jobs[job].grades[grade].label + job = ESX.Jobs[job].label + else + job, grade = 'Unemployed', '' + end local accounts = json.decode(result[i].accounts) - if grade == 'Unemployed' then grade = '' end local id = tonumber(string.sub(result[i].identifier, #Config.Prefix+1, string.find(result[i].identifier, ':')-1)) characters[id] = { id = id, bank = accounts.bank, money = accounts.money, - job = job.label, + job = job, job_grade = grade, firstname = result[i].firstname, lastname = result[i].lastname, From 8288fe6d42582cc2a0b35abaf95e603b5dbd06d6 Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Fri, 18 Jun 2021 10:41:39 +1000 Subject: [PATCH 6/7] fix(client/main): Maybe fix invalid skin Have no idea why the Character index skin wouldn't be set already --- client/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index 12ef7e6..aa787e2 100644 --- a/client/main.lua +++ b/client/main.lua @@ -283,7 +283,7 @@ if ESX.GetConfig().Multichar then end) end) else - TriggerEvent('skinchanger:loadSkin', Characters[Spawned].skin) + TriggerEvent('skinchanger:loadSkin', skin or Characters[Spawned].skin) Citizen.Wait(1500) end Characters = {} From 252a987798728473d75a85ae5fa41d00d6d5dd89 Mon Sep 17 00:00:00 2001 From: Ali <74619504+Utinax@users.noreply.github.com> Date: Mon, 21 Jun 2021 07:33:26 +0300 Subject: [PATCH 7/7] Turkish translation implemented. (#15) * Create tr.lua * Create tr.js --- html/locales/tr.js | 8 ++++++++ locales/tr.lua | 9 +++++++++ 2 files changed, 17 insertions(+) create mode 100644 html/locales/tr.js create mode 100644 locales/tr.lua diff --git a/html/locales/tr.js b/html/locales/tr.js new file mode 100644 index 0000000..ab82073 --- /dev/null +++ b/html/locales/tr.js @@ -0,0 +1,8 @@ +const translate = new Object(); + +translate.name = "İsim"; +translate.job = "Meslek"; +translate.bank = "Banka"; +translate.money = "Nakit"; +translate.gender = "Cinsiyet"; +translate.dob = "Doğum Tarihi"; diff --git a/locales/tr.lua b/locales/tr.lua new file mode 100644 index 0000000..6fc35da --- /dev/null +++ b/locales/tr.lua @@ -0,0 +1,9 @@ +Locales['tr'] = { + ['delete_label'] = "Sil %s %s?", + ['select_char'] = "Karakter Seç", + ['create_char'] = "Yeni Karakter Oluştur", + ['char_play'] = "Bu Karakterle Oyna", + ['char_delete'] = "Bu Karakteri Sil", + ['cancel'] = "İptal", + ['confirm'] = "Onayla", +}