- fix xtc not allowing to upgrade
This commit is contained in:
1 parent
a02e333688
commit
0ed22eb62b
4 files changed
+13
-8
No files matched your search
@@ -130,6 +130,7 @@ for k, v in pairs(locations.xtcpress) do
|
|||||||
icon = ps.getImage(m),
|
icon = ps.getImage(m),
|
||||||
title = ps.getLabel(m),
|
title = ps.getLabel(m),
|
||||||
description = ps.lang('xtc.buySingle', d.cash),
|
description = ps.lang('xtc.buySingle', d.cash),
|
||||||
|
type = d.type,
|
||||||
action = function()
|
action = function()
|
||||||
if not ps.progressbar(ps.lang('xtc.buyp'), 4000, 'uncuff') then return end
|
if not ps.progressbar(ps.lang('xtc.buyp'), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent('md-drugs:server:buypress',k, m)
|
TriggerServerEvent('md-drugs:server:buypress',k, m)
|
||||||
@@ -141,6 +142,7 @@ for k, v in pairs(locations.xtcpress) do
|
|||||||
icon = ps.getImage(m),
|
icon = ps.getImage(m),
|
||||||
title = ps.getLabel(m),
|
title = ps.getLabel(m),
|
||||||
description = descript,
|
description = descript,
|
||||||
|
type = d.type,
|
||||||
action = function()
|
action = function()
|
||||||
if not ps.progressbar(ps.lang('xtc.buyp'), 4000, 'uncuff') then return end
|
if not ps.progressbar(ps.lang('xtc.buyp'), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:upgradepress", k, m)
|
TriggerServerEvent("md-drugs:server:upgradepress", k, m)
|
||||||
@@ -149,6 +151,7 @@ for k, v in pairs(locations.xtcpress) do
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
table.sort(options, function(a, b) return a.type < b.type end)
|
||||||
ps.menu('XTC Presses', 'XTC Presses', options)
|
ps.menu('XTC Presses', 'XTC Presses', options)
|
||||||
end,
|
end,
|
||||||
canInteract = function() return handleGang(v.gang) end
|
canInteract = function() return handleGang(v.gang) end
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@ author "mustache_dom"
|
|||||||
description "drugs by mustache dom"
|
description "drugs by mustache dom"
|
||||||
fx_version "cerulean"
|
fx_version "cerulean"
|
||||||
game "gta5"
|
game "gta5"
|
||||||
version '4.0.7'
|
version '4.0.8'
|
||||||
client_scripts {
|
client_scripts {
|
||||||
'client/functions.lua',
|
'client/functions.lua',
|
||||||
'client/plantSpawns.lua',
|
'client/plantSpawns.lua',
|
||||||
|
|||||||
+7
-7
@@ -29,10 +29,10 @@ local RecipeList = {
|
|||||||
blue_xtc4 = {give = {blue_xtc4 = 1}, take = {raw_xtc = 1, crackrock = 1},},
|
blue_xtc4 = {give = {blue_xtc4 = 1}, take = {raw_xtc = 1, crackrock = 1},},
|
||||||
},
|
},
|
||||||
presses = {
|
presses = {
|
||||||
singlepress = {cash = 10000},
|
singlepress = {type = 1,cash = 10000},
|
||||||
dualpress = {give = {dualpress = 1}, take = {white_xtc = 20, blue_xtc = 20, red_xtc = 20, orange_xtc = 20, singlepress = 1}},
|
dualpress = {type = 2,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}},
|
triplepress = {type = 3,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}},
|
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
|
||||||
end)
|
end)
|
||||||
|
|
||||||
RegisterServerEvent('md-drugs:server:upgradepress', function(data)
|
RegisterServerEvent('md-drugs:server:upgradepress', function(data, item)
|
||||||
local src = source
|
local src = source
|
||||||
if timeOut(src, 'md-drugs:server:upgradepress') then return end
|
if timeOut(src, 'md-drugs:server:upgradepress') then return end
|
||||||
if not ps.checkDistance(src, xtcLocations.xtcpress[data].loc, 2.0) then
|
if not ps.checkDistance(src, xtcLocations.xtcpress[data].loc, 2.0) then
|
||||||
ps.notify(src, ps.lang('Catches.notIn'), "error")
|
ps.notify(src, ps.lang('Catches.notIn'), "error")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if not ps.craftItem(src, RecipeList.presses[data]) then
|
if not ps.craftItem(src, RecipeList.presses[item]) then
|
||||||
verifyHas(src, RecipeList.presses[data].take)
|
verifyHas(src, RecipeList.presses[item].take)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|||||||
@@ -77,3 +77,5 @@ Newest Build: 4.0.7
|
|||||||
|
|
||||||
- if you are seeing this, you most likely already have ps_lib working properly
|
- 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
|
||||||
Reference in new issue
Block a user