Added integration for Fivemerr

if you want to use the logs go to line 3 of server/functions.lua and turn to true, then inside of your server.cfg add this 

```
set fivemerrLogs "API_KEY"
```
obviously replace the API_KEY with your api key
This commit is contained in:
Mustache Dom authored and GitHub committed 2024-07-16 14:14:48 -07:00
1 parent 7aa929670e
commit 3d144cae58
17 files changed
+245 -61

No files matched your search

+29 -6
View File
@@ -15,6 +15,7 @@ function CaneCooldown(loc)
GlobalState.CocaPlant = Config.CocaPlant GlobalState.CocaPlant = Config.CocaPlant
Wait(1000) Wait(1000)
TriggerClientEvent('coke:respawnCane', -1, loc) TriggerClientEvent('coke:respawnCane', -1, loc)
Log('Coca Plant Respawned At ' .. Config.CocaPlant[loc].location, 'coke')
end) end)
end end
@@ -30,6 +31,7 @@ AddEventHandler("coke:pickupCane", function(loc)
CaneCooldown(loc) CaneCooldown(loc)
local Player = QBCore.Functions.GetPlayer(source) local Player = QBCore.Functions.GetPlayer(source)
AddItem('coca_leaf', 1) AddItem('coca_leaf', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Picked A Coca Leaf With a distance of ' .. dist(source, playerPed, Config.CocaPlant[loc].location) .. ' vectors', 'coke')
end end
end) end)
@@ -43,14 +45,27 @@ RegisterServerEvent('md-drugs:server:makepowder', function(num)
if Config.TierSystem then if Config.TierSystem then
local coke = Player.PlayerData.metadata['coke'] local coke = Player.PlayerData.metadata['coke']
if coke <= Config.Tier1 then if coke <= Config.Tier1 then
if RemoveItem("coca_leaf", 1) then AddItem("coke", 1) end if RemoveItem("coca_leaf", 1) then
AddItem("coke", 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made Raw Coke' .. dist(source, playerPed, Config.MakePowder[num]['loc']) .. ' vectors', 'coke')
end
elseif coke >= Config.Tier1 and coke <= Config.Tier2 then elseif coke >= Config.Tier1 and coke <= Config.Tier2 then
if RemoveItem("coca_leaf", 1) then AddItem("cokestagetwo", 1) end if RemoveItem("coca_leaf", 1) then
AddItem("cokestagetwo", 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made Raw Coke tier 2' .. dist(source, playerPed, Config.MakePowder[num]['loc']) .. ' vectors', 'coke')
end
else else
if RemoveItem("coca_leaf", 1) then AddItem("cokestagethree", 1) end if RemoveItem("coca_leaf", 1) then
AddItem("cokestagethree", 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made Raw Coke tier 3' .. dist(source, playerPed, Config.MakePowder[num]['loc']) .. ' vectors', 'coke')
end
end end
else else
if RemoveItem("coca_leaf", 1) then AddItem("coke", 1) end if RemoveItem("coca_leaf", 1) then
AddItem("coke", 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made Raw Coke' .. dist(source, playerPed, Config.MakePowder[num]['loc']) .. ' vectors', 'coke')
end
end end
end) end)
@@ -65,16 +80,19 @@ RegisterServerEvent('md-drugs:server:cutcokeone', function()
local coke3 = Player.Functions.GetItemByName('cokestagethree') local coke3 = Player.Functions.GetItemByName('cokestagethree')
if coke then if coke then
RemoveItem('coke', 1 ) RemoveItem('coke', 1 )
RemoveItem('bakingsoda', 1 ) RemoveItem('bakingsoda', 1 )
AddItem('loosecoke', 1) AddItem('loosecoke', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Cut Coke', 'coke')
elseif coke2 then elseif coke2 then
RemoveItem('cokestagetwo', 1 ) RemoveItem('cokestagetwo', 1 )
RemoveItem('bakingsoda', 1 ) RemoveItem('bakingsoda', 1 )
AddItem('loosecokestagetwo', 1) AddItem('loosecokestagetwo', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Cut Coke tier 2', 'coke')
elseif coke3 then elseif coke3 then
RemoveItem('cokestagethree', 1 ) RemoveItem('cokestagethree', 1 )
RemoveItem('bakingsoda', 1 ) RemoveItem('bakingsoda', 1 )
AddItem('loosecokestagethree', 1) AddItem('loosecokestagethree', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Cut Coke tier 3', 'coke')
else else
Notifys(Lang.Coke.nocutcoke, "error") Notifys(Lang.Coke.nocutcoke, "error")
end end
@@ -82,6 +100,7 @@ RegisterServerEvent('md-drugs:server:cutcokeone', function()
if RemoveItem('coke', 1 ) then if RemoveItem('coke', 1 ) then
RemoveItem('bakingsoda', 1 ) RemoveItem('bakingsoda', 1 )
AddItem('loosecoke', 1) AddItem('loosecoke', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Cut Coke', 'coke')
else else
Notifys(Lang.Coke.nocutcoke, "error") Notifys(Lang.Coke.nocutcoke, "error")
end end
@@ -102,16 +121,19 @@ RegisterServerEvent('md-drugs:server:bagcoke', function()
RemoveItem('empty_weed_bag', 1) RemoveItem('empty_weed_bag', 1)
AddItem('cokebaggy', 1) AddItem('cokebaggy', 1)
Player.Functions.SetMetaData('coke', (coke + 1)) Player.Functions.SetMetaData('coke', (coke + 1))
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Bagged Coke and now has a rep of ' .. coke + 1, 'coke')
elseif locoke2 then elseif locoke2 then
RemoveItem('loosecokestagetwo', 1 ) RemoveItem('loosecokestagetwo', 1 )
RemoveItem('empty_weed_bag', 1) RemoveItem('empty_weed_bag', 1)
AddItem('cokebaggystagetwo', 1) AddItem('cokebaggystagetwo', 1)
Player.Functions.SetMetaData('coke', (coke + 1)) Player.Functions.SetMetaData('coke', (coke + 1))
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Bagged Coke tier 2 and now has a rep of ' .. coke + 1, 'coke')
elseif locoke3 then elseif locoke3 then
RemoveItem('loosecokestagethree', 1 ) RemoveItem('loosecokestagethree', 1 )
RemoveItem('empty_weed_bag', 1) RemoveItem('empty_weed_bag', 1)
AddItem('cokebaggystagethree', 1) AddItem('cokebaggystagethree', 1)
Player.Functions.SetMetaData('coke', (coke + 1)) Player.Functions.SetMetaData('coke', (coke + 1))
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Bagged Coke tier 3 and now has a rep of ' .. coke + 1, 'coke')
else else
Notifys(Lang.Coke.nobagcoke, "error") Notifys(Lang.Coke.nobagcoke, "error")
end end
@@ -119,6 +141,7 @@ RegisterServerEvent('md-drugs:server:bagcoke', function()
if RemoveItem('loosecoke', 1 ) then if RemoveItem('loosecoke', 1 ) then
RemoveItem('empty_weed_bag', 1) RemoveItem('empty_weed_bag', 1)
AddItem('cokebaggy', 1) AddItem('cokebaggy', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Bagged Coke', 'coke')
else else
Notifys(Lang.Coke.nobagcoke, "error") Notifys(Lang.Coke.nobagcoke, "error")
end end
+1
View File
@@ -17,6 +17,7 @@ RegisterNetEvent('md-drugs:server:removeconsum', function(item)
local src = source local src = source
local Player = QBCore.Functions.GetPlayer(src) local Player = QBCore.Functions.GetPlayer(src)
Player.Functions.RemoveItem(item, 1) Player.Functions.RemoveItem(item, 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Got High With ' .. item .. '!', 'consuming')
end) end)
RegisterNetEvent('md-drugs:server:updatestatus', function(stat, statval) RegisterNetEvent('md-drugs:server:updatestatus', function(stat, statval)
+2 -2
View File
@@ -1,8 +1,6 @@
local QBCore = exports['qb-core']:GetCoreObject() local QBCore = exports['qb-core']:GetCoreObject()
local StolenDrugs = {} local StolenDrugs = {}
lib.callback.register('md-drugs:server:cornerselling:getAvailableDrugs', function(source, cb) lib.callback.register('md-drugs:server:cornerselling:getAvailableDrugs', function(source, cb)
local AvailableDrugs = {} local AvailableDrugs = {}
local Player = QBCore.Functions.GetPlayer(source) local Player = QBCore.Functions.GetPlayer(source)
@@ -12,6 +10,7 @@ lib.callback.register('md-drugs:server:cornerselling:getAvailableDrugs', functio
local item = Player.Functions.GetItemByName(k) local item = Player.Functions.GetItemByName(k)
if item and type == 0 then if item and type == 0 then
type = type + 1 type = type + 1
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Allowed To Sell ' .. item.name .. '!' , 'cornerselling')
return item.name, item.amount return item.name, item.amount
end end
end end
@@ -26,6 +25,7 @@ RegisterNetEvent('md-drugs:server:sellCornerDrugs', function(item, amount, price
local Player = QBCore.Functions.GetPlayer(src) local Player = QBCore.Functions.GetPlayer(src)
if RemoveItem(item, amount) then if RemoveItem(item, amount) then
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Sold ' .. amount .. ' Of ' .. item .. '!' , 'cornerselling')
if QBConfig.MarkedBills then if QBConfig.MarkedBills then
if price >= QBConfig.DrugsPrice[item]['min'] * amount and price <= QBConfig.DrugsPrice[item]['max'] * amount then if price >= QBConfig.DrugsPrice[item]['min'] * amount and price <= QBConfig.DrugsPrice[item]['max'] * amount then
local info = { local info = {
+8
View File
@@ -16,16 +16,19 @@ RegisterServerEvent('md-drugs:server:makecrackone', function(num)
RemoveItem('bakingsoda', 1) RemoveItem('bakingsoda', 1)
AddItem('crackrock', 1) AddItem('crackrock', 1)
Notifys(Lang.Crack.makecrack, "success") Notifys(Lang.Crack.makecrack, "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Cut Crack', 'crack')
elseif locoke2 then elseif locoke2 then
RemoveItem('loosecokestagetwo', 1 ) RemoveItem('loosecokestagetwo', 1 )
RemoveItem('bakingsoda', 1) RemoveItem('bakingsoda', 1)
AddItem('crackrockstagetwo', 1) AddItem('crackrockstagetwo', 1)
Notifys(Lang.Crack.makecrack, "success") Notifys(Lang.Crack.makecrack, "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Cut Crack', 'crack')
elseif locoke3 then elseif locoke3 then
RemoveItem('loosecokestagethree', 1 ) RemoveItem('loosecokestagethree', 1 )
RemoveItem('bakingsoda', 1) RemoveItem('bakingsoda', 1)
AddItem('crackrockstagethree', 1) AddItem('crackrockstagethree', 1)
Notifys(Lang.Crack.makecrack, "success") Notifys(Lang.Crack.makecrack, "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Cut Crack', 'crack')
else else
Notifys(Lang.Crack.nocoke, 'error') Notifys(Lang.Crack.nocoke, 'error')
end end
@@ -34,6 +37,7 @@ RegisterServerEvent('md-drugs:server:makecrackone', function(num)
RemoveItem('bakingsoda', 1) RemoveItem('bakingsoda', 1)
AddItem('crackrock', 1) AddItem('crackrock', 1)
Notifys(Lang.Crack.makecrack, "success") Notifys(Lang.Crack.makecrack, "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Cut Crack', 'crack')
else else
Notifys(Lang.Crack.nocoke, 'error') Notifys(Lang.Crack.nocoke, 'error')
end end
@@ -55,16 +59,19 @@ RegisterServerEvent('md-drugs:server:bagcrack', function(num)
RemoveItem('empty_weed_bag', 1) RemoveItem('empty_weed_bag', 1)
AddItem('baggedcracked', 1) AddItem('baggedcracked', 1)
Notifys(Lang.Crack.makecrack, "success") Notifys(Lang.Crack.makecrack, "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Bagged Crack', 'crack')
elseif rock2 then elseif rock2 then
RemoveItem('crackrockstagetwo', 1 ) RemoveItem('crackrockstagetwo', 1 )
RemoveItem('empty_weed_bag', 1) RemoveItem('empty_weed_bag', 1)
AddItem('baggedcrackedstagetwo', 1) AddItem('baggedcrackedstagetwo', 1)
Notifys(Lang.Crack.makecrack, "success") Notifys(Lang.Crack.makecrack, "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Bagged Crack', 'crack')
elseif rock3 then elseif rock3 then
RemoveItem('crackrockstagethree', 1 ) RemoveItem('crackrockstagethree', 1 )
RemoveItem('empty_weed_bag', 1) RemoveItem('empty_weed_bag', 1)
AddItem('baggedcrackedstagethree', 1) AddItem('baggedcrackedstagethree', 1)
Notifys(Lang.Crack.makecrack, "success") Notifys(Lang.Crack.makecrack, "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Bagged Crack', 'crack')
else else
Notifys(Lang.Crack.nocoke, "error") Notifys(Lang.Crack.nocoke, "error")
end end
@@ -73,6 +80,7 @@ RegisterServerEvent('md-drugs:server:bagcrack', function(num)
RemoveItem('empty_weed_bag', 1) RemoveItem('empty_weed_bag', 1)
AddItem('baggedcracked', 1) AddItem('baggedcracked', 1)
Notifys(Lang.Crack.makecrack, "success") Notifys(Lang.Crack.makecrack, "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Bagged Crack', 'crack')
else else
Notifys(Lang.Crack.nocoke, "error") Notifys(Lang.Crack.nocoke, "error")
end end
+59 -32
View File
@@ -1,5 +1,47 @@
local QBCore = exports['qb-core']:GetCoreObject() local QBCore = exports['qb-core']:GetCoreObject()
local notify = Config.Notify -- qb or ox local notify = Config.Notify -- qb or ox
local logs = false
local logapi = GetConvar("fivemerrLogs", "")
local endpoint = 'https://api.fivemerr.com/v1/logs'
local headers = {
['Authorization'] = logapi,
['Content-Type'] = 'application/json',
}
CreateThread(function()
if logs then
print'^2 Logs Enabled for md-drugs'
if logapi == 'insert string here' then
print'^1 homie you gotta set your api on line 4'
else
print'^2 API Key Looks Good, Dont Trust Me Though, Im Not Smart'
end
else
print'^1 logs disabled for md-drugs'
end
end)
function Log(message, meta, type)
if logs == false then return end
local buffer = {
level = "info",
message = message,
resource = GetCurrentResourceName(),
metadata = {
meta = type
}
}
SetTimeout(500, function()
PerformHttpRequest(endpoint, function(status, _, _, response)
if status ~= 200 then
if type(response) == 'string' then
response = json.decode(response) or response
end
end
end, 'POST', json.encode(buffer), headers)
buffer = nil
end)
end
function Notifys(text, type) function Notifys(text, type)
if notify == 'qb' then if notify == 'qb' then
@@ -13,18 +55,6 @@ function Notifys(text, type)
end end
end end
function checkTable(player, table)
local need = 0
local have = 0
for k, v in pairs (table) do
need = need + 1
if Itemcheck(player, k, v, 'true') then have = have + 1 end
end
if need == have then
return true
else
end
end
function Itemcheck(Player, item, amount, notify) function Itemcheck(Player, item, amount, notify)
local itemchecks = Player.Functions.GetItemByName(item) local itemchecks = Player.Functions.GetItemByName(item)
local yes local yes
@@ -37,7 +67,11 @@ function Itemcheck(Player, item, amount, notify)
Notifys('You Need ' .. amount .. ' Of ' .. QBCore.Shared.Items[item].label .. ' To Do this', 'error') return else end Notifys('You Need ' .. amount .. ' Of ' .. QBCore.Shared.Items[item].label .. ' To Do this', 'error') return else end
end end
end end
function dist(source, Player, coords)
local pcoords = GetEntityCoords(Player)
local dist = #(pcoords - coords)
return dist
end
function CheckDist(source,Player, coords) function CheckDist(source,Player, coords)
local pcoords = GetEntityCoords(Player) local pcoords = GetEntityCoords(Player)
local ok local ok
@@ -46,7 +80,18 @@ function CheckDist(source,Player, coords)
else else
DropPlayer(source, 'Too Far') return end DropPlayer(source, 'Too Far') return end
end end
function checkTable(player, table)
local need = 0
local have = 0
for k, v in pairs (table) do
need = need + 1
if Itemcheck(player, k, v, 'true') then have = have + 1 end
end
if need == have then
return true
else
end
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)
@@ -65,17 +110,6 @@ function AddItem(item, amount)
end end
end end
--QBCore.Functions.CreateCallback('md-drugs:server:GetCoppers', function(source, cb, args)
-- local amount = 0
-- local players = QBCore.Functions.GetQBPlayers()
-- for k, v in pairs(players) do
-- if v.PlayerData.job.type == 'leo' and v.PlayerData.job.onduty then
-- amount = amount + 1
-- end
-- end
-- cb(amount)
--end)
lib.callback.register('md-drugs:server:GetCoppers', function(source, cb, args) lib.callback.register('md-drugs:server:GetCoppers', function(source, cb, args)
local amount = 0 local amount = 0
local players = QBCore.Functions.GetQBPlayers() local players = QBCore.Functions.GetQBPlayers()
@@ -87,13 +121,6 @@ lib.callback.register('md-drugs:server:GetCoppers', function(source, cb, args)
return amount return amount
end) end)
lib.addCommand('cornersell', {
help = 'Start/Stop Cornerselling',
restricted = 'group.admin'
}, function(source, args, raw)
TriggerClientEvent('md-drugs:client:cornerselling',source)
end)
CreateThread(function() CreateThread(function()
if not GetResourceState('ox_lib'):find("start") then if not GetResourceState('ox_lib'):find("start") then
print('^1 ox_lib Is A Depndancy, Not An Optional ') print('^1 ox_lib Is A Depndancy, Not An Optional ')
+29 -4
View File
@@ -16,6 +16,7 @@ function heroinCooldown(loc)
GlobalState.PoppyPlants = Config.PoppyPlants GlobalState.PoppyPlants = Config.PoppyPlants
Wait(1000) Wait(1000)
TriggerClientEvent('heroin:respawnCane', -1, loc) TriggerClientEvent('heroin:respawnCane', -1, loc)
Log('Heroin Plant Respawned At ' .. Config.PoppyPlants[loc].location, 'heroin')
end) end)
end end
@@ -26,6 +27,7 @@ local Player = QBCore.Functions.GetPlayer(src)
if RemoveItem("cleaningkit", 1) then if RemoveItem("cleaningkit", 1) then
Notifys("Cleaned It Perfectly", "success") Notifys("Cleaned It Perfectly", "success")
TriggerClientEvent("md-drugs:client:deletedirtyheroin", src, data) TriggerClientEvent("md-drugs:client:deletedirtyheroin", src, data)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Wiped Down Their Heroin Lab Kit!' , 'heroin')
else else
Notifys("You cant clean it with spit alone", "error") Notifys("You cant clean it with spit alone", "error")
end end
@@ -42,7 +44,8 @@ RegisterServerEvent("heroin:pickupCane", function(loc)
heroinCooldown(loc) heroinCooldown(loc)
local Player = QBCore.Functions.GetPlayer(source) local Player = QBCore.Functions.GetPlayer(source)
AddItem('poppyresin', 1) AddItem('poppyresin', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Picked A Poppies With a distance of ' .. dist(source, playerPed, Config.PoppyPlants[loc].location) .. ' vectors', 'heroin')
end end
end) end)
@@ -57,19 +60,24 @@ RegisterServerEvent('md-drugs:server:dryplant', function(num)
if heroin <= Config.Tier1 then if heroin <= Config.Tier1 then
if RemoveItem("poppyresin", 1) then if RemoveItem("poppyresin", 1) then
AddItem("heroin", 1) AddItem("heroin", 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made Heroin Powder With a distance of ' .. dist(source, playerPed, Config.dryplant[num]['loc']) .. ' vectors', 'heroin')
end end
elseif heroin >= Config.Tier1 and heroin <= Config.Tier2 then elseif heroin >= Config.Tier1 and heroin <= Config.Tier2 then
if RemoveItem("poppyresin", 1) then if RemoveItem("poppyresin", 1) then
AddItem("heroinstagetwo", 1) AddItem("heroinstagetwo", 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made Heroin Powder Tier 2 With a distance of ' .. dist(source, playerPed, Config.dryplant[num]['loc']) .. ' vectors', 'heroin')
end end
else else
if RemoveItem("poppyresin", 1) then if RemoveItem("poppyresin", 1) then
AddItem("heroinstagethree", 1) AddItem("heroinstagethree", 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made Heroin Powder Tier 3 With a distance of ' .. dist(source, playerPed, Config.dryplant[num]['loc']) .. ' vectors', 'heroin')
end end
end end
else else
if RemoveItem("poppyresin", 1) then if RemoveItem("poppyresin", 1) then
AddItem("heroin", 1) AddItem("heroin", 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made Heroin Powder With a distance of ' .. dist(source, playerPed, Config.dryplant[num]['loc']) .. ' vectors', 'heroin')
end end
end end
end) end)
@@ -90,16 +98,19 @@ RegisterServerEvent('md-drugs:server:cutheroin', function(num)
RemoveItem('bakingsoda', 1 ) RemoveItem('bakingsoda', 1 )
AddItem('heroincut',1) AddItem('heroincut',1)
Notifys(Lang.Heroin.cutheroin, "success") Notifys(Lang.Heroin.cutheroin, "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Cut Heroin With a distance of ' .. dist(source, playerPed, Config.cutheroinone[num]['loc']) .. ' vectors', 'heroin')
elseif rawh2 then elseif rawh2 then
RemoveItem('heroinstagetwo', 1 ) RemoveItem('heroinstagetwo', 1 )
RemoveItem('bakingsoda', 1 ) RemoveItem('bakingsoda', 1 )
AddItem('heroincutstagetwo', 1) AddItem('heroincutstagetwo', 1)
Notifys(Lang.Heroin.cutheroin, "success") Notifys(Lang.Heroin.cutheroin, "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Cut Heroin Tier 2 With a distance of ' .. dist(source, playerPed, Config.cutheroinone[num]['loc']) .. ' vectors', 'heroin')
elseif rawh3 then elseif rawh3 then
RemoveItem('heroinstagethree', 1 ) RemoveItem('heroinstagethree', 1 )
RemoveItem('bakingsoda', 1 ) RemoveItem('bakingsoda', 1 )
AddItem('heroincutstagethree', 1) AddItem('heroincutstagethree', 1)
Notifys(Lang.Heroin.cutheroin, "success") Notifys(Lang.Heroin.cutheroin, "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Cut Heroin Tier 3 With a distance of ' .. dist(source, playerPed, Config.cutheroinone[num]['loc']) .. ' vectors', 'heroin')
else else
Notifys(Lang.Heroin.noheroin, "error") Notifys(Lang.Heroin.noheroin, "error")
end end
@@ -108,6 +119,7 @@ RegisterServerEvent('md-drugs:server:cutheroin', function(num)
RemoveItem('bakingsoda', 1 ) RemoveItem('bakingsoda', 1 )
AddItem('heroincut',1) AddItem('heroincut',1)
Notifys(Lang.Heroin.cutheroin, "success") Notifys(Lang.Heroin.cutheroin, "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Cut Heroin With a distance of ' .. dist(source, playerPed, Config.cutheroinone[num]['loc']) .. ' vectors', 'heroin')
else else
Notifys(Lang.Heroin.noheroin, "error") Notifys(Lang.Heroin.noheroin, "error")
end end
@@ -122,6 +134,7 @@ RegisterServerEvent('md-drugs:server:getheroinlabkit', function()
if CheckDist(source, playerPed, vector3(Config.buyheroinlabkit.x,Config.buyheroinlabkit.y,Config.buyheroinlabkit.z)) then return end if CheckDist(source, playerPed, vector3(Config.buyheroinlabkit.x,Config.buyheroinlabkit.y,Config.buyheroinlabkit.z)) then return end
if Player.Functions.RemoveMoney('cash', Config.heroinlabkitprice) then if Player.Functions.RemoveMoney('cash', Config.heroinlabkitprice) then
AddItem('heroinlabkit', 1) AddItem('heroinlabkit', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Bought A Heroin lab Kit ' .. dist(source, playerPed, vector3(Config.buyheroinlabkit.x,Config.buyheroinlabkit.y,Config.buyheroinlabkit.z)) .. ' vectors', 'heroin')
else else
Notifys('You Need '.. Config.heroinlabkitprice .. ' In Cash For This', 'error') Notifys('You Need '.. Config.heroinlabkitprice .. ' In Cash For This', 'error')
end end
@@ -130,18 +143,21 @@ end)
RegisterServerEvent('md-drugs:server:getheroinlabkitback', function() RegisterServerEvent('md-drugs:server:getheroinlabkitback', function()
local src = source local src = source
local Player = QBCore.Functions.GetPlayer(src) local Player = QBCore.Functions.GetPlayer(src)
local playerPed = GetPlayerPed(source)
if Player.Functions.AddItem("heroinlabkit", 1) then if Player.Functions.AddItem("heroinlabkit", 1) then
Notifys('You Got Your Lab Kit Back', 'Success') Notifys('You Got Your Lab Kit Back', 'Success')
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Picked Up Their Heroin Lab Kit Back At ' .. GetEntityCoords(playerPed) .. '!', 'heroin')
end end
end) end)
QBCore.Functions.CreateUseableItem('heroinlabkit', function(source, item) QBCore.Functions.CreateUseableItem('heroinlabkit', function(source, item)
local src = source local src = source
local Player = QBCore.Functions.GetPlayer(src) local Player = QBCore.Functions.GetPlayer(src)
local playerPed = GetPlayerPed(src)
if not Itemcheck(Player, 'heroinlabkit', 1, 'true') then return end if not Itemcheck(Player, 'heroinlabkit', 1, 'true') then return end
if TriggerClientEvent("md-drugs:client:setheroinlabkit", src) then if TriggerClientEvent("md-drugs:client:setheroinlabkit", src) then
Player.Functions.RemoveItem("heroinlabkit", 1) Player.Functions.RemoveItem("heroinlabkit", 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Placed Their Heroin Lab Kit Back At ' .. GetEntityCoords(playerPed) .. '!', 'heroin')
end end
end) end)
@@ -160,16 +176,19 @@ local Player = QBCore.Functions.GetPlayer(src)
RemoveItem('emptyvial', 1) RemoveItem('emptyvial', 1)
AddItem('heroinvial', 1) AddItem('heroinvial', 1)
Notifys(Lang.Heroin.vial, "success") Notifys(Lang.Heroin.vial, "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Vial Of Heroin', 'heroin')
elseif cuth2 then elseif cuth2 then
RemoveItem('heroincutstagetwo', 1) RemoveItem('heroincutstagetwo', 1)
RemoveItem('emptyvial', 1) RemoveItem('emptyvial', 1)
AddItem('heroinvialstagetwo', 1) AddItem('heroinvialstagetwo', 1)
Notifys(Lang.Heroin.vial, "success") Notifys(Lang.Heroin.vial, "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Vial Of Heroin Tier 2', 'heroin')
elseif cuth3 then elseif cuth3 then
RemoveItem('heroincutstagethree', 1) RemoveItem('heroincutstagethree', 1)
RemoveItem('emptyvial', 1) RemoveItem('emptyvial', 1)
AddItem('heroinvialstagethree', 1) AddItem('heroinvialstagethree', 1)
Notifys(Lang.Heroin.vial, "success") Notifys(Lang.Heroin.vial, "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Vial Of Heroin Tier 3', 'heroin')
else else
Notifys(Lang.Heroin.novial, "error") Notifys(Lang.Heroin.novial, "error")
end end
@@ -178,6 +197,7 @@ local Player = QBCore.Functions.GetPlayer(src)
RemoveItem('emptyvial', 1) RemoveItem('emptyvial', 1)
AddItem('heroinvial', 1) AddItem('heroinvial', 1)
Notifys(Lang.Heroin.vial, "success") Notifys(Lang.Heroin.vial, "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Vial Of Heroin', 'heroin')
else else
Notifys(Lang.Heroin.novial, "error") Notifys(Lang.Heroin.novial, "error")
end end
@@ -190,7 +210,7 @@ local Player = QBCore.Functions.GetPlayer(src)
local cuth = Player.Functions.GetItemByName('heroincut') local cuth = Player.Functions.GetItemByName('heroincut')
local cuth2 = Player.Functions.GetItemByName('heroincutstagetwo') local cuth2 = Player.Functions.GetItemByName('heroincutstagetwo')
local cuth3 = Player.Functions.GetItemByName('heroincutstagethree') local cuth3 = Player.Functions.GetItemByName('heroincutstagethree')
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Sucks And Burned Their Heroin', 'heroin')
if cuth then if cuth then
RemoveItem('heroincut', 1) RemoveItem('heroincut', 1)
Notifys(Lang.Heroin.fail, "error") Notifys(Lang.Heroin.fail, "error")
@@ -221,18 +241,21 @@ RegisterServerEvent('md-drugs:server:fillneedle', function(num)
AddItem('heroin_ready', 1) AddItem('heroin_ready', 1)
Player.Functions.SetMetaData('heroin', (heroin + 1)) Player.Functions.SetMetaData('heroin', (heroin + 1))
Notifys(Lang.Heroin.fill, "success") Notifys(Lang.Heroin.fill, "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Filled A Needle Of Heroin And Now Has A Rep Of ' .. heroin + 1 .. '!' , 'heroin')
elseif vh2 then elseif vh2 then
RemoveItem('heroinvialstagetwo', 1 ) RemoveItem('heroinvialstagetwo', 1 )
RemoveItem('needle', 1) RemoveItem('needle', 1)
AddItem('heroin_readystagetwo', 1) AddItem('heroin_readystagetwo', 1)
Player.Functions.SetMetaData('heroin', (heroin + 1)) Player.Functions.SetMetaData('heroin', (heroin + 1))
Notifys(Lang.Heroin.fill, "success") Notifys(Lang.Heroin.fill, "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Filled A Needle Of Heroin Tier 2 And Now Has A Rep Of ' .. heroin + 1 .. '!' , 'heroin')
elseif vh3 then elseif vh3 then
RemoveItem('heroinvialstagethree', 1 ) RemoveItem('heroinvialstagethree', 1 )
RemoveItem('needle', 1) RemoveItem('needle', 1)
AddItem('heroin_readystagethree', 1) AddItem('heroin_readystagethree', 1)
Player.Functions.SetMetaData('heroin', (heroin + 1)) Player.Functions.SetMetaData('heroin', (heroin + 1))
Notifys(Lang.Heroin.fill, "success") Notifys(Lang.Heroin.fill, "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Filled A Needle Of Heroin Tier 3 And Now Has A Rep Of ' .. heroin + 1 .. '!' , 'heroin')
else else
Notifys(Lang.Heroin.nofill, "error") Notifys(Lang.Heroin.nofill, "error")
end end
@@ -241,6 +264,7 @@ RegisterServerEvent('md-drugs:server:fillneedle', function(num)
RemoveItem('needle', 1) RemoveItem('needle', 1)
AddItem('heroin_ready', 1) AddItem('heroin_ready', 1)
Notifys(Lang.Heroin.fill, "success") Notifys(Lang.Heroin.fill, "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Filled A Needle Of Heroin!' , 'heroin')
else else
Notifys(Lang.Heroin.nofill, "error") Notifys(Lang.Heroin.nofill, "error")
end end
@@ -252,6 +276,7 @@ end)
RegisterServerEvent('md-drugs:server:failheroin', function() RegisterServerEvent('md-drugs:server:failheroin', function()
local src = source local src = source
local Player = QBCore.Functions.GetPlayer(src) local Player = QBCore.Functions.GetPlayer(src)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Sucks And Burned Their Heroin', 'heroin')
if Config.TierSystem then if Config.TierSystem then
local vh = Player.Functions.GetItemByName('heroinvial') local vh = Player.Functions.GetItemByName('heroinvial')
local vh2 = Player.Functions.GetItemByName('heroinvialstagetwo') local vh2 = Player.Functions.GetItemByName('heroinvialstagetwo')
+4
View File
@@ -8,10 +8,12 @@ RegisterServerEvent('md-drugs:server:givelean', function()
if chance <= 50 then if chance <= 50 then
if AddItem('mdlean', amount) then if AddItem('mdlean', amount) then
Notifys(Lang.Lean.lean, "success") Notifys(Lang.Lean.lean, "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Got ' .. amount .. ' Of Lean' , 'lean')
end end
else else
if AddItem('mdreddextro', amount) then if AddItem('mdreddextro', amount) then
Notifys(Lang.Lean.dextro, "success") Notifys(Lang.Lean.dextro, "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Got ' .. amount .. ' Of Red Dextro' , 'lean')
end end
end end
end) end)
@@ -26,6 +28,7 @@ local Player = QBCore.Functions.GetPlayer(src)
Player.Functions.RemoveItem('sprunk', 1 ) Player.Functions.RemoveItem('sprunk', 1 )
Player.Functions.RemoveItem('leancup', 1 ) Player.Functions.RemoveItem('leancup', 1 )
Player.Functions.AddItem('cupoflean', 1 ) Player.Functions.AddItem('cupoflean', 1 )
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Cup Of Lean' , 'lean')
end end
else else
if Player.Functions.GetItemByName('leancup') and Player.Functions.GetItemByName('sprunk') and Player.Functions.GetItemByName('mdreddextro') then if Player.Functions.GetItemByName('leancup') and Player.Functions.GetItemByName('sprunk') and Player.Functions.GetItemByName('mdreddextro') then
@@ -33,6 +36,7 @@ local Player = QBCore.Functions.GetPlayer(src)
Player.Functions.RemoveItem('sprunk', 1 ) Player.Functions.RemoveItem('sprunk', 1 )
Player.Functions.RemoveItem('leancup', 1 ) Player.Functions.RemoveItem('leancup', 1 )
Player.Functions.AddItem('cupofdextro', 1 ) Player.Functions.AddItem('cupofdextro', 1 )
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Cup Of Red Dextro' , 'lean')
end end
end end
end) end)
+22 -2
View File
@@ -7,6 +7,7 @@ local playerPed = GetPlayerPed(source)
if CheckDist(source, playerPed, Config.lysergicacid[num]['loc']) then return end if CheckDist(source, playerPed, Config.lysergicacid[num]['loc']) then return end
if AddItem('lysergic_acid', 2) then if AddItem('lysergic_acid', 2) then
Notifys(Lang.lsd.lys, "success") Notifys(Lang.lsd.lys, "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Got Lysergic acid with a distance of ' .. dist(source, playerPed, Config.lysergicacid[num]['loc']) .. '!', 'lsd')
end end
end) end)
@@ -17,6 +18,7 @@ local playerPed = GetPlayerPed(source)
if CheckDist(source, playerPed, Config.diethylamide[num]['loc']) then return end if CheckDist(source, playerPed, Config.diethylamide[num]['loc']) then return end
if AddItem('diethylamide', 2) then if AddItem('diethylamide', 2) then
Notifys(Lang.lsd.die, "success") Notifys(Lang.lsd.die, "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Got Diethylamide with a distance of ' .. dist(source, playerPed, Config.diethylamide[num]['loc']) .. '!', 'lsd')
end end
end) end)
@@ -24,9 +26,10 @@ end)
QBCore.Functions.CreateUseableItem('lsdlabkit', function(source, item) QBCore.Functions.CreateUseableItem('lsdlabkit', function(source, item)
local src = source local src = source
local Player = QBCore.Functions.GetPlayer(src) local Player = QBCore.Functions.GetPlayer(src)
local playerPed = GetPlayerPed(src)
if TriggerClientEvent("md-drugs:client:setlsdlabkit", src) then if TriggerClientEvent("md-drugs:client:setlsdlabkit", src) then
Player.Functions.RemoveItem("lsdlabkit", 1) Player.Functions.RemoveItem("lsdlabkit", 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Placed Their LSD Lab Kit Back At ' .. GetEntityCoords(playerPed) .. '!', 'lsd')
end end
end) end)
@@ -38,15 +41,17 @@ local Player = QBCore.Functions.GetPlayer(src)
if RemoveItem("cleaningkit", 1) then if RemoveItem("cleaningkit", 1) then
Notifys(Lang.lsd.cleaned, "success") Notifys(Lang.lsd.cleaned, "success")
TriggerClientEvent("md-drugs:client:resetlsdkit", src, data) TriggerClientEvent("md-drugs:client:resetlsdkit", src, data)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Wiped Down Their LSD Lab Kit!' , 'lsd')
end end
end) end)
RegisterServerEvent('md-drugs:server:getlabkitback', function() RegisterServerEvent('md-drugs:server:getlabkitback', function()
local src = source local src = source
local Player = QBCore.Functions.GetPlayer(src) local Player = QBCore.Functions.GetPlayer(src)
local playerPed = GetPlayerPed(src)
if AddItem("lsdlabkit", 1) then if AddItem("lsdlabkit", 1) then
Notifys('You Got Your Lab Kit Back', 'success') Notifys('You Got Your Lab Kit Back', 'success')
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Picked Up Their LSD Lab Kit Back At ' .. GetEntityCoords(playerPed) .. '!', 'lsd')
end end
end) end)
@@ -59,6 +64,8 @@ local Player = QBCore.Functions.GetPlayer(src)
RemoveItem('lysergic_acid', 1) RemoveItem('lysergic_acid', 1)
AddItem('lsd_one_vial', 1) AddItem('lsd_one_vial', 1)
Notifys(Lang.lsd.madelsd, "success") Notifys(Lang.lsd.madelsd, "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Heated Basic LSD!', 'lsd')
end) end)
RegisterServerEvent('md-drugs:server:failheating', function() RegisterServerEvent('md-drugs:server:failheating', function()
@@ -68,6 +75,7 @@ local Player = QBCore.Functions.GetPlayer(src)
RemoveItem('diethylamide', 1) RemoveItem('diethylamide', 1)
RemoveItem('lysergic_acid', 1) RemoveItem('lysergic_acid', 1)
Notifys(Lang.lsd.failed, "error") Notifys(Lang.lsd.failed, "error")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Failed Basic LSD Like An Idiot!', 'lsd')
end) end)
@@ -96,6 +104,7 @@ if not Itemcheck(Player, 'lsd_one_vial', 1, 'true') then return end
Notifys(Lang.lsd.refined, "Success") Notifys(Lang.lsd.refined, "Success")
end end
Player.Functions.SetMetaData('lsd', (lsd + 1)) Player.Functions.SetMetaData('lsd', (lsd + 1))
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Refined Acid and Now Has A Rep Of ' .. lsd + 1 .. '!', 'lsd')
end end
else else
if RemoveItem('lsd_one_vial', 1) then if RemoveItem('lsd_one_vial', 1) then
@@ -115,6 +124,7 @@ if not Itemcheck(Player, 'lsd_one_vial', 1, 'true') then return end
AddItem('lsd_vial_six', 1) AddItem('lsd_vial_six', 1)
Notifys(Lang.lsd.refined, "Success") Notifys(Lang.lsd.refined, "Success")
end end
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Refined Acid!', 'lsd')
end end
end end
end) end)
@@ -126,6 +136,7 @@ local randomchance = math.random(1,100)
if not Itemcheck(Player, 'lsd_one_vial', 1, 'true') then return end if not Itemcheck(Player, 'lsd_one_vial', 1, 'true') then return end
if RemoveItem('lsd_one_vial', 1) then if RemoveItem('lsd_one_vial', 1) then
Player.Functions.SetMetaData('lsd', (Player.PlayerData.metadata.lsd - 1)) Player.Functions.SetMetaData('lsd', (Player.PlayerData.metadata.lsd - 1))
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Failed A Refinement And Now Has A Rep Of ' .. Player.PlayerData.metadata.lsd - 1 .. '!', 'lsd')
if Player.PlayerData.metadata.lsd < 0 then Player.Functions.SetMetaData('lsd', 0) end if Player.PlayerData.metadata.lsd < 0 then Player.Functions.SetMetaData('lsd', 0) end
end end
end) end)
@@ -138,6 +149,7 @@ RegisterServerEvent('md-drugs:server:gettabpaper', function(num)
if CheckDist(source, playerPed, Config.gettabs[num]['loc']) then return end if CheckDist(source, playerPed, Config.gettabs[num]['loc']) then return end
if Player.Functions.RemoveMoney('cash', Config.tabcost * 10) then if Player.Functions.RemoveMoney('cash', Config.tabcost * 10) then
AddItem('tab_paper', 10) AddItem('tab_paper', 10)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Bought Tab Paper!', 'lsd')
else else
Notifys(Lang.lsd.broke, "error") Notifys(Lang.lsd.broke, "error")
end end
@@ -150,6 +162,7 @@ RegisterServerEvent('md-drugs:server:getlabkit', function()
if CheckDist(source, playerPed, vector3(Config.buylsdlabkit.x, Config.buylsdlabkit.y, Config.buylsdlabkit.z)) then return end if CheckDist(source, playerPed, vector3(Config.buylsdlabkit.x, Config.buylsdlabkit.y, Config.buylsdlabkit.z)) then return end
if Player.Functions.RemoveMoney('cash', Config.lsdlabkitcost) then if Player.Functions.RemoveMoney('cash', Config.lsdlabkitcost) then
AddItem('lsdlabkit', 1) AddItem('lsdlabkit', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Bought A LSD Lab Kit!', 'lsd')
else else
Notifys(Lang.lsd.broke, "error") Notifys(Lang.lsd.broke, "error")
end end
@@ -165,21 +178,27 @@ local Player = QBCore.Functions.GetPlayer(src)
if Player.Functions.RemoveItem('lsd_one_vial', 1) then if Player.Functions.RemoveItem('lsd_one_vial', 1) then
RemoveItem('tab_paper', 1) RemoveItem('tab_paper', 1)
AddItem('smileyfacesheet', 1) AddItem('smileyfacesheet', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Smiley Face Sheet', 'lsd')
elseif Player.Functions.RemoveItem('lsd_vial_two', 1) then elseif Player.Functions.RemoveItem('lsd_vial_two', 1) then
RemoveItem('tab_paper', 1) RemoveItem('tab_paper', 1)
AddItem('wildcherrysheet', 1) AddItem('wildcherrysheet', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Wild Cherry Sheet', 'lsd')
elseif Player.Functions.RemoveItem('lsd_vial_three', 1) then elseif Player.Functions.RemoveItem('lsd_vial_three', 1) then
RemoveItem('tab_paper', 1) RemoveItem('tab_paper', 1)
AddItem('yinyangsheet', 1) AddItem('yinyangsheet', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Yin Yang Sheet', 'lsd')
elseif Player.Functions.RemoveItem('lsd_vial_four', 1) then elseif Player.Functions.RemoveItem('lsd_vial_four', 1) then
RemoveItem('tab_paper', 1) RemoveItem('tab_paper', 1)
AddItem('pineapplesheet', 1) AddItem('pineapplesheet', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Pine Apple Sheet', 'lsd')
elseif Player.Functions.RemoveItem('lsd_vial_five', 1) then elseif Player.Functions.RemoveItem('lsd_vial_five', 1) then
RemoveItem('tab_paper', 1) RemoveItem('tab_paper', 1)
AddItem('bartsheet', 1) AddItem('bartsheet', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Cluckin Bell Sheet', 'lsd')
elseif Player.Functions.RemoveItem('lsd_vial_six', 1) then elseif Player.Functions.RemoveItem('lsd_vial_six', 1) then
RemoveItem('tab_paper', 1) RemoveItem('tab_paper', 1)
AddItem('gratefuldeadsheet', 1) AddItem('gratefuldeadsheet', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Maze Sheet', 'lsd')
else else
Notifys(Lang.lsd.novial, "error") Notifys(Lang.lsd.novial, "error")
end end
@@ -202,6 +221,7 @@ for k, v in pairs (sheets) do
if Player.Functions.RemoveItem(v.item, 1) then if Player.Functions.RemoveItem(v.item, 1) then
Player.Functions.AddItem(v.recieve, math) Player.Functions.AddItem(v.recieve, math)
TriggerClientEvent("inventory:client:ItemBox", src, QBCore.Shared.Items[v.recieve], "add", math ) TriggerClientEvent("inventory:client:ItemBox", src, QBCore.Shared.Items[v.recieve], "add", math )
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made ' .. math .. 'Tabs of ' .. v.recieve .. '!', 'lsd')
end end
end) end)
end end
+4
View File
@@ -16,6 +16,7 @@ function MescalineCooldown(loc)
GlobalState.Mescaline = Config.Mescaline GlobalState.Mescaline = Config.Mescaline
Wait(1000) Wait(1000)
TriggerClientEvent('Mescaline:respawnCane', -1, loc) TriggerClientEvent('Mescaline:respawnCane', -1, loc)
Log('Cactus Respawned At ' .. Config.Mescaline[loc].location, 'mescaline')
end) end)
end end
@@ -32,6 +33,7 @@ AddEventHandler("Mescaline:pickupCane", function(loc)
MescalineCooldown(loc) MescalineCooldown(loc)
local Player = QBCore.Functions.GetPlayer(source) local Player = QBCore.Functions.GetPlayer(source)
AddItem('cactusbulb', 1) AddItem('cactusbulb', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Picked Cactus Bulbs With a distance of ' .. dist(source, playerPed, Config.Mescaline[loc].location) .. ' vectors', 'mescaline')
end end
end) end)
@@ -44,6 +46,7 @@ local Player = QBCore.Functions.GetPlayer(src)
if RemoveItem("cactusbulb", 1) then if RemoveItem("cactusbulb", 1) then
AddItem("driedmescaline", 1) AddItem("driedmescaline", 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Dried Mescaline', 'mescaline')
else else
Notifys(Lang.mescaline.nocactus, "error") Notifys(Lang.mescaline.nocactus, "error")
end end
@@ -55,5 +58,6 @@ QBCore.Functions.CreateUseableItem("driedmescaline", function(source, item)
if Player.Functions.RemoveItem("driedmescaline", 1) then if Player.Functions.RemoveItem("driedmescaline", 1) then
TriggerClientEvent("md-drugs:client:takemescaline", src) TriggerClientEvent("md-drugs:client:takemescaline", src)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Consumed Mescaline', 'consume')
end end
end) end)
+6 -1
View File
@@ -7,6 +7,7 @@ RegisterServerEvent('md-drugs:server:startcook', function()
Notifys("Adding Things To The Mix", "success") Notifys("Adding Things To The Mix", "success")
RemoveItem('ephedrine', 1) RemoveItem('ephedrine', 1)
RemoveItem('acetone', 1) RemoveItem('acetone', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Started A Meth Batch', 'Meth')
end) end)
RegisterServerEvent('md-drugs:server:givemethingridients', function() RegisterServerEvent('md-drugs:server:givemethingridients', function()
@@ -17,11 +18,12 @@ RegisterServerEvent('md-drugs:server:givemethingridients', function()
if chance <= 50 then if chance <= 50 then
if AddItem('ephedrine', amount) then if AddItem('ephedrine', amount) then
Notifys(Lang.meth.eph, "success") Notifys(Lang.meth.eph, "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Got ' .. amount .. ' Of Ephedrine', 'Meth')
end end
else else
if AddItem('acetone', amount) then if AddItem('acetone', amount) then
Notifys(Lang.meth.ace, "success") Notifys(Lang.meth.ace, "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Got ' .. amount .. ' Of Acetone', 'Meth')
end end
end end
end) end)
@@ -34,6 +36,7 @@ RegisterServerEvent('md-drugs:server:getmeth', function()
if RemoveItem("empty_weed_bag", amount) then if RemoveItem("empty_weed_bag", amount) then
AddItem("methbags", amount) AddItem("methbags", amount)
Notifys("You Made " .. amount .. " Bags Of Meth!", "success") Notifys("You Made " .. amount .. " Bags Of Meth!", "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Bagged ' .. amount .. 'Of Meth', 'Meth')
else else
Notifys(Lang.meth.nobag, "error") Notifys(Lang.meth.nobag, "error")
end end
@@ -46,6 +49,7 @@ RegisterServerEvent('md-drugs:server:geteph', function(num)
if CheckDist(source, playerPed, Config.MethEph[num]['loc']) then return end if CheckDist(source, playerPed, Config.MethEph[num]['loc']) then return end
if AddItem('ephedrine', 1) then if AddItem('ephedrine', 1) then
Notifys('Got Ephedrine!', "success") Notifys('Got Ephedrine!', "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Got ' .. 1 .. 'Of Ephedrine', 'Meth')
end end
end) end)
@@ -55,6 +59,7 @@ RegisterServerEvent('md-drugs:server:getace', function(num)
local playerPed = GetPlayerPed(source) local playerPed = GetPlayerPed(source)
if CheckDist(source, playerPed, Config.Methace[num]['loc']) then return end if CheckDist(source, playerPed, Config.Methace[num]['loc']) then return end
if AddItem('acetone', 1) then if AddItem('acetone', 1) then
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Got ' .. 1 .. 'Of Acetone', 'Meth')
Notifys('Got Acetone!', "success") Notifys('Got Acetone!', "success")
end end
end) end)
+3
View File
@@ -6,6 +6,7 @@ RegisterServerEvent('md-drugs:server:payfortruck', function()
local playerPed = GetPlayerPed(source) local playerPed = GetPlayerPed(source)
if Player.Functions.RemoveMoney('cash', Config.TruckPrice ) or Player.Functions.RemoveMoney('bank', Config.TruckPrice ) then if Player.Functions.RemoveMoney('cash', Config.TruckPrice ) or Player.Functions.RemoveMoney('bank', Config.TruckPrice ) then
TriggerClientEvent("md-drugs:Client:getoxylocation", src) TriggerClientEvent("md-drugs:Client:getoxylocation", src)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Rented A Van For OxyRuns', 'oxy')
else else
Notifys(Lang.oxy.broke, "error") Notifys(Lang.oxy.broke, "error")
end end
@@ -25,6 +26,7 @@ RegisterServerEvent('md-drugs:server:giveoxybox', function()
Player.Functions.AddMoney("cash", cash * 0.5) Player.Functions.AddMoney("cash", cash * 0.5)
if itemchance <= Config.OxyItemChance then if itemchance <= Config.OxyItemChance then
AddItem(item, Config.OxyItemAmount) AddItem(item, Config.OxyItemAmount)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Got ' .. Config.OxyItemAmount .. ' Of ' .. item .. ' For This Drop Off', 'oxy')
end end
else else
Notifys(Lang.oxy.next, "success") Notifys(Lang.oxy.next, "success")
@@ -32,6 +34,7 @@ RegisterServerEvent('md-drugs:server:giveoxybox', function()
Player.Functions.AddMoney("cash", cash) Player.Functions.AddMoney("cash", cash)
if itemchance <= Config.OxyItemChance then if itemchance <= Config.OxyItemChance then
AddItem(item, Config.OxyItemAmount) AddItem(item, Config.OxyItemAmount)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Got ' .. Config.OxyItemAmount .. ' Of ' .. item .. ' For This Drop Off', 'oxy')
end end
end end
+4
View File
@@ -12,6 +12,7 @@ RegisterServerEvent('md-drugs:server:giveprescription', function(item)
local src = source local src = source
local Player = QBCore.Functions.GetPlayer(src) local Player = QBCore.Functions.GetPlayer(src)
Player.Functions.AddItem(item, 1) Player.Functions.AddItem(item, 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Prescription Of ' .. item .. '!', 'pharma')
TriggerClientEvent("inventory:client:ItemBox", source, QBCore.Shared.Items[item], "add", 1) TriggerClientEvent("inventory:client:ItemBox", source, QBCore.Shared.Items[item], "add", 1)
end) end)
@@ -20,6 +21,7 @@ RegisterServerEvent('md-drugs:server:unbottle', function(item)
local Player = QBCore.Functions.GetPlayer(src) local Player = QBCore.Functions.GetPlayer(src)
local amount = math.random(10,30) local amount = math.random(10,30)
Player.Functions.AddItem(item, amount) Player.Functions.AddItem(item, amount)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Unbottled '.. amount .. ' Of ' .. item .. '!', 'pharma')
TriggerClientEvent("inventory:client:ItemBox", source, QBCore.Shared.Items[item], "add", amount) TriggerClientEvent("inventory:client:ItemBox", source, QBCore.Shared.Items[item], "add", amount)
end) end)
@@ -42,6 +44,7 @@ local Player = QBCore.Functions.GetPlayer(src)
if TriggerClientEvent('md-drugs:client:takepharma', src, item.name) then if TriggerClientEvent('md-drugs:client:takepharma', src, item.name) then
Player.Functions.RemoveItem(item.name, 1) Player.Functions.RemoveItem(item.name, 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Took ' .. item.name .. '!', 'pharma')
TriggerClientEvent("inventory:client:ItemBox", source, QBCore.Shared.Items[item.name], "remove", 1) TriggerClientEvent("inventory:client:ItemBox", source, QBCore.Shared.Items[item.name], "remove", 1)
end end
@@ -75,4 +78,5 @@ RegisterServerEvent('md-drugs:server:fillprescription', function()
else else
Notifys(Lang.Pharma.no, "error") Notifys(Lang.Pharma.no, "error")
end end
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Filled A Prescription!', 'pharma')
end) end)
+4 -1
View File
@@ -16,6 +16,7 @@ function shroomsCooldown(loc)
GlobalState.shrooms = Config.shrooms GlobalState.shrooms = Config.shrooms
Wait(1000) Wait(1000)
TriggerClientEvent('shrooms:respawnCane', -1, loc) TriggerClientEvent('shrooms:respawnCane', -1, loc)
Log('Cactus Respawned At ' .. Config.shrooms[loc].location, 'shrooms')
end) end)
end end
@@ -32,6 +33,7 @@ AddEventHandler("shrooms:pickupCane", function(loc)
shroomsCooldown(loc) shroomsCooldown(loc)
local Player = QBCore.Functions.GetPlayer(source) local Player = QBCore.Functions.GetPlayer(source)
AddItem('shrooms', 1) AddItem('shrooms', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Picked A Shroom With a distance of ' .. dist(source, playerPed, Config.shrooms[loc].location) .. ' vectors', 'shrooms')
end end
end) end)
@@ -40,7 +42,8 @@ local src = source
local Player = QBCore.Functions.GetPlayer(src) local Player = QBCore.Functions.GetPlayer(src)
if TriggerClientEvent('md-drugs:client:takeshrooms', src, item.name) then if TriggerClientEvent('md-drugs:client:takeshrooms', src, item.name) then
Player.Functions.RemoveItem('shrooms', 1) Player.Functions.RemoveItem('shrooms', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Took Some Mushrooms', 'shrooms')
TriggerClientEvent("QBCore:Notify", src, Lang.Shrooms.trip, 'success') TriggerClientEvent("QBCore:Notify", src, Lang.Shrooms.trip, 'success')
end end
end) end)
+1
View File
@@ -7,6 +7,7 @@ RegisterServerEvent("md-drugs:server:travellingmerchantox", function(amount, mon
if Player.Functions.RemoveMoney(tostring(money), tonumber(price) * tonumber(amount)) then if Player.Functions.RemoveMoney(tostring(money), tonumber(price) * tonumber(amount)) then
TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items[item], "add", amount) TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items[item], "add", amount)
Player.Functions.AddItem(item, amount) Player.Functions.AddItem(item, amount)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Bought ' .. amount .. ' Of ' .. item .. ' For ' .. tonumber(price) * tonumber(amount) .. '!', 'merchant')
end end
end) end)
+16
View File
@@ -16,6 +16,7 @@ function WeedCooldown(loc)
GlobalState.WeedPlant = Config.WeedPlant GlobalState.WeedPlant = Config.WeedPlant
Wait(1000) Wait(1000)
TriggerClientEvent('weed:respawnCane', -1, loc) TriggerClientEvent('weed:respawnCane', -1, loc)
Log('Weed Plant Respawned At ' .. Config.WeedPlant[loc].location, 'weed')
end) end)
end end
@@ -30,6 +31,8 @@ AddEventHandler("weed:pickupCane", function(loc)
WeedCooldown(loc) WeedCooldown(loc)
local Player = QBCore.Functions.GetPlayer(source) local Player = QBCore.Functions.GetPlayer(source)
AddItem('wetcannabis', 1) AddItem('wetcannabis', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Picked Weed With a distance of ' .. dist(source, playerPed, Config.WeedPlant[loc].location) .. ' vectors', 'weed')
end end
end) end)
--------------- events --------------- events
@@ -38,6 +41,7 @@ RegisterServerEvent('md-drugs:server:dryoutweed', function()
local Player = QBCore.Functions.GetPlayer(src) local Player = QBCore.Functions.GetPlayer(src)
if RemoveItem("wetcannabis", 1) then if RemoveItem("wetcannabis", 1) then
AddItem("drycannabis", 1) AddItem("drycannabis", 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Dried Weed', 'weed')
else else
Notifys(Lang.Weed.nodry, "error") Notifys(Lang.Weed.nodry, "error")
end end
@@ -56,6 +60,7 @@ RegisterServerEvent('md-drugs:server:makebutter', function()
RemoveItem('mdbutter', 1) RemoveItem('mdbutter', 1)
RemoveItem('grindedweed', 1) RemoveItem('grindedweed', 1)
AddItem('cannabutter', 1 ) AddItem('cannabutter', 1 )
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made Canna Butter ', 'weed')
end end
end) end)
@@ -73,6 +78,7 @@ RegisterServerEvent('md-drugs:server:makebrownies', function()
RemoveItem('flour', 1) RemoveItem('flour', 1)
RemoveItem('chocolate', 1) RemoveItem('chocolate', 1)
AddItem('specialbrownie', 1 ) AddItem('specialbrownie', 1 )
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made Special Brownies ', 'weed')
end end
end) end)
@@ -88,6 +94,7 @@ RegisterServerEvent('md-drugs:server:makecookies', function()
RemoveItem('cannabutter', 1) RemoveItem('cannabutter', 1)
RemoveItem('flour', 1) RemoveItem('flour', 1)
AddItem('specialcookie', 1 ) AddItem('specialcookie', 1 )
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made Special Cookies ', 'weed')
end end
end) end)
@@ -103,6 +110,7 @@ RegisterServerEvent('md-drugs:server:makechocolate', function()
RemoveItem('cannabutter', 1) RemoveItem('cannabutter', 1)
RemoveItem('chocolate', 1) RemoveItem('chocolate', 1)
AddItem('specialchocolate', 1 ) AddItem('specialchocolate', 1 )
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made Special Chocolate ', 'weed')
end end
end) end)
@@ -118,6 +126,7 @@ RegisterServerEvent('md-drugs:server:makemuffin', function()
RemoveItem('cannabutter', 1) RemoveItem('cannabutter', 1)
RemoveItem('flour', 1) RemoveItem('flour', 1)
AddItem('specialmuffin', 1 ) AddItem('specialmuffin', 1 )
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made Special Muffin ', 'weed')
end end
end) end)
@@ -133,6 +142,7 @@ RegisterServerEvent('md-drugs:server:makeoil', function()
RemoveItem('butane', 1) RemoveItem('butane', 1)
RemoveItem('grindedweed', 1) RemoveItem('grindedweed', 1)
AddItem('shatter', 1 ) AddItem('shatter', 1 )
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made Shatter ', 'weed')
end end
end) end)
@@ -151,6 +161,7 @@ RegisterServerEvent('md-drugs:server:rollblunt', function()
RemoveItem('bluntwrap', 1) RemoveItem('bluntwrap', 1)
RemoveItem('grindedweed', 1) RemoveItem('grindedweed', 1)
AddItem('blunt', 1 ) AddItem('blunt', 1 )
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Rolled A Blunt ', 'weed')
end end
end) end)
@@ -167,6 +178,7 @@ RegisterServerEvent('md-drugs:server:rollleanblunt', function()
TriggerClientEvent("md-drugs:client:rollanim", src) TriggerClientEvent("md-drugs:client:rollanim", src)
RemoveItem("bluntwrap", 1) RemoveItem("bluntwrap", 1)
AddItem("leanbluntwrap", 1) AddItem("leanbluntwrap", 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Rolled A Lean Blunt ', 'weed')
if chance > 8 then if chance > 8 then
RemoveItem("mdlean", 1) RemoveItem("mdlean", 1)
end end
@@ -187,6 +199,7 @@ RegisterServerEvent('md-drugs:server:rolldextroblunt', function()
RemoveItem("bluntwrap", 1) RemoveItem("bluntwrap", 1)
AddItem("dextrobluntwrap", 1) AddItem("dextrobluntwrap", 1)
TriggerClientEvent("md-drugs:client:rollanim", src) TriggerClientEvent("md-drugs:client:rollanim", src)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Rolled A Dextro Blunt ', 'weed')
if chance > 8 then if chance > 8 then
Player.Functions.RemoveItem("mdreddextro", 1) Player.Functions.RemoveItem("mdreddextro", 1)
end end
@@ -207,6 +220,8 @@ RegisterServerEvent('md-drugs:server:rollchewyblunt', function()
RemoveItem("grindedweed", 1) RemoveItem("grindedweed", 1)
AddItem("chewyblunt", 1) AddItem("chewyblunt", 1)
TriggerClientEvent("md-drugs:client:rollanim", src) TriggerClientEvent("md-drugs:client:rollanim", src)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Rolled A Chewy Blunt ', 'weed')
end end
end) end)
------------------------ usuable items ------------------------ usuable items
@@ -223,6 +238,7 @@ local keef = Player.Functions.GetItemByName("grindedweed")
TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items['leanblunts'], "add", 1) TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items['leanblunts'], "add", 1)
TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items['grindedweed'], "remove", 1) TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items['grindedweed'], "remove", 1)
TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items['leanbluntwrap'], "remove", 1) TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items['leanbluntwrap'], "remove", 1)
end end
else else
Notifys(Lang.Weed.noweed, "error") Notifys(Lang.Weed.noweed, "error")
+6 -2
View File
@@ -23,6 +23,7 @@ RegisterServerEvent('md-drugs:server:wholesalecoke', function()
local removed = Player.Functions.RemoveItem(v, item.amount) local removed = Player.Functions.RemoveItem(v, item.amount)
Player.Functions.AddMoney("cash", item.amount * price) Player.Functions.AddMoney("cash", item.amount * price)
Notifys("You received " .. item.amount * price .. " Dollars!" , "success") Notifys("You received " .. item.amount * price .. " Dollars!" , "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Wholesaled Drugs ', 'wholesale')
end end
end end
end) end)
@@ -45,7 +46,8 @@ RegisterServerEvent('md-drugs:server:wholesalecrack', function()
if item and item.amount > 0 then if item and item.amount > 0 then
local removed = Player.Functions.RemoveItem(v, item.amount) local removed = Player.Functions.RemoveItem(v, item.amount)
Player.Functions.AddMoney("cash", item.amount * price) Player.Functions.AddMoney("cash", item.amount * price)
Notifys("You received " .. item.amount * price .. " Dollars!" , "success") Notifys("You received " .. item.amount * price .. " Dollars!" , "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Wholesaled Drugs ', 'wholesale')
end end
end end
end) end)
@@ -71,6 +73,7 @@ RegisterServerEvent('md-drugs:server:wholesalelsd', function()
local removed = Player.Functions.RemoveItem(v, item.amount) local removed = Player.Functions.RemoveItem(v, item.amount)
Player.Functions.AddMoney("cash", item.amount * price) Player.Functions.AddMoney("cash", item.amount * price)
Notifys("You received " .. item.amount * price .. " Dollars!" , "success") Notifys("You received " .. item.amount * price .. " Dollars!" , "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Wholesaled Drugs ', 'wholesale')
end end
end end
end) end)
@@ -95,7 +98,7 @@ RegisterServerEvent('md-drugs:server:wholesaleheroin', function()
local removed = Player.Functions.RemoveItem(v, item.amount) local removed = Player.Functions.RemoveItem(v, item.amount)
Player.Functions.AddMoney("cash", item.amount * price) Player.Functions.AddMoney("cash", item.amount * price)
Notifys("You received " .. item.amount * price .. " Dollars!" , "success") Notifys("You received " .. item.amount * price .. " Dollars!" , "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Wholesaled Drugs ', 'wholesale')
end end
end end
end) end)
@@ -119,6 +122,7 @@ RegisterServerEvent('md-drugs:server:wholesalextc', function()
local removed = Player.Functions.RemoveItem(v, item.amount) local removed = Player.Functions.RemoveItem(v, item.amount)
Player.Functions.AddMoney("cash", item.amount * price) Player.Functions.AddMoney("cash", item.amount * price)
Notifys("You received " .. item.amount * price .. " Dollars!" , "success") Notifys("You received " .. item.amount * price .. " Dollars!" , "success")
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Wholesaled Drugs ', 'wholesale')
end end
end end
end) end)
+47 -11
View File
@@ -6,6 +6,7 @@ RegisterServerEvent('md-drugs:server:stealisosafrole', function(num)
local playerPed = GetPlayerPed(source) local playerPed = GetPlayerPed(source)
if CheckDist(source, playerPed, Config.isosafrole[num]['loc']) then return end if CheckDist(source, playerPed, Config.isosafrole[num]['loc']) then return end
if AddItem("isosafrole", 1) then if AddItem("isosafrole", 1) then
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Stole isosafrole with a distance of ' .. dist(source, playerPed, Config.isosafrole[num]['loc']) .. ' vectors!', 'xtc')
end end
end) end)
@@ -15,6 +16,8 @@ RegisterServerEvent('md-drugs:server:stealmdp2p', function(num)
local playerPed = GetPlayerPed(source) local playerPed = GetPlayerPed(source)
if CheckDist(source, playerPed, Config.mdp2p[num]['loc']) then return end if CheckDist(source, playerPed, Config.mdp2p[num]['loc']) then return end
if AddItem("mdp2p", 1) then if AddItem("mdp2p", 1) then
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Stole MDP2P with a distance of ' .. dist(source, playerPed, Config.mdp2p[num]['loc']) .. ' vectors!', 'xtc')
end end
end) end)
local presses = { local presses = {
@@ -27,9 +30,10 @@ for k, v in pairs (presses) do
QBCore.Functions.CreateUseableItem(v.item, function(source, item) QBCore.Functions.CreateUseableItem(v.item, function(source, item)
local src = source local src = source
local Player = QBCore.Functions.GetPlayer(src) local Player = QBCore.Functions.GetPlayer(src)
local playerPed = GetPlayerPed(source)
if TriggerClientEvent("md-drugs:client:setpress", src, v.data) then if TriggerClientEvent("md-drugs:client:setpress", src, v.data) then
Player.Functions.RemoveItem(v.item, 1) Player.Functions.RemoveItem(v.item, 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Placed A ' .. v.item .. ' At ' .. GetEntityCoords(playerPed) .. '!', 'xtc')
end end
end) end)
end end
@@ -37,19 +41,23 @@ end
RegisterServerEvent('md-drugs:server:getpressback', function(type) RegisterServerEvent('md-drugs:server:getpressback', function(type)
local src = source local src = source
local Player = QBCore.Functions.GetPlayer(src) local Player = QBCore.Functions.GetPlayer(src)
local playerPed = GetPlayerPed(source)
if type == 'single' then if type == 'single' then
if Player.Functions.GetItemByName('singlepress') then Notifys('You Already Have A Kit') return end if Player.Functions.GetItemByName('singlepress') then Notifys('You Already Have A Kit') return end
AddItem('singlepress', 1) AddItem('singlepress', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Picked Their Single Press At ' .. GetEntityCoords(playerPed) .. '!', 'xtc')
elseif type == 'dual' then elseif type == 'dual' then
if Player.Functions.GetItemByName('dualpress') then Notifys('You Already Have A Kit') return end if Player.Functions.GetItemByName('dualpress') then Notifys('You Already Have A Kit') return end
AddItem('dualpress', 1) AddItem('dualpress', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Picked Their Dual Press At ' .. GetEntityCoords(playerPed) .. '!', 'xtc')
elseif type == 'triple' then elseif type == 'triple' then
if Player.Functions.GetItemByName('triplepress') then Notifys('You Already Have A Kit') return end if Player.Functions.GetItemByName('triplepress') then Notifys('You Already Have A Kit') return end
AddItem('triplepress', 1) AddItem('triplepress', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Picked Their Triple Press At ' .. GetEntityCoords(playerPed) .. '!', 'xtc')
elseif type == 'quad' then elseif type == 'quad' then
if Player.Functions.GetItemByName('quadpress') then Notifys('You Already Have A Kit') return end if Player.Functions.GetItemByName('quadpress') then Notifys('You Already Have A Kit') return end
AddItem('quadpress', 1) AddItem('quadpress', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Picked Their Quad Press At ' .. GetEntityCoords(playerPed) .. '!', 'xtc')
end end
end) end)
@@ -62,6 +70,7 @@ RegisterServerEvent('md-drugs:server:makextc', function(data)
if data.color == 'white' then if data.color == 'white' then
if RemoveItem('raw_xtc', 1) then if RemoveItem('raw_xtc', 1) then
AddItem('white_xtc', 1) AddItem('white_xtc', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Single Stack White Pill!', 'xtc')
end end
elseif data.color == 'red' then elseif data.color == 'red' then
if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end
@@ -69,23 +78,27 @@ RegisterServerEvent('md-drugs:server:makextc', function(data)
RemoveItem('raw_xtc', 1) RemoveItem('raw_xtc', 1)
RemoveItem('loosecoke', 1) RemoveItem('loosecoke', 1)
AddItem('red_xtc', 1) AddItem('red_xtc', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Single Stack Red Pill!', 'xtc')
elseif data.color == 'orange' then elseif data.color == 'orange' then
if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end
if not Itemcheck(Player, 'heroinvial', 1, 'true') then return end if not Itemcheck(Player, 'heroinvial', 1, 'true') then return end
RemoveItem('raw_xtc', 1) RemoveItem('raw_xtc', 1)
RemoveItem('heroinvial', 1) RemoveItem('heroinvial', 1)
AddItem('orange_xtc', 1) AddItem('orange_xtc', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Single Stack Orange Pill!', 'xtc')
elseif data.color == 'blue' then elseif data.color == 'blue' then
if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end
if not Itemcheck(Player, 'crackrock', 1, 'true') then return end if not Itemcheck(Player, 'crackrock', 1, 'true') then return end
RemoveItem('raw_xtc', 1) RemoveItem('raw_xtc', 1)
RemoveItem('crackrock', 1) RemoveItem('crackrock', 1)
AddItem('blue_xtc', 1) AddItem('blue_xtc', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Single Stack Blue Pill!', 'xtc')
end end
elseif data.data == 'dual' then elseif data.data == 'dual' then
if data.color == 'white' then if data.color == 'white' then
if RemoveItem('raw_xtc', 1) then if RemoveItem('raw_xtc', 1) then
AddItem('white_xtc2', 1) AddItem('white_xtc2', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Dual Stack White Pill!', 'xtc')
end end
elseif data.color == 'red' then elseif data.color == 'red' then
if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end
@@ -93,23 +106,27 @@ RegisterServerEvent('md-drugs:server:makextc', function(data)
RemoveItem('raw_xtc', 1) RemoveItem('raw_xtc', 1)
RemoveItem('loosecoke', 1) RemoveItem('loosecoke', 1)
AddItem('red_xtc2', 1) AddItem('red_xtc2', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Dual Stack Red Pill!', 'xtc')
elseif data.color == 'orange' then elseif data.color == 'orange' then
if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end
if not Itemcheck(Player, 'heroinvial', 1, 'true') then return end if not Itemcheck(Player, 'heroinvial', 1, 'true') then return end
RemoveItem('raw_xtc', 1) RemoveItem('raw_xtc', 1)
RemoveItem('heroinvial', 1) RemoveItem('heroinvial', 1)
AddItem('orange_xtc2', 1) AddItem('orange_xtc2', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Dual Stack Orange Pill!', 'xtc')
elseif data.color == 'blue' then elseif data.color == 'blue' then
if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end
if not Itemcheck(Player, 'crackrock', 1, 'true') then return end if not Itemcheck(Player, 'crackrock', 1, 'true') then return end
RemoveItem('raw_xtc', 1) RemoveItem('raw_xtc', 1)
RemoveItem('crackrock', 1) RemoveItem('crackrock', 1)
AddItem('blue_xtc2', 1) AddItem('blue_xtc2', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Dual Stack Blue Pill!', 'xtc')
end end
elseif data.data == 'triple' then elseif data.data == 'triple' then
if data.color == 'white' then if data.color == 'white' then
if RemoveItem('raw_xtc', 1) then if RemoveItem('raw_xtc', 1) then
AddItem('white_xtc3', 1) AddItem('white_xtc3', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Triple Stack White Pill!', 'xtc')
end end
elseif data.color == 'red' then elseif data.color == 'red' then
if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end
@@ -117,23 +134,27 @@ RegisterServerEvent('md-drugs:server:makextc', function(data)
RemoveItem('raw_xtc', 1) RemoveItem('raw_xtc', 1)
RemoveItem('loosecoke', 1) RemoveItem('loosecoke', 1)
AddItem('red_xtc3', 1) AddItem('red_xtc3', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Triple Stack Red Pill!', 'xtc')
elseif data.color == 'orange' then elseif data.color == 'orange' then
if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end
if not Itemcheck(Player, 'heroinvial', 1, 'true') then return end if not Itemcheck(Player, 'heroinvial', 1, 'true') then return end
RemoveItem('raw_xtc', 1) RemoveItem('raw_xtc', 1)
RemoveItem('heroinvial', 1) RemoveItem('heroinvial', 1)
AddItem('orange_xtc3', 1) AddItem('orange_xtc3', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Triple Stack Orange Pill!', 'xtc')
elseif data.color == 'blue' then elseif data.color == 'blue' then
if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end
if not Itemcheck(Player, 'crackrock', 1, 'true') then return end if not Itemcheck(Player, 'crackrock', 1, 'true') then return end
RemoveItem('raw_xtc', 1) RemoveItem('raw_xtc', 1)
RemoveItem('crackrock', 1) RemoveItem('crackrock', 1)
AddItem('blue_xtc3', 1) AddItem('blue_xtc3', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Triple Stack Blue Pill!', 'xtc')
end end
elseif data.data == 'quad' then elseif data.data == 'quad' then
if data.color == 'white' then if data.color == 'white' then
if RemoveItem('raw_xtc', 1) then if RemoveItem('raw_xtc', 1) then
AddItem('white_xtc4', 1) AddItem('white_xtc4', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Quad Stack White Pill!', 'xtc')
end end
elseif data.color == 'red' then elseif data.color == 'red' then
if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end
@@ -141,18 +162,21 @@ RegisterServerEvent('md-drugs:server:makextc', function(data)
RemoveItem('raw_xtc', 1) RemoveItem('raw_xtc', 1)
RemoveItem('loosecoke', 1) RemoveItem('loosecoke', 1)
AddItem('red_xtc4', 1) AddItem('red_xtc4', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Quad Stack Red Pill!', 'xtc')
elseif data.color == 'orange' then elseif data.color == 'orange' then
if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end
if not Itemcheck(Player, 'heroinvial', 1, 'true') then return end if not Itemcheck(Player, 'heroinvial', 1, 'true') then return end
RemoveItem('raw_xtc', 1) RemoveItem('raw_xtc', 1)
RemoveItem('heroinvial', 1) RemoveItem('heroinvial', 1)
AddItem('orange_xtc4', 1) AddItem('orange_xtc4', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Quad Stack Orange Pill!', 'xtc')
elseif data.color == 'blue' then elseif data.color == 'blue' then
if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end
if not Itemcheck(Player, 'crackrock', 1, 'true') then return end if not Itemcheck(Player, 'crackrock', 1, 'true') then return end
RemoveItem('raw_xtc', 1) RemoveItem('raw_xtc', 1)
RemoveItem('crackrock', 1) RemoveItem('crackrock', 1)
AddItem('blue_xtc4', 1) AddItem('blue_xtc4', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Quad Stack Blue Pill!', 'xtc')
end end
end end
end) end)
@@ -163,6 +187,7 @@ RegisterServerEvent('md-drugs:server:buypress', function()
if Player.Functions.RemoveMoney("cash", 20000) then if Player.Functions.RemoveMoney("cash", 20000) then
AddItem("singlepress", 1) AddItem("singlepress", 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Bought A Pill Press', 'xtc')
else else
Notifys(Lang.xtc.cash, "error") Notifys(Lang.xtc.cash, "error")
end end
@@ -188,6 +213,7 @@ RegisterServerEvent('md-drugs:server:upgradepress', function(data)
RemoveItem('orange_xtc', 20) RemoveItem('orange_xtc', 20)
RemoveItem('singlepress', 1) RemoveItem('singlepress', 1)
AddItem('dualpress', 1) AddItem('dualpress', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Upgraded Press To Dual Press', 'xtc')
end end
elseif data == 'triple' then elseif data == 'triple' then
local have = 0 local have = 0
@@ -202,6 +228,7 @@ RegisterServerEvent('md-drugs:server:upgradepress', function(data)
RemoveItem('red_xtc2', 50) RemoveItem('red_xtc2', 50)
RemoveItem('orange_xtc2', 50) RemoveItem('orange_xtc2', 50)
AddItem('triplepress', 1) AddItem('triplepress', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Upgraded Press To Triple Press', 'xtc')
end end
elseif data == 'quad' then elseif data == 'quad' then
local have = 0 local have = 0
@@ -216,6 +243,7 @@ RegisterServerEvent('md-drugs:server:upgradepress', function(data)
RemoveItem('red_xtc3', 150) RemoveItem('red_xtc3', 150)
RemoveItem('orange_xtc3', 150) RemoveItem('orange_xtc3', 150)
AddItem('quadpress', 1) AddItem('quadpress', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Upgraded Press To Quad Press', 'xtc')
end end
else else
Notify('huh', 'error') Notify('huh', 'error')
@@ -232,6 +260,7 @@ RegisterServerEvent('md-drugs:server:makingrawxtc', function(num)
RemoveItem('mdp2p', 1) RemoveItem('mdp2p', 1)
RemoveItem('isosafrole', 1) RemoveItem('isosafrole', 1)
AddItem("raw_xtc", 1) AddItem("raw_xtc", 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made Raw XTC With A Distance Of ' .. dist(source, playerPed, Config.rawxtcloc[num]['loc']) .. '!', 'xtc')
end) end)
RegisterServerEvent('md-drugs:server:stampwhite', function(num) RegisterServerEvent('md-drugs:server:stampwhite', function(num)
@@ -250,14 +279,16 @@ RegisterServerEvent('md-drugs:server:stampwhite', function(num)
if Player.Functions.RemoveItem("white_xtc", 1) then if Player.Functions.RemoveItem("white_xtc", 1) then
AddItem(one[chance], 1) AddItem(one[chance], 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Stamped A Single White Pill And Got ' .. one[chance] .. '!', 'xtc')
elseif Player.Functions.RemoveItem("white_xtc2", 1) then elseif Player.Functions.RemoveItem("white_xtc2", 1) then
AddItem(two[chance2], 1) AddItem(two[chance2], 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Stamped A Dual White Pill And Got ' .. two[chance2] .. '!', 'xtc')
elseif Player.Functions.RemoveItem("white_xtc3", 1) then elseif Player.Functions.RemoveItem("white_xtc3", 1) then
AddItem(three[chance3], 1) AddItem(three[chance3], 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Stamped A Triple White Pill And Got ' .. three[chance3] .. '!', 'xtc')
elseif Player.Functions.RemoveItem("white_xtc4", 1) then elseif Player.Functions.RemoveItem("white_xtc4", 1) then
AddItem(four[chance4], 1) AddItem(four[chance4], 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Stamped A Quad White Pill And Got ' .. four[chance4] .. '!', 'xtc')
else else
Notifys('You Dont Have Unstamped White Pills', 'error') Notifys('You Dont Have Unstamped White Pills', 'error')
end end
@@ -279,14 +310,16 @@ RegisterServerEvent('md-drugs:server:stampred', function(num)
if Player.Functions.RemoveItem("red_xtc", 1) then if Player.Functions.RemoveItem("red_xtc", 1) then
AddItem(one[chance], 1) AddItem(one[chance], 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Stamped A Single Red Pill And Got ' .. one[chance] .. '!', 'xtc')
elseif Player.Functions.RemoveItem("red_xtc2", 1) then elseif Player.Functions.RemoveItem("red_xtc2", 1) then
AddItem(two[chance2], 1) AddItem(two[chance2], 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Stamped A Dual Red Pill And Got ' .. two[chance2] .. '!', 'xtc')
elseif Player.Functions.RemoveItem("red_xtc3", 1) then elseif Player.Functions.RemoveItem("red_xtc3", 1) then
AddItem(three[chance3], 1) AddItem(three[chance3], 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Stamped A Triple Red Pill And Got ' .. three[chance3] .. '!', 'xtc')
elseif Player.Functions.RemoveItem("red_xtc4", 1) then elseif Player.Functions.RemoveItem("red_xtc4", 1) then
AddItem(four[chance4], 1) AddItem(four[chance4], 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Stamped A Quad Red Pill And Got ' .. four[chance4] .. '!', 'xtc')
else else
Notifys('You Dont Have Unstamped red Pills', 'error') Notifys('You Dont Have Unstamped red Pills', 'error')
end end
@@ -308,14 +341,16 @@ RegisterServerEvent('md-drugs:server:stamporange', function(num)
if Player.Functions.RemoveItem("orange_xtc", 1) then if Player.Functions.RemoveItem("orange_xtc", 1) then
AddItem(one[chance], 1) AddItem(one[chance], 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Stamped A Single Orange Pill And Got ' .. one[chance] .. '!', 'xtc')
elseif Player.Functions.RemoveItem("orange_xtc2", 1) then elseif Player.Functions.RemoveItem("orange_xtc2", 1) then
AddItem(two[chance2], 1) AddItem(two[chance2], 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Stamped A Dual Orange Pill And Got ' .. two[chance2] .. '!', 'xtc')
elseif Player.Functions.RemoveItem("orange_xtc3", 1) then elseif Player.Functions.RemoveItem("orange_xtc3", 1) then
AddItem(three[chance3], 1) AddItem(three[chance3], 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Stamped A Triple Orange Pill And Got ' .. three[chance3] .. '!', 'xtc')
elseif Player.Functions.RemoveItem("orange_xtc4", 1) then elseif Player.Functions.RemoveItem("orange_xtc4", 1) then
AddItem(four[chance4], 1) AddItem(four[chance4], 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Stamped A Quad Orange Pill And Got ' .. four[chance4] .. '!', 'xtc')
else else
Notifys('You Dont Have Unstamped orange Pills', 'error') Notifys('You Dont Have Unstamped orange Pills', 'error')
end end
@@ -334,17 +369,18 @@ RegisterServerEvent('md-drugs:server:stampblue', function(num)
local chance4 = math.random(#one) local chance4 = math.random(#one)
local playerPed = GetPlayerPed(source) local playerPed = GetPlayerPed(source)
if CheckDist(source, playerPed, Config.stamp[num]['loc']) then return end if CheckDist(source, playerPed, Config.stamp[num]['loc']) then return end
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Stamped A Single Blue Pill And Got ' .. one[chance] .. '!', 'xtc')
if Player.Functions.RemoveItem("blue_xtc", 1) then if Player.Functions.RemoveItem("blue_xtc", 1) then
AddItem(one[chance], 1) AddItem(one[chance], 1)
elseif Player.Functions.RemoveItem("blue_xtc2", 1) then elseif Player.Functions.RemoveItem("blue_xtc2", 1) then
AddItem(two[chance2], 1) AddItem(two[chance2], 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Stamped A Dual Blue Pill And Got ' .. two[chance2] .. '!', 'xtc')
elseif Player.Functions.RemoveItem("blue_xtc3", 1) then elseif Player.Functions.RemoveItem("blue_xtc3", 1) then
AddItem(three[chance3], 1) AddItem(three[chance3], 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Stamped A Triple Blue Pill And Got ' .. three[chance3] .. '!', 'xtc')
elseif Player.Functions.RemoveItem("blue_xtc4", 1) then elseif Player.Functions.RemoveItem("blue_xtc4", 1) then
AddItem(four[chance4], 1) AddItem(four[chance4], 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Stamped A Quad Blue Pill And Got ' .. four[chance4] .. '!', 'xtc')
else else
Notifys('You Dont Have Unstamped blue Pills', 'error') Notifys('You Dont Have Unstamped blue Pills', 'error')
end end