mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-30 17:58:54 +00:00
Updates
This commit is contained in:
@@ -43,9 +43,7 @@ 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
|
||||
cd es_extended
|
||||
git checkout legacy
|
||||
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
|
||||
@@ -93,7 +91,7 @@ start esx_menu_dialog
|
||||
|
||||
es_extended - ESX framework for FiveM
|
||||
|
||||
Copyright (C) 2015-2020 Jérémie N'gadi
|
||||
Copyright (C) 2015-2021 Jérémie N'gadi
|
||||
|
||||
This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version.
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ Citizen.CreateThread(function()
|
||||
Citizen.Wait(0)
|
||||
|
||||
if NetworkIsPlayerActive(PlayerId()) then
|
||||
if not Config.UseMulticharacter end
|
||||
TriggerServerEvent('esx:onPlayerJoined')
|
||||
break
|
||||
end
|
||||
@@ -39,8 +40,10 @@ AddEventHandler('esx:playerLoaded', function(playerData)
|
||||
NetworkSetFriendlyFireOption(true)
|
||||
|
||||
-- disable wanted level
|
||||
if not Config.EnableWantedLevel then
|
||||
ClearPlayerWantedLevel(PlayerId())
|
||||
SetMaxWantedLevel(0)
|
||||
end
|
||||
|
||||
if Config.EnableHud then
|
||||
for k,v in ipairs(playerData.accounts) do
|
||||
|
||||
+10
-6
@@ -7,11 +7,15 @@ Config.Accounts = {
|
||||
money = _U('account_money')
|
||||
}
|
||||
|
||||
Config.StartingAccountMoney = {bank = 50000}
|
||||
Config.StartingAccountMoney = {bank = 50000}
|
||||
|
||||
Config.EnableSocietyPayouts = false -- pay from the society account that the player is employed at? Requirement: esx_society
|
||||
Config.EnableHud = true -- enable the default hud? Display current job and accounts (black, bank & cash)
|
||||
Config.MaxWeight = 24 -- the max inventory weight without backpack
|
||||
Config.PaycheckInterval = 7 * 60000 -- how often to recieve pay checks in milliseconds
|
||||
Config.EnableDebug = false -- Use Debug options?
|
||||
Config.EnableSocietyPayouts = false -- pay from the society account that the player is employed at? Requirement: esx_society
|
||||
Config.EnableHud = true -- enable the default hud? Display current job and accounts (black, bank & cash)
|
||||
Config.MaxWeight = 24 -- the max inventory weight without backpack
|
||||
Config.PaycheckInterval = 7 * 60000 -- how often to recieve pay checks in milliseconds
|
||||
Config.EnableDebug = false -- Use Debug options?
|
||||
Config.EnableDefaultInventory = true -- Display the default Inventory ( F2 )
|
||||
Config.EnableWantedLevel = false -- Use Normal GTA wanted Level?
|
||||
Config.DisableSuperadmin = true -- Disable the use of superadmin
|
||||
Config.UseMulticharacter = false -- WIP, ADDS multicharacter features
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ game 'gta5'
|
||||
|
||||
description 'ES Extended'
|
||||
|
||||
version '1.2.0'
|
||||
version 'legacy'
|
||||
|
||||
server_scripts {
|
||||
'@async/async.lua',
|
||||
|
||||
+5
-8
@@ -20,6 +20,7 @@ end, true, {help = _U('command_setjob'), validate = true, arguments = {
|
||||
}})
|
||||
|
||||
ESX.RegisterCommand('car', 'admin', function(xPlayer, args, showError)
|
||||
if not args.car then args.car = "baller2" end
|
||||
xPlayer.triggerEvent('esx:spawnVehicle', args.car)
|
||||
end, false, {help = _U('command_car'), validate = false, arguments = {
|
||||
{name = 'car', help = _U('command_car_car'), type = 'any'}
|
||||
@@ -124,6 +125,8 @@ end, true, {help = _U('command_clearloadout'), validate = true, arguments = {
|
||||
}})
|
||||
|
||||
ESX.RegisterCommand('setgroup', 'admin', function(xPlayer, args, showError)
|
||||
if not args.playerId then args.playerId = xPlayer.source end
|
||||
if Config.DisableSuperadmin and args.group == "superadmin" then args.group = "admin" end
|
||||
args.playerId.setGroup(args.group)
|
||||
end, true, {help = _U('command_setgroup'), validate = true, arguments = {
|
||||
{name = 'playerId', help = _U('commandgeneric_playerid'), type = 'player'},
|
||||
@@ -141,19 +144,13 @@ ESX.RegisterCommand('saveall', 'admin', function(xPlayer, args, showError)
|
||||
end, true, {help = _U('command_saveall')})
|
||||
|
||||
ESX.RegisterCommand('currentgroup', {"user", "admin"}, function(xPlayer, args, showError)
|
||||
TriggerClientEvent('chatMessage', xPlayer.source, "You are currently: "..xPlayer.getGroup()))
|
||||
print("You are currently: ".. xPlayer.getGroup())
|
||||
end, true)
|
||||
|
||||
ESX.RegisterCommand('getcoords', "admin", function(xPlayer, args, showError)
|
||||
print("".. xPlayer.getName().. ": "xPlayer.getCoords(true))
|
||||
print("".. xPlayer.getName().. ": ".. xPlayer.getCoords(true))
|
||||
end, true)
|
||||
|
||||
ESX.RegisterCommand('tpm', "admin", function(xPlayer, args, showError)
|
||||
TriggerEvent("esx:admin:tpm", xPlayer.source, args.playerid)
|
||||
end, true, {help = _U('command_save'), validate = true, arguments = {
|
||||
{name = 'playerId', help = _U('commandgeneric_playerid'), type = 'player'}
|
||||
}}))
|
||||
|
||||
ESX.RegisterCommand('getplayers', "admin", function(xPlayer, args, showError)
|
||||
local xAll = ESX.GetPlayers()
|
||||
print("^2"..#xAll.." ^3online player(s)^0")
|
||||
|
||||
@@ -284,3 +284,12 @@ ESX.DoesJobExist = function(job, grade)
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
ESX.GetPlayerIdentifier = function(playerId)
|
||||
local identifiers = GetPlayerIdentifiers(playerId)
|
||||
for _,id in ipairs(identifiers) do
|
||||
if id:find(Config.IdentifierPrefix) then
|
||||
return id:gsub(string.format("%s:","licence"),"")
|
||||
end
|
||||
end
|
||||
end
|
||||
+24
-11
@@ -1,6 +1,6 @@
|
||||
Citizen.CreateThread(function()
|
||||
SetMapName('San Andreas')
|
||||
SetGameType('Roleplay')
|
||||
SetGameType('ESX Roleplay')
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx:onPlayerJoined')
|
||||
@@ -10,13 +10,23 @@ AddEventHandler('esx:onPlayerJoined', function()
|
||||
end
|
||||
end)
|
||||
|
||||
if Config.UseMulticharacter then
|
||||
AddEventHandler("esx:overwriteIdentifierMethod",function(ref)
|
||||
ESX.GetPlayerIdentifier = ref
|
||||
end)
|
||||
end
|
||||
|
||||
function onPlayerJoined(playerId)
|
||||
local identifier
|
||||
|
||||
for k,v in ipairs(GetPlayerIdentifiers(playerId)) do
|
||||
if string.match(v, 'license:') then
|
||||
identifier = string.sub(v, 9)
|
||||
break
|
||||
if Config.UseMulticharacter then
|
||||
local identifier = ESX.GetPlayerIdentifier(playerId)
|
||||
else
|
||||
for k,v in ipairs(GetPlayerIdentifiers(playerId)) do
|
||||
if string.match(v, 'license:') then
|
||||
identifier = string.sub(v, 9)
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -63,13 +73,17 @@ AddEventHandler('playerConnecting', function(name, setCallback, deferrals)
|
||||
local playerId, identifier = source
|
||||
Citizen.Wait(100)
|
||||
|
||||
for k,v in ipairs(GetPlayerIdentifiers(playerId)) do
|
||||
if string.match(v, 'license:') then
|
||||
identifier = string.sub(v, 9)
|
||||
break
|
||||
|
||||
if Config.UseMulticharacter then
|
||||
local identifier = ESX.GetPlayerIdentifier(playerId)
|
||||
else
|
||||
for k,v in ipairs(GetPlayerIdentifiers(playerId)) do
|
||||
if string.match(v, 'license:') then
|
||||
identifier = string.sub(v, 9)
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if identifier then
|
||||
if ESX.GetPlayerFromIdentifier(identifier) then
|
||||
deferrals.done(('There was an error loading your character!\nError code: identifier-active\n\nThis error is caused by a player on this server who has the same identifier as you have. Make sure you are not playing on the same Rockstar account.\n\nYour Rockstar identifier: %s'):format(identifier))
|
||||
@@ -81,7 +95,6 @@ AddEventHandler('playerConnecting', function(name, setCallback, deferrals)
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
function loadESXPlayer(identifier, playerId)
|
||||
local tasks = {}
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"version": "legacy",
|
||||
"commit" : "1",
|
||||
"changelog": "Performance Improvements; Config Updates; Bug Fixes"
|
||||
}
|
||||
Reference in New Issue
Block a user