Clothing and clipboard update
QBClothing and ESKSkin working. Need others (WIP) Copy to clipboard now a utility function. Will json encode if ~= string
This commit is contained in:
1 parent
b9f5a3ed64
commit
d4908042be
16 files changed
+1306
-44
No files matched your search
@@ -1,34 +1,58 @@
|
||||
--[[This module is incomplete]]--
|
||||
|
||||
Clothing = Clothing or {}
|
||||
Clothing.LastAppearance = Clothing.LastAppearance or {}
|
||||
Callback = Callback or Require("lib/utility/shared/callbacks.lua")
|
||||
|
||||
function Clothing.IsMale(src)
|
||||
local ped = GetPlayerPed(src)
|
||||
if not ped or not DoesEntityExist(ped) then return end
|
||||
return GetEntityModel(ped) == `mp_m_freemode_01`
|
||||
end
|
||||
|
||||
|
||||
function Clothing.GetAppearance(src)
|
||||
return Callback.Trigger('community_bridge:cb:GetAppearance', src)
|
||||
end
|
||||
|
||||
Clothing.SetAppearance = function(src, data)
|
||||
local strSrc = tostring(src)
|
||||
Clothing.LastAppearance[strSrc] = Clothing.GetAppearance(src)
|
||||
TriggerClientEvent('community_bridge:client:SetAppearance', src, data)
|
||||
end
|
||||
|
||||
--- Sets a player's appearance based on gender-specific data
|
||||
--- @param src number The server ID of the player
|
||||
--- @param data table Table containing separate appearance data for male and female characters
|
||||
--- @return table|nil Appearance updated player appearance data or nil if failed
|
||||
function Clothing.SetAppearanceExt(src, data)
|
||||
local tbl = Clothing.IsMale(src) and data.male or data.female
|
||||
Clothing.SetAppearance(src, tbl)
|
||||
end
|
||||
|
||||
Clothing.RestoreAppearance = function(src)
|
||||
TriggerClientEvent('community_bridge:client:RestoreAppearance', src)
|
||||
end
|
||||
|
||||
Clothing.ReloadSkin = function(src)
|
||||
TriggerClientEvent('community_bridge:client:ReloadSkin', src)
|
||||
end
|
||||
|
||||
-- RegisterNetEvent('community_bridge:client:SetAppearance', function(data)
|
||||
-- local src = source
|
||||
-- Clothing.SetAppearance(src, data)
|
||||
-- end)
|
||||
|
||||
RegisterNetEvent('community_bridge:client:SetAppearance', function(data)
|
||||
Clothing.SetAppearance(data)
|
||||
end)
|
||||
-- RegisterNetEvent('community_bridge:client:GetAppearance', function()
|
||||
-- local src = source
|
||||
-- Clothing.GetAppearance(src)
|
||||
-- end)
|
||||
|
||||
RegisterNetEvent('community_bridge:client:GetAppearance', function()
|
||||
Clothing.GetAppearance()
|
||||
end)
|
||||
-- RegisterNetEvent('community_bridge:client:RestoreAppearance', function()
|
||||
-- local src = source
|
||||
-- Clothing.RestoreAppearance(src)
|
||||
-- end)
|
||||
|
||||
RegisterNetEvent('community_bridge:client:RestoreAppearance', function()
|
||||
Clothing.RestoreAppearance()
|
||||
end)
|
||||
|
||||
RegisterNetEvent('community_bridge:client:ReloadSkin', function()
|
||||
Clothing.ReloadSkin()
|
||||
end)
|
||||
-- RegisterNetEvent('community_bridge:client:ReloadSkin', function()
|
||||
-- local src = source
|
||||
-- Clothing.ReloadSkin(src)
|
||||
-- end)
|
||||
|
||||
return Clothing
|
||||
Reference in new issue
Block a user