2023-12-07 15:45:48 -08:00
local QBCore = exports [ 'qb-core' ]: GetCoreObject ()
-------------------- stealing ingridients
2024-05-02 18:34:49 -07:00
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
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Stole isosafrole with a distance of ' .. dist ( source , playerPed , Config.isosafrole [ num ][ 'loc' ]) .. ' vectors!' , 'xtc' )
2024-05-02 18:34:49 -07:00
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
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Stole MDP2P with a distance of ' .. dist ( source , playerPed , Config.mdp2p [ num ][ 'loc' ]) .. ' vectors!' , 'xtc' )
2024-05-02 18:34:49 -07:00
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 )
2023-12-07 15:45:48 -08:00
local src = source
local Player = QBCore.Functions . GetPlayer ( src )
2024-07-16 14:14:48 -07:00
local playerPed = GetPlayerPed ( source )
2024-05-02 18:34:49 -07:00
if TriggerClientEvent ( "md-drugs:client:setpress" , src , v.data ) then
Player.Functions . RemoveItem ( v.item , 1 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Placed A ' .. v.item .. ' At ' .. GetEntityCoords ( playerPed ) .. '!' , 'xtc' )
2023-12-07 15:45:48 -08:00
end
end )
2024-05-02 18:34:49 -07:00
end
2023-12-07 15:45:48 -08:00
2024-05-02 18:34:49 -07:00
RegisterServerEvent ( 'md-drugs:server:getpressback' , function ( type )
2023-12-07 15:45:48 -08:00
local src = source
local Player = QBCore.Functions . GetPlayer ( src )
2024-07-16 14:14:48 -07:00
local playerPed = GetPlayerPed ( source )
2024-05-02 18:34:49 -07:00
if type == 'single' then
if Player.Functions . GetItemByName ( 'singlepress' ) then Notifys ( 'You Already Have A Kit' ) return end
AddItem ( 'singlepress' , 1 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Picked Their Single Press At ' .. GetEntityCoords ( playerPed ) .. '!' , 'xtc' )
2024-05-02 18:34:49 -07:00
elseif type == 'dual' then
if Player.Functions . GetItemByName ( 'dualpress' ) then Notifys ( 'You Already Have A Kit' ) return end
AddItem ( 'dualpress' , 1 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Picked Their Dual Press At ' .. GetEntityCoords ( playerPed ) .. '!' , 'xtc' )
2024-05-02 18:34:49 -07:00
elseif type == 'triple' then
if Player.Functions . GetItemByName ( 'triplepress' ) then Notifys ( 'You Already Have A Kit' ) return end
AddItem ( 'triplepress' , 1 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Picked Their Triple Press At ' .. GetEntityCoords ( playerPed ) .. '!' , 'xtc' )
2024-05-02 18:34:49 -07:00
elseif type == 'quad' then
if Player.Functions . GetItemByName ( 'quadpress' ) then Notifys ( 'You Already Have A Kit' ) return end
AddItem ( 'quadpress' , 1 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Picked Their Quad Press At ' .. GetEntityCoords ( playerPed ) .. '!' , 'xtc' )
2024-05-02 18:34:49 -07:00
end
2023-12-07 15:45:48 -08:00
end )
2024-05-02 18:34:49 -07:00
RegisterServerEvent ( 'md-drugs:server:makextc' , function ( data )
2023-12-07 15:45:48 -08:00
local src = source
local Player = QBCore.Functions . GetPlayer ( src )
2024-05-02 18:34:49 -07:00
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 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Made A Single Stack White Pill!' , 'xtc' )
2023-12-07 15:45:48 -08:00
end
2024-05-02 18:34:49 -07:00
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 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Made A Single Stack Red Pill!' , 'xtc' )
2024-05-02 18:34:49 -07:00
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 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Made A Single Stack Orange Pill!' , 'xtc' )
2024-05-02 18:34:49 -07:00
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 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Made A Single Stack Blue Pill!' , 'xtc' )
2023-12-07 15:45:48 -08:00
end
2024-05-02 18:34:49 -07:00
elseif data.data == 'dual' then
if data.color == 'white' then
if RemoveItem ( 'raw_xtc' , 1 ) then
AddItem ( 'white_xtc2' , 1 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Made A Dual Stack White Pill!' , 'xtc' )
2023-12-07 15:45:48 -08:00
end
2024-05-02 18:34:49 -07:00
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 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Made A Dual Stack Red Pill!' , 'xtc' )
2024-05-02 18:34:49 -07:00
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 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Made A Dual Stack Orange Pill!' , 'xtc' )
2024-05-02 18:34:49 -07:00
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 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Made A Dual Stack Blue Pill!' , 'xtc' )
2023-12-07 15:45:48 -08:00
end
2024-05-02 18:34:49 -07:00
elseif data.data == 'triple' then
if data.color == 'white' then
if RemoveItem ( 'raw_xtc' , 1 ) then
AddItem ( 'white_xtc3' , 1 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Made A Triple Stack White Pill!' , 'xtc' )
2023-12-07 15:45:48 -08:00
end
2024-05-02 18:34:49 -07:00
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 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Made A Triple Stack Red Pill!' , 'xtc' )
2024-05-02 18:34:49 -07:00
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 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Made A Triple Stack Orange Pill!' , 'xtc' )
2024-05-02 18:34:49 -07:00
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 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Made A Triple Stack Blue Pill!' , 'xtc' )
2024-05-02 18:34:49 -07:00
end
elseif data.data == 'quad' then
if data.color == 'white' then
if RemoveItem ( 'raw_xtc' , 1 ) then
AddItem ( 'white_xtc4' , 1 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Made A Quad Stack White Pill!' , 'xtc' )
2024-05-02 18:34:49 -07:00
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 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Made A Quad Stack Red Pill!' , 'xtc' )
2024-05-02 18:34:49 -07:00
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 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Made A Quad Stack Orange Pill!' , 'xtc' )
2024-05-02 18:34:49 -07:00
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 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Made A Quad Stack Blue Pill!' , 'xtc' )
2024-05-02 18:34:49 -07:00
end
2023-12-07 15:45:48 -08:00
end
end )
2024-05-02 18:34:49 -07:00
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 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Bought A Pill Press' , 'xtc' )
2023-12-07 15:45:48 -08:00
else
2024-05-02 18:34:49 -07:00
Notifys ( Lang.xtc . cash , "error" )
2023-12-07 15:45:48 -08:00
end
2024-05-02 18:34:49 -07:00
end )
2023-12-07 15:45:48 -08:00
2024-05-02 18:34:49 -07:00
RegisterServerEvent ( 'md-drugs:server:upgradepress' , function ( data )
2023-12-07 15:45:48 -08:00
local src = source
local Player = QBCore.Functions . GetPlayer ( src )
2024-05-02 18:34:49 -07:00
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
2023-12-07 15:45:48 -08:00
end
2024-05-02 18:34:49 -07:00
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 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Upgraded Press To Dual Press' , 'xtc' )
2023-12-07 15:45:48 -08:00
end
2024-05-02 18:34:49 -07:00
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
2023-12-07 15:45:48 -08:00
end
2024-05-02 18:34:49 -07:00
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 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Upgraded Press To Triple Press' , 'xtc' )
2024-05-02 18:34:49 -07:00
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
2023-12-07 15:45:48 -08:00
end
2024-05-02 18:34:49 -07:00
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 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Upgraded Press To Quad Press' , 'xtc' )
2024-05-02 18:34:49 -07:00
end
else
Notify ( 'huh' , 'error' )
2023-12-07 15:45:48 -08:00
end
end )
2024-05-02 18:34:49 -07:00
------------- making powder
RegisterServerEvent ( 'md-drugs:server:makingrawxtc' , function ( num )
2023-12-07 15:45:48 -08:00
local src = source
local Player = QBCore.Functions . GetPlayer ( src )
2024-05-02 18:34:49 -07:00
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 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Made Raw XTC With A Distance Of ' .. dist ( source , playerPed , Config.rawxtcloc [ num ][ 'loc' ]) .. '!' , 'xtc' )
2023-12-07 15:45:48 -08:00
end )
2024-05-02 18:34:49 -07:00
RegisterServerEvent ( 'md-drugs:server:stampwhite' , function ( num )
2023-12-07 15:45:48 -08:00
local src = source
local Player = QBCore.Functions . GetPlayer ( src )
2024-05-02 18:34:49 -07:00
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 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Stamped A Single White Pill And Got ' .. one [ chance ] .. '!' , 'xtc' )
2024-05-02 18:34:49 -07:00
elseif Player.Functions . RemoveItem ( "white_xtc2" , 1 ) then
AddItem ( two [ chance2 ], 1 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Stamped A Dual White Pill And Got ' .. two [ chance2 ] .. '!' , 'xtc' )
2024-05-02 18:34:49 -07:00
elseif Player.Functions . RemoveItem ( "white_xtc3" , 1 ) then
AddItem ( three [ chance3 ], 1 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Stamped A Triple White Pill And Got ' .. three [ chance3 ] .. '!' , 'xtc' )
2024-05-02 18:34:49 -07:00
elseif Player.Functions . RemoveItem ( "white_xtc4" , 1 ) then
AddItem ( four [ chance4 ], 1 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Stamped A Quad White Pill And Got ' .. four [ chance4 ] .. '!' , 'xtc' )
2023-12-07 15:45:48 -08:00
else
2024-05-02 18:34:49 -07:00
Notifys ( 'You Dont Have Unstamped White Pills' , 'error' )
2023-12-07 15:45:48 -08:00
end
end )
2024-05-02 18:34:49 -07:00
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
2023-12-07 15:45:48 -08:00
2024-05-02 18:34:49 -07:00
if Player.Functions . RemoveItem ( "red_xtc" , 1 ) then
AddItem ( one [ chance ], 1 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Stamped A Single Red Pill And Got ' .. one [ chance ] .. '!' , 'xtc' )
2024-05-02 18:34:49 -07:00
elseif Player.Functions . RemoveItem ( "red_xtc2" , 1 ) then
AddItem ( two [ chance2 ], 1 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Stamped A Dual Red Pill And Got ' .. two [ chance2 ] .. '!' , 'xtc' )
2024-05-02 18:34:49 -07:00
elseif Player.Functions . RemoveItem ( "red_xtc3" , 1 ) then
AddItem ( three [ chance3 ], 1 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Stamped A Triple Red Pill And Got ' .. three [ chance3 ] .. '!' , 'xtc' )
2024-05-02 18:34:49 -07:00
elseif Player.Functions . RemoveItem ( "red_xtc4" , 1 ) then
AddItem ( four [ chance4 ], 1 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Stamped A Quad Red Pill And Got ' .. four [ chance4 ] .. '!' , 'xtc' )
2024-05-02 18:34:49 -07:00
else
Notifys ( 'You Dont Have Unstamped red Pills' , 'error' )
end
2023-12-07 15:45:48 -08:00
end )
2024-05-02 18:34:49 -07:00
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 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Stamped A Single Orange Pill And Got ' .. one [ chance ] .. '!' , 'xtc' )
2024-05-02 18:34:49 -07:00
elseif Player.Functions . RemoveItem ( "orange_xtc2" , 1 ) then
AddItem ( two [ chance2 ], 1 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Stamped A Dual Orange Pill And Got ' .. two [ chance2 ] .. '!' , 'xtc' )
2024-05-02 18:34:49 -07:00
elseif Player.Functions . RemoveItem ( "orange_xtc3" , 1 ) then
AddItem ( three [ chance3 ], 1 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Stamped A Triple Orange Pill And Got ' .. three [ chance3 ] .. '!' , 'xtc' )
2024-05-02 18:34:49 -07:00
elseif Player.Functions . RemoveItem ( "orange_xtc4" , 1 ) then
AddItem ( four [ chance4 ], 1 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Stamped A Quad Orange Pill And Got ' .. four [ chance4 ] .. '!' , 'xtc' )
2024-05-02 18:34:49 -07:00
else
Notifys ( 'You Dont Have Unstamped orange Pills' , 'error' )
end
end )
2023-12-07 15:45:48 -08:00
2024-05-02 18:34:49 -07:00
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
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Stamped A Single Blue Pill And Got ' .. one [ chance ] .. '!' , 'xtc' )
2024-05-02 18:34:49 -07:00
if Player.Functions . RemoveItem ( "blue_xtc" , 1 ) then
AddItem ( one [ chance ], 1 )
elseif Player.Functions . RemoveItem ( "blue_xtc2" , 1 ) then
AddItem ( two [ chance2 ], 1 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Stamped A Dual Blue Pill And Got ' .. two [ chance2 ] .. '!' , 'xtc' )
2024-05-02 18:34:49 -07:00
elseif Player.Functions . RemoveItem ( "blue_xtc3" , 1 ) then
AddItem ( three [ chance3 ], 1 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Stamped A Triple Blue Pill And Got ' .. three [ chance3 ] .. '!' , 'xtc' )
2024-05-02 18:34:49 -07:00
elseif Player.Functions . RemoveItem ( "blue_xtc4" , 1 ) then
AddItem ( four [ chance4 ], 1 )
2024-07-16 14:14:48 -07:00
Log ( Player.PlayerData . charinfo.firstname .. ' ' .. Player.PlayerData . charinfo.lastname .. ' Stamped A Quad Blue Pill And Got ' .. four [ chance4 ] .. '!' , 'xtc' )
2024-05-02 18:34:49 -07:00
else
Notifys ( 'You Dont Have Unstamped blue Pills' , 'error' )
end
end )