Files
md-drugs/server/xtc.lua
T
Mustache Dom 3d144cae58 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
2024-07-16 14:14:48 -07:00

387 lines
19 KiB
Lua

local QBCore = exports['qb-core']:GetCoreObject()
-------------------- stealing ingridients
RegisterServerEvent('md-drugs:server:stealisosafrole', function(num)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
local playerPed = GetPlayerPed(source)
if CheckDist(source, playerPed, Config.isosafrole[num]['loc']) then return end
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)
RegisterServerEvent('md-drugs:server:stealmdp2p', function(num)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
local playerPed = GetPlayerPed(source)
if CheckDist(source, playerPed, Config.mdp2p[num]['loc']) then return end
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)
local presses = {
{item = 'singlepress', data = 'single'},
{item = 'dualpress', data = 'dual'},
{item = 'triplepress', data = 'triple'},
{item = 'quadpress', data = 'quad'},
}
for k, v in pairs (presses) do
QBCore.Functions.CreateUseableItem(v.item, function(source, item)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
local playerPed = GetPlayerPed(source)
if TriggerClientEvent("md-drugs:client:setpress", src, v.data) then
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
RegisterServerEvent('md-drugs:server:getpressback', function(type)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
local playerPed = GetPlayerPed(source)
if type == 'single' then
if Player.Functions.GetItemByName('singlepress') then Notifys('You Already Have A Kit') return end
AddItem('singlepress', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Picked Their Single Press At ' .. GetEntityCoords(playerPed) .. '!', 'xtc')
elseif type == 'dual' then
if Player.Functions.GetItemByName('dualpress') then Notifys('You Already Have A Kit') return end
AddItem('dualpress', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Picked Their Dual Press At ' .. GetEntityCoords(playerPed) .. '!', 'xtc')
elseif type == 'triple' then
if Player.Functions.GetItemByName('triplepress') then Notifys('You Already Have A Kit') return end
AddItem('triplepress', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Picked Their Triple Press At ' .. GetEntityCoords(playerPed) .. '!', 'xtc')
elseif type == 'quad' then
if Player.Functions.GetItemByName('quadpress') then Notifys('You Already Have A Kit') return end
AddItem('quadpress', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Picked Their Quad Press At ' .. GetEntityCoords(playerPed) .. '!', 'xtc')
end
end)
RegisterServerEvent('md-drugs:server:makextc', function(data)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end
if data.data == 'single' then
if data.color == 'white' then
if RemoveItem('raw_xtc', 1) then
AddItem('white_xtc', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Single Stack White Pill!', 'xtc')
end
elseif data.color == 'red' then
if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end
if not Itemcheck(Player, 'loosecoke', 1, 'true') then return end
RemoveItem('raw_xtc', 1)
RemoveItem('loosecoke', 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
if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end
if not Itemcheck(Player, 'heroinvial', 1, 'true') then return end
RemoveItem('raw_xtc', 1)
RemoveItem('heroinvial', 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
if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end
if not Itemcheck(Player, 'crackrock', 1, 'true') then return end
RemoveItem('raw_xtc', 1)
RemoveItem('crackrock', 1)
AddItem('blue_xtc', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Single Stack Blue Pill!', 'xtc')
end
elseif data.data == 'dual' then
if data.color == 'white' then
if RemoveItem('raw_xtc', 1) then
AddItem('white_xtc2', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Dual Stack White Pill!', 'xtc')
end
elseif data.color == 'red' then
if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end
if not Itemcheck(Player, 'loosecoke', 1, 'true') then return end
RemoveItem('raw_xtc', 1)
RemoveItem('loosecoke', 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
if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end
if not Itemcheck(Player, 'heroinvial', 1, 'true') then return end
RemoveItem('raw_xtc', 1)
RemoveItem('heroinvial', 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
if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end
if not Itemcheck(Player, 'crackrock', 1, 'true') then return end
RemoveItem('raw_xtc', 1)
RemoveItem('crackrock', 1)
AddItem('blue_xtc2', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Dual Stack Blue Pill!', 'xtc')
end
elseif data.data == 'triple' then
if data.color == 'white' then
if RemoveItem('raw_xtc', 1) then
AddItem('white_xtc3', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Triple Stack White Pill!', 'xtc')
end
elseif data.color == 'red' then
if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end
if not Itemcheck(Player, 'loosecoke', 1, 'true') then return end
RemoveItem('raw_xtc', 1)
RemoveItem('loosecoke', 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
if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end
if not Itemcheck(Player, 'heroinvial', 1, 'true') then return end
RemoveItem('raw_xtc', 1)
RemoveItem('heroinvial', 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
if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end
if not Itemcheck(Player, 'crackrock', 1, 'true') then return end
RemoveItem('raw_xtc', 1)
RemoveItem('crackrock', 1)
AddItem('blue_xtc3', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Triple Stack Blue Pill!', 'xtc')
end
elseif data.data == 'quad' then
if data.color == 'white' then
if RemoveItem('raw_xtc', 1) then
AddItem('white_xtc4', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Quad Stack White Pill!', 'xtc')
end
elseif data.color == 'red' then
if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end
if not Itemcheck(Player, 'loosecoke', 1, 'true') then return end
RemoveItem('raw_xtc', 1)
RemoveItem('loosecoke', 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
if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end
if not Itemcheck(Player, 'heroinvial', 1, 'true') then return end
RemoveItem('raw_xtc', 1)
RemoveItem('heroinvial', 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
if not Itemcheck(Player, 'raw_xtc', 1, 'true') then return end
if not Itemcheck(Player, 'crackrock', 1, 'true') then return end
RemoveItem('raw_xtc', 1)
RemoveItem('crackrock', 1)
AddItem('blue_xtc4', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Made A Quad Stack Blue Pill!', 'xtc')
end
end
end)
RegisterServerEvent('md-drugs:server:buypress', function()
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if Player.Functions.RemoveMoney("cash", 20000) then
AddItem("singlepress", 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Bought A Pill Press', 'xtc')
else
Notifys(Lang.xtc.cash, "error")
end
end)
RegisterServerEvent('md-drugs:server:upgradepress', function(data)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
local playerPed = GetPlayerPed(source)
if CheckDist(source, playerPed, Config.buypress) then return end
if data == 'dual' then
local have = 0
local pill = {'white_xtc', 'blue_xtc', 'red_xtc', 'orange_xtc'}
for k, v in pairs (pill) do
if Itemcheck(Player, v, 20, 'true') then have = have + 1 end
end
if have == 4 then
if not Itemcheck(Player, 'singlepress', 1, 'true') then return end
RemoveItem('white_xtc', 20)
RemoveItem('blue_xtc', 20)
RemoveItem('red_xtc', 20)
RemoveItem('orange_xtc', 20)
RemoveItem('singlepress', 1)
AddItem('dualpress', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Upgraded Press To Dual Press', 'xtc')
end
elseif data == 'triple' then
local have = 0
local pill = {'white_xtc2', 'blue_xtc2', 'red_xtc2', 'orange_xtc2'}
for k, v in pairs (pill) do
if Itemcheck(Player, v, 50, 'true') then have = have + 1 end
end
if have == 4 then
RemoveItem('dualpress', 1)
RemoveItem('white_xtc2', 50)
RemoveItem('blue_xtc2', 50)
RemoveItem('red_xtc2', 50)
RemoveItem('orange_xtc2', 50)
AddItem('triplepress', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Upgraded Press To Triple Press', 'xtc')
end
elseif data == 'quad' then
local have = 0
local pill = {'white_xtc3', 'blue_xtc3', 'red_xtc3', 'orange_xtc3'}
for k, v in pairs (pill) do
if Itemcheck(Player, v, 150, 'true') then have = have + 1 end
end
if have == 4 then
RemoveItem('triplepress', 1)
RemoveItem('white_xtc3', 150)
RemoveItem('blue_xtc3', 150)
RemoveItem('red_xtc3', 150)
RemoveItem('orange_xtc3', 150)
AddItem('quadpress', 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Upgraded Press To Quad Press', 'xtc')
end
else
Notify('huh', 'error')
end
end)
------------- making powder
RegisterServerEvent('md-drugs:server:makingrawxtc', function(num)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
local playerPed = GetPlayerPed(source)
if CheckDist(source, playerPed, Config.rawxtcloc[num]['loc']) then return end
if not Itemcheck(Player, 'mdp2p', 1, 'true') and not Itemcheck(Player, 'isosafrole', 1, 'true') then return end
RemoveItem('mdp2p', 1)
RemoveItem('isosafrole', 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)
RegisterServerEvent('md-drugs:server:stampwhite', function(num)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
local one = {'white_playboys', 'white_aliens', 'white_pl', 'white_trolls', 'white_cats'}
local chance = math.random(#one)
local two = {'white_playboys2', 'white_aliens2', 'white_pl2', 'white_trolls2', 'white_cats2'}
local chance2 = math.random(#one)
local three = {'white_playboys3', 'white_aliens3', 'white_pl3', 'white_trolls3', 'white_cats3'}
local chance3 = math.random(#one)
local four = {'white_playboys4', 'white_aliens4', 'white_pl4', 'white_trolls4', 'white_cats4'}
local chance4 = math.random(#one)
local playerPed = GetPlayerPed(source)
if CheckDist(source, playerPed, Config.stamp[num]['loc']) then return end
if Player.Functions.RemoveItem("white_xtc", 1) then
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
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
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
AddItem(four[chance4], 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Stamped A Quad White Pill And Got ' .. four[chance4] .. '!', 'xtc')
else
Notifys('You Dont Have Unstamped White Pills', 'error')
end
end)
RegisterServerEvent('md-drugs:server:stampred', function(num)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
local one = {'red_playboys', 'red_aliens', 'red_pl', 'red_trolls', 'red_cats'}
local chance = math.random(#one)
local two = {'red_playboys2', 'red_aliens2', 'red_pl2', 'red_trolls2', 'red_cats2'}
local chance2 = math.random(#one)
local three = {'red_playboys3', 'red_aliens3', 'red_pl3', 'red_trolls3', 'red_cats3'}
local chance3 = math.random(#one)
local four = {'red_playboys4', 'red_aliens4', 'red_pl4', 'red_trolls4', 'red_cats4'}
local chance4 = math.random(#one)
local playerPed = GetPlayerPed(source)
if CheckDist(source, playerPed, Config.stamp[num]['loc']) then return end
if Player.Functions.RemoveItem("red_xtc", 1) then
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
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
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
AddItem(four[chance4], 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Stamped A Quad Red Pill And Got ' .. four[chance4] .. '!', 'xtc')
else
Notifys('You Dont Have Unstamped red Pills', 'error')
end
end)
RegisterServerEvent('md-drugs:server:stamporange', function(num)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
local one = {'orange_playboys', 'orange_aliens', 'orange_pl', 'orange_trolls', 'orange_cats'}
local chance = math.random(#one)
local two = {'orange_playboys2', 'orange_aliens2', 'orange_pl2', 'orange_trolls2', 'orange_cats2'}
local chance2 = math.random(#one)
local three = {'orange_playboys3', 'orange_aliens3', 'orange_pl3', 'orange_trolls3', 'orange_cats3'}
local chance3 = math.random(#one)
local four = {'orange_playboys4', 'orange_aliens4', 'orange_pl4', 'orange_trolls4', 'orange_cats4'}
local chance4 = math.random(#one)
local playerPed = GetPlayerPed(source)
if CheckDist(source, playerPed, Config.stamp[num]['loc']) then return end
if Player.Functions.RemoveItem("orange_xtc", 1) then
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
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
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
AddItem(four[chance4], 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Stamped A Quad Orange Pill And Got ' .. four[chance4] .. '!', 'xtc')
else
Notifys('You Dont Have Unstamped orange Pills', 'error')
end
end)
RegisterServerEvent('md-drugs:server:stampblue', function(num)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
local one = {'blue_playboys', 'blue_aliens', 'blue_pl', 'blue_trolls', 'blue_cats'}
local chance = math.random(#one)
local two = {'blue_playboys2', 'blue_aliens2', 'blue_pl2', 'blue_trolls2', 'blue_cats2'}
local chance2 = math.random(#one)
local three = {'blue_playboys3', 'blue_aliens3', 'blue_pl3', 'blue_trolls3', 'blue_cats3'}
local chance3 = math.random(#one)
local four = {'blue_playboys4', 'blue_aliens4', 'blue_pl4', 'blue_trolls4', 'blue_cats4'}
local chance4 = math.random(#one)
local playerPed = GetPlayerPed(source)
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
AddItem(one[chance], 1)
elseif Player.Functions.RemoveItem("blue_xtc2", 1) then
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
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
AddItem(four[chance4], 1)
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Stamped A Quad Blue Pill And Got ' .. four[chance4] .. '!', 'xtc')
else
Notifys('You Dont Have Unstamped blue Pills', 'error')
end
end)