[Release] [WIP] ESX 2

ESX 2

Sill looking for old version ? => https://github.com/ESX-Org/es_extended/tree/v1-final

How to run latest ESX

# minimum resources and config to get it working

set mysql_connection_string "mysql://john:[email protected]/es_extended?charset=utf8mb4"

stop webadmin

ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure hardcap
ensure ■■■■■■■
ensure baseevents

ensure mysql-async
ensure cron
ensure skinchanger

ensure es_extended

Changelog

- Switched to a module-based single resource for ease of use and performance
- Performance improvements
- Split all base functionnalities into their own module
- Module can either encapsulate its own functionality or declare global stuff
- Loading modules via method M('themodule') ensure correct loading order of modules
- Automated database schema generation (RIP SQL files everywhere)
- Database schema can also be expanded by other modules
- Custom event system to avoid serialization of event data and cross-resource communication, that make it possible to pass metatables through these events (You can still use TriggerEvent and such to escape that thing)
- xPlayer fully customizable without rewriting core resources (Hello second job, faction system and such...)
- Added some modules to optimize common things like input, marker and static npc management
- Extend base lua functionnality when appropriate via module. example: table.indexOf
- OOP System based on http://lua-users.org/wiki/InheritanceTutorial and improved
- Neat menu API
- Open as many pages as you want in single NUI frame with Frame API
- EventEmitter class
- WIP rewrite of well-known datastore / inventory / account stuff

Code examples

-- Menu

M('ui.menu') -- This module provides global Menu factory method

local menu = Menu:create('test', {
  title = 'Test menu',
  float = 'top|left',
  items = {
    {name = 'a', label = 'Fufu c\'est ma bro', type = 'slider'},
    {name = 'b', label = 'Fuck that shit',     type = 'check'},
    {name = 'c', label = 'Fuck that shit',     type = 'text'},
    {name = 'd', label = 'Lorem ipsum'},
    {name = 'e', label = 'Submit',             type = 'button'},
  }
})

menu:on('ready', function()
  menu.items[1].label = 'TEST';-- label changed instantly in webview
end)

menu:on('item.change', function(item, prop, val, index)

  if (item.name == 'a') and (prop == 'value') then

    item.label = 'Dynamic label ' .. tostring(val);

  end

  if (item.name == 'b') and (prop == 'value') then

    local c = table.find(menu.items, function(e) return e.name == 'c' end)

    c.value = 'Dynamic text ' .. tostring(val);

  end

end)

menu:on('item.click', function(item, index)
  print('index', index)
end)

Menu

-- DataStore

M('datastore')

on('esx:db:ready', function()

  local ds = DataStore:create('test', true, {sample = 'data'}) -- name, shared, initial data

  ds:on('save', function()
    print(ds.name .. ' saved => ' .. json.encode(ds:get()))
  end)

  ds:on('ready', function()

    ds:set('foo', 'bar')

    ds:save(function()
      print('callbacks also')
    end)

  end)

end)
-- Here is how datastore schema is declared, no need to feed some SQL file

M('events')

on('esx:db:init', function(initTable, extendTable)

  initTable('datastores', 'name', {
    {name = 'name',  type = 'VARCHAR',  length = 255, default = nil,    extra = 'NOT NULL'},
    {name = 'owner', type = 'VARCHAR',  length = 64,  default = 'NULL', extra = nil},
    {name = 'data',  type = 'LONGTEXT', length = nil, default = nil,    extra = nil},
  })

end)
-- Want to create faction system ?

M('player')

xPlayer.createDBAccessor('faction', {name = 'faction', type = 'VARCHAR', length = 64, default = 'gang.ballas', extra = nil})

-- Now any player (which is instance of xPlayer) have the following methods
-- Also user table has now a faction column added automatically

local player = xPlayer:fromId(2)

print(player:getFaction())

player:setFaction('another.faction')

