update for fivem appearance
should be working for esx now
This commit is contained in:
1 parent
d6cb8ece6c
commit
7a598dd8d8
2 files changed
+16
-13
No files matched your search
@@ -9,9 +9,6 @@ ClientEntity = {} -- Renamed from BaseEntity
|
|||||||
local function SpawnEntity(entityData)
|
local function SpawnEntity(entityData)
|
||||||
entityData = entityData and entityData.args
|
entityData = entityData and entityData.args
|
||||||
if entityData.spawned and DoesEntityExist(entityData.spawned) then return end -- Already spawned
|
if entityData.spawned and DoesEntityExist(entityData.spawned) then return end -- Already spawned
|
||||||
-- for k, v in pairs(entityData.args) do
|
|
||||||
-- print(string.format("SpawnEntity %s: %s", k, v))
|
|
||||||
-- end
|
|
||||||
local loaded, model = Utility.LoadModel(entityData.model)
|
local loaded, model = Utility.LoadModel(entityData.model)
|
||||||
if not loaded then
|
if not loaded then
|
||||||
print(string.format("[ClientEntity] Failed to load model %s for entity %s", entityData.model, entityData.id))
|
print(string.format("[ClientEntity] Failed to load model %s for entity %s", entityData.model, entityData.id))
|
||||||
@@ -40,9 +37,6 @@ local function SpawnEntity(entityData)
|
|||||||
else
|
else
|
||||||
SetModelAsNoLongerNeeded(model)
|
SetModelAsNoLongerNeeded(model)
|
||||||
end
|
end
|
||||||
-- if entityData.OnSpawn then
|
|
||||||
-- entityData.OnSpawn(entityData)
|
|
||||||
-- end
|
|
||||||
if entityData.OnSpawn then
|
if entityData.OnSpawn then
|
||||||
pcall(function (...)
|
pcall(function (...)
|
||||||
return entityData.OnSpawn(entityData)
|
return entityData.OnSpawn(entityData)
|
||||||
|
|||||||
@@ -18,13 +18,22 @@ function Clothing.GetFullAppearanceData(src)
|
|||||||
|
|
||||||
if Clothing.Players[citId] then return Clothing.Players[citId] end
|
if Clothing.Players[citId] then return Clothing.Players[citId] end
|
||||||
|
|
||||||
local result = MySQL.query.await('SELECT * FROM playerskins WHERE citizenid = ? AND active = ?', { citId, 1 })
|
local result = nil
|
||||||
if result[1] == nil then return end
|
local model = GetEntityModel(GetPlayerPed(src))
|
||||||
|
local skinData = nil
|
||||||
local model = result[1].model
|
local converted = nil
|
||||||
local skinData = json.decode(result[1].skin)
|
if Bridge.Framework.GetFrameworkName() == "es_extended" then
|
||||||
local converted = skinData
|
result = MySQL.query.await('SELECT skin FROM users WHERE identifier = ?', { citId })
|
||||||
|
if not result or not result[1] then return end
|
||||||
|
skinData = json.decode(result[1].skin)
|
||||||
|
converted = skinData
|
||||||
|
else
|
||||||
|
result = MySQL.query.await('SELECT * FROM playerskins WHERE citizenid = ? AND active = ?', { citId, 1 })
|
||||||
|
if not result or not result[1] then return end
|
||||||
|
model = result[1].model
|
||||||
|
skinData = json.decode(result[1].skin)
|
||||||
|
converted = skinData
|
||||||
|
end
|
||||||
-- Store complete data in the cache
|
-- Store complete data in the cache
|
||||||
Clothing.Players[citId] = {
|
Clothing.Players[citId] = {
|
||||||
model = model,
|
model = model,
|
||||||
|
|||||||
Reference in new issue
Block a user