diff --git a/client/xtc.lua b/client/xtc.lua index b1f535e..dca6b7b 100644 --- a/client/xtc.lua +++ b/client/xtc.lua @@ -60,7 +60,7 @@ ps.registerCallback('md-drugs:client:setpress', function(xtcData) }, } ps.entityTarget(press, options) - return true + return coords end) for k, v in pairs(locations.mdp2p) do diff --git a/fxmanifest.lua b/fxmanifest.lua index 299fa07..a7f9bec 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.0' +version '4.0.1' client_scripts { 'client/functions.lua', 'client/plantSpawns.lua', diff --git a/items_install/images.zip b/items_install/images.zip new file mode 100644 index 0000000..5107b3f Binary files /dev/null and b/items_install/images.zip differ diff --git a/items_install/images/adderal.png b/items_install/images/adderal.png index 6f081f3..dad4403 100644 Binary files a/items_install/images/adderal.png and b/items_install/images/adderal.png differ diff --git a/items_install/images/bakingsoda.png b/items_install/images/bakingsoda.png index 5d9e428..d3c722c 100644 Binary files a/items_install/images/bakingsoda.png and b/items_install/images/bakingsoda.png differ diff --git a/items_install/images/butter.webp b/items_install/images/butter.webp deleted file mode 100644 index b777669..0000000 Binary files a/items_install/images/butter.webp and /dev/null differ diff --git a/items_install/images/chocolate.png b/items_install/images/chocolate.png index d1163f8..55ae788 100644 Binary files a/items_install/images/chocolate.png and b/items_install/images/chocolate.png differ diff --git a/items_install/images/ciggie.png b/items_install/images/ciggie.png index 6bb1901..b0f0eb5 100644 Binary files a/items_install/images/ciggie.png and b/items_install/images/ciggie.png differ diff --git a/items_install/images/coca_leaf.png b/items_install/images/coca_leaf.png index 3eefbf0..51b167f 100644 Binary files a/items_install/images/coca_leaf.png and b/items_install/images/coca_leaf.png differ diff --git a/items_install/images/cocaine_baggy.png b/items_install/images/cocaine_baggy.png index 529c2fb..7e78492 100644 Binary files a/items_install/images/cocaine_baggy.png and b/items_install/images/cocaine_baggy.png differ diff --git a/items_install/images/cocaine_baggystagethree.png b/items_install/images/cocaine_baggystagethree.png index 77c0c88..258e281 100644 Binary files a/items_install/images/cocaine_baggystagethree.png and b/items_install/images/cocaine_baggystagethree.png differ diff --git a/items_install/images/cocaine_baggystagetwo.png b/items_install/images/cocaine_baggystagetwo.png index fc6549b..995b31c 100644 Binary files a/items_install/images/cocaine_baggystagetwo.png and b/items_install/images/cocaine_baggystagetwo.png differ diff --git a/items_install/images/coke.png b/items_install/images/coke.png index cdd55e7..260da76 100644 Binary files a/items_install/images/coke.png and b/items_install/images/coke.png differ diff --git a/items_install/images/cokeburner.png b/items_install/images/cokeburner.png index f25f280..ca062bc 100644 Binary files a/items_install/images/cokeburner.png and b/items_install/images/cokeburner.png differ diff --git a/items_install/images/cokestagethree.png b/items_install/images/cokestagethree.png index 407deac..8df566b 100644 Binary files a/items_install/images/cokestagethree.png and b/items_install/images/cokestagethree.png differ diff --git a/items_install/images/cokestagetwo.png b/items_install/images/cokestagetwo.png index b2ab405..4c720bf 100644 Binary files a/items_install/images/cokestagetwo.png and b/items_install/images/cokestagetwo.png differ diff --git a/items_install/images/crackbag1.png b/items_install/images/crackbag1.png index 0aa8c2e..041a961 100644 Binary files a/items_install/images/crackbag1.png and b/items_install/images/crackbag1.png differ diff --git a/items_install/images/crackbag2.png b/items_install/images/crackbag2.png index c7c78fa..1ee6db8 100644 Binary files a/items_install/images/crackbag2.png and b/items_install/images/crackbag2.png differ diff --git a/items_install/images/crackbag3.png b/items_install/images/crackbag3.png index d70ca36..08af7f5 100644 Binary files a/items_install/images/crackbag3.png and b/items_install/images/crackbag3.png differ diff --git a/items_install/images/crackburner.png b/items_install/images/crackburner.png index 0205879..2435635 100644 Binary files a/items_install/images/crackburner.png and b/items_install/images/crackburner.png differ diff --git a/items_install/images/crackrock1.png b/items_install/images/crackrock1.png index b83a85d..57e2373 100644 Binary files a/items_install/images/crackrock1.png and b/items_install/images/crackrock1.png differ diff --git a/items_install/images/crackrock2.png b/items_install/images/crackrock2.png index 8ebf206..2d37206 100644 Binary files a/items_install/images/crackrock2.png and b/items_install/images/crackrock2.png differ diff --git a/items_install/images/crackrock3.png b/items_install/images/crackrock3.png index ce6dfa3..bfbc575 100644 Binary files a/items_install/images/crackrock3.png and b/items_install/images/crackrock3.png differ diff --git a/items_install/images/emptyvial.png b/items_install/images/emptyvial.png index c262bb3..19ab257 100644 Binary files a/items_install/images/emptyvial.png and b/items_install/images/emptyvial.png differ diff --git a/items_install/images/flour.png b/items_install/images/flour.png index f15ff1f..e0c43d6 100644 Binary files a/items_install/images/flour.png and b/items_install/images/flour.png differ diff --git a/items_install/images/heroin.png b/items_install/images/heroin.png index f5476e3..4b5c634 100644 Binary files a/items_install/images/heroin.png and b/items_install/images/heroin.png differ diff --git a/items_install/images/heroin_ready.png b/items_install/images/heroin_ready.png index d81ecc9..123d4a3 100644 Binary files a/items_install/images/heroin_ready.png and b/items_install/images/heroin_ready.png differ diff --git a/items_install/images/heroin_readystagethree.png b/items_install/images/heroin_readystagethree.png index 1428fbc..624fd29 100644 Binary files a/items_install/images/heroin_readystagethree.png and b/items_install/images/heroin_readystagethree.png differ diff --git a/items_install/images/heroin_readystagetwo.png b/items_install/images/heroin_readystagetwo.png index 2b01f31..cd1cfaf 100644 Binary files a/items_install/images/heroin_readystagetwo.png and b/items_install/images/heroin_readystagetwo.png differ diff --git a/items_install/images/heroinburner.png b/items_install/images/heroinburner.png index 0b5c842..59ba759 100644 Binary files a/items_install/images/heroinburner.png and b/items_install/images/heroinburner.png differ diff --git a/items_install/images/heroinpowder.png b/items_install/images/heroinpowder.png index 0176c28..26b5615 100644 Binary files a/items_install/images/heroinpowder.png and b/items_install/images/heroinpowder.png differ diff --git a/items_install/images/heroinpowderstagethree.png b/items_install/images/heroinpowderstagethree.png index d6e00f0..7e267d5 100644 Binary files a/items_install/images/heroinpowderstagethree.png and b/items_install/images/heroinpowderstagethree.png differ diff --git a/items_install/images/heroinpowderstagetwo.png b/items_install/images/heroinpowderstagetwo.png index 6e4b421..a907fa6 100644 Binary files a/items_install/images/heroinpowderstagetwo.png and b/items_install/images/heroinpowderstagetwo.png differ diff --git a/items_install/images/heroinstagethree.png b/items_install/images/heroinstagethree.png index 3e45c8e..ac2ce97 100644 Binary files a/items_install/images/heroinstagethree.png and b/items_install/images/heroinstagethree.png differ diff --git a/items_install/images/heroinstagetwo.png b/items_install/images/heroinstagetwo.png index bc1886d..88ef81c 100644 Binary files a/items_install/images/heroinstagetwo.png and b/items_install/images/heroinstagetwo.png differ diff --git a/items_install/images/loosecoke.png b/items_install/images/loosecoke.png index c426253..7240491 100644 Binary files a/items_install/images/loosecoke.png and b/items_install/images/loosecoke.png differ diff --git a/items_install/images/loosecokestagethree.png b/items_install/images/loosecokestagethree.png index 7264b81..ec18a8a 100644 Binary files a/items_install/images/loosecokestagethree.png and b/items_install/images/loosecokestagethree.png differ diff --git a/items_install/images/loosecokestagetwo.png b/items_install/images/loosecokestagetwo.png index f3ab739..c03aa49 100644 Binary files a/items_install/images/loosecokestagetwo.png and b/items_install/images/loosecokestagetwo.png differ diff --git a/items_install/images/lsdburner.png b/items_install/images/lsdburner.png index bddc337..9982ef0 100644 Binary files a/items_install/images/lsdburner.png and b/items_install/images/lsdburner.png differ diff --git a/items_install/images/morphine.png b/items_install/images/morphine.png index 261761f..069a54a 100644 Binary files a/items_install/images/morphine.png and b/items_install/images/morphine.png differ diff --git a/items_install/images/syringe.png b/items_install/images/syringe.png index 808e284..fc2ed3d 100644 Binary files a/items_install/images/syringe.png and b/items_install/images/syringe.png differ diff --git a/items_install/images/syringefull.png b/items_install/images/syringefull.png new file mode 100644 index 0000000..f4c0931 Binary files /dev/null and b/items_install/images/syringefull.png differ diff --git a/items_install/images/vicodin.png b/items_install/images/vicodin.png index 1353e11..4e6e656 100644 Binary files a/items_install/images/vicodin.png and b/items_install/images/vicodin.png differ diff --git a/items_install/images/xanax.png b/items_install/images/xanax.png index e4f689b..c8414e2 100644 Binary files a/items_install/images/xanax.png and b/items_install/images/xanax.png differ diff --git a/items_install/images/xtcburner.png b/items_install/images/xtcburner.png index b95f1df..59ba759 100644 Binary files a/items_install/images/xtcburner.png and b/items_install/images/xtcburner.png differ diff --git a/server/xtc.lua b/server/xtc.lua index dc1dd68..46edc15 100644 --- a/server/xtc.lua +++ b/server/xtc.lua @@ -17,7 +17,7 @@ local RecipeList = { blue_xtc2 = {amount = 1, take = {raw_xtc = 1, crackrock = 1},}, }, triplestack = { - white_xtc3 = {amount = 1, take = {raw_xtc = 1},}, + white_xtc3 = {amount = 1, take = {raw_xtc = 1},}, red_xtc3 = {amount = 1, take = {raw_xtc = 1, loosecoke = 1},}, orange_xtc3 = {amount = 1, take = {raw_xtc = 1, heroinvial = 1},}, blue_xtc3 = {amount = 1, take = {raw_xtc = 1, crackrock = 1},}, @@ -58,25 +58,6 @@ ps.registerCallback('md-drugs:server:GetXtcLocs', function(source) return xtcLocations end) -local function craft(source, tbl, item) - local src = source - local need, have = 0,0 - for k, v in pairs(tbl.take) do - if ps.hasItem(src, k, v) then - have = have + v - end - need = need + v - end - if need == have then - for k, v in pairs (tbl.take) do - ps.removeItem(src, k, v) - end - ps.addItem(src, item , tbl.amount) - return true - end - return false -end - local activePresses = {} RegisterServerEvent('md-drugs:server:stealisosafrole', function(num) @@ -109,8 +90,8 @@ local presses = { for k, v in pairs (presses) do ps.createUseable(v.item, function(source, item) local src = source - local check, loc = ps.callback('md-drugs:client:setpress', src, v) - if check then + local location = ps.callback('md-drugs:client:setpress', src, v) + if location then if ps.removeItem(src, v.item, 1) then activePresses[ps.getIdentifier(src)] = { press = v.data, @@ -118,7 +99,7 @@ ps.createUseable(v.item, function(source, item) owner = ps.getPlayerName(src), ownerid = ps.getIdentifier(src), src = src, - loc = loc + loc = location } end end @@ -142,7 +123,10 @@ RegisterServerEvent('md-drugs:server:makextc', function(data) end if timeOut(src, 'md-drugs:server:makextc') then return end if not ps.checkDistance(src, activePresses[ps.getIdentifier(src)].loc, 2.0) then return end - craft(src, RecipeList[activePresses[ps.getIdentifier(src)].press][data], data) + if not ps.craftItem(src, RecipeList[activePresses[ps.getIdentifier(src)].press][data]) then + verifyHas(src, RecipeList[activePresses[ps.getIdentifier(src)].press][data].take) + return + end end) RegisterServerEvent('md-drugs:server:buypress', function(loc, item) @@ -166,12 +150,16 @@ RegisterServerEvent('md-drugs:server:upgradepress', function(data) ps.notify(src, ps.lang('Catches.notIn'), "error") return end - craft(src, RecipeList.presses[data], data) + if not ps.craftItem(src, RecipeList.presses[data]) then + verifyHas(src, RecipeList.presses[data].take) + return + end end) ps.registerCallback('md-drugs:server:getpressrecipes', function(source) return RecipeList.presses end) + ------------- making powder RegisterServerEvent('md-drugs:server:makingrawxtc', function(num) local src = source @@ -180,7 +168,10 @@ RegisterServerEvent('md-drugs:server:makingrawxtc', function(num) return end if timeOut(src, 'md-drugs:server:makingrawxtc') then return end - if not ps.craftItem(src, RecipeList.raw.raw_xtc) then return end + if not ps.craftItem(src, RecipeList.raw.raw_xtc) then + verifyHas(src, RecipeList.raw.raw_xtc.take) + return + end end) local function getColor(color) diff --git a/version.txt b/version.txt index 99ad7de..1e95ee9 100644 --- a/version.txt +++ b/version.txt @@ -1,2 +1,12 @@ -Newest Build: 4.0.0 +Build: 4.0.0 - update to ps_lib + +Newest Build: 4.0.1 +- fix saving location of pill presses in xtc +- Adjust XTC item crafting +- HOW TO UPDATE BELOW +- bump version in fxmanifest from 4.0.0 to 4.0.1 +- redownload and add these files +- client/xtc.lua +- server/xtc.lua +- version.txt \ No newline at end of file