Skip to content

Commit

Permalink
Merge branch 'esx-framework:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
1nexis authored Mar 4, 2024
2 parents 05f2318 + b887903 commit 04227b2
Show file tree
Hide file tree
Showing 18 changed files with 65 additions and 47 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/simple-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ on:
type: string
description: Separate the files or folders that you do not want to see in the release with a comma.
required: false
default: 'node_modules,package.json,package-lock.json'
neededNewBranch:
type: string
description: Specify true or false if you want to create a new branch.
required: false

jobs:
simple-create-release:
Expand All @@ -28,3 +33,4 @@ jobs:
web: ${{ github.event.inputs.web }}
versionNumber: ${{ github.event.inputs.versionNumber }}
excludeOptions: ${{ github.event.inputs.excludeOptions }}
neededNewBranch: ${{ github.event.inputs.neededNewBranch }}
2 changes: 1 addition & 1 deletion [core]/cron/fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ game 'gta5'
author 'ESX-Framework'
description 'cron'
lua54 'yes'
version '1.10.3'
version '1.10.5'

server_script 'server/main.lua'
75 changes: 43 additions & 32 deletions [core]/es_extended/client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,61 +18,67 @@ RegisterNetEvent("esx:requestModel", function(model)
ESX.Streaming.RequestModel(model)
end)

function ESX.SpawnPlayer(skin, coords, cb)
local p = promise.new()
TriggerEvent("skinchanger:loadSkin", skin, function()
p:resolve()
end)
Citizen.Await(p)

local playerPed = PlayerPedId()
FreezeEntityPosition(playerPed, true)
SetEntityCoordsNoOffset(playerPed, coords.x, coords.y, coords.z, false, false, false, true)
SetEntityHeading(playerPed, coords.heading)
while not HasCollisionLoadedAroundEntity(playerPed) do
Wait(0)
end
FreezeEntityPosition(playerPed, false)
NetworkResurrectLocalPlayer(coords.x, coords.y, coords.z, coords.heading, true, true, false)
TriggerEvent('playerSpawned', coords)
cb()
end

