Skip to content

Commit

Permalink
Merge pull request #72 from solareon/fix-coredetect
Browse files Browse the repository at this point in the history
fix(client/main): fix issue ped rotation and options
  • Loading branch information
FjamZoo authored Sep 6, 2024
2 parents 2c0b848 + 8ff9647 commit 4b503ce
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
11 changes: 4 additions & 7 deletions client/framework.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
local Framework = Config.framework
QBCore, ESX, FullyLoaded = nil, nil, nil --luacheck: ignore
if Framework == 'qb' then
QBCore = exports['qb-core']:GetCoreObject() --luacheck: ignore
FullyLoaded = Framework == 'qb' and LocalPlayer.state.isLoggedIn
elseif Framework == 'qbx' then
FullyLoaded = Framework == 'qbx' and LocalPlayer.state.isLoggedIn
local Framework = GetResourceState('es_extended') == 'started' and 'esx' or GetResourceState('qbx_core') == 'started' and 'qbx' or GetResourceState('qb-core') == 'started' and 'qb' or 'Unknown'
FullyLoaded = false
if Framework == 'qb' or Framework == 'qbx' then
FullyLoaded = LocalPlayer.state.isLoggedIn
elseif Framework == 'esx' then
ESX = exports['es_extended']:getSharedObject()
FullyLoaded = Framework == 'esx' and ESX.PlayerLoaded or false
Expand Down
10 changes: 6 additions & 4 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,18 @@ function CreatePeds()
coords = coords,
distance = 300,
model = joaat(Config.peds[k].model),
heading = coords.w,
ped = nil,
targetOptions = Config.peds[k].createAccounts and {{
targetOptions = {{
name = 'renewed_banking_accountmng',
event = 'Renewed-Banking:client:accountManagmentMenu',
icon = 'fas fa-money-check',
label = locale('manage_bank'),
atm = false,
canInteract = function(_, distance)
return distance < 4.5
return distance < 4.5 and Config.peds[k].createAccounts
end
}} or {{
},{
name = 'renewed_banking_openui',
event = 'Renewed-Banking:client:openBankUI',
icon = 'fas fa-money-check',
Expand All @@ -121,7 +122,8 @@ function CreatePeds()
function pedPoint:onEnter()
lib.requestModel(self.model, 10000)

self.ped = CreatePed(0, self.model, self.coords.x, self.coords.y, self.coords.z-1, self.coords.w, false, false)
self.ped = CreatePed(0, self.model, self.coords.x, self.coords.y, self.coords.z-1, self.heading, false, false)
SetEntityHeading(self.ped, self.heading)
SetModelAsNoLongerNeeded(self.model)

TaskStartScenarioInPlace(self.ped, 'PROP_HUMAN_STAND_IMPATIENT', 0, true)
Expand Down
3 changes: 2 additions & 1 deletion config.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
lib.locale()
Config = {
framework = 'qb', -- QB, QBX, and ESX preconfigured edit the framework.lua to add functionality to other frameworks
-- Framework automatically detected
-- QB, QBX, and ESX preconfigured edit the framework.lua to add functionality to other frameworks
renewedMultiJob = false, -- QBCORE ONLY! https://github.com/Renewed-Scripts/qb-phone
progressbar = 'circle', -- circle or rectangle (Anything other than circle will default to rectangle)
currency = 'USD', -- USD, EUR, GBP ect.....
Expand Down
5 changes: 3 additions & 2 deletions server/framework.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local Framework = Config.framework == 'qb' and 'qb' or Config.framework == 'qbx' and 'qbx' or Config.framework == 'esx' and 'esx' or 'Unknown'
local Framework = GetResourceState('es_extended') == 'started' and 'esx' or GetResourceState('qbx_core') == 'started' and 'qbx' or GetResourceState('qb-core') == 'started' and 'qb' or 'Unknown'
local QBCore, ESX, Jobs, Gangs = nil, nil, nil, nil
local deadPlayers = {}

Expand Down Expand Up @@ -29,10 +29,11 @@ CreateThread(function()
ExportHandler("qb-management", "AddGangMoney", AddAccountMoney)
ExportHandler("qb-management", "RemoveMoney", RemoveAccountMoney)
ExportHandler("qb-management", "RemoveGangMoney", RemoveAccountMoney)
elseif Framework == 'esx'then
elseif Framework == 'esx' then
ESX = exports['es_extended']:getSharedObject()
ESX.RefreshJobs()
Jobs = ESX.GetJobs()
Gangs = {} -- ESX doesn't have gangs

-- Backwards Compatability
ExportHandler("esx_society", "GetSociety", GetAccountMoney)
Expand Down

0 comments on commit 4b503ce

Please sign in to comment.