jesussssss
This commit is contained in:
1 parent
daa1a4f8a3
commit
3574ecef5b
32 files changed
+1639
-914
No files matched your search
+168
-145
@@ -1,157 +1,180 @@
|
||||
local xtcpress = false
|
||||
local locations = ps.callback('md-drugs:server:GetXtcLocs')
|
||||
|
||||
RegisterNetEvent("md-drugs:client:setpress", function(type)
|
||||
if xtcpress then
|
||||
local function getRecipeList(tbl)
|
||||
local rec = {}
|
||||
for m, d in pairs(tbl) do table.insert(rec, ps.getLabel(m) .. ' X ' .. d) end
|
||||
return table.concat(rec, ', ')
|
||||
end
|
||||
|
||||
ps.registerCallback('md-drugs:client:setpress', function(xtcData)
|
||||
if xtcpress then
|
||||
ps.notify(Lang.xtc.out, 'error')
|
||||
else
|
||||
local coords, head = StartRay2()
|
||||
xtcpress = true
|
||||
ps.progressbar('Setting Press On The Ground', 4000, 'uncuff')
|
||||
local press = CreateObject("bkr_prop_coke_press_01aa", coords.x, coords.y, coords.z, true, false, false)
|
||||
PlaceObjectOnGroundProperly(press)
|
||||
Freeze(press, true, head)
|
||||
local options = {
|
||||
{ icon = "fas fa-eye", label = Lang.targets.xtc.make, distance = 2.0, action = function() TriggerEvent("md-drugs:client:XTCMenu", type) end,
|
||||
canInteract = function() if xtcpress then return true end end
|
||||
},
|
||||
{icon = "fas fa-eye", label = Lang.targets.xtc.pick, action = function() TriggerEvent("md-drugs:client:GetPressBack", type, press) end, distance = 2.0,
|
||||
canInteract = function() if xtcpress then return true end end
|
||||
},
|
||||
}
|
||||
AddMultiModel(press, options, nil)
|
||||
return
|
||||
end
|
||||
end)
|
||||
|
||||
ps.registerCallback('md-drugs:client:setpress', function(type)
|
||||
if xtcpress then
|
||||
ps.notify(Lang.xtc.out, 'error')
|
||||
return false
|
||||
else
|
||||
local coords, head = StartRay2()
|
||||
xtcpress = true
|
||||
ps.progressbar('Setting Press On The Ground', 4000, 'uncuff')
|
||||
local press = CreateObject("bkr_prop_coke_press_01aa", coords.x, coords.y, coords.z, true, false, false)
|
||||
PlaceObjectOnGroundProperly(press)
|
||||
if not ps.progressbar('Setting Press On The Ground', 4000, 'uncuff') then return end
|
||||
local press = CreateObject("bkr_prop_coke_press_01aa", coords.x, coords.y, coords.z, true, false, false)
|
||||
PlaceObjectOnGroundProperly(press)
|
||||
Freeze(press, true, head)
|
||||
local options = {
|
||||
{ icon = "fa-solid fa-tablets", label = Lang.targets.xtc.make, distance = 2.0, action = function() TriggerEvent("md-drugs:client:XTCMenu", type) end,
|
||||
canInteract = function() if xtcpress then return true end end
|
||||
},
|
||||
{icon = "fas fa-eye", label = Lang.targets.xtc.pick, action = function() TriggerEvent("md-drugs:client:GetPressBack", type, press) end, distance = 2.0,
|
||||
canInteract = function() if xtcpress then return true end end
|
||||
},
|
||||
}
|
||||
AddMultiModel(press, options, nil)
|
||||
return true, GetEntityCoords(press)
|
||||
end
|
||||
local options = {
|
||||
{
|
||||
icon = "fas fa-eye",
|
||||
label = ps.lang('targets.xtc.make'),
|
||||
distance = 2.0,
|
||||
action = function()
|
||||
local options = {}
|
||||
for k, v in pairs(xtcData.recipes) do
|
||||
local descript = getRecipeList(v.take)
|
||||
options[#options + 1] = {
|
||||
icon = ps.getImage(k),
|
||||
title = ps.getLabel(k),
|
||||
description = descript,
|
||||
action = function()
|
||||
if not minigame() then ps.notify(ps.lang('xtc.fail'), "error") return end
|
||||
if not ps.progressbar(string.format(ps.lang('xtc.make'), ps.getLabel(k)), 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:makextc", k)
|
||||
end,
|
||||
distance = 2.0
|
||||
}
|
||||
end
|
||||
ps.menu('XTC Recipes', 'XTC Recipes', options)
|
||||
end,
|
||||
canInteract = function()
|
||||
if xtcpress then return true end
|
||||
end
|
||||
},
|
||||
{
|
||||
icon = "fas fa-eye",
|
||||
label = ps.lang('targets.xtc.pick'),
|
||||
action = function()
|
||||
if not ps.progressbar(ps.lang('xtc.pickup'), 5000, 'uncuff') then return end
|
||||
DeleteObject(press)
|
||||
xtcpress = false
|
||||
TriggerServerEvent("md-drugs:server:getpressback")
|
||||
end,
|
||||
canInteract = function()
|
||||
if xtcpress then return true end
|
||||
end
|
||||
},
|
||||
}
|
||||
ps.entityTarget(press, options)
|
||||
return true
|
||||
end)
|
||||
|
||||
RegisterNetEvent("md-drugs:client:XTCMenu", function(type)
|
||||
local event = "md-drugs:client:MakeXTC"
|
||||
lib.registerContext({
|
||||
id = 'XTCmenu',
|
||||
title = 'XTC Menu',
|
||||
options = {
|
||||
{icon = GetImage('white_xtc'), title = 'White XTC', description = '1 X Raw XTC', event = event, args = { data = type, color = 'white'}},
|
||||
{icon = GetImage('red_xtc'), title = 'Red XTC', description = '1 X Raw XTC and 1 X Loose Coke', event = event, args = { data = type, color = 'red'}},
|
||||
{icon = GetImage('orange_xtc'), title = 'Orange XTC', description = '1 X Raw XTC and 1 X Heroin Vial', event = event, args = { data = type, color = 'orange'}},
|
||||
{icon = GetImage('blue_xtc'), title = 'Blue XTC', description = '1 X Raw XTC and 1 X Crack Rock', event = event, args = { data = type, color = 'blue'}},
|
||||
for k, v in pairs(locations.mdp2p) do
|
||||
ps.boxTarget('mdp2p'..k, v.loc, {length = v.l, width = v.w, heading = v.rot}, {
|
||||
{
|
||||
icon = 'fa-solid fa-flask',
|
||||
label = ps.lang('targets.xtc.mdp2p'),
|
||||
action = function()
|
||||
if not minigame() then ps.notify(ps.lang('xtc.fail'), "error") return end
|
||||
if not ps.progressbar(ps.lang('xtc.mdp2p'), 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:stealmdp2p", k)
|
||||
end
|
||||
}
|
||||
})
|
||||
lib.showContext('XTCmenu')
|
||||
end)
|
||||
|
||||
RegisterNetEvent("md-drugs:client:GetPressBack", function(type, press)
|
||||
if not ps.progressbar(Lang.xtc.pickup, 5000, 'uncuff') then return end
|
||||
DeleteObject(press)
|
||||
xtcpress = false
|
||||
TriggerServerEvent("md-drugs:server:getpressback", type)
|
||||
end)
|
||||
|
||||
RegisterNetEvent("md-drugs:client:stealisosafrole", function(data)
|
||||
if not minigame() then ps.notify(Lang.xtc.fail, "error") return end
|
||||
if not ps.progressbar(Lang.xtc.iso, 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:stealisosafrole",data.data)
|
||||
end)
|
||||
|
||||
RegisterNetEvent("md-drugs:client:stealmdp2p", function(data)
|
||||
if not minigame() then ps.notify(Lang.xtc.fail, "error") return end
|
||||
if not ps.progressbar(Lang.xtc.mdp2p, 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:stealmdp2p", data.data)
|
||||
end)
|
||||
|
||||
RegisterNetEvent("md-drugs:client:makingrawxtc", function(data)
|
||||
if not ItemCheck('isosafrole') then return end
|
||||
if not ItemCheck('mdp2p') then return end
|
||||
if not ps.progressbar(Lang.xtc.raw, 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:makingrawxtc",data.data)
|
||||
end)
|
||||
|
||||
RegisterNetEvent("md-drugs:client:MakeXTC", function(data)
|
||||
if not ItemCheck('raw_xtc') then return end
|
||||
if not ps.progressbar(Lang.xtc.pressing, 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:makextc",data)
|
||||
end)
|
||||
|
||||
RegisterNetEvent("md-drugs:client:stampwhite", function(data)
|
||||
lib.registerContext({ id = 'stampxtc', title = 'Stamp XTC Menu',
|
||||
options = {
|
||||
{ icon = GetImage('white_xtc'), title = 'White XTC',
|
||||
onSelect = function()
|
||||
if not minigame() then ps.notify(Lang.xtc.fail, "error") return end
|
||||
if not ps.progressbar(string.format(Lang.xtc.stamp, 'White'), 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:stampwhite",data.data)
|
||||
end
|
||||
},
|
||||
{ icon = GetImage('red_xtc'), title = 'Red XTC',
|
||||
onSelect = function()
|
||||
if not minigame() then ps.notify(Lang.xtc.fail, "error") return end
|
||||
if not ps.progressbar(string.format(Lang.xtc.stamp, 'Red'), 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:stampred", data.data)
|
||||
end
|
||||
},
|
||||
{ icon = GetImage('orange_xtc'), title = 'Orange XTC',
|
||||
onSelect = function()
|
||||
if not minigame() then ps.notify(Lang.xtc.fail, "error") return end
|
||||
if not ps.progressbar(string.format(Lang.xtc.stamp, 'Orange'), 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:stamporange", data.data)
|
||||
end,
|
||||
},
|
||||
{ icon = GetImage('blue_xtc'), title = 'Blue XTC',
|
||||
onSelect = function()
|
||||
if not minigame() then ps.notify(Lang.xtc.fail, "error") return end
|
||||
if not ps.progressbar(string.format(Lang.xtc.stamp, 'Blue'), 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:stampblue", data.data)
|
||||
end
|
||||
},
|
||||
}
|
||||
})
|
||||
lib.showContext('stampxtc')
|
||||
end)
|
||||
|
||||
RegisterNetEvent("md-drugs:client:getsinglepress", function()
|
||||
if not ps.progressbar(Lang.xtc.buyp, 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:buypress")
|
||||
end)
|
||||
|
||||
|
||||
RegisterNetEvent("md-drugs:client:exchangepresses", function(data)
|
||||
if not ps.progressbar(Lang.xtc.buyp, 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:upgradepress", data.data)
|
||||
end)
|
||||
|
||||
RegisterNetEvent("md-drugs:client:buypress", function()
|
||||
local img = GetImage('singlepress')
|
||||
lib.registerContext({
|
||||
id = 'buypresses',
|
||||
title = 'Purchase Presses',
|
||||
options = {
|
||||
{title = Lang.xtc.press.title.single, description = Lang.xtc.press.des.single, icon = img, event = 'md-drugs:client:getsinglepress'},
|
||||
{title = Lang.xtc.press.title.dual, description = Lang.xtc.press.des.dual, icon = img, event = 'md-drugs:client:exchangepresses', args = {data = 'dual'}},
|
||||
{title = Lang.xtc.press.title.triple, description = Lang.xtc.press.des.triple, icon = img, event = 'md-drugs:client:exchangepresses', args = {data = 'triple'}},
|
||||
{title = Lang.xtc.press.title.quad, description = Lang.xtc.press.des.quad, icon = img, event = 'md-drugs:client:exchangepresses', args = {data = 'quad'}}
|
||||
}
|
||||
})
|
||||
lib.showContext('buypresses')
|
||||
end)
|
||||
end
|
||||
for k, v in pairs(locations.isosafrole) do
|
||||
ps.boxTarget('isosafrole'..k, v.loc, {length = v.l, width = v.w, heading = v.rot}, {
|
||||
{
|
||||
icon = 'fa-solid fa-flask',
|
||||
label = ps.lang('targets.xtc.isosafrole'),
|
||||
action = function()
|
||||
if not minigame() then ps.notify(ps.lang('xtc.fail'), "error") return end
|
||||
if not ps.progressbar(ps.lang('xtc.isosafrole'), 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:stealisosafrole", k)
|
||||
end
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
for k, v in pairs(locations.rawxtcloc) do
|
||||
ps.boxTarget('xtc'..k, v.loc, {length = v.l, width = v.w, heading = v.rot}, {
|
||||
{
|
||||
icon = 'fa-solid fa-flask',
|
||||
label = ps.lang('targets.xtc.raw'),
|
||||
action = function()
|
||||
if not minigame() then ps.notify(ps.lang('xtc.fail'), "error") return end
|
||||
if not ps.progressbar(ps.lang('xtc.raw'), 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:makingrawxtc", k)
|
||||
end
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
for k, v in pairs(locations.xtcpress) do
|
||||
ps.requestModel(v.ped)
|
||||
local ped = CreatePed(0, v.ped, v.loc, false, false)
|
||||
Freeze(ped, true, v.loc.w)
|
||||
ps.entityTarget(ped, {
|
||||
{
|
||||
icon = 'fa-solid fa-flask',
|
||||
label = ps.lang('targets.xtc.press'),
|
||||
action = function()
|
||||
local options = {}
|
||||
local recipeList = ps.callback('md-drugs:server:getpressrecipes')
|
||||
for m, d in pairs(recipeList) do
|
||||
if m == 'singlepress' then
|
||||
options[#options + 1] = {
|
||||
icon = ps.getImage(m),
|
||||
title = ps.getLabel(m),
|
||||
description = ps.lang('xtc.press.buysingle', d.cash),
|
||||
action = function()
|
||||
if not ps.progressbar(ps.lang('xtc.buyp'), 4000, 'uncuff') then return end
|
||||
TriggerServerEvent('md-drugs:server:buypress', m)
|
||||
end,
|
||||
}
|
||||
else
|
||||
ps.debug(d.take)
|
||||
local descript = getRecipeList(d.take)
|
||||
options[#options + 1] = {
|
||||
icon = ps.getImage(m),
|
||||
title = ps.getLabel(m),
|
||||
description = descript,
|
||||
action = function()
|
||||
if not ps.progressbar(ps.lang('xtc.buyp'), 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:upgradepress", k, m)
|
||||
end,
|
||||
distance = 2.0
|
||||
}
|
||||
end
|
||||
end
|
||||
ps.menu('XTC Presses', 'XTC Presses', options)
|
||||
end
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
for k, v in pairs (locations.stamp) do
|
||||
ps.boxTarget('xtc'..k, v.loc, {length = v.l, width = v.w, heading = v.rot}, {
|
||||
{
|
||||
icon = 'fa-solid fa-flask',
|
||||
label = ps.lang('targets.xtc.' .. k),
|
||||
action = function()
|
||||
local item = {
|
||||
{item = 'white_xtc', label = ps.getLabel('white_xtc'), color = 'white'},
|
||||
{item = 'red_xtc', label = ps.getLabel('red_xtc'), color = 'red'},
|
||||
{item = 'orange_xtc', label = ps.getLabel('orange_xtc'), color = 'orange'},
|
||||
{item = 'blue_xtc', label = ps.getLabel('blue_xtc'), color = 'blue'},
|
||||
}
|
||||
local options = {}
|
||||
for m, d in pairs (item) do
|
||||
options[#options + 1] = {
|
||||
icon = ps.getImage(d.item),
|
||||
title = d.label,
|
||||
description = ps.lang('xtc.stamp_desc', d.color),
|
||||
action = function()
|
||||
if not minigame() then ps.notify(ps.lang('xtc.fail'), "error") return end
|
||||
if not ps.progressbar(string.format(ps.lang('xtc.stamp'), d.label), 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:stamp", k, d.color)
|
||||
end,
|
||||
distance = 2.0
|
||||
}
|
||||
end
|
||||
ps.menu('Stamp Pills', 'Stamp Pills', options)
|
||||
end
|
||||
}
|
||||
})
|
||||
end
|
||||
Reference in new issue
Block a user