rcore_clothing partial support
This relys on the default server file to handle most, but we have opening menus and when rcore_clothing provides as qb/esx_skin this should resolve the errors if the framework didnt match the bridged option. Formatting fixed, debug commands disabled as this is for production.
This commit is contained in:
1 parent
a280606c3d
commit
c7d638cbfb
13 files changed
+124
-174
No files matched your search
@@ -1,5 +1,4 @@
|
|||||||
--[[This module is incomplete]]--
|
---@diagnostic disable: duplicate-set-field
|
||||||
|
|
||||||
Clothing = Clothing or {}
|
Clothing = Clothing or {}
|
||||||
|
|
||||||
ClothingBackup = {}
|
ClothingBackup = {}
|
||||||
@@ -25,10 +24,12 @@ function Clothing.GetAppearance(entity)
|
|||||||
local model = GetEntityModel(entity)
|
local model = GetEntityModel(entity)
|
||||||
local skinData = { model = model, components = {}, props = {} }
|
local skinData = { model = model, components = {}, props = {} }
|
||||||
for i = 0, 11 do
|
for i = 0, 11 do
|
||||||
table.insert(skinData.components, { component_id = i, drawable = GetPedDrawableVariation(entity, i), texture = GetPedTextureVariation(entity, i) })
|
table.insert(skinData.components,
|
||||||
|
{ component_id = i, drawable = GetPedDrawableVariation(entity, i), texture = GetPedTextureVariation(entity, i) })
|
||||||
end
|
end
|
||||||
for i = 0, 13 do
|
for i = 0, 13 do
|
||||||
table.insert(skinData.props, { prop_id = i, drawable = GetPedPropIndex(entity, i), texture = GetPedPropTextureIndex(entity, i) })
|
table.insert(skinData.props,
|
||||||
|
{ prop_id = i, drawable = GetPedPropIndex(entity, i), texture = GetPedPropTextureIndex(entity, i) })
|
||||||
end
|
end
|
||||||
return skinData
|
return skinData
|
||||||
end
|
end
|
||||||
@@ -91,11 +92,10 @@ end, 1000)
|
|||||||
|
|
||||||
local onChange = nil
|
local onChange = nil
|
||||||
Clothing.ToggleDebugging = function()
|
Clothing.ToggleDebugging = function()
|
||||||
|
|
||||||
if Clothing.RunningDebug then
|
if Clothing.RunningDebug then
|
||||||
Clothing.RunningDebug = false
|
Clothing.RunningDebug = false
|
||||||
print("Clothing Debugging Disabled")
|
print("Clothing Debugging Disabled")
|
||||||
return Cache.RemoveOnChange('Clothing', onChange)
|
return Cache.RemoveOnChange('Clothing', onChange)
|
||||||
end
|
end
|
||||||
Clothing.RunningDebug = true
|
Clothing.RunningDebug = true
|
||||||
print("Clothing Debugging Enabled")
|
print("Clothing Debugging Enabled")
|
||||||
@@ -109,63 +109,23 @@ Clothing.ToggleDebugging = function()
|
|||||||
for k, v in pairs(old.components) do
|
for k, v in pairs(old.components) do
|
||||||
if v.component_id then
|
if v.component_id then
|
||||||
if new.components[k].drawable ~= v.drawable or new.components[k].texture ~= v.texture then
|
if new.components[k].drawable ~= v.drawable or new.components[k].texture ~= v.texture then
|
||||||
print("Component ID: " .. v.component_id .. " Drawable: " .. new.components[k].drawable .. " Texture: " .. new.components[k].texture)
|
print("Component ID: " ..
|
||||||
|
v.component_id ..
|
||||||
|
" Drawable: " .. new.components[k].drawable .. " Texture: " .. new.components[k].texture)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
for k, v in pairs(old.props) do
|
for k, v in pairs(old.props) do
|
||||||
if v.prop_id then
|
if v.prop_id then
|
||||||
if new.props[k].drawable ~= v.drawable or new.props[k].texture ~= v.texture then
|
if new.props[k].drawable ~= v.drawable or new.props[k].texture ~= v.texture then
|
||||||
print("Prop ID: " .. v.prop_id .. " Drawable: " .. new.props[k].drawable .. " Texture: " .. new.props[k].texture)
|
print("Prop ID: " ..
|
||||||
|
v.prop_id .. " Drawable: " .. new.props[k].drawable .. " Texture: " .. new.props[k].texture)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
-- CreateThread(function()
|
|
||||||
-- while Clothing.RunningDebug do
|
|
||||||
-- Wait(3)
|
|
||||||
-- local ped = PlayerPedId()
|
|
||||||
-- if ped then
|
|
||||||
-- if not Clothing.Cache then
|
|
||||||
-- Clothing.Cache = Clothing.GetAppearance(ped)
|
|
||||||
-- end
|
|
||||||
-- for k, v in pairs(Clothing.Cache.components) do
|
|
||||||
-- if v.component_id then
|
|
||||||
-- local drawable = GetPedDrawableVariation(ped, v.component_id)
|
|
||||||
-- local texture = GetPedTextureVariation(ped, v.component_id)
|
|
||||||
-- if drawable ~= v.drawable or texture ~= v.texture then
|
|
||||||
-- print("Component ID: " .. v.component_id .. " Drawable: " .. drawable .. " Texture: " .. texture)
|
|
||||||
-- Clothing.Cache.components[k].drawable = drawable
|
|
||||||
-- Clothing.Cache.components[k].texture = texture
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- for k, v in pairs(Clothing.Cache.props) do
|
|
||||||
-- if v.prop_id then
|
|
||||||
-- local drawable = GetPedPropIndex(ped, v.prop_id)
|
|
||||||
-- local texture = GetPedPropTextureIndex(ped, v.prop_id)
|
|
||||||
-- if drawable ~= v.drawable or texture ~= v.texture then
|
|
||||||
-- print("Prop ID: " .. v.prop_id .. " Drawable: " .. drawable .. " Texture: " .. texture)
|
|
||||||
-- Clothing.Cache.props[k].drawable = drawable
|
|
||||||
-- Clothing.Cache.props[k].texture = texture
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- -- esc key to exit
|
|
||||||
-- if IsControlJustPressed(0, 177) then
|
|
||||||
-- Clothing.RunningDebug = false
|
|
||||||
-- print("Clothing Debugging Disabled")
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- Clothing.Cache = nil
|
|
||||||
-- end)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
RegisterCommand("clothing:enabledebug", function(source, args, rawCommand)
|
|
||||||
Clothing.ToggleDebugging()
|
|
||||||
end)
|
|
||||||
|
|
||||||
RegisterNetEvent('community_bridge:client:SetAppearance', function(data)
|
RegisterNetEvent('community_bridge:client:SetAppearance', function(data)
|
||||||
Clothing.SetAppearance(PlayerPedId(), data)
|
Clothing.SetAppearance(PlayerPedId(), data)
|
||||||
end)
|
end)
|
||||||
@@ -178,10 +138,13 @@ RegisterNetEvent('community_bridge:client:RestoreAppearance', function()
|
|||||||
Clothing.RestoreAppearance(PlayerPedId())
|
Clothing.RestoreAppearance(PlayerPedId())
|
||||||
end)
|
end)
|
||||||
|
|
||||||
RegisterCommand("clothing:copy", function(source, args, rawCommand)
|
-- RegisterCommand("clothing:enabledebug", function(source, args, rawCommand)
|
||||||
Clothing.CopyAppearanceToClipboard()
|
-- Clothing.ToggleDebugging()
|
||||||
end)
|
-- end)
|
||||||
|
|
||||||
|
-- RegisterCommand("clothing:copy", function(source, args, rawCommand)
|
||||||
|
-- Clothing.CopyAppearanceToClipboard()
|
||||||
|
-- end)
|
||||||
|
|
||||||
|
|
||||||
|
return Clothing
|
||||||
return Clothing
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
--[[This module is incomplete]]--
|
---@diagnostic disable: duplicate-set-field
|
||||||
|
|
||||||
Clothing = Clothing or {}
|
Clothing = Clothing or {}
|
||||||
Clothing.LastAppearance = Clothing.LastAppearance or {}
|
Clothing.LastAppearance = Clothing.LastAppearance or {}
|
||||||
Callback = Callback or Require("lib/utility/shared/callbacks.lua")
|
Callback = Callback or Require("lib/utility/shared/callbacks.lua")
|
||||||
@@ -10,7 +9,6 @@ function Clothing.IsMale(src)
|
|||||||
return GetEntityModel(ped) == `mp_m_freemode_01`
|
return GetEntityModel(ped) == `mp_m_freemode_01`
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function Clothing.GetAppearance(src)
|
function Clothing.GetAppearance(src)
|
||||||
return Callback.Trigger('community_bridge:cb:GetAppearance', src)
|
return Callback.Trigger('community_bridge:cb:GetAppearance', src)
|
||||||
end
|
end
|
||||||
@@ -55,4 +53,4 @@ end
|
|||||||
-- Clothing.ReloadSkin(src)
|
-- Clothing.ReloadSkin(src)
|
||||||
-- end)
|
-- end)
|
||||||
|
|
||||||
return Clothing
|
return Clothing
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
---@diagnostic disable: duplicate-set-field
|
---@diagnostic disable: duplicate-set-field
|
||||||
if GetResourceState('esx_skin') == 'missing' then return end
|
if GetResourceState('esx_skin') == 'missing' then return end
|
||||||
|
if GetResourceState('rcore_clothing') ~= 'missing' then return end
|
||||||
Clothing = Clothing or {}
|
Clothing = Clothing or {}
|
||||||
|
|
||||||
function Clothing.OpenMenu()
|
function Clothing.OpenMenu()
|
||||||
TriggerEvent('esx_skin:openMenu', function()end, function()end, true)
|
TriggerEvent('esx_skin:openMenu', function() end, function() end, true)
|
||||||
end
|
end
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
---@diagnostic disable: duplicate-set-field
|
---@diagnostic disable: duplicate-set-field
|
||||||
if GetResourceState('esx_skin') == 'missing' then return end
|
if GetResourceState('esx_skin') == 'missing' then return end
|
||||||
|
if GetResourceState('rcore_clothing') ~= 'missing' then return end
|
||||||
Clothing = Clothing or {}
|
Clothing = Clothing or {}
|
||||||
Clothing.Players = {}
|
Clothing.Players = {}
|
||||||
|
|
||||||
@@ -17,7 +18,7 @@ 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 skin FROM users WHERE identifier = ?', { citId})
|
local result = MySQL.query.await('SELECT skin FROM users WHERE identifier = ?', { citId })
|
||||||
if result[1] == nil then return end
|
if result[1] == nil then return end
|
||||||
|
|
||||||
local model = GetEntityModel(GetPlayerPed(src))
|
local model = GetEntityModel(GetPlayerPed(src))
|
||||||
@@ -63,6 +64,7 @@ function Clothing.Save(src)
|
|||||||
citId
|
citId
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
---Sets a player's appearance based on the provided data
|
---Sets a player's appearance based on the provided data
|
||||||
---@param src number The server ID of the player
|
---@param src number The server ID of the player
|
||||||
---@param data table The appearance data to apply
|
---@param data table The appearance data to apply
|
||||||
@@ -172,4 +174,4 @@ end)
|
|||||||
Callback.Register('community_bridge:cb:GetAppearance', function(source)
|
Callback.Register('community_bridge:cb:GetAppearance', function(source)
|
||||||
local src = source
|
local src = source
|
||||||
return Clothing.GetAppearance(src)
|
return Clothing.GetAppearance(src)
|
||||||
end)
|
end)
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
---@diagnostic disable: duplicate-set-field
|
---@diagnostic disable: duplicate-set-field
|
||||||
if GetResourceState('esx_skin') == 'missing' then return end
|
if GetResourceState('esx_skin') == 'missing' then return end
|
||||||
|
if GetResourceState('rcore_clothing') ~= 'missing' then return end
|
||||||
|
|
||||||
Clothing = Clothing or {}
|
Clothing = Clothing or {}
|
||||||
|
|
||||||
@@ -58,19 +59,19 @@ Props.InverseMap = {
|
|||||||
-- Converts from illinium format to esx format
|
-- Converts from illinium format to esx format
|
||||||
function Components.ConvertFromDefault(defaultComponents)
|
function Components.ConvertFromDefault(defaultComponents)
|
||||||
local returnComponents = {}
|
local returnComponents = {}
|
||||||
for index, componentData in pairs(defaultComponents or {}) do
|
for index, componentData in pairs(defaultComponents or {}) do
|
||||||
local componentId = Components.Map[componentData.component_id]
|
local componentId = Components.Map[componentData.component_id]
|
||||||
if componentId then
|
if componentId then
|
||||||
returnComponents[componentId .. '_1'] = componentData.drawable
|
returnComponents[componentId .. '_1'] = componentData.drawable
|
||||||
returnComponents[componentId .. '_2'] = componentData.texture
|
returnComponents[componentId .. '_2'] = componentData.texture
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return returnComponents
|
return returnComponents
|
||||||
end
|
end
|
||||||
|
|
||||||
function Components.ConvertToDefault(esxComponents)
|
function Components.ConvertToDefault(esxComponents)
|
||||||
local returnComponents = {}
|
local returnComponents = {}
|
||||||
for componentIndex, componentData in pairs(esxComponents or {}) do
|
for componentIndex, componentData in pairs(esxComponents or {}) do
|
||||||
local isTexture = componentIndex:find('_2')
|
local isTexture = componentIndex:find('_2')
|
||||||
componentIndex = componentIndex:gsub('_1', ''):gsub('_2', '')
|
componentIndex = componentIndex:gsub('_1', ''):gsub('_2', '')
|
||||||
local componentId = Components.InverseMap[componentIndex]
|
local componentId = Components.InverseMap[componentIndex]
|
||||||
@@ -103,7 +104,7 @@ end
|
|||||||
|
|
||||||
function Props.ConvertToDefault(esxProps)
|
function Props.ConvertToDefault(esxProps)
|
||||||
local returnProps = {}
|
local returnProps = {}
|
||||||
for propIndex, propData in pairs(esxProps or {}) do
|
for propIndex, propData in pairs(esxProps or {}) do
|
||||||
local isTexture = propIndex:find('_2')
|
local isTexture = propIndex:find('_2')
|
||||||
propIndex = propIndex:gsub('_1', ''):gsub('_2', '')
|
propIndex = propIndex:gsub('_1', ''):gsub('_2', '')
|
||||||
local propId = Props.InverseMap[propIndex]
|
local propId = Props.InverseMap[propIndex]
|
||||||
@@ -142,19 +143,6 @@ function Clothing.ConvertToDefault(esxClothing)
|
|||||||
return { components = components, props = props }
|
return { components = components, props = props }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Clothing = {}
|
-- Clothing = {}
|
||||||
|
|
||||||
-- StoredOldClothing = {}
|
-- StoredOldClothing = {}
|
||||||
@@ -213,4 +201,4 @@ end
|
|||||||
-- end
|
-- end
|
||||||
-- end
|
-- end
|
||||||
-- TriggerEvent('esx-clothing:client:loadOutfit', repackedTable)
|
-- TriggerEvent('esx-clothing:client:loadOutfit', repackedTable)
|
||||||
-- end
|
-- end
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
---@diagnostic disable: duplicate-set-field
|
---@diagnostic disable: duplicate-set-field
|
||||||
if GetResourceState('fivem-appearance') == 'missing' then return end
|
if GetResourceState('fivem-appearance') == 'missing' then return end
|
||||||
|
if GetResourceState('rcore_clothing') ~= 'missing' then return end
|
||||||
Clothing = Clothing or {}
|
Clothing = Clothing or {}
|
||||||
|
|
||||||
function Clothing.OpenMenu()
|
function Clothing.OpenMenu()
|
||||||
TriggerEvent('qb-clothing:client:openMenu')
|
TriggerEvent('qb-clothing:client:openMenu')
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
---@diagnostic disable: duplicate-set-field
|
---@diagnostic disable: duplicate-set-field
|
||||||
if GetResourceState('fivem-appearance') == 'missing' then return end
|
if GetResourceState('fivem-appearance') == 'missing' then return end
|
||||||
|
if GetResourceState('rcore_clothing') ~= 'missing' then return end
|
||||||
Clothing = Clothing or {}
|
Clothing = Clothing or {}
|
||||||
Clothing.Players = {}
|
Clothing.Players = {}
|
||||||
|
|
||||||
@@ -159,20 +160,20 @@ end)
|
|||||||
RegisterCommand('clothing:debug', function(source, args, rawCommand)
|
RegisterCommand('clothing:debug', function(source, args, rawCommand)
|
||||||
local src = source
|
local src = source
|
||||||
Clothing.SetAppearance(src, {
|
Clothing.SetAppearance(src, {
|
||||||
components ={
|
components = {
|
||||||
{component_id = 1, drawable = math.random(0, 50), texture = 0},
|
{ component_id = 1, drawable = math.random(0, 50), texture = 0 },
|
||||||
{component_id = 2, drawable = math.random(0, 50), texture = 0},
|
{ component_id = 2, drawable = math.random(0, 50), texture = 0 },
|
||||||
{component_id = 3, drawable = math.random(0, 50), texture = 0},
|
{ component_id = 3, drawable = math.random(0, 50), texture = 0 },
|
||||||
{component_id = 4, drawable = math.random(0, 50), texture = 0},
|
{ component_id = 4, drawable = math.random(0, 50), texture = 0 },
|
||||||
{component_id = 5, drawable = math.random(0, 50), texture = 0},
|
{ component_id = 5, drawable = math.random(0, 50), texture = 0 },
|
||||||
{component_id = 6, drawable = math.random(0, 50), texture = 0},
|
{ component_id = 6, drawable = math.random(0, 50), texture = 0 },
|
||||||
{component_id = 7, drawable = math.random(0, 50), texture = 0},
|
{ component_id = 7, drawable = math.random(0, 50), texture = 0 },
|
||||||
{component_id = 8, drawable = math.random(0, 50), texture = 0},
|
{ component_id = 8, drawable = math.random(0, 50), texture = 0 },
|
||||||
},
|
},
|
||||||
props = {
|
props = {
|
||||||
{prop_id = 3, drawable = 0, texture = 0},
|
{ prop_id = 3, drawable = 0, texture = 0 },
|
||||||
{prop_id = 1, drawable = 0, texture = 0},
|
{ prop_id = 1, drawable = 0, texture = 0 },
|
||||||
{prop_id = 2, drawable = 0, texture = 0},
|
{ prop_id = 2, drawable = 0, texture = 0 },
|
||||||
}
|
}
|
||||||
}, false, true)
|
}, false, true)
|
||||||
end, false)
|
end, false)
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
---@diagnostic disable: duplicate-set-field
|
---@diagnostic disable: duplicate-set-field
|
||||||
if GetResourceState('illenium-appearance') == 'missing' then return end
|
if GetResourceState('illenium-appearance') == 'missing' then return end
|
||||||
|
if GetResourceState('rcore_clothing') ~= 'missing' then return end
|
||||||
Clothing = Clothing or {}
|
Clothing = Clothing or {}
|
||||||
|
|
||||||
function Clothing.OpenMenu()
|
function Clothing.OpenMenu()
|
||||||
TriggerEvent('qb-clothing:client:openMenu')
|
TriggerEvent('qb-clothing:client:openMenu')
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
---@diagnostic disable: duplicate-set-field
|
---@diagnostic disable: duplicate-set-field
|
||||||
if GetResourceState('illenium-appearance') == 'missing' then return end
|
if GetResourceState('illenium-appearance') == 'missing' then return end
|
||||||
|
if GetResourceState('rcore_clothing') ~= 'missing' then return end
|
||||||
Clothing = Clothing or {}
|
Clothing = Clothing or {}
|
||||||
Clothing.Players = {}
|
Clothing.Players = {}
|
||||||
|
|
||||||
@@ -161,35 +162,35 @@ end)
|
|||||||
RegisterCommand('clothing:debug', function(source, args, rawCommand)
|
RegisterCommand('clothing:debug', function(source, args, rawCommand)
|
||||||
local src = source
|
local src = source
|
||||||
Clothing.SetAppearance(src, {
|
Clothing.SetAppearance(src, {
|
||||||
components ={
|
components = {
|
||||||
{component_id = 0, drawable = math.random(0, 50), texture = 0},
|
{ component_id = 0, drawable = math.random(0, 50), texture = 0 },
|
||||||
{component_id = 1, drawable = math.random(0, 50), texture = 0},
|
{ component_id = 1, drawable = math.random(0, 50), texture = 0 },
|
||||||
{component_id = 2, drawable = math.random(0, 50), texture = 0},
|
{ component_id = 2, drawable = math.random(0, 50), texture = 0 },
|
||||||
{component_id = 3, drawable = math.random(0, 50), texture = 0},
|
{ component_id = 3, drawable = math.random(0, 50), texture = 0 },
|
||||||
{component_id = 4, drawable = math.random(0, 50), texture = 0},
|
{ component_id = 4, drawable = math.random(0, 50), texture = 0 },
|
||||||
{component_id = 5, drawable = math.random(0, 50), texture = 0},
|
{ component_id = 5, drawable = math.random(0, 50), texture = 0 },
|
||||||
{component_id = 6, drawable = math.random(0, 50), texture = 0},
|
{ component_id = 6, drawable = math.random(0, 50), texture = 0 },
|
||||||
{component_id = 7, drawable = math.random(0, 50), texture = 0},
|
{ component_id = 7, drawable = math.random(0, 50), texture = 0 },
|
||||||
{component_id = 8, drawable = math.random(0, 50), texture = 0},
|
{ component_id = 8, drawable = math.random(0, 50), texture = 0 },
|
||||||
{component_id = 9, drawable = math.random(0, 50), texture = 0},
|
{ component_id = 9, drawable = math.random(0, 50), texture = 0 },
|
||||||
{component_id = 10, drawable = math.random(0, 50), texture = 0},
|
{ component_id = 10, drawable = math.random(0, 50), texture = 0 },
|
||||||
{component_id = 11, drawable = math.random(0, 50), texture = 0},
|
{ component_id = 11, drawable = math.random(0, 50), texture = 0 },
|
||||||
},
|
},
|
||||||
props = {
|
props = {
|
||||||
{prop_id = 0, drawable = math.random(0, 50), texture = 0},
|
{ prop_id = 0, drawable = math.random(0, 50), texture = 0 },
|
||||||
{prop_id = 1, drawable = math.random(0, 50), texture = 0},
|
{ prop_id = 1, drawable = math.random(0, 50), texture = 0 },
|
||||||
{prop_id = 2, drawable = math.random(0, 50), texture = 0},
|
{ prop_id = 2, drawable = math.random(0, 50), texture = 0 },
|
||||||
{prop_id = 3, drawable = math.random(0, 50), texture = 0},
|
{ prop_id = 3, drawable = math.random(0, 50), texture = 0 },
|
||||||
{prop_id = 4, drawable = math.random(0, 50), texture = 0},
|
{ prop_id = 4, drawable = math.random(0, 50), texture = 0 },
|
||||||
{prop_id = 5, drawable = math.random(0, 50), texture = 0},
|
{ prop_id = 5, drawable = math.random(0, 50), texture = 0 },
|
||||||
{prop_id = 6, drawable = math.random(0, 50), texture = 0},
|
{ prop_id = 6, drawable = math.random(0, 50), texture = 0 },
|
||||||
{prop_id = 7, drawable = math.random(0, 50), texture = 0},
|
{ prop_id = 7, drawable = math.random(0, 50), texture = 0 },
|
||||||
{prop_id = 8, drawable = math.random(0, 50), texture = 0},
|
{ prop_id = 8, drawable = math.random(0, 50), texture = 0 },
|
||||||
{prop_id = 9, drawable = math.random(0, 50), texture = 0},
|
{ prop_id = 9, drawable = math.random(0, 50), texture = 0 },
|
||||||
{prop_id = 10, drawable = math.random(0, 50), texture = 0},
|
{ prop_id = 10, drawable = math.random(0, 50), texture = 0 },
|
||||||
{prop_id = 11, drawable = math.random(0, 50), texture = 0},
|
{ prop_id = 11, drawable = math.random(0, 50), texture = 0 },
|
||||||
{prop_id = 12, drawable = math.random(0, 50), texture = 0},
|
{ prop_id = 12, drawable = math.random(0, 50), texture = 0 },
|
||||||
{prop_id = 13, drawable = math.random(0, 50), texture = 0},
|
{ prop_id = 13, drawable = math.random(0, 50), texture = 0 },
|
||||||
}
|
}
|
||||||
}, false, true)
|
}, false, true)
|
||||||
end, false)
|
end, false)
|
||||||
@@ -218,34 +219,34 @@ RegisterCommand('clothing:crowley', function(source, args, rawCommand)
|
|||||||
local src = source
|
local src = source
|
||||||
Clothing.SetAppearance(src, {
|
Clothing.SetAppearance(src, {
|
||||||
components = {
|
components = {
|
||||||
{drawable = 0, texture = 0, component_id = 0},
|
{ drawable = 0, texture = 0, component_id = 0 },
|
||||||
{drawable = 0, texture = 0, component_id = 1},
|
{ drawable = 0, texture = 0, component_id = 1 },
|
||||||
{drawable = 19, texture = 0, component_id = 2},
|
{ drawable = 19, texture = 0, component_id = 2 },
|
||||||
{drawable = 6, texture = 0, component_id = 3},
|
{ drawable = 6, texture = 0, component_id = 3 },
|
||||||
{drawable = 0, texture = 0, component_id = 4},
|
{ drawable = 0, texture = 0, component_id = 4 },
|
||||||
{drawable = 0, texture = 0, component_id = 5},
|
{ drawable = 0, texture = 0, component_id = 5 },
|
||||||
{drawable = 0, texture = 0, component_id = 6},
|
{ drawable = 0, texture = 0, component_id = 6 },
|
||||||
{drawable = 0, texture = 0, component_id = 7},
|
{ drawable = 0, texture = 0, component_id = 7 },
|
||||||
{drawable = 23, texture = 0, component_id = 8},
|
{ drawable = 23, texture = 0, component_id = 8 },
|
||||||
{drawable = 0, texture = 0, component_id = 9},
|
{ drawable = 0, texture = 0, component_id = 9 },
|
||||||
{drawable = 0, texture = 0, component_id = 10},
|
{ drawable = 0, texture = 0, component_id = 10 },
|
||||||
{drawable = 4, texture = 2, component_id = 11}
|
{ drawable = 4, texture = 2, component_id = 11 }
|
||||||
},
|
},
|
||||||
props = {
|
props = {
|
||||||
{drawable = 27, prop_id = 0, texture = 0},
|
{ drawable = 27, prop_id = 0, texture = 0 },
|
||||||
{drawable = 0, prop_id = 1, texture = 0},
|
{ drawable = 0, prop_id = 1, texture = 0 },
|
||||||
{drawable = 0, prop_id = 2, texture = 0},
|
{ drawable = 0, prop_id = 2, texture = 0 },
|
||||||
{drawable = 0, prop_id = 3, texture = 0},
|
{ drawable = 0, prop_id = 3, texture = 0 },
|
||||||
{drawable = 0, prop_id = 4, texture = 0},
|
{ drawable = 0, prop_id = 4, texture = 0 },
|
||||||
{drawable = 0, prop_id = 5, texture = 0},
|
{ drawable = 0, prop_id = 5, texture = 0 },
|
||||||
{drawable = 0, prop_id = 6, texture = 0},
|
{ drawable = 0, prop_id = 6, texture = 0 },
|
||||||
{drawable = 0, prop_id = 7, texture = 0},
|
{ drawable = 0, prop_id = 7, texture = 0 },
|
||||||
{drawable = 0, prop_id = 8, texture = 0},
|
{ drawable = 0, prop_id = 8, texture = 0 },
|
||||||
{drawable = 0, prop_id = 9, texture = 0},
|
{ drawable = 0, prop_id = 9, texture = 0 },
|
||||||
{drawable = 0, prop_id = 10, texture = 0},
|
{ drawable = 0, prop_id = 10, texture = 0 },
|
||||||
{drawable = 0, prop_id = 11, texture = 0},
|
{ drawable = 0, prop_id = 11, texture = 0 },
|
||||||
{drawable = 0, prop_id = 12, texture = 0},
|
{ drawable = 0, prop_id = 12, texture = 0 },
|
||||||
{drawable = 0, prop_id = 13, texture = 0}
|
{ drawable = 0, prop_id = 13, texture = 0 }
|
||||||
|
|
||||||
}
|
}
|
||||||
}, false, true)
|
}, false, true)
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
---@diagnostic disable: duplicate-set-field
|
---@diagnostic disable: duplicate-set-field
|
||||||
if GetResourceState('qb-clothing') == 'missing' then return end
|
if GetResourceState('qb-clothing') == 'missing' then return end
|
||||||
|
if GetResourceState('rcore_clothing') ~= 'missing' then return end
|
||||||
Clothing = Clothing or {}
|
Clothing = Clothing or {}
|
||||||
|
|
||||||
function Clothing.OpenMenu()
|
function Clothing.OpenMenu()
|
||||||
TriggerEvent('qb-clothing:client:openMenu')
|
TriggerEvent('qb-clothing:client:openMenu')
|
||||||
end
|
end
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
---@diagnostic disable: duplicate-set-field
|
---@diagnostic disable: duplicate-set-field
|
||||||
if GetResourceState('qb-clothing') == 'missing' then return end
|
if GetResourceState('qb-clothing') == 'missing' then return end
|
||||||
|
if GetResourceState('rcore_clothing') ~= 'missing' then return end
|
||||||
Clothing = Clothing or {}
|
Clothing = Clothing or {}
|
||||||
Clothing.Players = {}
|
Clothing.Players = {}
|
||||||
|
|
||||||
@@ -235,4 +236,4 @@ end, false)
|
|||||||
-- -- {drawable = 0, prop_id = 7, texture = 0},
|
-- -- {drawable = 0, prop_id = 7, texture = 0},
|
||||||
-- }
|
-- }
|
||||||
-- }, false, true)
|
-- }, false, true)
|
||||||
-- end, false)
|
-- end, false)
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
|
|
||||||
if GetResourceState('qb-clothing') == 'missing' then return end
|
if GetResourceState('qb-clothing') == 'missing' then return end
|
||||||
|
if GetResourceState('rcore_clothing') ~= 'missing' then return end
|
||||||
|
|
||||||
Clothing = Clothing or {}
|
Clothing = Clothing or {}
|
||||||
|
|
||||||
@@ -49,7 +51,7 @@ Props.InverseMap = {
|
|||||||
|
|
||||||
function Components.ConvertFromDefault(defaultComponents)
|
function Components.ConvertFromDefault(defaultComponents)
|
||||||
local returnComponents = {}
|
local returnComponents = {}
|
||||||
for index, componentData in pairs(defaultComponents or {}) do
|
for index, componentData in pairs(defaultComponents or {}) do
|
||||||
local componentId = Components.Map[componentData.component_id]
|
local componentId = Components.Map[componentData.component_id]
|
||||||
if componentId then
|
if componentId then
|
||||||
returnComponents[componentId] = {
|
returnComponents[componentId] = {
|
||||||
@@ -58,12 +60,12 @@ function Components.ConvertFromDefault(defaultComponents)
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return returnComponents
|
return returnComponents
|
||||||
end
|
end
|
||||||
|
|
||||||
function Components.ConvertToDefault(qbComponents)
|
function Components.ConvertToDefault(qbComponents)
|
||||||
local returnComponents = {}
|
local returnComponents = {}
|
||||||
for componentIndex, componentData in pairs(qbComponents or {}) do
|
for componentIndex, componentData in pairs(qbComponents or {}) do
|
||||||
local componentId = Components.InverseMap[componentIndex]
|
local componentId = Components.InverseMap[componentIndex]
|
||||||
if componentId then
|
if componentId then
|
||||||
returnComponents[componentId] = {
|
returnComponents[componentId] = {
|
||||||
@@ -78,7 +80,7 @@ end
|
|||||||
|
|
||||||
function Props.ConvertFromDefault(defaultProps)
|
function Props.ConvertFromDefault(defaultProps)
|
||||||
local returnProps = {}
|
local returnProps = {}
|
||||||
for index, propData in pairs(defaultProps or {}) do
|
for index, propData in pairs(defaultProps or {}) do
|
||||||
local propId = Props.Map[propData.prop_id]
|
local propId = Props.Map[propData.prop_id]
|
||||||
if propId then
|
if propId then
|
||||||
returnProps[propId] = {
|
returnProps[propId] = {
|
||||||
@@ -87,7 +89,7 @@ function Props.ConvertFromDefault(defaultProps)
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return returnProps
|
return returnProps
|
||||||
end
|
end
|
||||||
|
|
||||||
function Props.ConvertToDefault(qbProps)
|
function Props.ConvertToDefault(qbProps)
|
||||||
@@ -125,21 +127,6 @@ function Clothing.ConvertToDefault(qbClothing)
|
|||||||
return { components = components, props = props }
|
return { components = components, props = props }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Clothing = {}
|
-- Clothing = {}
|
||||||
|
|
||||||
-- StoredOldClothing = {}
|
-- StoredOldClothing = {}
|
||||||
@@ -198,4 +185,4 @@ end
|
|||||||
-- end
|
-- end
|
||||||
-- end
|
-- end
|
||||||
-- TriggerEvent('qb-clothing:client:loadOutfit', repackedTable)
|
-- TriggerEvent('qb-clothing:client:loadOutfit', repackedTable)
|
||||||
-- end
|
-- end
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
---@diagnostic disable: duplicate-set-field
|
||||||
|
if GetResourceState('rcore_clothing') == 'missing' then return end
|
||||||
|
Clothing = Clothing or {}
|
||||||
|
|
||||||
|
function Clothing.OpenMenu()
|
||||||
|
TriggerEvent('qb-clothing:client:openMenu')
|
||||||
|
end
|
||||||
Reference in new issue
Block a user