Add files via upload

This commit is contained in:
Mustache Dom authored and GitHub committed 2024-07-21 21:45:06 -07:00
1 parent 1070a3d1a8
commit 48d5c6928a
2 files changed
+41 -6

No files matched your search

+34 -3
View File
@@ -53,12 +53,13 @@ end
end)
function Notifys(text, type)
local src = source
if notify == 'qb' then
TriggerClientEvent("QBCore:Notify", source, text, type)
TriggerClientEvent("QBCore:Notify", src, text, type)
elseif notify == 'ox' then
lib.notify(source, { title = text, type = type})
lib.notify(src, { title = text, type = type})
elseif notify == 'okok' then
TriggerClientEvent('okokNotify:Alert', source, '', text, 4000, type, false)
TriggerClientEvent('okokNotify:Alert', src, '', text, 4000, type, false)
else
print"dude, it literally tells you what to put in the config"
end
@@ -119,6 +120,36 @@ function AddItem(item, amount)
end
end
function Notifysu(text, type, source)
if notify == 'qb' then
TriggerClientEvent("QBCore:Notify", source, text, type)
elseif notify == 'ox' then
lib.notify(source, { title = text, type = type})
elseif notify == 'okok' then
TriggerClientEvent('okokNotify:Alert', source, '', text, 4000, type, false)
else
print"dude, it literally tells you what to put in the config"
end
end
function RemoveItemu( item, amount, source)
local Player = QBCore.Functions.GetPlayer(source)
if Player.Functions.RemoveItem(item, amount) then TriggerClientEvent(invname ..":client:ItemBox", source, QBCore.Shared.Items[item], "remove", amount) return true
else
Notifysu('You Need ' .. amount .. ' Of ' .. QBCore.Shared.Items[item].label .. ' To Do This', 'error', source)
end
end
function AddItemu(item, amount, source)
local Player = QBCore.Functions.GetPlayer(source)
if Player.Functions.AddItem(item, amount) then TriggerClientEvent(invname ..":client:ItemBox", source, QBCore.Shared.Items[item], "add", amount) return true
else
print('you sucks')
end
end
lib.callback.register('md-drugs:server:GetCoppers', function(source, cb, args)
local amount = 0
local players = QBCore.Functions.GetQBPlayers()
+7 -3
View File
@@ -259,7 +259,7 @@ local keef = Player.Functions.GetItemByName("grindedweed")
TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items['dextrobluntwrap'], "remove", 1)
end
else
Notifysu('You Need Keef', 'error', src)
end
end)
@@ -268,12 +268,13 @@ local src = source
local Player = QBCore.Functions.GetPlayer(src)
if Player.Functions.GetItemByName("butanetorch") then
if Player.Functions.RemoveItem("shatter", 1) then
TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["shatter"], "remove", 1)
if RemoveItemu("shatter", 1, src) then
Notifysu('test', 'success', src)
TriggerClientEvent("md-drugs:client:dodabs", src)
end
end
end)
QBCore.Functions.CreateUseableItem("bluntwrap", function(source, item)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
@@ -283,10 +284,13 @@ end)
QBCore.Functions.CreateUseableItem("weedgrinder", function(source, item)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if Player.Functions.RemoveItem("drycannabis",1 ) then
Player.Functions.AddItem("grindedweed", 1)
TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items["grindedweed"], "add", 1)
TriggerClientEvent("md-drugs:client:grind", src)
else
Notifysu('You Need Dried Weed', 'error', src)
end
end)