diff --git a/client/xtc.lua b/client/xtc.lua index a160464..ca23244 100644 --- a/client/xtc.lua +++ b/client/xtc.lua @@ -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 diff --git a/fxmanifest.lua b/fxmanifest.lua index d89d630..fb2c87c 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -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', diff --git a/server/xtc.lua b/server/xtc.lua index 9613e38..b8a85cc 100644 --- a/server/xtc.lua +++ b/server/xtc.lua @@ -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) diff --git a/version.txt b/version.txt index 6aafd28..0e72172 100644 --- a/version.txt +++ b/version.txt @@ -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 \ No newline at end of file