Skip to content

Commit

Permalink
Merge pull request #579 from bitpredator/dev
Browse files Browse the repository at this point in the history
fix: No such export getSharedObject in resource es_extended
  • Loading branch information
bitpredator authored Dec 5, 2023
2 parents cb50e34 + a63b205 commit c035067
Show file tree
Hide file tree
Showing 27 changed files with 762 additions and 400 deletions.
5 changes: 4 additions & 1 deletion .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,7 @@ fix lint error: unused argument last; accessing undefined variable Invoke; unuse
42. [esx_joblisting]: refactor: correct the good year for the license + varius fix @bitpredator
43. [EUP]: delete: removed package [EUP] @bitpredator
44. [bpt_ammujob]: refactor: bpt_ammujob inventory implementation @bitpredator
45. [SQL]: fix: es_extended.sql "addon_inventory" syntax error @bitpredator
45. [SQL]: fix: es_extended.sql "addon_inventory" syntax error @bitpredator
46. [npwd]: fix: Warning: could not find @bitpredator
47. [server.cfg]: fix: Couldn't find resource @bitpredator
48. fix: No such export getSharedObject in resource es_extended @bitpredator
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ local Keys = {
["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118
}

ESX = nil
local labels = {}
local craftingQueue = {}
local job = ""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
ESX = nil
ESX = exports["es_extended"]:getSharedObject()
function setCraftingLevel(identifier, level)
MySQL.Async.execute(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ fx_version 'adamant'
game 'gta5'
description 'bpt_farmer, introduces various collection points for the crafting system (not a job)'
author'bitpredator'
version'0.0.4'
version'1.0.0'

shared_script '@es_extended/imports.lua'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ local armor = 0
local food = 0
local thirst = 0
local posi = "bottom"
ESX = nil

ESX = exports["es_extended"]:getSharedObject()

Expand Down
4 changes: 3 additions & 1 deletion server-data/resources/[bpt_addons]/bpt_hud/fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ fx_version 'adamant'
game 'gta5'
author 'bitpredator'
description 'bitpredator HUD'
version '0.0.4'
version '1.0.0'

ui_page 'html/ui.html'

shared_script '@es_extended/imports.lua'

files {
'html/*.css',
'html/*.js',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Keys = {
["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118
}

ESX = nil
local menuOpen = false

CreateThread(function()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
ESX = nil
ESX = exports["es_extended"]:getSharedObject()

RegisterServerEvent('bpt_woodcutter:pickedUpWood')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ author 'bitpredator'

description 'bpt_teleport'

version '0.0.4'
version '1.0.0'

shared_script '@es_extended/imports.lua'

client_scripts {
'@es_extended/locale.lua',
Expand Down
9 changes: 4 additions & 5 deletions server-data/resources/[esx]/es_extended/imports.lua
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
---@diagnostic disable: missing-fields
ESX = exports['es_extended']:getSharedObject()

if not IsDuplicityVersion() then -- Only register this event for the client
AddEventHandler('esx:setPlayerData', function(key, val)
AddEventHandler('esx:setPlayerData', function(key, val, last)
if GetInvokingResource() == 'es_extended' then
ESX.PlayerData[key] = val
-- if OnPlayerData then not used?
-- OnPlayerData(key, val, last)
-- end
if OnPlayerData then
OnPlayerData(key, val, last)
end
end
end)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
local firstSpawn, PlayerLoaded = true, false

isDead, isSearched, medic = false, false, 0
ESX = nil

AddEventHandler("onClientMapStart", function()
exports.spawnmanager:spawnPlayer()
Expand All @@ -10,15 +9,10 @@ AddEventHandler("onClientMapStart", function()
end)

CreateThread(function()
while ESX == nil do
ESX = exports["es_extended"]:getSharedObject()
Wait(0)
end

ESX = exports["es_extended"]:getSharedObject()
while ESX.GetPlayerData().job == nil do
Wait(100)
end

PlayerLoaded = true
ESX.PlayerData = ESX.GetPlayerData()
end)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
ESX = nil
local playersHealing, deadPlayers = {}, {}

ESX = exports["es_extended"]:getSharedObject()
Expand Down
Loading

0 comments on commit c035067

Please sign in to comment.