player:save()
-- I want to store JSON :(
-- No problem

xPlayer.createDBAccessor('someData', {name = 'some_data', type = 'TEXT', length = nil, default = '{}', extra = nil}, json.encode, json.decode)
-- I want to store WHATEVER (comma-separated list for example) :(
-- No problem

M('string')

xPlayer.createDBAccessor(
  'someWeirdData',
  {name = 'some_weird_data', type = 'TEXT', length = nil, default = '1,2,3,4,5', extra = nil},
  function(x) -- encode
    return table.concat(x, ',')
  end,
  function(x) -- decode
    return string.split(x, ',')
  end
)
85 Likes
[How-To] FX Server Setup For Dummies
Roleplay
[vRP Framework]-[Psycho Edited - FX 3.5]-[23/07/17]
Role Script (What should I search for?)
Server shutdowns/crashes sometimes. :/
Skin Menu At Spawn - RP
[ESX] Improved HUD (compatible allcity_wallet)
[Request] Advanced Admin Menu (For ESX)
Roleplay server help
Esx_phone3 help!
ESX_robbery
[Release] EssentialMode base
Saving players
My New Server
How do i make Police to beable use a taser/gun on a player?
Economy Script for Server
Money Script
Server problem esx scripts wont work
How would I go about making a Roleplay server?
How i can upload .sql if its show this error
Mod/Script for the basics of roleplaying servers? // Rookie
A script to rally all menus?
ServerPack
[Release] [ESX] loffe_burglary
Who can give me a RolePlay Gamemode with cop, with mafia, with jobs(uber, bankdriver, delivery) ems and more and an data base
My server blips are gone!
How i get so i create a character when i join my server?
Disable steam auth
How to give myself money on my server
[Release] [ESX] Grandmas House (RP Revive)
[Help] Need help with locking custom cars
ESX money HUD like vRP
How to turn on Money_Hud in fivem
[RELEASE] [ESX] LRP-Farmcyc l farming of shrimp and crabs
Creating my own fivem roleplay server
[Release] ESX_Scrap
HELLP for set skin my armyjob server
[Relelase] [ESX] loffe_race
[HELP] Last location is not saving
Es_extended disable bank from inventory
Problem with es_extended for new players
Why it doesn't save the position of the last connection? ESX
Fivem server Issue
Can someone please help me with esx skin
Paying from bank like a credit card
[HELP] Max Salary Amount
Esx on Ubuntu 18.04 server
[EN I FR] Easy Banking [ESX I FXServer]
Remove last position save [ESX]
Problem with ESX?
What is the best roleplay framework
Tazio - New Banking reskin
How to change start amount for esx server
[help] script error main lua (global esx)
ESX - How to change cash icon
Server doesn't save new people anymore (Need Help)|ESX|
[Moved] Error when trying to respawn
Esx pack?
[Release][ESX] J5-BankTrucks
Es_extended problem always
Modern Scoreboard [cd-scoreboard] | ESX and WarMenu based
[Release][ESX] Money Truck Robbery's
[Release][ESX] SB-PoliceSystems
Help i can't understand whats wrong
What is this its start to happen when i upgrade es_extended
[Release][ESX][Disc] X-Hotwire, hotwire script with keys and NPC interactions
[Discontinued] Healthbar / UI - Now Supports vRP and ESX! (V 1.1)
SB_Carnitro
Looking for some places for support regarding ESX
[Release] [ESX] [Onesync] Fines for Police
How i can find a boilerplate for FiveM Roleplay Server?
[SEARCH] Pls help i need a good gamemode roleplay for FiveM
[Solved] Esx_extended error when i start server
[Release][ESX] SB-ChopShop
[Release][ESX] onyxLocksystem | Keys, Hotwiring
[Release] Darkstore - A Hidden store for restricted items - ESX - V1.0
Can some one help me how i make a weaponshop with attachments?

Thanks guys for this work :slight_smile:

3 Likes

Thanks @Kanersps and thanks @GiZz

4 Likes

Can you please make your ESX scripts one big folder, thanks

12 Likes

I’m working on helping them do that.

3 Likes

does this support couchdb as my essentialsmode is couch db ?

1 Like

No CouchDB support for now, maybe in the future if someone is willing to help on this task.

1 Like

i would but i am only learning couch db at mo not brill at it in a few weeks hoping to know how to do it so if you dont have anyone will message back here

1 Like

what is the name of the script that saves loadout and position?

1 Like

tout installé comme le tutoriel mais cette partie ne comprenait pas.

Create a resource or add this in an existing resource :
server.lua

TriggerEvent(‘es:setDefaultSettings’, {
nativeMoneySystem = false,
});

1 Like

The script name is es_extended

1 Like

Hi GiZz, I want to thank you for sharing your framework, very good, I’m enjoying it, I’m having some problems with esx_atm, no matter where I am and press E, it opens the option of deposit and withdrawal, has any solution for this ? The other problem is with the work of Police, at the time I’m going to wear the uniform, he does not wear it, he keeps the clothes he was wearing.

Can you fix a place where everyone can start in town?

Thanks for the framework, I’m grateful.

1 Like

Can you make your ESX scripts all in one github? To just download, pull the SQL in DB and start the server?

I downloaded everything I set up the server and so far it’s almost everything 100% only 2 Scripts giving error, other than that, excellent team work :slight_smile:

6 Likes

Thanks ^^
Yes, it’s planned, but not yet ! we have a few basics to finish (lscustom, basic needs aka food and drink, etc).

2 Likes

The ATM is fixed already, you must have an old version.

2 Likes

Thanks :slight_smile: , tomorrow I will see the 2 scripts that are giving errors (addonsccount & society) and my pack will be practically ready to test more deep and translate, but so far everything I have seen is very good, excellent work, easy installation, translation, and lots of fun, amazing how easy is make the server with ESX.

1 Like

Thanks, I updated the ATM and now everything is ok.

Do you intend to create a file for other users to translate into your languages?

I think if you do this, more people will surely use your framework.

Keep up the great work, congratulations again.

1 Like

Thank you :slight_smile: we are starting to include translations in scripts but that is not the priority

1 Like

Esx Scripts are good. 90% works normally. But I’m having a mistake with esx_vehicleshop

It starts normal but it starts to return me these 3 errors Can someone help me ?

[ERROR] [] An error happens on MySQL for query "SELECT * FROM user_vehicle WHERE [email protected] {@identifier=steam:11000010b8efe66}": Table '71_151_gta5gamemode.user_vehicle' 

[ERROR] [] An error happens on MySQL for query "SELECT personalvehicle FROM users WHERE [email protected] {@identifier=steam:11000010b8efe66}": Unknown column 'personalvehicle' in 'field list'


[ERROR] [] An error happens on MySQL for query "UPDATE users SET [email protected]_state WHERE [email protected] {@identifier=steam:11000010b8efe66;@player_state=0}": Unknown column 'player_state' in 'field list'
Sending heartbeat to live-internal.fivem.net:30110
hitch warning: frame time of 286 milliseconds
[SAVED] ???[PM] Denny Novaes
1 Like

None of our scripts use these tables

2 Likes