added troll feature
This commit is contained in:
1 parent
fb500dc502
commit
d46e28e8f2
9 files changed
+833
-802
No files matched your search
+61
-40
@@ -1,20 +1,26 @@
|
||||
local xtcpress = false
|
||||
local locations = ps.callback('md-drugs:server:GetXtcLocs')
|
||||
local locations = GlobalState.MDDrugsLocations.XTC
|
||||
|
||||
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, ', ')
|
||||
local function getRecipeList(tbl, type)
|
||||
local rec
|
||||
if type == 'presses' then
|
||||
rec = {'XTC FROM THE PREVIOUS TIER REQUIRED TO UPGRADE \n '}
|
||||
else
|
||||
rec = {'REQUIRED INGREDIENTS: \n '}
|
||||
end
|
||||
|
||||
for m, d in pairs(tbl) do table.insert(rec, Bridge.Inventory.GetItemInfo(m).label .. ' X ' .. d .. ' \n ') end
|
||||
return table.concat(rec, ' ')
|
||||
end
|
||||
|
||||
ps.registerCallback('md-drugs:client:setpress', function(xtcData)
|
||||
Bridge.Callback.Register('md-drugs:client:setpress', function(xtcData)
|
||||
if xtcpress then
|
||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('xtc.alreadyOut'), 'error')
|
||||
return
|
||||
end
|
||||
local coords, head = StartRay2()
|
||||
xtcpress = true
|
||||
if not ps.progressbar(Bridge.Language.Locale('xtc.settingDown'), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('xtc.settingDown'), 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)
|
||||
@@ -27,19 +33,24 @@ ps.registerCallback('md-drugs:client:setpress', function(xtcData)
|
||||
local options = {}
|
||||
for k, v in pairs(xtcData.recipes) do
|
||||
local descript = getRecipeList(v.take)
|
||||
local itemInfo = Bridge.Inventory.GetItemInfo(k)
|
||||
options[#options + 1] = {
|
||||
icon = ps.getImage(k),
|
||||
title = ps.getLabel(k),
|
||||
icon = itemInfo.image,
|
||||
title = Bridge.Language.Locale(k),
|
||||
description = descript,
|
||||
action = function()
|
||||
onSelect = function()
|
||||
if not minigame() then Bridge.Notify.SendNotify(Bridge.Language.Locale('xtc.fail'), "error") return end
|
||||
if not ps.progressbar(Bridge.Language.Locale('xtc.making', ps.getLabel(k)), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('xtc.making', Bridge.Language.Locale(k)), 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:makextc", k)
|
||||
end,
|
||||
distance = 2.0
|
||||
}
|
||||
end
|
||||
ps.menu('XTC Recipes', 'XTC Recipes', options)
|
||||
Bridge.Menu.Open({
|
||||
id = 'XTC Recipes',
|
||||
title = 'XTC Recipes',
|
||||
options = options
|
||||
})
|
||||
end,
|
||||
canInteract = function()
|
||||
if xtcpress then return true end
|
||||
@@ -49,7 +60,7 @@ ps.registerCallback('md-drugs:client:setpress', function(xtcData)
|
||||
icon = "fas fa-eye",
|
||||
label = Bridge.Language.Locale('xtc.targetPickup'),
|
||||
action = function()
|
||||
if not ps.progressbar(Bridge.Language.Locale('xtc.picking'), 5000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('xtc.picking'), 5000, 'uncuff') then return end
|
||||
DeleteObject(press)
|
||||
xtcpress = false
|
||||
TriggerServerEvent("md-drugs:server:getpressback")
|
||||
@@ -64,13 +75,13 @@ ps.registerCallback('md-drugs:client:setpress', function(xtcData)
|
||||
end)
|
||||
|
||||
for k, v in pairs(locations.mdp2p) do
|
||||
ps.boxTarget('mdp2p'..k, v.loc, {length = v.l, width = v.w, heading = v.rot}, {
|
||||
Bridge.Target.AddBoxZone('mdp2p'..k, v.loc, vector3(v.l, v.w, 2.0), v.rot or 180.0, {
|
||||
{
|
||||
icon = 'fa-solid fa-flask',
|
||||
label = Bridge.Language.Locale('xtc.targetStealMDP2P'),
|
||||
action = function()
|
||||
if not minigame() then Bridge.Notify.SendNotify(Bridge.Language.Locale('xtc.fail'), "error") return end
|
||||
if not ps.progressbar(Bridge.Language.Locale('xtc.stealingMDP2P'), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('xtc.stealingMDP2P'), 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:stealmdp2p", k)
|
||||
end,
|
||||
canInteract = function()
|
||||
@@ -80,13 +91,13 @@ for k, v in pairs(locations.mdp2p) do
|
||||
})
|
||||
end
|
||||
for k, v in pairs(locations.isosafrole) do
|
||||
ps.boxTarget('isosafrole'..k, v.loc, {length = v.l, width = v.w, heading = v.rot}, {
|
||||
Bridge.Target.AddBoxZone('isosafrole'..k, v.loc, vector3(v.l, v.w, 2.0), v.rot or 180.0, {
|
||||
{
|
||||
icon = 'fa-solid fa-flask',
|
||||
label = Bridge.Language.Locale('xtc.targetStealIsosafrole'),
|
||||
action = function()
|
||||
if not minigame() then Bridge.Notify.SendNotify(Bridge.Language.Locale('xtc.fail'), "error") return end
|
||||
if not ps.progressbar(Bridge.Language.Locale('xtc.stealingIsosafrole'), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('xtc.stealingIsosafrole'), 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:stealisosafrole", k)
|
||||
end,
|
||||
canInteract = function()
|
||||
@@ -97,13 +108,13 @@ for k, v in pairs(locations.isosafrole) do
|
||||
end
|
||||
|
||||
for k, v in pairs(locations.rawxtcloc) do
|
||||
ps.boxTarget('xtcraw'..k, v.loc, {length = v.l, width = v.w, heading = v.rot}, {
|
||||
Bridge.Target.AddBoxZone('xtcraw'..k, v.loc, vector3(v.l, v.w, 2.0), v.rot or 180.0, {
|
||||
{
|
||||
icon = 'fa-solid fa-flask',
|
||||
label = Bridge.Language.Locale('xtc.targetRaw'),
|
||||
action = function()
|
||||
if not minigame() then Bridge.Notify.SendNotify(Bridge.Language.Locale('xtc.fail'), "error") return end
|
||||
if not ps.progressbar(Bridge.Language.Locale('xtc.makingRaw'), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('xtc.makingRaw'), 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:makingrawxtc", k)
|
||||
end,
|
||||
canInteract = function()
|
||||
@@ -121,30 +132,32 @@ for k, v in pairs(locations.xtcpress) do
|
||||
{
|
||||
icon = 'fa-solid fa-flask',
|
||||
label = Bridge.Language.Locale('xtc.getPress'),
|
||||
action = function()
|
||||
onSelect = function()
|
||||
local options = {}
|
||||
local recipeList = ps.callback('md-drugs:server:getpressrecipes')
|
||||
local recipeList = GlobalState.MDDrugsRecipes.XTC.presses
|
||||
for m, d in pairs(recipeList) do
|
||||
if m == 'singlepress' then
|
||||
local itemInfo = Bridge.Inventory.GetItemInfo(m)
|
||||
options[#options + 1] = {
|
||||
icon = ps.getImage(m),
|
||||
title = ps.getLabel(m),
|
||||
icon = itemInfo.image,
|
||||
title = itemInfo.label,
|
||||
description = Bridge.Language.Locale('xtc.buySingle', d.cash),
|
||||
type = d.type,
|
||||
action = function()
|
||||
if not ps.progressbar(Bridge.Language.Locale('xtc.buyp'), 4000, 'uncuff') then return end
|
||||
onSelect = function()
|
||||
if not progressbar(Bridge.Language.Locale('xtc.buyp'), 4000, 'uncuff') then return end
|
||||
TriggerServerEvent('md-drugs:server:buypress',k, m)
|
||||
end,
|
||||
}
|
||||
else
|
||||
local descript = getRecipeList(d.take)
|
||||
local itemInfo = Bridge.Inventory.GetItemInfo(m)
|
||||
local descript = getRecipeList(d.take, 'presses')
|
||||
options[#options + 1] = {
|
||||
icon = ps.getImage(m),
|
||||
title = ps.getLabel(m),
|
||||
icon = itemInfo.image,
|
||||
title = itemInfo.label,
|
||||
description = descript,
|
||||
type = d.type,
|
||||
action = function()
|
||||
if not ps.progressbar(Bridge.Language.Locale('xtc.buyp'), 4000, 'uncuff') then return end
|
||||
onSelect = function()
|
||||
if not progressbar(Bridge.Language.Locale('xtc.buyp'), 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:upgradepress", k, m)
|
||||
end,
|
||||
distance = 2.0
|
||||
@@ -152,7 +165,11 @@ for k, v in pairs(locations.xtcpress) do
|
||||
end
|
||||
end
|
||||
table.sort(options, function(a, b) return a.type < b.type end)
|
||||
ps.menu('XTC Presses', 'XTC Presses', options)
|
||||
Bridge.Menu.Open({
|
||||
id = 'XTC Presses',
|
||||
title = 'XTC Presses',
|
||||
options = options
|
||||
})
|
||||
end,
|
||||
canInteract = function() return handleGang(v.gang) end
|
||||
}
|
||||
@@ -160,32 +177,36 @@ for k, v in pairs(locations.xtcpress) do
|
||||
end
|
||||
|
||||
for k, v in pairs (locations.stamp) do
|
||||
ps.boxTarget('xtcstamp'..k, v.loc, {length = v.l, width = v.w, heading = v.rot}, {
|
||||
Bridge.Target.AddBoxZone('xtcstamp'..k, v.loc, vector3(v.l, v.w, 2.0), v.rot or 180.0, {
|
||||
{
|
||||
icon = 'fa-solid fa-flask',
|
||||
label = Bridge.Language.Locale('xtc.targetStamp'),
|
||||
action = function()
|
||||
onSelect = 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'},
|
||||
{item = 'white_xtc', label = Bridge.Inventory.GetItemInfo('white_xtc').label, color = 'white'},
|
||||
{item = 'red_xtc', label = Bridge.Inventory.GetItemInfo('red_xtc').label, color = 'red'},
|
||||
{item = 'orange_xtc', label = Bridge.Inventory.GetItemInfo('orange_xtc').label, color = 'orange'},
|
||||
{item = 'blue_xtc', label = Bridge.Inventory.GetItemInfo('blue_xtc').label, color = 'blue'},
|
||||
}
|
||||
local options = {}
|
||||
for m, d in pairs (item) do
|
||||
options[#options + 1] = {
|
||||
icon = ps.getImage(d.item),
|
||||
icon = Bridge.Inventory.GetItemInfo(d.item).image,
|
||||
title = d.label,
|
||||
description = Bridge.Language.Locale('xtc.stamp_desc', d.color),
|
||||
action = function()
|
||||
if not minigame() then Bridge.Notify.SendNotify(Bridge.Language.Locale('xtc.fail'), "error") return end
|
||||
if not ps.progressbar(Bridge.Language.Locale('xtc.stamping', d.label), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('xtc.stamping', 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)
|
||||
Bridge.Menu.Open({
|
||||
id = 'XTC Stamp',
|
||||
title = 'XTC Stamp',
|
||||
options = options
|
||||
})
|
||||
end,
|
||||
canInteract = function() return handleGang(v.gang) end
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user