Update functions.lua
This commit is contained in:
1 parent
84e890b232
commit
5c8076c651
1 file changed
+11
-2
+11
-2
@@ -42,7 +42,15 @@ if logs == false then return end
|
|||||||
buffer = nil
|
buffer = nil
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
local invname = ''
|
||||||
|
CreateThread(function()
|
||||||
|
if GetResourceState('ps-inventory') == 'started' then
|
||||||
|
invname = 'ps-inventory'
|
||||||
|
elseif GetResourceState('qb-inventory') == 'started' then
|
||||||
|
invname = 'qb-inventory'
|
||||||
|
end
|
||||||
|
|
||||||
|
end)
|
||||||
|
|
||||||
function Notifys(text, type)
|
function Notifys(text, type)
|
||||||
if notify == 'qb' then
|
if notify == 'qb' then
|
||||||
@@ -96,7 +104,7 @@ end
|
|||||||
function RemoveItem( item, amount)
|
function RemoveItem( item, amount)
|
||||||
local src = source
|
local src = source
|
||||||
local Player = QBCore.Functions.GetPlayer(src)
|
local Player = QBCore.Functions.GetPlayer(src)
|
||||||
if Player.Functions.RemoveItem(item, amount) then TriggerClientEvent("inventory:client:ItemBox", src, QBCore.Shared.Items[item], "remove", amount) return true
|
if Player.Functions.RemoveItem(item, amount) then TriggerClientEvent(invname ..":client:ItemBox", src, QBCore.Shared.Items[item], "remove", amount) return true
|
||||||
else
|
else
|
||||||
Notifys('You Need ' .. amount .. ' Of ' .. QBCore.Shared.Items[item].label .. ' To Do This', 'error')
|
Notifys('You Need ' .. amount .. ' Of ' .. QBCore.Shared.Items[item].label .. ' To Do This', 'error')
|
||||||
end
|
end
|
||||||
@@ -105,7 +113,7 @@ end
|
|||||||
function AddItem(item, amount)
|
function AddItem(item, amount)
|
||||||
local src = source
|
local src = source
|
||||||
local Player = QBCore.Functions.GetPlayer(src)
|
local Player = QBCore.Functions.GetPlayer(src)
|
||||||
if Player.Functions.AddItem(item, amount) then TriggerClientEvent("inventory:client:ItemBox", src, QBCore.Shared.Items[item], "add", amount) return true
|
if Player.Functions.AddItem(item, amount) then TriggerClientEvent(invname ..":client:ItemBox", src, QBCore.Shared.Items[item], "add", amount) return true
|
||||||
else
|
else
|
||||||
print('you sucks')
|
print('you sucks')
|
||||||
end
|
end
|
||||||
@@ -139,3 +147,4 @@ CreateThread(function()
|
|||||||
end
|
end
|
||||||
end, "GET", "", "")
|
end, "GET", "", "")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
Reference in new issue
Block a user