RegisterNetEvent("esx:playerLoaded")
AddEventHandler("esx:playerLoaded", function(xPlayer, isNew, skin)
AddEventHandler("esx:playerLoaded", function(xPlayer, _, skin)
ESX.PlayerData = xPlayer

if Config.Multichar then
Wait(3000)
else
exports.spawnmanager:spawnPlayer({
x = ESX.PlayerData.coords.x,
y = ESX.PlayerData.coords.y,
z = ESX.PlayerData.coords.z + 0.25,
heading = ESX.PlayerData.coords.heading,
model = `mp_m_freemode_01`,
skipFade = false,
}, function()
TriggerServerEvent("esx:onPlayerSpawn")
if not Config.Multichar then
ESX.SpawnPlayer(skin, ESX.PlayerData.coords, function()
TriggerEvent("esx:onPlayerSpawn")
TriggerEvent("esx:restoreLoadout")

if isNew then
TriggerEvent("skinchanger:loadDefaultModel", skin.sex == 0)
elseif skin then
TriggerEvent("skinchanger:loadSkin", skin)
end

TriggerServerEvent("esx:onPlayerSpawn")
TriggerEvent("esx:loadingScreenOff")
ShutdownLoadingScreen()
ShutdownLoadingScreenNui()
end)
end

while not DoesEntityExist(ESX.PlayerData.ped) do
Wait(20)
end

ESX.PlayerLoaded = true

while ESX.PlayerData.ped == nil do
Wait(20)
local metadata = ESX.PlayerData.metadata

if metadata.health then
SetEntityHealth(ESX.PlayerData.ped, metadata.health)
end
if metadata.armor and metadata.armor > 0 then
SetPedArmour(ESX.PlayerData.ped, metadata.armor)
end

while not HasCollisionLoadedAroundEntity(ESX.PlayerData.ped) do
local timer = GetGameTimer()
while not HaveAllStreamingRequestsCompleted(ESX.PlayerData.ped) and (GetGameTimer() - timer) < 2000 do
Wait(0)
end
end

if Config.EnablePVP then
SetCanAttackFriendly(ESX.PlayerData.ped, true, false)
NetworkSetFriendlyFireOption(true)
end

local playerId = PlayerId()
local metadata = ESX.PlayerData.metadata
if metadata.health then
SetEntityHealth(ESX.PlayerData.ped, metadata.health)
end
if metadata.armor and metadata.armor > 0 then
SetPedArmour(ESX.PlayerData.ped, metadata.armor)
end

-- RemoveHudComponents
for i = 1, #Config.RemoveHudComponents do
if Config.RemoveHudComponents[i] then
Expand Down Expand Up @@ -196,10 +202,15 @@ AddEventHandler("esx:playerLoaded", function(xPlayer, isNew, skin)
end
end

if IsScreenFadedOut() then
DoScreenFadeIn(500)
end

SetDefaultVehicleNumberPlateTextPattern(-1, Config.CustomAIPlates)
StartServerSyncLoops()
end)


RegisterNetEvent("esx:onPlayerLogout")
AddEventHandler("esx:onPlayerLogout", function()
ESX.PlayerLoaded = false
Expand Down
1 change: 1 addition & 0 deletions [core]/es_extended/client/modules/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ local function GetData(vehicle)
end

CreateThread(function()
while not ESX.PlayerLoaded do Wait(200) end
while true do
ESX.SetPlayerData("coords", GetEntityCoords(playerPed))
if playerPed ~= PlayerPedId() then
Expand Down
2 changes: 1 addition & 1 deletion [core]/es_extended/config.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Config = {}
Config.Locale = GetConvar("esx:locale", "en")

Config.OxInventory = GetResourceState("ox_inventory") ~= 'missing'
Config.OxInventory = GetResourceState("ox_inventory") ~= 'missing'

Config.Accounts = {
bank = {
Expand Down
2 changes: 1 addition & 1 deletion [core]/es_extended/fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ fx_version 'adamant'
game 'gta5'
description 'ES Extended'
lua54 'yes'
version '1.10.3'
version '1.10.5'

shared_scripts {
'locale.lua',
Expand Down
2 changes: 1 addition & 1 deletion [core]/esx_context/fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ game 'gta5'
author 'ESX-Framework & Brayden'
description 'Offical ESX Legacy Context Menu'
lua54 'yes'
version '1.10.3'
version '1.10.5'

ui_page 'index.html'

Expand Down
2 changes: 1 addition & 1 deletion [core]/esx_identity/fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ fx_version 'adamant'
game 'gta5'
description 'ESX Identity'
lua54 'yes'
version '1.10.3'
version '1.10.5'

shared_scripts {
'@es_extended/imports.lua',
Expand Down
2 changes: 1 addition & 1 deletion [core]/esx_loadingscreen/fxmanifest.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
game 'common'

version '1.10.3'
version '1.10.5'
fx_version 'cerulean'
author 'ESX-Framework'
lua54 'yes'
Expand Down
2 changes: 1 addition & 1 deletion [core]/esx_menu_default/fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ fx_version 'adamant'
game 'gta5'
description 'ESX Menu Default'
lua54 'yes'
version '1.10.3'
version '1.10.5'

client_scripts { '@es_extended/imports.lua', 'client/main.lua' }

Expand Down
2 changes: 1 addition & 1 deletion [core]/esx_menu_dialog/fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ fx_version 'adamant'
game 'gta5'
description 'ESX Menu Dialog'
lua54 'yes'
version '1.10.3'
version '1.10.5'

client_scripts {
'@es_extended/imports.lua',
Expand Down
2 changes: 1 addition & 1 deletion [core]/esx_menu_list/fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ fx_version 'adamant'
game 'gta5'
description 'ESX Menu List'
lua54 'yes'
version '1.10.3'
version '1.10.5'


client_scripts {
Expand Down
2 changes: 1 addition & 1 deletion [core]/esx_multicharacter/fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ fx_version 'cerulean'
game 'gta5'
author 'ESX-Framework - Linden - KASH'
description 'Official Multicharacter System For ESX Legacy'
version '1.10.3'
version '1.10.5'
lua54 'yes'

dependencies { 'es_extended', 'esx_context', 'esx_identity', 'esx_skin' }
Expand Down
2 changes: 1 addition & 1 deletion [core]/esx_notify/fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ fx_version 'adamant'

lua54 'yes'
game 'gta5'
version '1.10.3'
version '1.10.5'
author 'ESX-Framework'
description 'Official NUI Notification system for ESX'

Expand Down
2 changes: 1 addition & 1 deletion [core]/esx_progressbar/fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ fx_version 'adamant'
game 'gta5'
author 'ESX-Framework'
lua54 'yes'
version '1.10.3'
version '1.10.5'
description 'ESX Progressbar'

client_scripts { 'Progress.lua' }
Expand Down
2 changes: 1 addition & 1 deletion [core]/esx_skin/fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ fx_version 'adamant'

game 'gta5'
description 'ESX Skin'
version '1.10.3'
version '1.10.5'
lua54 'yes'

shared_script '@es_extended/imports.lua'
Expand Down
2 changes: 1 addition & 1 deletion [core]/esx_textui/fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ fx_version 'adamant'

game 'gta5'
author 'ESX-Framework'
version '1.10.3'
version '1.10.5'
description 'ESX TextUI'
lua54 'yes'

Expand Down
2 changes: 1 addition & 1 deletion [core]/skinchanger/fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ fx_version 'adamant'
game 'gta5'
lua54 'yes'
description 'Official ESX-Legacy resource for handling the Player`s Skin'
version '1.10.3'
version '1.10.5'

client_scripts {
'@es_extended/locale.lua',
Expand Down

0 comments on commit 04227b2

Please sign in to comment.