Skip to content

Commit aaa31a9

Browse files
authored
Update v1.0.1
- Added a support for QB Inventory. - Added appearance and inventory to bridge. - Added blacklist for hat & mask clipping. - Added missing options to take off watches and bracelets. - Added commands to configuration. - Added missing translations. - Fixed the "Take off player outfit" option. - Fixed a duplication of gloves. - Fixed an error when trying to take off clothes using context menu. - Fixed an error when taking off clothes on QB. - Fixed a wrong label for the hat item. - Fixed disappearing hair when taking off an outfit. - Fixed small errors and did some tweaks to the code.
1 parent db866d0 commit aaa31a9

File tree

21 files changed

+502
-217
lines changed

21 files changed

+502
-217
lines changed

bridge/appearance/esx_skin/client.lua

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
if GetResourceState('skinchanger') ~= 'started' or GetResourceState('esx_skin') ~= 'started' and GetResourceState('fivem-appearance') ~= 'started' then return end
2+
3+
appearance = {}
4+
5+
appearance.saveSkin = function()
6+
TriggerEvent('skinchanger:getSkin', function(getSkin)
7+
TriggerServerEvent('esx_skin:save', getSkin)
8+
return true
9+
end)
10+
11+
return false
12+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
if GetResourceState('fivem-appearance') ~= 'started' then return end
2+
3+
appearance = {}
4+
5+
appearance.saveSkin = function()
6+
local appearance = exports['fivem-appearance']:getPedAppearance(cache.ped)
7+
if appearance then
8+
TriggerServerEvent('fivem-appearance:save', appearance)
9+
return true
10+
end
11+
12+
return false
13+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
if GetResourceState('illenium-appearance') ~= 'started' then return end
2+
3+
appearance = {}
4+
5+
appearance.saveSkin = function()
6+
local appearance = exports['illenium-appearance']:getPedAppearance(cache.ped)
7+
if appearance then
8+
TriggerServerEvent('illenium-appearance:server:saveAppearance', appearance)
9+
return true
10+
end
11+
12+
return false
13+
end
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
if GetResourceState('ox_appearance') ~= 'started' then return end
2+
3+
appearance = {}
4+
5+
appearance.saveSkin = function()
6+
local appearance = exports['fivem-appearance']:getPedAppearance(cache.ped)
7+
if appearance then
8+
TriggerServerEvent('ox_appearance:save', appearance)
9+
return true
10+
end
11+
12+
return false
13+
end
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
if GetResourceState('qb-clothing') ~= 'started' then return end
2+
error('qb_clothing is not supported!')
3+
4+
appearance = {}
5+
6+
appearance.saveSkin = function()
7+
local appearance = exports['fivem-appearance']:getPedAppearance(cache.ped)
8+
local model = IsPedMale(cache.ped) and 'mp_m_freemode_01' or 'mp_f_freemode_01'
9+
if appearance and model then
10+
TriggerServerEvent('qb-clothing:saveSkin', model , appearance)
11+
return true
12+
end
13+
14+
return false
15+
end

bridge/framework/esx/server.lua

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
if GetResourceState('es_extended') ~= 'started' then return end
2+
ESX = exports.es_extended:getSharedObject()
3+
4+
local framework = {}
5+
6+
framework.getPlayerName = function(playerId)
7+
local player = ESX.GetPlayerFromId(playerId)
8+
9+
if player then
10+
return player.getName()
11+
end
12+
13+
return GetPlayerName(playerId)
14+
end

bridge/framework/ox/server.lua

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
if GetResourceState('ox_core') ~= 'started' then return end
2+
CreateThread(function() lib.load('@ox_core.imports.server') end)
3+
4+
local framework = {}
5+
6+
framework.getPlayerName = function(playerId)
7+
local player = Ox.GetPlayer(playerId)
8+
9+
if player and player.charId then
10+
return player.firstName .. ' ' .. player.lastName
11+
end
12+
13+
return GetPlayerName(playerId)
14+
end

bridge/framework/qb/server.lua

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
if GetResourceState('qb-core') ~= 'started' then return end
2+
QBCore = exports['qb-core']:GetCoreObject()
3+
4+
local framework = {}
5+
6+
framework.getPlayerName = function(playerId)
7+
local player = QBCore.Functions.GetPlayer(playerId)
8+
9+
if player then
10+
return player.PlayerData.charinfo.firstname .. ' ' .. player.PlayerData.charinfo.lastname
11+
end
12+
13+
return GetPlayerName(playerId)
14+
end
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
if GetResourceState('ox_inventory') ~= 'started' then return end
2+
local ox_inventory = exports.ox_inventory
3+
4+
inventory = {}
5+
6+
inventory.Search = function(item)
7+
local count = ox_inventory:Search('count', item)
8+
if count > 0 then
9+
return true
10+
end
11+
12+
return false
13+
end
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
if GetResourceState('ox_inventory') ~= 'started' then return end
2+
local ox_inventory = exports.ox_inventory
3+
4+
inventory = {}
5+
6+
inventory.AddItem = function(source, item, amount, metadata)
7+
if metadata then
8+
ox_inventory:AddItem(source, item, amount, metadata)
9+
else
10+
ox_inventory:AddItem(source, item, amount)
11+
end
12+
end
13+
14+
inventory.RemoveItem = function(source, item, amount, metadata, slot)
15+
ox_inventory:RemoveItem(source, item, amount, metadata, slot)
16+
end
17+
18+
inventory.GetSlot = function(source, slot)
19+
return ox_inventory:GetSlot(source, slot)
20+
end
21+
22+
inventory.SetMetadata = function(source, slot, metadata)
23+
ox_inventory:SetMetadata(source, slot, metadata)
24+
end
25+
26+
inventory.GetActiveInventory = function()
27+
return 'ox_inventory'
28+
end
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
if GetResourceState('qb-inventory') ~= 'started' then return end
2+
local qbinventory = exports['qb-inventory']
3+
4+
inventory = {}
5+
6+
inventory.Search = function(item)
7+
return qbinventory:HasItem(item, 1)
8+
end
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
if GetResourceState('qb-inventory') ~= 'started' then return end
2+
local qbinventory = exports['qb-inventory']
3+
4+
inventory = {}
5+
6+
inventory.AddItem = function(source, item, amount, metadata)
7+
local player = QBCore.Functions.GetPlayer(source)
8+
if metadata then
9+
player.Functions.AddItem(source, item, amount, metadata)
10+
else
11+
player.Functions.AddItem(source, item, amount)
12+
end
13+
TriggerEvent('inventory:client:ItemBox', QBCore.Shared.Items[item], "add")
14+
end
15+
16+
inventory.RemoveItem = function(source, item, amount, metadata, slot)
17+
local player = QBCore.Functions.GetPlayer(source)
18+
player.Functions.RemoveItem(source, item, amount, metadata, slot)
19+
TriggerEvent('inventory:client:ItemBox', QBCore.Shared.Items[item], "remove")
20+
end
21+
22+
inventory.GetSlot = function(source, slot)
23+
return qbinventory:GetItemBySlot(source, slot)
24+
end
25+
26+
inventory.SetMetadata = function(source, slot, metadata)
27+
qbinventory:SetItemData(source, slot, 'label', metadata)
28+
end
29+
30+
inventory.GetActiveInventory = function()
31+
return 'qb-inventory'
32+
end

0 commit comments

Comments
 (0)