- fix xtc not allowing to upgrade

This commit is contained in:
Mustache Dom committed 2026-01-07 02:12:06 -07:00
1 parent a02e333688
commit 0ed22eb62b
4 files changed
+13 -8

No files matched your search

+3
View File
@@ -130,6 +130,7 @@ for k, v in pairs(locations.xtcpress) do
icon = ps.getImage(m),
title = ps.getLabel(m),
description = ps.lang('xtc.buySingle', d.cash),
type = d.type,
action = function()
if not ps.progressbar(ps.lang('xtc.buyp'), 4000, 'uncuff') then return end
TriggerServerEvent('md-drugs:server:buypress',k, m)
@@ -141,6 +142,7 @@ for k, v in pairs(locations.xtcpress) do
icon = ps.getImage(m),
title = ps.getLabel(m),
description = descript,
type = d.type,
action = function()
if not ps.progressbar(ps.lang('xtc.buyp'), 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:upgradepress", k, m)
@@ -149,6 +151,7 @@ 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)
end,
canInteract = function() return handleGang(v.gang) end
+1 -1
View File
@@ -3,7 +3,7 @@ author "mustache_dom"
description "drugs by mustache dom"
fx_version "cerulean"
game "gta5"
version '4.0.7'
version '4.0.8'
client_scripts {
'client/functions.lua',
'client/plantSpawns.lua',
+7 -7
View File
@@ -29,10 +29,10 @@ local RecipeList = {
blue_xtc4 = {give = {blue_xtc4 = 1}, take = {raw_xtc = 1, crackrock = 1},},
},
presses = {
singlepress = {cash = 10000},
dualpress = {give = {dualpress = 1}, take = {white_xtc = 20, blue_xtc = 20, red_xtc = 20, orange_xtc = 20, singlepress = 1}},
triplepress = {give = {triplepress = 1}, take = {white_xtc2 = 50, blue_xtc2 = 50, red_xtc2 = 50, orange_xtc2 = 50, dualpress = 1}},
quadpress = {give = {quadpress = 1}, take = {white_xtc3 = 50, blue_xtc3 = 50, red_xtc3 = 50, orange_xtc3 = 50, triplepress = 1}},
singlepress = {type = 1,cash = 10000},
dualpress = {type = 2,give = {dualpress = 1}, take = {white_xtc = 20, blue_xtc = 20, red_xtc = 20, orange_xtc = 20, singlepress = 1}},
triplepress = {type = 3,give = {triplepress = 1}, take = {white_xtc2 = 50, blue_xtc2 = 50, red_xtc2 = 50, orange_xtc2 = 50, dualpress = 1}},
quadpress = {type = 4,give = {quadpress = 1}, take = {white_xtc3 = 50, blue_xtc3 = 50, red_xtc3 = 50, orange_xtc3 = 50, triplepress = 1}},
}
}
@@ -143,15 +143,15 @@ RegisterServerEvent('md-drugs:server:buypress', function(loc, item)
end
end)
RegisterServerEvent('md-drugs:server:upgradepress', function(data)
RegisterServerEvent('md-drugs:server:upgradepress', function(data, item)
local src = source
if timeOut(src, 'md-drugs:server:upgradepress') then return end
if not ps.checkDistance(src, xtcLocations.xtcpress[data].loc, 2.0) then
ps.notify(src, ps.lang('Catches.notIn'), "error")
return
end
if not ps.craftItem(src, RecipeList.presses[data]) then
verifyHas(src, RecipeList.presses[data].take)
if not ps.craftItem(src, RecipeList.presses[item]) then
verifyHas(src, RecipeList.presses[item].take)
return
end
end)
+2
View File
@@ -77,3 +77,5 @@ Newest Build: 4.0.7
- if you are seeing this, you most likely already have ps_lib working properly
Newest Build: 4.0.8
- fix: xtc not allowing you to upgrade a press