diff --git a/client/cornerselling.lua b/client/cornerselling.lua index 1a4f44a..2aed95b 100644 --- a/client/cornerselling.lua +++ b/client/cornerselling.lua @@ -208,7 +208,7 @@ RegisterNetEvent('md-drugs:client:cornerselling', function() end) CreateThread(function() - for k, v in pairs (QBConfig.NoSellZones) do + for k, v in pairs (GlobalState.MDDrugsLocations.CornerSelling.noSellZones) do Bridge.Point.Register( 'MDDRUGNOSELLZONE'..k, v.loc, diff --git a/mddrugs.sql b/mddrugs.sql index abc220f..05fc665 100644 --- a/mddrugs.sql +++ b/mddrugs.sql @@ -1,3 +1,12 @@ +CREATE TABLE IF NOT EXISTS `dealers` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL DEFAULT '0', + `coords` longtext DEFAULT NULL, + `time` longtext DEFAULT NULL, + `createdby` varchar(50) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + CREATE TABLE IF NOT EXISTS `deliveriesdealer` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -8,7 +17,7 @@ CREATE TABLE IF NOT EXISTS `deliveriesdealer` ( `maxtime` varchar(50) NOT NULL, `location` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; CREATE TABLE IF NOT EXISTS `drugrep` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -16,4 +25,4 @@ CREATE TABLE IF NOT EXISTS `drugrep` ( `drugrep` varchar(255) DEFAULT NULL, `name` varchar(50) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; diff --git a/readme.md b/readme.md index a0aca62..59aa73c 100644 --- a/readme.md +++ b/readme.md @@ -31,13 +31,12 @@ A fully customizable, immersive drug system for FiveM servers. | Dependency | Link | |----------|------| -| `ps_lib` | [GitHub - Project-Sloth/ps_lib](https://github.com/Project-Sloth/ps_lib) | +| `Community_bridge` | [GitHub - Community Bridge Repo](https://github.com/TheOrderFivem/community_bridge) | | `Read` | [Read Docs](https://letters.hookedonphonics.com/us/read-guaranteed-G14.html) | | Game Build | **2944 or later** required | -> ⚠️ Ensure all dependencies are installed and up to date before proceeding. +> ⚠️ Ensure all dependencies are installed, started before md-drugs and up to date. ---- ## 🛠️ Installation @@ -51,7 +50,6 @@ A fully customizable, immersive drug system for FiveM servers. 1. Copy items from `md-drugs/items_install/ox_inventory` into `ox_inventory/data/items.lua`. 2. Add item images to `ox_inventory/web/images`. ---- ### Step 2: Configure Drug Locations & Recipes @@ -64,85 +62,7 @@ A fully customizable, immersive drug system for FiveM servers. > ✏️ Modify these files to customize spawn points, yields, and processing times. ---- -### STEP 3 - - Head to your emote script search for **uncuff** if it's missing add it - - if rpemotes do this - - go to client/animationListCustom.lua - - add these to the CustomDP.Emotes = {} - ```lua - ["uncuff"] = {"mp_arresting","a_uncuff","Uncuff", AnimationOptions = { EmoteLoop = true, EmoteMoving = true } }, - ["edible"] = { "mp_player_inteat@burger", "mp_player_int_eat_burger", "edible", AnimationOptions = { EmoteLoop = false, EmoteMoving = true }}, - ``` - - Add This to CustomDP.PropEmotes = {} - ```lua - ["shootup"] = { "rcmpaparazzo1ig_4", "miranda_shooting_up", "Shoot Up", AnimationOptions = {EmoteLoop = true,EmoteMoving = true,Prop = 'prop_syringe_01', PansexualPropBone = 18905,PropPlacement = {0.11, 0.03, 0.0, -124.0, 0.0, 0.0},}} - ``` - - elseif dpemotes add this to client/AnimationList.lua - - add these to DP.Emotes = {} - ```lua - ["uncuff"] = {"mp_arresting","a_uncuff","Uncuff", AnimationOptions = { EmoteLoop = true, EmoteMoving = true } }, - ["edible"] = { "mp_player_inteat@burger", "mp_player_int_eat_burger", "edible", AnimationOptions = { EmoteLoop = false, EmoteMoving = true }}, - ``` - - add these to DP.PropEmotes = {} - ```lua - ["shootup"] = { "rcmpaparazzo1ig_4", "miranda_shooting_up", "Shoot Up", AnimationOptions = {EmoteLoop = true,EmoteMoving = true,Prop = 'prop_syringe_01', PansexualPropBone = 18905,PropPlacement = {0.11, 0.03, 0.0, -124.0, 0.0, 0.0},}} - ``` - - elseif scullyemotes then - - add this to emotes.lua - ```lua - { - Label = 'Uncuff', - Command = 'uncuff', - Animation = 'a_uncuff', - Dictionary = 'mp_arresting', - Options = { - Flags = { - Loop = true, - Move = true, - }, - } - }, - { - Label = 'Edibles', - Command = 'edible', - Animation = 'mp_player_int_eat_burger', - Dictionary = 'mp_player_inteat@burger', - Options = { - Flags = { - Loop = true, - Move = true, - }, - } - }, - ``` - - then in prop emotes do - ```lua - { - Label = 'Shoot Up', - Command = 'shootup', - Animation = "miranda_shooting_up", - Dictionary = "rcmpaparazzo1ig_4", - Options = { - Flags = { - Loop = true, - }, - Props = { - { - Bone = 18905, - Name = 'prop_syringe_01', - Placement = { - vector3(0.11, 0.03, 0.0), - vector3( -124.0, 0.0, 0.0), - }, - }, - }, - }, - }, - ``` - - -### STEP 4 (IF QBCore) +### STEP 3 (IF QBCore) - check `qb-smallresources/config.lua` and if this exists, delete it - look for this code ```lua @@ -160,10 +80,10 @@ A fully customizable, immersive drug system for FiveM servers. } ``` -### STEP 5 +### STEP 4 - Run SQL - if you dont know how, click this image below - [![YouTube Video](https://img.youtube.com/vi/8QpFOluK_xo/hqdefault.jpg)](https://www.youtube.com/watch?v=8QpFOluK_xo) -### STEP 6 +### STEP 5 - If you want whippits, take the folder `ate_balloon` and place that folder into the standalone folder like it was another script :) (or a [props] if you got it) \ No newline at end of file diff --git a/server/cornerselling.lua b/server/cornerselling.lua index 3f01bd1..41eca0f 100644 --- a/server/cornerselling.lua +++ b/server/cornerselling.lua @@ -127,7 +127,13 @@ for k, v in pairs(Drugs) do table.insert(drugsNames, k) end GlobalState.DrugNames = drugsNames - +Locations = Locations or {} +Locations.CornerSelling = { + noSellZones = { + {loc = vector3(445.11, -991.3, 30.69), width = 10.0, length = 10.0, height = 10.0, rot = 180.0}, + } +} +GlobalState.MDDrugsLocations = Locations local RobbedDrugs = {} local cornsellConfig = { MarkedBills = false, -- if you want to use qb markedbills for selling set to true, if you want to use a custom item or cash set to false diff --git a/server/functions.lua b/server/functions.lua index 53b2206..c7efad8 100644 --- a/server/functions.lua +++ b/server/functions.lua @@ -88,9 +88,9 @@ local function handleFresh(source) heroin = 0, dealerrep = 0, cornerselling = { - price = QBConfig.SellLevel[1].price, + price = Config.CornerSellLevell[1].price, rep = 0, - label = QBConfig.SellLevel[1].label, + label = Config.CornerSellLevel[1].label, level = 1 } } @@ -135,11 +135,11 @@ function AddRep(source, type, amount) end if type == 'cornerselling' then local rep = playerRep[id].cornerselling - local cornerData = QBConfig.SellLevel[rep.level] + local cornerData = Config.CornerSellLevel[rep.level] if rep.rep + amount >= cornerData.maxrep then rep.level = rep.level + 1 - rep.label = QBConfig.SellLevel[rep.level].label - rep.price = QBConfig.SellLevel[rep.level].price + rep.label = Config.CornerSellLevel[rep.level].label + rep.price = Config.CornerSellLevel[rep.level].price end rep.rep = rep.rep + amount else diff --git a/shared/config.lua b/shared/config.lua index 2ae4c52..8a196a4 100644 --- a/shared/config.lua +++ b/shared/config.lua @@ -2,14 +2,22 @@ Config = {} --Ignore. Bridge = exports.community_bridge:Bridge() -Config.TierSystem = true -- allows for three tiers of certain drugs ( coke, heroin, crack, lsd) -Config.Emotes = 'rp' -- rp, dp, scully, custom ----------------------------------- TierSystem levels ** ONLY IN USE IF CONFIG.TIERSYTEM IS TRUE +Config.TierSystem = true -- allows for three tiers of certain drugs ( coke, heroin, crack, lsd) Config.Tier1 = 100 -- amount to hit for level 2 Config.Tier2 = 300 -- amount to hit for level 3 +Config.CornerSellLevel = { + {price = 0.5, minrep = 0, maxrep = 240, label = 'Rookie'}, + {price = 1.0, minrep = 240, maxrep = 600, label = 'Corner Boy'}, + {price = 1.1, minrep = 600, maxrep = 1200, label = 'Corner Man'}, + {price = 1.2, minrep = 1200, maxrep = 1800, label = 'Dope Peddler'}, + {price = 1.3, minrep = 1800, maxrep = 2400, label = 'Drug Supplier'}, + {price = 1.5, minrep = 2400, maxrep = 4800, label = 'Drug Pusher'}, + {price = 1.75, minrep = 4800, maxrep = 99999999999999, label = 'Drug Lord'}, +} +--- Customizations Config.Dispatch = 'ps' -- either 'ps', 'cd', 'core', 'aty' - Config.Minigames = { ps_circle = {amount = 2, speed = 8,}, ps_maze = {timelimit = 15}, @@ -44,6 +52,8 @@ Config.ProgressBar = { mouse = false -- Disable mouse } } + +-- Drug System Configs Config.Drugs = { -- want a drug turn on? keep it true, want it turned off, mark it false cocaine = true, consumables = true, diff --git a/shared/qbdrugsrewrite.lua b/shared/qbdrugsrewrite.lua deleted file mode 100644 index 231a608..0000000 --- a/shared/qbdrugsrewrite.lua +++ /dev/null @@ -1,20 +0,0 @@ -QBConfig = {} ------------ qb-drugs update built in here below ------------ Everything is now a target and not displaytext. Dealers are no longer just doors, they will spawn peds where you place your dealer. This is a literally qb-drugs with SLIGHT edits. mainly added peds for deliveries, made everything a target -QBConfig.Dealers = {} - --- Delivery locations and items is now in server/deliveries.lua --- cornerselling pricing and rep is now in server/cornerselling.lua - -QBConfig.NoSellZones = { - {loc = vector3(445.11, -991.3, 30.69), width = 10.0, length = 10.0, height = 10.0, rot = 180.0}, -} -QBConfig.SellLevel = { - {price = 0.5, minrep = 0, maxrep = 240, label = 'Rookie'}, - {price = 1.0, minrep = 240, maxrep = 600, label = 'Corner Boy'}, - {price = 1.1, minrep = 600, maxrep = 1200, label = 'Corner Man'}, - {price = 1.2, minrep = 1200, maxrep = 1800, label = 'Dope Peddler'}, - {price = 1.3, minrep = 1800, maxrep = 2400, label = 'Drug Supplier'}, - {price = 1.5, minrep = 2400, maxrep = 4800, label = 'Drug Pusher'}, - {price = 1.75, minrep = 4800, maxrep = 99999999999999, label = 'Drug Lord'}, -} \ No newline at end of file