- push for ready
This commit is contained in:
1 parent
c3084abc78
commit
4e48857437
39 files changed
+167
-138
No files matched your search
@@ -1,4 +1,4 @@
|
||||
|
||||
if not Config.Drugs['TravellingMerchant'] then return end
|
||||
local function spawn()
|
||||
local data = Bridge.Callback.Trigger('md-drugs:server:GetMerchant')
|
||||
local model = 's_m_m_trucker_01'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
if not Config.Drugs['consumables'] then return end
|
||||
|
||||
Bridge.Callback.Register('md-drugs:client:consumedrugs', function(time, effect, anim, progresstext, status, item)
|
||||
Bridge.Anim.RequestDict(anim.dict)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
if not Config.Drugs['deliveries'] then return end
|
||||
local dealer = {}
|
||||
local buyer = nil
|
||||
|
||||
|
||||
+42
-4
@@ -304,9 +304,43 @@ else
|
||||
end
|
||||
end
|
||||
|
||||
if Config.Emotes == 'scully' then
|
||||
function playEmote(emote)
|
||||
exports.scully_emotemenu:playEmoteByCommand(emote, 0)
|
||||
end
|
||||
function stopEmote()
|
||||
exports.scully_emotemenu:cancelEmote()
|
||||
end
|
||||
end
|
||||
|
||||
if Config.Emotes == 'dpemotes' then
|
||||
function playEmote(emote)
|
||||
TriggerEvent('animations:client:EmoteCommandStart', {emote})
|
||||
end
|
||||
function stopEmote()
|
||||
TriggerEvent('animations:client:EmoteCommandStart', {"c"})
|
||||
end
|
||||
end
|
||||
|
||||
if Config.Emotes == 'rpemotes' then
|
||||
function playEmote(emote)
|
||||
exports["rpemotes"]:EmoteCommandStart(emote, 0)
|
||||
end
|
||||
function stopEmote()
|
||||
exports["rpemotes"]:EmoteCancel()
|
||||
end
|
||||
end
|
||||
|
||||
local animation = nil
|
||||
|
||||
function progressbar(text, time, emote, cancel)
|
||||
if emote and emote.prop then
|
||||
if not emote.prop.model then
|
||||
local animData
|
||||
if type(emote) == 'string' then
|
||||
playEmote(emote)
|
||||
animation = emote
|
||||
elseif type(emote) == 'table' then
|
||||
animData = emote
|
||||
if emote.prop and not emote.prop.model then
|
||||
emote.prop = nil
|
||||
end
|
||||
end
|
||||
@@ -315,9 +349,13 @@ function progressbar(text, time, emote, cancel)
|
||||
label = text or 'LAZY AF DEVS',
|
||||
canCancel = true,
|
||||
disable = cancel or Config.ProgressBar.Disables,
|
||||
anim = emote or Config.DefaultAnimation,
|
||||
prop = emote and emote.prop or nil
|
||||
anim = animData,
|
||||
prop = animData and animData.prop or nil
|
||||
})
|
||||
if animation then
|
||||
animation = nil
|
||||
stopEmote()
|
||||
end
|
||||
return success
|
||||
end
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
|
||||
if not Config.Drugs['heroin'] then return end
|
||||
local herointable = false
|
||||
local dirty = false
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
|
||||
if not Config.Drugs['lean'] then return end
|
||||
local started = false
|
||||
local leanCar = nil
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
if not Config.Drugs['lsd'] then return end
|
||||
local tableout = false
|
||||
local dirtylsd = false
|
||||
local locations = Config.LSD.Locations
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
if not Config.Drugs['mescaline'] then return end
|
||||
local badTrip = 100
|
||||
local locations = Config.Mescaline.Locations
|
||||
local function AlienEffect()
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
if not Config.Drugs['meth'] then return end
|
||||
local amonia, tray, heated, active, trays, startedmeth, methVan = false, false, false, false, nil, false, nil
|
||||
local locations = Config.Meth.Locations
|
||||
--- meth heist
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
if not Config.Drugs['oxyruns'] then return end
|
||||
local carryPackage = nil
|
||||
local onMission = false
|
||||
local locations = Config.Oxy.Locations
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
|
||||
if not Config.Drugs['pharma'] then return end
|
||||
local locations = Config.Pharma.Locations
|
||||
|
||||
Bridge.Callback.Register("md-drugs:client:prescriptionpad", function( data, op)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
if not Config.Drugs['shrooms'] then return end
|
||||
|
||||
local function EcstasyEffect()
|
||||
local startStamina = 50
|
||||
SetFlash(0, 0, 500, 20000, 500)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
if not Config.Drugs['weed'] then return end
|
||||
local exploded, drying = false, false
|
||||
local locations, recipes = Config.Weed.Locations, Config.Weed.Recipes
|
||||
for k, v in pairs (locations.WeedDry) do
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
if not Config.Drugs['whippit'] then return end
|
||||
local prop = nil
|
||||
|
||||
local function animation(color)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
local active = false
|
||||
if not Config.Drugs['wholesale'] then return end
|
||||
local active, ped, peds = false, nil, {}
|
||||
|
||||
local function loop(wholesaleData)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
if not Config.Drugs['xtc'] then return end
|
||||
local xtcpress = false
|
||||
local locations = Config.XTC.Locations
|
||||
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
function loadFile(filePath)
|
||||
local resourceName = 'md-drugs'
|
||||
local fullScript = LoadResourceFile(resourceName, filePath)
|
||||
if not fullScript then
|
||||
Bridge.Prints.Error("Error: Failed to load module '" .. filePath .. "' from resource '" .. resourceName .. "'.")
|
||||
return false
|
||||
end
|
||||
local chunk, err = load(fullScript, filePath, "t")
|
||||
if not chunk then
|
||||
Bridge.Prints.Error("Error loading Lua chunk from '" .. filePath .. "': " .. tostring(err))
|
||||
return false
|
||||
end
|
||||
|
||||
local success, execErr = pcall(chunk)
|
||||
if not success then
|
||||
Bridge.Prints.Error("Error executing Lua chunk from '" .. filePath .. "': " .. tostring(execErr))
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
for scriptName, toggle in pairs(Config.Drugs) do
|
||||
if not toggle then goto continue end
|
||||
loadFile('client/' .. scriptName .. '.lua')
|
||||
::continue::
|
||||
end
|
||||
+2
-5
@@ -6,16 +6,13 @@ game "gta5"
|
||||
version '4.0.8'
|
||||
client_scripts {
|
||||
'client/functions.lua',
|
||||
'client/plantSpawns.lua',
|
||||
'clientRun.lua',
|
||||
'client/**.lua',
|
||||
}
|
||||
|
||||
server_scripts {
|
||||
'@oxmysql/lib/MySQL.lua',
|
||||
'server/functions.lua',
|
||||
'server/plantSpawns.lua',
|
||||
'serverRun.lua',
|
||||
|
||||
'server/**.lua',
|
||||
}
|
||||
|
||||
shared_scripts {
|
||||
|
||||
@@ -1,72 +1,101 @@
|
||||
# 🌿 MD-Drugs – Advanced Drug System for FiveM
|
||||
|
||||
A fully customizable, immersive drug system for FiveM servers.
|
||||
> ✨ A fully customizable, immersive, and performance-optimized drug system built for serious FiveM roleplay servers.
|
||||
|
||||
<div align="center">
|
||||
<a href="https://discord.gg/sAMzrB4DDx">
|
||||
<img src="https://i.imgur.com/t65G9Z0.png" width="200" alt="Mustache Scripts Logo">
|
||||
<a href="https://discord.gg/sAMzrB4DDx" >
|
||||
<img style="width:200px;", src="https://i.imgur.com/t65G9Z0.png"></img>
|
||||
</a>
|
||||
<br>
|
||||
<a href="https://discord.gg/sAMzrB4DDx"><strong>Join Mustache Scripts Discord</strong></a>
|
||||
|
||||
**[Join Mustache Scripts Discord](https://discord.gg/sAMzrB4DDx)**
|
||||
</div>
|
||||
|
||||
---
|
||||
## 📦 Dependencies
|
||||
|
||||
> ⚠️ **Important:** Ensure all dependencies are installed, started **before** `md-drugs`, and kept up to date.
|
||||
|
||||
| Dependency | Requirement | Link |
|
||||
|-----------|-------------|------|
|
||||
| `Community_bridge` | Required | [GitHub](https://github.com/TheOrderFivem/community_bridge) |
|
||||
| `Read` | Required | [Documentation](https://letters.hookedonphonics.com/us/read-guaranteed-G14.html) |
|
||||
| **Game Build** | **2944 or later** | - |
|
||||
|
||||
---
|
||||
## 🙏 Credits
|
||||
|
||||
A huge thank you to everyone who made this possible:
|
||||
|
||||
| Contributor | Contribution | Link |
|
||||
|------------|--------------|------|
|
||||
| **Samuel's Development** | Christmas script global states & prop spawning | [Visit](https://fivem.samueldev.shop/) |
|
||||
| **STACHY225** | Meth network animations | [Visit](https://babiczind.tebex.io/category/2103836) |
|
||||
| **Bostra** | Free scripts, sanity checks & mushrooms | [Discord](https://discord.gg/5ncbwMNq) |
|
||||
| **Feisty** | Stunning visuals & effects | - |
|
||||
| **Athena** | Balloon props | [Discord](https://discord.gg/mam8Nmg49d) |
|
||||
| **Kamaryn** | Installation guide video | [Watch](https://youtu.be/zvuYnUfrqaA?si=FGJuBO5krZMC14Nd) |
|
||||
| **1of1 Servers** | Hosting & support | [Website](https://1of1servers.com/) \| [Discord](https://discord.gg/1of1servers) |
|
||||
| **Beta Testers** | Invaluable feedback & testing | - |
|
||||
|
||||
---
|
||||
|
||||
## 🎬 Preview
|
||||
|
||||
<div align="center">
|
||||
|
||||
[](https://www.youtube.com/watch?v=I_x7_oz_SAU)
|
||||
|
||||
**[📺 Watch Full Preview Video](https://www.youtube.com/watch?v=I_x7_oz_SAU)**
|
||||
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
- **[Samuel's Development](https://fivem.samueldev.shop/ ):** Used their Christmas script global states and prop spawning (with permission).
|
||||
- **[STACHY225](https://babiczind.tebex.io/category/2103836 ):** Meth network animations.
|
||||
- **[Bostra](https://discord.gg/5ncbwMNq ):** Free scripts, sanity checks, and those cute mushrooms!
|
||||
- **[Feisty]():** Stunning visuals that make everything look amazing.
|
||||
- **Beta Testers:** Your invaluable feedback made this possible.
|
||||
- **[1of1 Servers](https://1of1servers.com/ ):** Top-notch hosting and support. Join their [Discord](https://discord.gg/1of1servers ).
|
||||
- **[Kamaryn](https://discord.gg/KPRmZqFS ):** For the [installation guide video](https://youtu.be/zvuYnUfrqaA?si=FGJuBO5krZMC14Nd).
|
||||
- **[Athena](https://discord.gg/mam8Nmg49d):** For the Balloon props :)
|
||||
## 🎬 Preview
|
||||
|
||||
🎥 **[Watch Full Preview Video](https://www.youtube.com/watch?v=I_x7_oz_SAU)**
|
||||
|
||||
|
||||
---
|
||||
|
||||
## 📦 Dependencies
|
||||
|
||||
| Dependency | Link |
|
||||
|----------|------|
|
||||
| `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, started before md-drugs and up to date.
|
||||
|
||||
|
||||
## 🛠️ Installation
|
||||
|
||||
### Step 1: Inventory Integration
|
||||
|
||||
#### For QBCore (`qb-inventory`)
|
||||
1. Copy items from `md-drugs/items_install/qb-inventory` into `qb-core/shared/items.lua`.
|
||||
2. Add item images from `md-drugs/items_install/images` to `qb-inventory/html/images`.
|
||||
#### 📦 For QBCore (`qb-inventory`)
|
||||
|
||||
#### For OX_Inventory
|
||||
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`.
|
||||
1. **Copy Items:**
|
||||
- Copy items from `md-drugs/items_install/qb-inventory` into `qb-core/shared/items.lua`
|
||||
|
||||
2. **Add Images:**
|
||||
- Add item images from `md-drugs/items_install/images` to `qb-inventory/html/images`
|
||||
|
||||
#### 📦 For OX_Inventory
|
||||
|
||||
1. **Copy Items:**
|
||||
- Copy items from `md-drugs/items_install/ox_inventory` into `ox_inventory/data/items.lua`
|
||||
|
||||
2. **Add Images:**
|
||||
- Add item images to `ox_inventory/web/images`
|
||||
|
||||
---
|
||||
|
||||
### Step 2: Configure Drug Locations & Recipes
|
||||
|
||||
- All **processing locations and recipes** are located in their respective drug type files:
|
||||
- `cocaine.lua`,
|
||||
- `meth.lua`,
|
||||
- `weed.lua`,
|
||||
- etc.
|
||||
- **Plant spawns** are managed in `server/plantSpawns.lua`.
|
||||
All drug data is now organized in: `shared/DrugData/{drugname}.lua`
|
||||
|
||||
> ✏️ Modify these files to customize spawn points, yields, and processing times.
|
||||
> ✏️ **Tip:** Modify these files to customize:
|
||||
> - Spawn points
|
||||
> - Yields
|
||||
> - Processing times
|
||||
> - And more!
|
||||
|
||||
### STEP 3 (IF QBCore)
|
||||
- check `qb-smallresources/config.lua` and if this exists, delete it
|
||||
- look for this code
|
||||
```lua
|
||||
[2] = { --Coke Processing Enter/Exit
|
||||
*Note: Some data is also located in the server files.*
|
||||
|
||||
---
|
||||
|
||||
### Step 3: QBCore Users Only! ⚠️
|
||||
|
||||
If you're using QBCore, check `qb-smallresources/config.lua`:
|
||||
|
||||
1. Look for this code block:
|
||||
```lua
|
||||
[2] = { --Coke Processing Enter/Exit
|
||||
[1] = {
|
||||
poly = { coords = vector3(909.49, -1589.22, 30.51), heading = 92.24, length = 2, width = 2 },
|
||||
allowVeh = false,
|
||||
@@ -77,9 +106,8 @@ A fully customizable, immersive drug system for FiveM servers.
|
||||
allowVeh = false,
|
||||
label = '[E] Leave'
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
}
|
||||
```
|
||||
### STEP 4
|
||||
- Run SQL
|
||||
- if you dont know how, click this image below
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
if not Config.Drugs['TravellingMerchant'] then return end
|
||||
local loc = Config.Merchant.Locations.Travellingmerchant[math.random(1, #Config.Merchant.Locations.Travellingmerchant)]
|
||||
|
||||
Bridge.Callback.Register('md-drugs:server:GetMerchant', function(source)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
if not Config.Drugs['cocaine'] then return end
|
||||
local Locations = Config.Cocaine.Locations
|
||||
local Recipes = Config.Cocaine.Recipes
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
if not Config.Drugs['consumables'] then return end
|
||||
for k, v in pairs(Config.Consumables.Consume) do
|
||||
Bridge.Framework.RegisterUsableItem(k, function(source, item)
|
||||
if not Bridge.Inventory.HasItem(source, k, 1) then return end
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
|
||||
if not Config.Drugs['crack'] then return end
|
||||
RegisterServerEvent('md-drugs:server:makecrackone', function(num)
|
||||
local src = source
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
if not Config.Drugs['deliveries'] then return end
|
||||
|
||||
local drugDeliveryItem = {
|
||||
{item = 'coke_brick', amount = 1},
|
||||
@@ -12,11 +12,18 @@ CreateThread(function()
|
||||
for i = 1, #dealers do
|
||||
local coords = json.decode(dealers[i].coords)
|
||||
Dealers[#Dealers + 1] = {
|
||||
coords = vector4(coords.x, coords.y, coords.z, coords.w),
|
||||
coords = vector4(coords.x, coords.y, coords.z, coords.w or 180.0),
|
||||
model = dealers[i].model or 'a_m_m_skater_01',
|
||||
}
|
||||
end
|
||||
GlobalState.MDDrugDealers = Dealers
|
||||
else
|
||||
MySQL.insert('INSERT INTO dealers (model, coords, createdby) VALUES (?, ?, ?)', {'a_m_m_skater_01', json.encode(vector4(1915.68, 154.22, 155.41, 6.88)), 'default'})
|
||||
Dealers[#Dealers + 1] = {
|
||||
coords = vector4(1915.68, 154.22, 155.41, 6.88),
|
||||
model = 'a_m_m_skater_01',
|
||||
}
|
||||
GlobalState.MDDrugDealers = Dealers
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
|
||||
if not Config.Drugs['heroin'] then return end
|
||||
local heroinLabKits = {}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
|
||||
if not Config.Drugs['lean'] then return end
|
||||
local onRun = {}
|
||||
|
||||
local function setTimeout(identifier)
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
|
||||
if not Config.Drugs['lsd'] then return end
|
||||
local lsdTables = {}
|
||||
|
||||
RegisterServerEvent('md-drugs:server:getlysergic', function(num)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
if not Config.Drugs['mescaline'] then return end
|
||||
|
||||
RegisterNetEvent("md-drugs:server:drymescaline", function(num)
|
||||
local src = source
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
if not Config.Drugs['meth'] then return end
|
||||
local onRun = {}
|
||||
local vehicles = {}
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
|
||||
if not Config.Drugs['oxyruns'] then return end
|
||||
local onRoute = {}
|
||||
local vehicles = {}
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
|
||||
if not Config.Drugs['deliveries'] then return end
|
||||
|
||||
local function GetJob(source)
|
||||
local src = source
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
|
||||
if not Config.Drugs['shrooms'] then return end
|
||||
Bridge.Framework.RegisterUsableItem('shrooms', function(source, item)
|
||||
local src = source
|
||||
if not Bridge.Callback.Trigger("md-drugs:client:shrooms", src) then
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
|
||||
if not Config.Drugs['weed'] then return end
|
||||
RegisterNetEvent('md-drugs:server:buyWeedItem', function(loc, name, amount)
|
||||
local src = source
|
||||
if not checkDistance(src, Config.Weed.Locations.WeedSalesman[loc].loc, 3.5, 'md-drugs:server:buyWeedItem') then
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
|
||||
if not Config.Drugs['whippit'] then return end
|
||||
|
||||
RegisterServerEvent('md-drugs:server:buyWhippitItem', function(loc, item,amount)
|
||||
local src = source
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
if not Config.Drugs['wholesale'] then return end
|
||||
local burners = {
|
||||
cokeburner = { "cokebaggy", "cokebaggystagethree", "cokebaggystagetwo"},
|
||||
crackburner = {"baggedcracked", "baggedcrackedstagetwo", "baggedcrackedstagethree"},
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
|
||||
if not Config.Drugs['xtc'] then return end
|
||||
local activePresses = {}
|
||||
|
||||
RegisterServerEvent('md-drugs:server:stealisosafrole', function(num)
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
function loadFile(filePath)
|
||||
local resourceName = 'md-drugs'
|
||||
local fullScript = LoadResourceFile(resourceName, filePath)
|
||||
if not fullScript then
|
||||
Bridge.Prints.Error("Error: Failed to load module '" .. filePath .. "' from resource '" .. resourceName .. "'.")
|
||||
return false
|
||||
end
|
||||
local chunk, err = load(fullScript, filePath, "t")
|
||||
if not chunk then
|
||||
Bridge.Prints.Error("Error loading Lua chunk from '" .. filePath .. "': " .. tostring(err))
|
||||
return false
|
||||
end
|
||||
|
||||
local success, execErr = pcall(chunk)
|
||||
if not success then
|
||||
Bridge.Prints.Error("Error executing Lua chunk from '" .. filePath .. "': " .. tostring(execErr))
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
for scriptName, toggle in pairs(Config.Drugs) do
|
||||
if not toggle then goto continue end
|
||||
loadFile('server/' .. scriptName .. '.lua')
|
||||
::continue::
|
||||
end
|
||||
@@ -32,7 +32,7 @@ local emotes = {
|
||||
drink = {
|
||||
dict = "mp_player_intdrink",
|
||||
clip = "loop_bottle",
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
Config.Consumables = {
|
||||
|
||||
+2
-2
@@ -26,8 +26,8 @@ Config.Minigames = {
|
||||
glspot = {gridSize = 6, timeLimit = 999999, charSet = "alphabet", required = 10},
|
||||
glmath = {timeLimit = 300000},
|
||||
}
|
||||
Config.minigametype = 'ps_circle' -- look above for options or choose none if you dont want any minigames
|
||||
|
||||
Config.minigametype = 'ox' -- look above for options or choose none if you dont want any minigames
|
||||
Config.Emotes = 'rpemotes' -- this is if you want to use emotes, you can pass the string of the emote name instead of the animDict and animClip like below
|
||||
Config.DefaultAnimation = {
|
||||
dict = "mp_arresting",
|
||||
clip = "a_uncuff",
|
||||
|
||||
Reference in new issue
Block a user