locales and wholesale
This commit is contained in:
1 parent
c1c8b8cb86
commit
fc8a623067
15 files changed
+356
-459
No files matched your search
+17
-11
@@ -81,21 +81,27 @@ RegisterServerEvent('md-drugs:server:bagcrack', function(num)
|
||||
end
|
||||
end)
|
||||
|
||||
local cokecut = {crackrockstagetwo = 2, crackrockstagethree = 3}
|
||||
local cokecut = {
|
||||
crackrockstagetwo = {give = {crackrock = 2}, take = {crackrockstagetwo = 1, bakingsoda = 1}},
|
||||
crackrockstagethree = { give = {crackrock = 3}, take = {crackrockstagethree = 1, bakingsoda = 1}},
|
||||
}
|
||||
for k, v in pairs (cokecut) do
|
||||
Bridge.Framework.RegisterUsableItem(k, function(source, item)
|
||||
local src = source
|
||||
if not Bridge.Inventory.HasItem(src, 'bakingsoda') then
|
||||
Bridge.Notify.SendNotify(src, Bridge.Language.Locale('coke.needBakingSoda'), 'error')
|
||||
return
|
||||
end
|
||||
if Bridge.Inventory.HasItem(src,item.name) then
|
||||
local check = Bridge.Callback.Trigger('md-drugs:client:uncuff', src, 'Cutting It Further')
|
||||
if not check then return end
|
||||
if Bridge.Inventory.RemoveItem(src, k, 1) and Bridge.Inventory.RemoveItem(src, 'bakingsoda', 1) then
|
||||
Bridge.Inventory.AddItem(src, 'crackrock', v)
|
||||
local can = true
|
||||
for k, v in pairs (v.take) do
|
||||
local count = Bridge.Inventory.GetItemCount(src, k)
|
||||
if count < v then
|
||||
can = false
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
if not can then
|
||||
return craft(src, v)
|
||||
end
|
||||
local progress = Bridge.Callback.Trigger("md-drugs:client:uncuff", src, Bridge.Language.Locale('crack.breakdown'))
|
||||
if not progress then return end
|
||||
craft(src, v)
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user