Update pharma.lua

This commit is contained in:
Mustache Dom authored and GitHub committed 2024-05-17 18:27:56 -07:00
1 parent ab8510e302
commit 992b5d7b26
1 file changed
+14 -6
+14 -6
View File
@@ -49,22 +49,30 @@ end)
end
RegisterServerEvent('md-drugs:server:fillprescription', function()
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if RemoveItem('vicodin_prescription', 1 ) then
local Player = QBCore.Functions.GetPlayer(src)
local vic = Player.Functions.GetItemByName('vicodin_prescription)
local add = Player.Functions.GetItemByName('vicodin_prescription)
local mor = Player.Functions.GetItemByName('vicodin_prescription)
local xan = Player.Functions.GetItemByName('vicodin_prescription)
if vic then
RemoveItem('vicodin_prescription', 1 )
AddItem('vicodinbottle', 1)
Notifys(Lang.Pharma.pills, "success")
elseif RemoveItem('adderal_prescription', 1 ) then
elseif add then
RemoveItem('adderal_prescription', 1 )
AddItem('adderalbottle', 1)
Notifys(Lang.Pharma.pills, "success")
elseif RemoveItem('morphine_prescription', 1 ) then
elseif mor then
RemoveItem('morphine_prescription', 1 )
AddItem('morphinebottle', 1)
Notifys(Lang.Pharma.pills, "success")
elseif RemoveItem('xanax_prescription', 1 ) then
elseif xan then
RemoveItem('xanax_prescription', 1 )
AddItem('xanaxbottle', 1)
Notifys(Lang.Pharma.pills, "success")
else
Notifys(Lang.Pharma.no, "error")
end
end)
end)