From 1372d6fe853910b63b4600ad49bdb976fa815d37 Mon Sep 17 00:00:00 2001 From: Linden Date: Mon, 7 Jun 2021 10:11:13 +1000 Subject: [PATCH 1/7] Update README.md --- README.md | 80 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 60 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index e57318b4..52cc01a4 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,57 @@ -# es_extended LEGACY / BROKEN / WONTFIX +

ESX Legacy

There is no official support for this resource. Create a thread on the ESX Server Development board or find a support Discord.
-### Things hapenning here now https://github.com/ESX-Org/es_extended/tree/develop (WIP) -es_extended is a roleplay framework for FiveM. The to-go framework for creating an economy based roleplay server on FiveM and most popular on the platform, too! +ESX is the most popular framework for creating an economy-based roleplay server on FiveM, with many more official and unofficial resources designed to utilise the tools provided by this resource. Here's a taste of what's available: +``` +esx_identity: enable character registration using a name, sex, and date of birth +esx_society: add employee management, society funds and more +esx_billing: add support for registered societies to fine or bill players +esx_vehicleshop: allow players to purchase vehicles directly or from players +esx_ambulancejob: adds a death and respawn system while allowing players to become EMS and revive +esx_policejob: allow players to become cops and protect the city +``` +Many more resources are available on the [ESX Framework Github](https://github.com/esx-framework) and [ESX Community Github](https://github.com/esx-community/) pages. -Featuring many extra resources to fit roleplaying servers, here's a taste of what's available: -- esx_ambulancejob: play as a medic to revive players who are bleeding out. Complete with garages and respawn & bleedout system -- esx_policejob: patrol the city and arrest players commiting crime, with armory, outfit room and garages -- esx_vehicleshop: roleplay working in an vehicle dealership where you sell cars to players - -ESX was initially developed by Gizz back in 2017 for his friend as the were creating an FiveM server and there wasn't any economy roleplaying frameworks available. The original code was written within a week or two and later open sourced, it has ever since been improved and parts been rewritten to further improve on it. - -## Links & Read more +## Information - [ESX Forum](https://forum.esx-framework.org/) - [ESX Documentation](https://wiki.esx-framework.org/) - [ESX Development Discord](https://discord.me/esx) - [FiveM Native Reference](https://runtime.fivem.net/doc/reference.html) -## Features +ESX was initially developed by Gizz back in 2017 for his friend as the were creating an FiveM server and there wasn't any economy roleplaying frameworks available. The original code was written within a week or two and later open sourced, it has ever since been improved and parts been rewritten to further improve on it. + + +## Legacy + +ESX Legacy is mostly intended as a bug-fix and optimisation update to provide a more stable experience for the people using ESX 1.2 or Final, however there are also some new features added in to allow better server performance with other resources and official support for esx_multicharacter. +#### Bug fixes +* /clearloadout now properly removes all weapons instead of needing to be performed multiple times +* ESX.Jobs is no longer set until the full table has been creating, allowing other resources to retrieve it more easily +* Now using spawnmanager to spawn players and prevent weird desync issues + +#### Optimisation +* Support for compile-time hashing instead of calling the native +* Utilise the `MySQL.Store` function to reduce overhead when executing queries +* Allow loops to sleep while not performing any tasks +* The current player ped and death status are now stored in ESX.PlayerData, reducing the need to constantly call the native +* Weapon ammo is no longer synced on every frame, instead triggering a server event once shooting has ceased + +#### Features +* Support for the latest weapons and components +* Additional admin commands from esx_adminplus +* Save all players before the txAdmin scheduled restarts +* Reduce the number of queries being performed when a player loads by returning skin and identity data with the initial query +* When loading a new player, send the isNew argument along with `esx:playerLoaded` +* Added an imports file to load in other resource manifests with `shared_script '@es_extended/imports.lua'` + - Removes the need to define ESX in your resources, as it will perform the task for you + - Ensures ESX.PlayerData will always return current information (exception: loadout and inventory) +* Support for relogging, clearing all player data and cancelling sync loops +* Added the `ESX.GetExtendedPlayers` function to be used with xPlayer loops without causing massive server hitches + + +## 1.2 + Features - Weight based inventory system - Weapons support, including support for attachments and tints @@ -30,10 +62,11 @@ ESX was initially developed by Gizz back in 2017 for his friend as the were crea - Easy to use API for developers to easily integrate ESX to their projects - Register your own commands easily, with argument validation, chat suggestion and using FXServer ACL + ## Requirements - [mysql-async](https://github.com/brouznouf/fivem-mysql-async) -- [async](https://github.com/ESX-Org/async) +- [async](https://github.com/esx-framework/async) ## Download & Installation @@ -44,10 +77,11 @@ ESX was initially developed by Gizz back in 2017 for his friend as the were crea ``` cd resources git clone https://github.com/esx-framework/es_extended.git --branch legacy -git clone https://github.com/ESX-Org/esx_menu_default [esx]/[ui]/esx_menu_default -git clone https://github.com/ESX-Org/esx_menu_dialog [esx]/[ui]/esx_menu_dialog -git clone https://github.com/ESX-Org/esx_menu_list [esx]/[ui]/esx_menu_list +git clone https://github.com/esx-framework/esx_menu_default [esx]/[ui]/esx_menu_default +git clone https://github.com/esx-framework/esx_menu_dialog [esx]/[ui]/esx_menu_dialog +git clone https://github.com/esx-framework/esx_menu_list [esx]/[ui]/esx_menu_list ``` + ### Plume ESX: PlumeESX is a full featured (13 jobs) and highly configurable yet lightweight ESX v1.2 base that can be easily extendable. @@ -56,15 +90,16 @@ YouTube Tutorial: https://www.youtube.com/watch?v=iGfwUCO0RZQ ### Manually -- Download https://github.com/esx-framework/es_extended/releases/tag/v1-final +- Download https://github.com/esx-framework/es_extended/archive/refs/heads/legacy.zip - Put it in the `resource/[esx]` directory -- Download https://github.com/ESX-Org/esx_menu_default/releases/latest +- Download https://github.com/esx-framework/esx_menu_default/archive/refs/heads/master.zip - Put it in the `resource/[esx]/[ui]` directory -- Download https://github.com/ESX-Org/esx_menu_dialog/releases/latest +- Download https://github.com/esx-framework/esx_menu_dialog/archive/refs/heads/master.zip - Put it in the `resource/[esx]/[ui]` directory -- Download https://github.com/ESX-Org/esx_menu_list/releases/latest +- Download https://github.com/esx-framework/esx_menu_list/archive/refs/heads/master.zip - Put it in the `resource/[esx]/[ui]` directory + ### Installation - Import `es_extended.sql` in your database @@ -85,6 +120,11 @@ start esx_menu_list start esx_menu_dialog ``` +## Reborn + +ESX Reborn is the name for the framework being actively developed by the team, with many existing features being rewritten and improved upon. It is currently possible to create a server using ESX Reborn, however the project is still missing many features and should not be used unless you are a developer looking to contribute in some way. + + ## Legal ### License From caa418848985173458e3b38c9e196efa069487cb Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Mon, 7 Jun 2021 11:26:32 +1000 Subject: [PATCH 2/7] Update README.md --- README.md | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 52cc01a4..8f77a157 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,15 @@ ESX is the most popular framework for creating an economy-based roleplay server on FiveM, with many more official and unofficial resources designed to utilise the tools provided by this resource. Here's a taste of what's available: -``` -esx_identity: enable character registration using a name, sex, and date of birth -esx_society: add employee management, society funds and more -esx_billing: add support for registered societies to fine or bill players -esx_vehicleshop: allow players to purchase vehicles directly or from players -esx_ambulancejob: adds a death and respawn system while allowing players to become EMS and revive -esx_policejob: allow players to become cops and protect the city -``` + +###### `esx_identity` enable character registration using a name, sex, and date of birth +###### `esx_society` add employee management, society funds and more +###### `esx_billing` add support for registered societies to fine or bill players +###### `esx_vehicleshop` allow players to purchase vehicles directly or from players +###### `esx_ambulancejob` adds a death and respawn system while allowing players to become EMS and revive +###### `esx_policejob` allow players to become cops and protect the city + + Many more resources are available on the [ESX Framework Github](https://github.com/esx-framework) and [ESX Community Github](https://github.com/esx-community/) pages. @@ -50,6 +51,9 @@ ESX Legacy is mostly intended as a bug-fix and optimisation update to provide a * Support for relogging, clearing all player data and cancelling sync loops * Added the `ESX.GetExtendedPlayers` function to be used with xPlayer loops without causing massive server hitches +To get an idea for how you can utilise imports and the new functions, you can refer to [this updated boilerplate](https://github.com/thelindat/esx_legacy_boilerplate). +##### Any resources made using the imports will only work for ESX Legacy. + ## 1.2 + Features From 405197124e73f5568917f99977c853c8dd2627b5 Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Mon, 7 Jun 2021 20:19:18 +1000 Subject: [PATCH 3/7] Update README.md --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8f77a157..88165fe3 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,8 @@ ESX is the most popular framework for creating an economy-based roleplay server ###### `esx_society` add employee management, society funds and more ###### `esx_billing` add support for registered societies to fine or bill players ###### `esx_vehicleshop` allow players to purchase vehicles directly or from players -###### `esx_ambulancejob` adds a death and respawn system while allowing players to become EMS and revive -###### `esx_policejob` allow players to become cops and protect the city +###### `esx_ambulancejob` adds a death and respawn system while allowing players to become EMS to heal or revive others +###### `esx_policejob` allow players to become cops, granting the ability to detain and fine others Many more resources are available on the [ESX Framework Github](https://github.com/esx-framework) and [ESX Community Github](https://github.com/esx-community/) pages. @@ -31,6 +31,7 @@ ESX Legacy is mostly intended as a bug-fix and optimisation update to provide a * /clearloadout now properly removes all weapons instead of needing to be performed multiple times * ESX.Jobs is no longer set until the full table has been creating, allowing other resources to retrieve it more easily * Now using spawnmanager to spawn players and prevent weird desync issues + - This may cause problems with some third-party resources that modify player spawns #### Optimisation * Support for compile-time hashing instead of calling the native @@ -38,12 +39,12 @@ ESX Legacy is mostly intended as a bug-fix and optimisation update to provide a * Allow loops to sleep while not performing any tasks * The current player ped and death status are now stored in ESX.PlayerData, reducing the need to constantly call the native * Weapon ammo is no longer synced on every frame, instead triggering a server event once shooting has ceased +* Reduced the number of queries being performed by a single player connecting to the server #### Features * Support for the latest weapons and components * Additional admin commands from esx_adminplus * Save all players before the txAdmin scheduled restarts -* Reduce the number of queries being performed when a player loads by returning skin and identity data with the initial query * When loading a new player, send the isNew argument along with `esx:playerLoaded` * Added an imports file to load in other resource manifests with `shared_script '@es_extended/imports.lua'` - Removes the need to define ESX in your resources, as it will perform the task for you From fa5f7be47fd8015e8aee8e29c745f28302812265 Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Wed, 9 Jun 2021 00:02:41 +1000 Subject: [PATCH 4/7] fix(server/main): Added missing loadout option from query --- server/main.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/main.lua b/server/main.lua index 924b5f25..6841a9e4 100644 --- a/server/main.lua +++ b/server/main.lua @@ -6,7 +6,7 @@ Citizen.CreateThread(function() NewPlayer = storeId end) - local query = '`accounts`, `job`, `job_grade`, `group`, `position`, `inventory`, `skin`' + local query = '`accounts`, `job`, `job_grade`, `group`, `position`, `inventory`, `skin`, `loadout`' if Config.Multichar or Config.Identity then query = query..', `firstname`, `lastname`, `dateofbirth`, `sex`, `height`' end MySQL.Async.store("SELECT "..query.." FROM `users` WHERE ?? LIKE ?", function(storeId) @@ -625,7 +625,7 @@ Citizen.CreateThread( ^1DOWNLOAD:^5 https://github.com/esx-framework/es_extended/tree/legacy ^1CHANGELOG:^5 %s ^1----------------------------------------------------------------------- -]]):format( +^0]]):format( rv.commit, rv.changelog ) @@ -640,7 +640,7 @@ Citizen.CreateThread( ^5COMMIT:^0 %s ^5CHANGELOG:^0 %s ^8------------------------------------------------------- -]]):format( +^0]]):format( rv.version, rv.commit, rv.changelog @@ -656,7 +656,7 @@ Citizen.CreateThread( ^1DOWNLOAD:^5 https://github.com/esx-framework/es_extended/tree/legacy ^1CHANGELOG:^5 %s ^1----------------------------------------------------------------------- -]]):format( +^0]]):format( rv.commit, rv.changelog ) From ce4cdc6f88269a6ffcb0c05862edb460ec50937b Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Wed, 9 Jun 2021 01:30:32 +1000 Subject: [PATCH 5/7] Update README.md --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 88165fe3..254562d9 100644 --- a/README.md +++ b/README.md @@ -28,10 +28,10 @@ ESX was initially developed by Gizz back in 2017 for his friend as the were crea ESX Legacy is mostly intended as a bug-fix and optimisation update to provide a more stable experience for the people using ESX 1.2 or Final, however there are also some new features added in to allow better server performance with other resources and official support for esx_multicharacter. #### Bug fixes -* /clearloadout now properly removes all weapons instead of needing to be performed multiple times * ESX.Jobs is no longer set until the full table has been creating, allowing other resources to retrieve it more easily * Now using spawnmanager to spawn players and prevent weird desync issues - This may cause problems with some third-party resources that modify player spawns +* /clearloadout now properly removes all weapons instead of needing to be performed multiple times #### Optimisation * Support for compile-time hashing instead of calling the native @@ -56,6 +56,14 @@ To get an idea for how you can utilise imports and the new functions, you can re ##### Any resources made using the imports will only work for ESX Legacy. +## Conflicts +* The following resources should not be used with ESX Legacy and can result in errors + - basic-gamemode + - fivem-map-skater + - fivem-map-hipster + - **essentialsmode** + + ## 1.2 + Features - Weight based inventory system From 7cfcf10e23133ec6d4ea03c115627d425934c51c Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Wed, 9 Jun 2021 01:32:20 +1000 Subject: [PATCH 6/7] Update version.json --- version.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version.json b/version.json index 98f31f8d..2caac30f 100644 --- a/version.json +++ b/version.json @@ -1,5 +1,5 @@ { "version": "legacy", - "commit" : "1.3.1", - "changelog": "\n- Improved spawn event triggers\n- Improved support for relogging\n- Set PlayerData.dead initial value based on `is_dead` column (or 0)\n- Added a MySQL.store for the loadESXPlayer function\n- Ammo sync now waits for the player to stop shooting before sending a server event\n- /clearloadout now clears all player weapons on the first try\n- Minor fixes and optimisations" + "commit" : "1.3.2", + "changelog": "Corrected a mistake resulting in loadouts not being loaded with players" } From 286dbb2e781f900e06d5ac10faf7e88b272f34eb Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Wed, 9 Jun 2021 13:06:31 +1000 Subject: [PATCH 7/7] refactor(server/common): Start paycheck and sync after ESX.Jobs has been defined --- server/common.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/server/common.lua b/server/common.lua index 95a2ff6a..1eb6aa62 100644 --- a/server/common.lua +++ b/server/common.lua @@ -53,12 +53,11 @@ MySQL.ready(function() end end ESX.Jobs = Jobs + print('[^2INFO^7] ESX ^5Legacy^0 initialized') + ESX.StartDBSync() + ESX.StartPayCheck() end) end) - - print('[^2INFO^7] ESX ^5Legacy^0 initialized') - ESX.StartDBSync() - ESX.StartPayCheck() end) RegisterServerEvent('esx:clientLog')