- holy fuck a lot
This commit is contained in:
1 parent
94c6458037
commit
2fd900ec22
33 files changed
+680
-910
No files matched your search
@@ -1,4 +1,4 @@
|
||||
local QBCore = exports['qb-core']:GetCoreObject()
|
||||
|
||||
--[[
|
||||
effect options
|
||||
alien
|
||||
@@ -21,7 +21,7 @@ strength = number -- how long you are strong boi
|
||||
]]
|
||||
local Consume = {
|
||||
-- meth
|
||||
methbags = { time = 4000, effect = 'meth', anim = "smoke", progressbartext = "Injesting",
|
||||
methbags = { time = 4000, effect = 'meth', anim = "smoke", ps.progressbartext = "Injesting",
|
||||
add = {health = -20, stress = -10, speed = 40, strength = 10, thirst = -30}},
|
||||
cokebaggy = { anim = 'smell', time = 1000, effect = 'coke', add = { stress = -10 }},
|
||||
cokebaggystagetwo = { anim = 'smell', time = 1000, effect = 'coke', add = { stress = -10 }},
|
||||
@@ -148,9 +148,9 @@ for k, v in pairs(Consume) do
|
||||
local time = v.time or Consumables.defaulttime
|
||||
local effect = v.effect or 0
|
||||
local anim = v.anim or Consumables.defaultanim
|
||||
local progressbartext = v.progressbartext or Consumables.defaultprogresstext
|
||||
local ps.progressbartext = v.ps.progressbartext or Consumables.defaultprogresstext
|
||||
local add = v.add or {hunger = 0}
|
||||
local done = ps.callback('md-drugs:client:consumedrugs', source, time, effect, anim, progressbartext, add, k)
|
||||
local done = ps.callback('md-drugs:client:consumedrugs', source, time, effect, anim, ps.progressbartext, add, k)
|
||||
if done then
|
||||
RemoveItem(source, k, 1)
|
||||
end
|
||||
|
||||
@@ -213,7 +213,7 @@ RegisterNetEvent('md-drugs:server:sellCornerDrugs', function(item, amount, price
|
||||
return
|
||||
end
|
||||
AddRep(src, 'cornerselling', Drugs[item].rep * amount)
|
||||
Log(string.format('%s Sold %s Of %s For A Price Of $%s !', GetName(src),amount, item, price), 'cornerselling')
|
||||
--Log(string.format('%s Sold %s Of %s For A Price Of $%s !', GetName(src),amount, item, price), 'cornerselling')
|
||||
DrugDeals[ps.getIdentifier(src)] = nil
|
||||
ps.addMoney(src, 'cash', price)
|
||||
end)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
local QBCore = exports['qb-core']:GetCoreObject()
|
||||
|
||||
|
||||
local dloc = {
|
||||
{coords = vector4(282.48, -1814.32, 27.23, 145.11)},
|
||||
@@ -122,8 +122,8 @@ ps.registerCallback('md-drugs:server:GetDeliveryItem', function(data)
|
||||
local time = os.time()
|
||||
local timeout = math.floor(os.difftime(time, check[1].maxtime) / 60)
|
||||
|
||||
if timeout > 15 then MySQL.query.await('DELETE FROM deliveriesdealer WHERE cid = ?', {Player.PlayerData.citizenid}) Notifys(src, 'You Failed To Make It In Time!', 'error' ) return false end
|
||||
Notifys(src,'You Already Have A Delivery To Make', 'error' ) return false, item, amount, coord
|
||||
if timeout > 15 then MySQL.query.await('DELETE FROM deliveriesdealer WHERE cid = ?', {Player.PlayerData.citizenid}) ps.notify(src, 'You Failed To Make It In Time!', 'error' ) return false end
|
||||
ps.notify(src,'You Already Have A Delivery To Make', 'error' ) return false, item, amount, coord
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -135,7 +135,7 @@ RegisterNetEvent('md-drugs:server:giveDeliveryItems', function(item, amount)
|
||||
local time = os.time()
|
||||
local timeout = math.floor(os.difftime(time, check[1].maxtime) / 60)
|
||||
local itemData = json.decode(check[1].itemdata)
|
||||
if timeout >= 15 then MySQL.query.await('DELETE FROM deliveriesdealer WHERE cid = ?', {Player.PlayerData.citizenid}) Notifys(source, 'You Failed To Make It In Time!', 'error' ) return end
|
||||
if timeout >= 15 then MySQL.query.await('DELETE FROM deliveriesdealer WHERE cid = ?', {Player.PlayerData.citizenid}) ps.notify(source, 'You Failed To Make It In Time!', 'error' ) return end
|
||||
if item ~= itemData.item then return end
|
||||
if amount ~= itemData.amount then return end
|
||||
if RemoveItem(src, item, amount) then
|
||||
@@ -169,7 +169,7 @@ lib.addCommand("newdealer", {
|
||||
|
||||
local result = MySQL.scalar.await('SELECT name FROM dealers WHERE name = ?', { dealerName })
|
||||
if result then
|
||||
return Notifys(source,"Already Exists", "error")
|
||||
return ps.notify(source,"Already Exists", "error")
|
||||
end
|
||||
|
||||
MySQL.insert('INSERT INTO dealers (name, coords, time, createdby) VALUES (?, ?, ?, ?)', {
|
||||
@@ -202,8 +202,8 @@ lib.addCommand("deletedealer", {
|
||||
MySQL.query('DELETE FROM dealers WHERE name = ?', { dealerName })
|
||||
QBConfig.Dealers[dealerName] = nil
|
||||
TriggerClientEvent('md-drugs:client:RefreshDealers', -1, QBConfig.Dealers)
|
||||
TriggerClientEvent('QBCore:Notify', source, "Dealer Deleted", "success")
|
||||
TriggerClientEvent('QBCore:ps.notify', source, "Dealer Deleted", "success")
|
||||
else
|
||||
TriggerClientEvent('QBCore:Notify', source, "Who You Tryna Delete", "error")
|
||||
TriggerClientEvent('QBCore:ps.notify', source, "Who You Tryna Delete", "error")
|
||||
end
|
||||
end)
|
||||
+5
-398
@@ -1,7 +1,3 @@
|
||||
local QBCore, ESX, qbx = {}, {}, nil
|
||||
local notify = Config.Notify -- qb or ox
|
||||
local inventory = Config.Inventory -- qb or ox
|
||||
local invname = ''
|
||||
|
||||
------------------------------------------ logging stuff
|
||||
local logs = false
|
||||
@@ -12,311 +8,7 @@ local headers = {
|
||||
['Content-Type'] = 'application/json',
|
||||
}
|
||||
|
||||
if Config.Framework == 'qb' then
|
||||
QBCore = exports['qb-core']:GetCoreObject()
|
||||
elseif Config.Framework == 'esx' then
|
||||
ESX = exports['es_extended']:getSharedObject()
|
||||
elseif Config.Framework == 'qbx' then
|
||||
qbx = exports.qbx_core
|
||||
end
|
||||
|
||||
|
||||
CreateThread(function()
|
||||
if logs then
|
||||
print'^2 Logs Enabled for md-drugs'
|
||||
if logapi == 'insert string here' then
|
||||
print'^1 homie you gotta set your api on line 4'
|
||||
else
|
||||
print'^2 API Key Looks Good, Dont Trust Me Though, Im Not Smart'
|
||||
end
|
||||
else
|
||||
print'^1 logs disabled for md-drugs'
|
||||
end
|
||||
end)
|
||||
|
||||
function Log(message, type)
|
||||
if logs == false then return end
|
||||
local buffer = { level = "info", message = message, resource = GetCurrentResourceName(),
|
||||
metadata = { drugs = type, playerid = source}
|
||||
}
|
||||
SetTimeout(500, function()
|
||||
PerformHttpRequest(endpoint, function(status, _, _, response)
|
||||
if status ~= 200 then
|
||||
if type(response) == 'string' then
|
||||
response = json.decode(response) or response
|
||||
end
|
||||
end
|
||||
end, 'POST', json.encode(buffer), headers)
|
||||
buffer = nil
|
||||
end)
|
||||
end
|
||||
------------------------------------ Player Stuff functions
|
||||
function getPlayer(source)
|
||||
local src = source
|
||||
if Config.Framework == 'qb' then
|
||||
local Player = QBCore.Functions.GetPlayer(src)
|
||||
return Player
|
||||
elseif Config.Framework == 'esx' then
|
||||
local Player = ESX.GetPlayerFromId(src)
|
||||
return Player
|
||||
elseif Config.Framework == 'qbx' then
|
||||
local Player = qbx:GetPlayer(source)
|
||||
return Player
|
||||
end
|
||||
end
|
||||
|
||||
function getPlayerByCid(cid)
|
||||
if Config.Framework == 'qb' then
|
||||
local Player = QBCore.Functions.GetPlayerByCitizenId(cid)
|
||||
return Player
|
||||
elseif Config.Framework == 'esx' then
|
||||
local Player = ESX.GetPlayerFromIdentifier(cid)
|
||||
return Player
|
||||
elseif Config.Framework == 'qbx' then
|
||||
local Player = qbx:GetPlayerByCitizenId(cid)
|
||||
return Player
|
||||
end
|
||||
end
|
||||
|
||||
function GetName(source)
|
||||
local src = source
|
||||
if Config.Framework == 'qb' then
|
||||
local Player = getPlayer(src)
|
||||
return Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname
|
||||
elseif Config.Framework == 'esx' then
|
||||
local Player = getPlayer(src)
|
||||
return Player.getName()
|
||||
elseif Config.Framework == 'qbx' then
|
||||
local Player = getPlayer(src)
|
||||
return Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname
|
||||
end
|
||||
end
|
||||
|
||||
function getCid(source)
|
||||
local src = source
|
||||
if Config.Framework == 'qb' then
|
||||
local Player = getPlayer(src)
|
||||
return Player.PlayerData.citizenid
|
||||
elseif Config.Framework == 'esx' then
|
||||
local Player = getPlayer(src)
|
||||
return Player.getIdentifier()
|
||||
elseif Config.Framework == 'qbx' then
|
||||
local Player = getPlayer(src)
|
||||
return Player.PlayerData.citizenid
|
||||
end
|
||||
end
|
||||
|
||||
function GetCoords(source)
|
||||
local ped = GetPlayerPed(source)
|
||||
local playerCoords = GetEntityCoords(ped)
|
||||
return playerCoords
|
||||
end
|
||||
|
||||
function dist(source, coords)
|
||||
local playerPed = GetPlayerPed(source)
|
||||
local pcoords = GetEntityCoords(playerPed)
|
||||
local dist = #(pcoords - coords)
|
||||
|
||||
return dist
|
||||
end
|
||||
|
||||
function CheckDist(source, coords)
|
||||
local playerPed = GetPlayerPed(source)
|
||||
local pcoords = GetEntityCoords(playerPed)
|
||||
local ok
|
||||
if #(pcoords - coords) < 4.0 then
|
||||
return ok
|
||||
else
|
||||
DropPlayer(source, 'md-drugs: You Were A Total Of ' .. #(pcoords - coords) .. ' Too Far Away To Trigger This Event')
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function Notifys(source, text, type)
|
||||
local src = source
|
||||
if notify == 'qb' then
|
||||
TriggerClientEvent("QBCore:Notify", src, text, type)
|
||||
elseif notify == 'ox' then
|
||||
lib.notify(src, { title = text, type = type})
|
||||
elseif notify == 'okok' then
|
||||
TriggerClientEvent('okokNotify:Alert', src, '', text, 4000, type, false)
|
||||
else
|
||||
print"^1 Look At The Config For Proper Alert Options"
|
||||
end
|
||||
end
|
||||
|
||||
function GetLabels(item)
|
||||
if inventory == 'qb' then
|
||||
return QBCore.Shared.Items[item].label
|
||||
elseif inventory == 'ox' then
|
||||
local items = exports.ox_inventory:Items()
|
||||
return items[item].label
|
||||
end
|
||||
end
|
||||
|
||||
function CUI(item, useFunction)
|
||||
if Config.Framework == 'qb' then
|
||||
QBCore.Functions.CreateUseableItem(item, useFunction)
|
||||
elseif Config.Framework == 'esx' then
|
||||
ESX.RegisterUsableItem(item, useFunction)
|
||||
elseif Config.Framework == 'qbx' then
|
||||
qbx:CreateUseableItem(item, useFunction)
|
||||
end
|
||||
end
|
||||
|
||||
function Itemcheck(source, item, amount)
|
||||
if inventory == 'qb' then
|
||||
local Player = getPlayer(source)
|
||||
local itemchecks = Player.Functions.GetItemByName(item)
|
||||
if itemchecks and itemchecks.amount >= amount then
|
||||
return true
|
||||
else
|
||||
Notifys(source, 'You Need ' .. amount .. ' Of ' .. GetLabels(item) .. ' To Do this', 'error')
|
||||
return false
|
||||
end
|
||||
elseif inventory == 'ox' then
|
||||
local items = exports.ox_inventory:GetItem(source, item, nil, false)
|
||||
if items.count >= amount then
|
||||
return true
|
||||
else
|
||||
Notifys(source, 'You Need ' .. amount .. ' Of ' .. GetLabels(item) .. ' To Do This', 'error')
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function hasItem(source, item, amount)
|
||||
if inventory == 'qb' then
|
||||
local Player = getPlayer(source)
|
||||
local itemchecks = Player.Functions.GetItemByName(item)
|
||||
if itemchecks and itemchecks.amount >= amount then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
elseif inventory == 'ox' then
|
||||
local items = exports.ox_inventory:GetItem(source, item, nil, false)
|
||||
if items == nil then return false end
|
||||
if items.count >= amount then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function getItemCount(source, item)
|
||||
if inventory == 'qb' then
|
||||
local Player = getPlayer(source)
|
||||
local itemchecks = Player.Functions.GetItemByName(item)
|
||||
if itemchecks then
|
||||
return itemchecks.amount
|
||||
else
|
||||
return false
|
||||
end
|
||||
elseif inventory == 'ox' then
|
||||
local items = exports.ox_inventory:GetItem(source, item, nil, false)
|
||||
if items == nil then
|
||||
print('You are missing ' .. item)
|
||||
return 0
|
||||
end
|
||||
if items.count >= 1 then
|
||||
return items.count
|
||||
else
|
||||
return 0
|
||||
end
|
||||
end
|
||||
end
|
||||
function RemoveItem(source, item, amount)
|
||||
if inventory == 'qb' then
|
||||
local Player = getPlayer(source)
|
||||
if Player.Functions.RemoveItem(item, amount) then
|
||||
TriggerClientEvent(invname ..":client:ItemBox", source, QBCore.Shared.Items[item], "remove", amount)
|
||||
return true
|
||||
else
|
||||
Notifys(source, 'You Need ' .. amount .. ' Of ' .. GetLabels(item) .. ' To Do This', 'error')
|
||||
end
|
||||
elseif inventory == 'ox' then
|
||||
if exports.ox_inventory:RemoveItem(source, item, amount) then
|
||||
return true
|
||||
else
|
||||
Notifys(source, 'You Need ' .. amount .. ' Of ' .. GetLabels(item) .. ' To Do This', 'error')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function AddItem(source, item, amount)
|
||||
if inventory == 'qb' then
|
||||
local Player = getPlayer(source)
|
||||
if Player.Functions.AddItem(item, amount) then
|
||||
TriggerClientEvent(invname ..":client:ItemBox", source, QBCore.Shared.Items[item], "add", amount)
|
||||
return true
|
||||
else
|
||||
print('Failed To Give Item: ' .. item .. ' Check Your qb-core/shared/items.lua')
|
||||
return false
|
||||
end
|
||||
else
|
||||
if exports.ox_inventory:AddItem(source, item, amount) then
|
||||
return true
|
||||
else
|
||||
print('Failed To Give Item: ' .. item .. ' Check Your ox_inventory/data/items.lua')
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function addMoney(source, type, amount)
|
||||
if Config.Framework == 'qb' then
|
||||
local Player = getPlayer(source)
|
||||
if Player.Functions.AddMoney(type, amount) then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
elseif Config.Framework == 'esx' then
|
||||
local Player = getPlayer(source)
|
||||
if Player.addMoney(amount) then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
elseif Config.Framework == 'qbx' then
|
||||
if qbx:AddMoney(source, type, amount) then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function removeMoney(source, type, amount)
|
||||
if Config.Framework == 'qb' then
|
||||
local Player = getPlayer(source)
|
||||
if Player.Functions.RemoveMoney(type, amount) then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
elseif Config.Framework == 'esx' then
|
||||
if type == 'bank' then
|
||||
print('Does Not Support Bank Funds Removing From ESX Defaulted To Cash')
|
||||
end
|
||||
local Player = getPlayer(source)
|
||||
if Player.getMoney() >= amount then
|
||||
Player.removeMoney(amount)
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
elseif Config.Framework == 'qbx' then
|
||||
if qbx:RemoveMoney(source, type, amount) then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
local function handleFresh(source)
|
||||
local table = json.encode({
|
||||
coke = 0,lsd = 0,heroin = 0,dealerrep = 0,
|
||||
@@ -351,7 +43,7 @@ end
|
||||
function AddRep(source, type, amount)
|
||||
if not Config.TierSystem then return false end
|
||||
if not amount then amount = 1 end
|
||||
local sql = MySQL.query.await('SELECT * FROM drugrep WHERE cid = ?', {getCid(source)})
|
||||
local sql = MySQL.query.await('SELECT * FROM drugrep WHERE cid = ?', {ps.getIdentifier(source)})
|
||||
local reps = json.decode(sql[1].drugrep)
|
||||
local update
|
||||
local rep = ''
|
||||
@@ -367,11 +59,11 @@ function AddRep(source, type, amount)
|
||||
end
|
||||
end
|
||||
if update == '' then return false end
|
||||
MySQL.update('UPDATE drugrep SET drugrep = ? WHERE cid = ?', {update, getCid(source)})
|
||||
MySQL.update('UPDATE drugrep SET drugrep = ? WHERE cid = ?', {update, ps.getIdentifier(source)})
|
||||
return true
|
||||
else
|
||||
rep[type] = rep[type] + amount
|
||||
MySQL.update('UPDATE drugrep SET drugrep = ? WHERE cid = ?', {json.encode(rep), getCid(source)})
|
||||
MySQL.update('UPDATE drugrep SET drugrep = ? WHERE cid = ?', {json.encode(rep), ps.getIdentifier(source)})
|
||||
return true
|
||||
end
|
||||
end
|
||||
@@ -408,73 +100,6 @@ function sortTab(tbl, type)
|
||||
end)
|
||||
end
|
||||
|
||||
function getCops()
|
||||
local amount = 0
|
||||
if Config.Framework == 'qb' then
|
||||
local players = QBCore.Functions.GetQBPlayers()
|
||||
for k, v in pairs(players) do
|
||||
if v.PlayerData.job.type == 'leo' and v.PlayerData.job.onduty then
|
||||
amount = amount + 1
|
||||
end
|
||||
end
|
||||
return amount
|
||||
elseif Config.Framework == 'esx' then
|
||||
local players = ESX.GetPlayers()
|
||||
for k, v in pairs(players) do
|
||||
local xPlayer = ESX.GetPlayerFromId(v)
|
||||
if xPlayer.job.name == 'police' and xPlayer.job.onduty then
|
||||
amount = amount + 1
|
||||
end
|
||||
end
|
||||
return amount
|
||||
elseif Config.Framework == 'qbx' then
|
||||
return qbx:GetDutyCountType('leo')
|
||||
end
|
||||
end
|
||||
|
||||
function getNear(src)
|
||||
if Config.Framework == 'qb' then
|
||||
local near = {}
|
||||
local players = QBCore.Functions.GetPlayers()
|
||||
for k, v in pairs (players) do
|
||||
local targ = QBCore.Functions.GetPlayerByCitizenId(v.PlayerData.citizenid)
|
||||
local tname = GetName(v.PlayerData.source)
|
||||
local ped, tped = GetPlayerPed(src), GetPlayerPed(v.PlayerData.source)
|
||||
local dist = #(GetEntityCoords(ped) - GetEntityCoords(tped))
|
||||
if dist < 5.0 then
|
||||
table.insert(near, {label = tname, value = targ.PlayerData.citizenid})
|
||||
end
|
||||
end
|
||||
return near
|
||||
elseif Config.Framework == 'esx' then
|
||||
local near = {}
|
||||
local players = ESX.GetPlayers()
|
||||
for k, v in pairs (players) do
|
||||
local targ = ESX.GetPlayerFromId(v)
|
||||
local tname = GetName(v)
|
||||
local ped, tped = GetPlayerPed(src), GetPlayerPed(v)
|
||||
local dist = #(GetEntityCoords(ped) - GetEntityCoords(tped))
|
||||
if dist < 5.0 then
|
||||
table.insert(near, {label = tname, value = getCid(v)})
|
||||
end
|
||||
end
|
||||
return near
|
||||
elseif Config.Framework == 'qbx' then
|
||||
local near = {}
|
||||
local players = qbx:GetPlayers()
|
||||
for k, v in pairs (players) do
|
||||
local targ = qbx:GetPlayer(v)
|
||||
local tname = GetName(v)
|
||||
local ped, tped = GetPlayerPed(src), GetPlayerPed(v)
|
||||
local dist = #(GetEntityCoords(ped) - GetEntityCoords(tped))
|
||||
if dist < 5.0 then
|
||||
table.insert(near, {label = tname, value = getCid(v)})
|
||||
end
|
||||
end
|
||||
return near
|
||||
end
|
||||
end
|
||||
|
||||
function handleCornersell(source, item, amount, price)
|
||||
if RemoveItem(source, item, amount) then
|
||||
if inventory == 'qb' then
|
||||
@@ -501,27 +126,9 @@ lib.callback.register('md-drugs:server:GetCoppers', function(source, cb, args)
|
||||
return getCops()
|
||||
end)
|
||||
|
||||
lib.callback.register('md-drugs:server:GetRep', function(source, cb, args)
|
||||
ps.registerCallback('md-drugs:server:GetRep', function(source, cb, args)
|
||||
local rep = GetAllRep(source)
|
||||
return rep
|
||||
end)
|
||||
|
||||
CreateThread(function()
|
||||
if GetResourceState('ps-inventory') == 'started' then
|
||||
invname = 'ps-inventory'
|
||||
elseif GetResourceState('qb-inventory') == 'started' then
|
||||
invname = 'qb-inventory'
|
||||
else
|
||||
invname = 'inventory'
|
||||
end
|
||||
local url = "https://raw.githubusercontent.com/Mustachedom/md-drugs/main/version.txt"
|
||||
local version = GetResourceMetadata('md-drugs', "version" )
|
||||
PerformHttpRequest(url, function(err, text, headers)
|
||||
if (text ~= nil) then
|
||||
print('^2 Your Version:' .. version .. ' | Current Version:' .. text .. '' )
|
||||
end
|
||||
end, "GET", "", "")
|
||||
if GetResourceState('ox_lib') ~= 'started' then
|
||||
print('^1 ox_lib Is A Depndancy, Not An Optional ')
|
||||
end
|
||||
end)
|
||||
ps.versionCheck('md-drugs', 'https://raw.githubusercontent.com/Mustachedom/md-drugs/refs/heads/hushhushmotherfucker/version.txt', 'https://github.com/Mustachedom/md-drugs/')
|
||||
+2
-2
@@ -164,7 +164,7 @@ RegisterServerEvent('md-drugs:server:fillneedle', function(num)
|
||||
if vh then
|
||||
if not GetRecipe(src, 'heroin', 'fillneedle', v.tier) then return end
|
||||
AddRep(src, 'heroin')
|
||||
Log(ps.getPlayerName(src) .. v.log, 'heroin')
|
||||
--Log(ps.getPlayerName(src) .. v.log, 'heroin')
|
||||
return
|
||||
end
|
||||
end
|
||||
@@ -176,7 +176,7 @@ end)
|
||||
|
||||
RegisterServerEvent('md-drugs:server:failheroin', function()
|
||||
local src = source
|
||||
Log(ps.getPlayerName(src) ..' Sucks And Burned Their Heroin', 'heroin')
|
||||
--Log(ps.getPlayerName(src) ..' Sucks And Burned Their Heroin', 'heroin')
|
||||
if Config.TierSystem then
|
||||
local itemList = {
|
||||
heroinvial = 1,
|
||||
|
||||
+60
-19
@@ -1,27 +1,68 @@
|
||||
local QBCore = exports['qb-core']:GetCoreObject()
|
||||
|
||||
local onRun = {}
|
||||
|
||||
local function setTimeout(identifier)
|
||||
if onRun[identifier] then
|
||||
CreateThread(function()
|
||||
Wait(10 * 60 * 1000)
|
||||
onRun[identifier] = nil
|
||||
end)
|
||||
end
|
||||
end
|
||||
RegisterServerEvent('md-drugs:server:givelean', function()
|
||||
local chance = math.random(1,100)
|
||||
local src = source
|
||||
local amount = math.random(1,5)
|
||||
if chance <= 50 then
|
||||
if AddItem(source, 'mdlean', amount) then
|
||||
Notifys(Lang.Lean.lean, "success")
|
||||
Log(GetName(source) .. ' Got ' .. amount .. ' Of Lean' , 'lean')
|
||||
end
|
||||
if not onRun[ps.getIdentifier(src)] then return ps.notify(src, Lang.lean.err, "error") end
|
||||
onRun[ps.getIdentifier(src)] = onRun[ps.getIdentifier(src)] + 1
|
||||
if math.random(1,100) <= 50 then
|
||||
ps.addItem(src, "mdlean", amount)
|
||||
else
|
||||
if AddItem(source, 'mdreddextro', amount) then
|
||||
Notifys(Lang.Lean.dextro, "success")
|
||||
Log(GetName(source) .. ' Got ' .. amount .. ' Of Red Dextro' , 'lean')
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
CUI('leancup', function(source, item)
|
||||
if Itemcheck(source, 'leancup', 1) then
|
||||
TriggerClientEvent('md-drugs:client:leancraft', source)
|
||||
ps.addItem(src, "mdreddextro", amount)
|
||||
end
|
||||
if onRun[ps.getIdentifier(src)] >= 4 then
|
||||
onRun[ps.getIdentifier(src)] = nil
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterServerEvent('md-drugs:server:finishcup', function(data)
|
||||
if not GetRecipe(source, 'lean','cups', data.item) then return end
|
||||
exports.ps_lib:registerCrafter({
|
||||
loc = GlobalState.MDDrugsLocs.MakeLean,
|
||||
recipes = {
|
||||
cupoflean = {
|
||||
amount = 1,
|
||||
time = 5000,
|
||||
anim = 'uncuff',
|
||||
recipe = {
|
||||
leancup = 1,
|
||||
mdlean = 1,
|
||||
sprunk = 1
|
||||
}
|
||||
},
|
||||
cupofdextro = {
|
||||
amount = 1,
|
||||
time = 5000,
|
||||
anim = 'uncuff',
|
||||
recipe = {
|
||||
leancup = 1,
|
||||
mdreddextro = 1,
|
||||
sprunk = 1
|
||||
}
|
||||
}
|
||||
},
|
||||
targetData = {
|
||||
size = {height = 1.0, width = 1.0, length = 1.0, rotation = 180.0},
|
||||
label = 'Make Lean',
|
||||
icon = 'fa-solid fa-mug-saucer',
|
||||
},
|
||||
})
|
||||
|
||||
ps.registerCallback('md-drugs:server:RegisterLean', function(source)
|
||||
local identifier = ps.getIdentifier(source)
|
||||
if not identifier then return false end
|
||||
if onRun[identifier] then
|
||||
return false
|
||||
else
|
||||
onRun[identifier] = 0
|
||||
setTimeout(identifier)
|
||||
return true
|
||||
end
|
||||
end)
|
||||
+39
-32
@@ -30,6 +30,9 @@ local Target = {
|
||||
{loc = vector3(-1370.77, -314.51, 39.58), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
|
||||
{loc = vector3(2409.59, 5012.45, 46.09), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
|
||||
},
|
||||
buyLSDkit = {
|
||||
{ped = 'g_f_y_families_01', loc = vector4(2598.47, 5033.06, 105.86, 283.51), l = 1.0, w = 1.0, rot = 283.51, gang = ""},
|
||||
},
|
||||
dryplant = { -- turn resin into powder
|
||||
{loc = vector3(-1353.77, -335.58, 43.92), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
|
||||
},
|
||||
@@ -54,15 +57,47 @@ local Target = {
|
||||
FillPrescription = { -- where to fill out your prescription
|
||||
{loc = vector3(2855.62, 4446.73, 48.53), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
|
||||
},
|
||||
DryOutMescaline = { -- where to dry out mescaline
|
||||
{loc = vector3(2638.22, 4237.93, 44.78), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
|
||||
},
|
||||
MakeLean = {
|
||||
{
|
||||
loc = vector3(2635.81, 4240.57, 45.32),
|
||||
checks = { -- these can be arrays like {'police', 'ambulance'} or just a single string like 'police'
|
||||
--gang = {},
|
||||
--item = {},
|
||||
--job = {},
|
||||
--citizenid = {}
|
||||
}
|
||||
},
|
||||
},
|
||||
CookMeth = {
|
||||
{loc = vector3(1006.09, -3200.59, -38.52), l = 1.0, w = 1.0, rot = 45.0, offset = vec3(4.79, 2.13, -0.41), rotation = vector3(0,0,0.0), gang = ""},
|
||||
},
|
||||
MethDials = {
|
||||
{loc = vector3(1007.89, -3201.17, -38.99),l = 1.0, w = 1.0, rot = 45.0, gang = ""},
|
||||
},
|
||||
MethSmash = {
|
||||
{loc = vector3(1012.04, -3194.96, -38.99), bucket = vector4(1012.86, -3194.13, -39.20, 90.00), l = 1.0, w = 1.0, rot = 45.0, offset = vec3(-3.143311, -1.666748, -1.010128), rotation = vector3(0,0,0.0), gang = ""},
|
||||
},
|
||||
BagMeth = {
|
||||
{loc = vector3(1014.25, -3194.93, -38.99), l = 1.0, w = 1.0, rot = 45.0, offset = vec3(-4.9, -1.70, -1.01), rotation = vector3(0,0,0.0), gang = ""},
|
||||
},
|
||||
MethEph = { -- get ephedrine
|
||||
{loc = vector3(3559.86, 3673.9, 28.13), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
|
||||
},
|
||||
Methace = { -- get acetone
|
||||
{loc = vector3(3535.41, 3661.05, 28.12), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
|
||||
},
|
||||
SyrupVendor = {
|
||||
{ped = 'a_m_m_farmer_01', loc = vector4(365.21, -578.77, 39.30, 347.23), l = 1.0, w = 1.0, rot = 347.23, gang = ""},
|
||||
},
|
||||
singleSpot = {
|
||||
|
||||
CokeTeleIn = vector3(198.16, -1276.92, 29.33), -- where you target to go inside coke
|
||||
CokeTeleOut = vector3(1088.81, -3187.57, -38.99), -- where you target to leave coke
|
||||
buylsdlabkit = vector4(2598.47, 5033.06, 105.86, 283.51), -- buy lab kit for lsd
|
||||
buyheroinlabkit = vector4(-1358.77, -339.12, 43.92, 302.13), -- buy lab kit for heroin
|
||||
buypress = vector3(845.82, -884.79, 25.18), -- buy lab kit for xtc
|
||||
DryOut = vector3(2638.22, 4237.93, 44.78), -- Place to dry out mescaline into usuable drug
|
||||
SyrupVendor = vector4(365.21, -578.77, 39.30, 347.23), -- where the mission ped starts
|
||||
weedTelein = vector3(244.74, 374.54, 105.74), -- where you target to tele in
|
||||
weedTeleout = vector3(1066.31, -3183.36, -39.16), -- where you target to tele out
|
||||
MakeButter = vector3(1045.48, -3198.49, -38.22), -- where you make cannabutter and baked edibles
|
||||
@@ -74,12 +109,7 @@ local Target = {
|
||||
truckspawn = vector4(1450.87, -1482.13, 63.22, 69.95), --- where the truck will spawn when you pay for it
|
||||
Payfortruck = vector3(1437.64, -1491.91, 63.62), --- where you pay for the truck
|
||||
},
|
||||
MethEph = { -- get ephedrine
|
||||
{loc = vector3(3559.86, 3673.9, 28.13), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
|
||||
},
|
||||
Methace = { -- get acetone
|
||||
{loc = vector3(3535.41, 3661.05, 28.12), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
|
||||
},
|
||||
|
||||
StartLoc = { -- where truck spawns for lean and meth missions
|
||||
vector3(-2307.22, 434.77, 174.47),
|
||||
vector3(614.75, 1786.26, 199.39),
|
||||
@@ -112,31 +142,8 @@ local Target = {
|
||||
}
|
||||
}
|
||||
GlobalState.MDDrugsLocs = Target
|
||||
function checkLoc(source, event, num)
|
||||
local ped = source
|
||||
local pos = GetPlayerPed(ped)
|
||||
local coord = GetEntityCoords(pos)
|
||||
local loc
|
||||
if type(num) == 'string' then
|
||||
loc = vector3(Target[event][num].x, Target[event][num].y, Target[event][num].z)
|
||||
else
|
||||
loc = Target[event][num].loc
|
||||
end
|
||||
local dist = #(coord - loc)
|
||||
if dist < 2.5 then
|
||||
Log(GetName(source) .. ' Triggered the table ' .. event .. ' Within The Correct Distance', 'locations')
|
||||
return true
|
||||
else
|
||||
Log(GetName(source) .. ' Triggered the table ' .. event .. ' Not Within The Correct Distance', 'locations')
|
||||
Notifys(source, 'You are not in the correct location', 'error')
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
local loc = Target.Travellingmerchant[math.random(1, #Target.Travellingmerchant)]
|
||||
ps.registerCallback('md-drugs:server:getLocs', function()
|
||||
return Target
|
||||
end)
|
||||
|
||||
ps.registerCallback('md-drugs:server:GetMerchant', function(source)
|
||||
return loc
|
||||
|
||||
+21
-18
@@ -30,7 +30,7 @@ RegisterServerEvent('md-drugs:server:getdiethylamide', function(num)
|
||||
local src = source
|
||||
if timedOut[src] then return end
|
||||
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.diethylamide[num].loc, 2.0) then
|
||||
Notifys(src, Lang.lsd.notinloc, "error")
|
||||
ps.notify(src, Lang.lsd.notinloc, "error")
|
||||
return
|
||||
end
|
||||
timeout(src, 3000)
|
||||
@@ -41,7 +41,7 @@ end)
|
||||
ps.createUseable('lsdlabkit', function(source, item)
|
||||
local src = source
|
||||
local placed, loc = ps.callback('md-drugs:client:setlsdlabkit', src)
|
||||
if placed then
|
||||
if placed then
|
||||
if ps.removeItem(src, 'lsdlabkit', 1) then
|
||||
table.insert(lsdTables, {
|
||||
owner = ps.getPlayerName(src),
|
||||
@@ -64,7 +64,7 @@ end
|
||||
|
||||
ps.registerCallback('md-drugs:server:removecleaningkit', function(source)
|
||||
local src = source
|
||||
return ps.removeItem(src,"cleaningkit", 1)
|
||||
return ps.removeItem(src, "cleaningkit", 1)
|
||||
end)
|
||||
|
||||
RegisterServerEvent('md-drugs:server:getlabkitback', function()
|
||||
@@ -89,18 +89,18 @@ RegisterServerEvent('md-drugs:server:failheating', function()
|
||||
ps.removeItem(src, 'lysergic_acid', 1)
|
||||
ps.removeItem(src, 'diethylamide', 1)
|
||||
ps.notify(src, ps.lang('prices.lsd.failed'), "error")
|
||||
Log(ps.getPlayerName(src) ..' Failed Basic LSD Like An Idiot!', 'lsd')
|
||||
--Log(ps.getPlayerName(src) ..' Failed Basic LSD Like An Idiot!', 'lsd')
|
||||
end)
|
||||
|
||||
|
||||
RegisterServerEvent('md-drugs:server:refinequalityacid', function()
|
||||
local src = source
|
||||
if not hasLabKit(src) then return end
|
||||
if not ps.itemCheck(src, 'lsd_one_vial', 1) then return end
|
||||
if not ps.hasItem(src, 'lsd_one_vial', 1) then return end
|
||||
if Config.TierSystem then
|
||||
local lsd = getRep(src, 'lsd')
|
||||
if ps.removeItem(src, 'lsd_one_vial', 1) then
|
||||
if lsd <= 30 then
|
||||
if lsd <= 30 then
|
||||
ps.addItem(src,'lsd_vial_two', 1)
|
||||
elseif lsd >= 31 and lsd <= 60 then
|
||||
ps.addItem(src,'lsd_vial_three', 1)
|
||||
@@ -112,7 +112,7 @@ if not ps.itemCheck(src, 'lsd_one_vial', 1) then return end
|
||||
ps.addItem(src,'lsd_vial_six', 1)
|
||||
end
|
||||
AddRep(src,'lsd')
|
||||
ps.log(ps.getPlayerName(src) ..' Refined Acid and Now Has A Rep Of ' .. lsd + 1 .. '!', 'lsd')
|
||||
--ps.log(ps.getPlayerName(src) ..' Refined Acid and Now Has A Rep Of ' .. lsd + 1 .. '!', 'lsd')
|
||||
end
|
||||
else
|
||||
local randomchance = math.random(1,100)
|
||||
@@ -128,7 +128,7 @@ if not ps.itemCheck(src, 'lsd_one_vial', 1) then return end
|
||||
else
|
||||
ps.addItem(src,'lsd_vial_six', 1)
|
||||
end
|
||||
ps.log(ps.getPlayerName(src) ..' Refined Acid!', 'lsd')
|
||||
--ps.log(ps.getPlayerName(src) ..' Refined Acid!', 'lsd')
|
||||
end
|
||||
end
|
||||
end)
|
||||
@@ -136,25 +136,28 @@ end)
|
||||
RegisterServerEvent('md-drugs:server:failrefinequality', function()
|
||||
local src = source
|
||||
if not hasLabKit(src) then return end
|
||||
if not ps.hasItem(src, 'lsd_one_vial', 1) then return end
|
||||
ps.removeItem(src,'lsd_one_vial', 1)
|
||||
ps.removeItem(src,'lsd_one_vial', 1)
|
||||
end)
|
||||
|
||||
|
||||
RegisterServerEvent('md-drugs:server:gettabpaper', function(num)
|
||||
local src = source
|
||||
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.gettabs[num].loc, 3.0) then return end
|
||||
if ps.removeMoney('cash', prices.tabcost * 10) then
|
||||
if ps.removeMoney(src, 'cash', prices.tabcost * 10) then
|
||||
ps.addItem(src,'tab_paper', 10)
|
||||
else
|
||||
ps.notify(src, Lang.lsd.broke, "error")
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterServerEvent('md-drugs:server:getlabkit', function()
|
||||
RegisterServerEvent('md-drugs:server:getlabkit', function(num)
|
||||
local src = source
|
||||
if not ps.checkDistance(src,'singleSpot', 'buylsdlabkit') then return end
|
||||
if ps.removeMoney('cash', prices.lsdlabkitcost) then
|
||||
if ps.hasItem(src,'lsdlabkit', 1) then
|
||||
ps.notify(src, ps.lang('lsd.havlabkit'), 'error')
|
||||
return
|
||||
end
|
||||
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.buyLSDkit[num].loc, 3.0) then return end
|
||||
if ps.removeMoney(src, 'cash', prices.lsdlabkitcost) then
|
||||
ps.addItem(src,'lsdlabkit', 1)
|
||||
else
|
||||
ps.notify(src, Lang.lsd.broke, "error")
|
||||
@@ -174,8 +177,8 @@ RegisterServerEvent('md-drugs:server:maketabpaper', function()
|
||||
{vial = 'lsd_vial_six', sheet = 'gratefuldeadsheet', log = 'Made A Maze Sheet'}
|
||||
}
|
||||
for k, v in ipairs (vialdata) do
|
||||
local check = ps.hasItem(src, v.vial)
|
||||
if check then
|
||||
local check = ps.hasItem(src, v.vial) and ps.hasItem(src, 'tab_paper')
|
||||
if check then
|
||||
if ps.removeItem(src, v.vial, 1) and ps.removeItem(src, 'tab_paper', 1) then
|
||||
ps.addItem(src, v.sheet, 1)
|
||||
end
|
||||
@@ -193,12 +196,12 @@ local sheets = {
|
||||
}
|
||||
|
||||
for k, v in pairs (sheets) do
|
||||
CUI(v.item, function(source)
|
||||
ps.createUseable(v.item, function(source)
|
||||
local src = source
|
||||
local math = math.random(1,10)
|
||||
if ps.removeItem(src, v.item, 1) then
|
||||
ps.addItem(src, v.recieve, math)
|
||||
ps.log(ps.getPlayerName(src) ..' Made ' .. math .. 'Tabs of ' .. v.recieve .. '!', 'lsd')
|
||||
--ps.log(ps.getPlayerName(src) ..' Made ' .. math .. 'Tabs of ' .. v.recieve .. '!', 'lsd')
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
|
||||
|
||||
RegisterNetEvent("md-drugs:server:drymescaline", function()
|
||||
RegisterNetEvent("md-drugs:server:drymescaline", function(num)
|
||||
local src = source
|
||||
if not checkLoc(src, 'singleSpot', 'DryOut') then return end
|
||||
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.DryOutMescaline[num].loc, 3.0) then
|
||||
ps.notify(src, "You are not in the right location", "error")
|
||||
return
|
||||
end
|
||||
if not GetRecipe(src, 'mescaline', 'dry', 'dried') then return end
|
||||
end)
|
||||
|
||||
CUI("driedmescaline", function(source, item)
|
||||
ps.createUseable("driedmescaline", function(source, item)
|
||||
local src = source
|
||||
if RemoveItem(src, "driedmescaline", 1) then
|
||||
if ps.removeItem(src, "driedmescaline", 1) then
|
||||
TriggerClientEvent("md-drugs:client:takemescaline", src)
|
||||
Log(GetName(source) .. ' Consumed Mescaline', 'consume')
|
||||
--Log(GetName(source) .. ' Consumed Mescaline', 'consume')
|
||||
end
|
||||
end)
|
||||
end)
|
||||
+37
-19
@@ -1,28 +1,38 @@
|
||||
local QBCore = exports['qb-core']:GetCoreObject()
|
||||
|
||||
RegisterServerEvent('md-drugs:server:startcook', function()
|
||||
local src = source
|
||||
if not GetRecipe(source, 'meth', 'cook', 'heat') then return end
|
||||
Notifys(src, "Adding Things To The Mix", "success")
|
||||
end)
|
||||
local onRun = {}
|
||||
|
||||
local function setTimeout(identifier)
|
||||
if onRun[identifier] then
|
||||
CreateThread(function()
|
||||
Wait(10 * 60 * 1000)
|
||||
onRun[identifier] = nil
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
RegisterServerEvent('md-drugs:server:givemethingridients', function()
|
||||
local src = source
|
||||
local chance = math.random(1,100)
|
||||
local src = source
|
||||
local amount = math.random(1,5)
|
||||
if chance <= 50 then
|
||||
if AddItem(src,'ephedrine', amount) then
|
||||
Log(GetName(src) .. ' Got ' .. amount .. ' Of Ephedrine', 'Meth')
|
||||
end
|
||||
if not onRun[ps.getIdentifier(src)] then return ps.notify(src, Lang.lean.err, "error") end
|
||||
onRun[ps.getIdentifier(src)] = onRun[ps.getIdentifier(src)] + 1
|
||||
if math.random(1,100) <= 50 then
|
||||
ps.addItem(src, "ephedrine", amount)
|
||||
else
|
||||
if AddItem(src, 'acetone', amount) then
|
||||
Log(GetName(src) .. ' Got ' .. amount .. ' Of Acetone', 'Meth')
|
||||
end
|
||||
end
|
||||
ps.addItem(src, "acetone", amount)
|
||||
end
|
||||
if onRun[ps.getIdentifier(src)] >= 4 then
|
||||
onRun[ps.getIdentifier(src)] = nil
|
||||
end
|
||||
end)
|
||||
RegisterServerEvent('md-drugs:server:startcook', function(num)
|
||||
local src = source
|
||||
if not GetRecipe(source, 'meth', 'cook', 'heat') then return end
|
||||
ps.notify(src, "Adding Things To The Mix", "success")
|
||||
end)
|
||||
|
||||
RegisterServerEvent('md-drugs:server:getmeth', function()
|
||||
RegisterServerEvent('md-drugs:server:getmeth', function(num)
|
||||
local src = source
|
||||
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.BagMeth[num].loc, 2.5) then return end
|
||||
if not GetRecipe(src, 'meth', 'bag', 'bags') then return end
|
||||
end)
|
||||
|
||||
@@ -30,7 +40,7 @@ RegisterServerEvent('md-drugs:server:geteph', function(num)
|
||||
local src = source
|
||||
if not checkLoc(src, 'MethEph', num) then return end
|
||||
if AddItem(src, 'ephedrine', 1) then
|
||||
Notifys(src, 'Got Ephedrine!', "success")
|
||||
ps.notify(src, 'Got Ephedrine!', "success")
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -38,6 +48,14 @@ RegisterServerEvent('md-drugs:server:getace', function(num)
|
||||
local src = source
|
||||
if not checkLoc(src, 'Methace', num) then return end
|
||||
if AddItem(src, 'acetone', 1) then
|
||||
Log(GetName(src) .. ' Got ' .. 1 .. 'Of Acetone', 'Meth')
|
||||
--Log(GetName(src) .. ' Got ' .. 1 .. 'Of Acetone', 'Meth')
|
||||
end
|
||||
end)
|
||||
|
||||
ps.registerCallback('md-drugs:server:startcook', function(source, num)
|
||||
local src = source
|
||||
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.CookMeth[num].loc, 2.5) then return false end
|
||||
local recipe = GetRecipe(src, 'meth', 'cook', 'heat')
|
||||
ps.debug(recipe)
|
||||
return recipe
|
||||
end)
|
||||
+4
-4
@@ -8,10 +8,10 @@ ps.registerCallback('md-drugs:server:payfortruck', function()
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
if Player.Functions.RemoveMoney('cash', prices.payfortruck) or Player.Functions.RemoveMoney('bank', prices.payfortruck) then
|
||||
Log(GetName(src) .. ' Rented A Van For OxyRuns', 'oxy')
|
||||
--Log(GetName(src) .. ' Rented A Van For OxyRuns', 'oxy')
|
||||
return true
|
||||
else
|
||||
Notifys(src, Lang.oxy.broke, "error")
|
||||
ps.notify(src, Lang.oxy.broke, "error")
|
||||
return false
|
||||
end
|
||||
end)
|
||||
@@ -29,13 +29,13 @@ RegisterServerEvent('md-drugs:server:giveoxybox', function()
|
||||
}
|
||||
local item = itemList[math.random(1, #itemList)]
|
||||
if chance <= prices.hotchance then
|
||||
Notifys(src, Lang.oxy.hot, "error")
|
||||
ps.notify(src, Lang.oxy.hot, "error")
|
||||
Player.Functions.AddMoney("cash", cash * 0.5)
|
||||
if itemchance <= prices.itemChance then
|
||||
AddItem(src, item.item, item.amount)
|
||||
end
|
||||
else
|
||||
Notifys(Lang.oxy.next, "success")
|
||||
ps.notify(Lang.oxy.next, "success")
|
||||
TriggerClientEvent("md-drugs:client:getoxylocationroute", src)
|
||||
Player.Functions.AddMoney("cash", cash)
|
||||
if itemchance <= prices.itemChance then
|
||||
|
||||
+4
-4
@@ -6,7 +6,7 @@ local function GetJob(source)
|
||||
if Player.PlayerData.job.type == 'ems' then
|
||||
return true
|
||||
else
|
||||
Notifys(src, 'You Must Be EMS To Do This', 'error')
|
||||
ps.notify(src, 'You Must Be EMS To Do This', 'error')
|
||||
return false
|
||||
end
|
||||
end
|
||||
@@ -54,8 +54,8 @@ CUI(d, function(source, item)
|
||||
if d == k then
|
||||
RemoveItem(src, d, 1)
|
||||
AddItem(src, v, math.random(10,30))
|
||||
Notifys(src,Lang.Pharma.unbottle, "success")
|
||||
Log(GetName(src) .. ' Unbottled 30 Of ' .. v .. '!', 'pharma')
|
||||
ps.notify(src,Lang.Pharma.unbottle, "success")
|
||||
--Log(GetName(src) .. ' Unbottled 30 Of ' .. v .. '!', 'pharma')
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -73,5 +73,5 @@ RegisterServerEvent('md-drugs:server:fillprescription', function()
|
||||
break
|
||||
end
|
||||
end
|
||||
Log(GetName(src) .. ' Filled A Prescription!', 'pharma')
|
||||
--Log(GetName(src) .. ' Filled A Prescription!', 'pharma')
|
||||
end)
|
||||
@@ -102,7 +102,7 @@ local plantData = {
|
||||
plants.cocaine[loc].taken = false
|
||||
GlobalState.CocaPlant = plants.cocaine
|
||||
TriggerClientEvent('coke:respawnCane', -1, loc)
|
||||
Log('Coca Plant Respawned At ' .. plants.cocaine[loc].location, 'coke')
|
||||
--Log('Coca Plant Respawned At ' .. plants.cocaine[loc].location, 'coke')
|
||||
end)
|
||||
end,
|
||||
allow = Config.Drugs.cocaine
|
||||
@@ -122,7 +122,7 @@ local plantData = {
|
||||
plants.heroin[loc].taken = false
|
||||
GlobalState.PoppyPlants = plants.heroin
|
||||
TriggerClientEvent('heroin:respawnCane', -1, loc)
|
||||
Log('Heroin Plant Respawned At ' .. plants.heroin[loc].location, 'heroin')
|
||||
--Log('Heroin Plant Respawned At ' .. plants.heroin[loc].location, 'heroin')
|
||||
end)
|
||||
end,
|
||||
allow = Config.Drugs.heroin
|
||||
@@ -142,7 +142,7 @@ local plantData = {
|
||||
plants.mescaline[loc].taken = false
|
||||
GlobalState.Mescaline = plants.mescaline
|
||||
TriggerClientEvent('Mescaline:respawnCane', -1, loc)
|
||||
Log('Mescaline Plant Respawned At ' .. plants.mescaline[loc].location, 'mescaline')
|
||||
--Log('Mescaline Plant Respawned At ' .. plants.mescaline[loc].location, 'mescaline')
|
||||
end)
|
||||
end,
|
||||
allow = Config.Drugs.mescaline
|
||||
@@ -162,7 +162,7 @@ local plantData = {
|
||||
plants.shrooms[loc].taken = false
|
||||
GlobalState.shrooms = plants.shrooms
|
||||
TriggerClientEvent('shrooms:respawnCane', -1, loc)
|
||||
Log('Shroom Respawned At ' .. plants.shrooms[loc].location, 'shrooms')
|
||||
--Log('Shroom Respawned At ' .. plants.shrooms[loc].location, 'shrooms')
|
||||
end)
|
||||
end,
|
||||
allow = Config.Drugs.shrooms
|
||||
@@ -182,7 +182,7 @@ local plantData = {
|
||||
plants.weed[loc].taken = false
|
||||
GlobalState.WeedPlant = plants.weed
|
||||
TriggerClientEvent('weed:respawnCane', -1, loc)
|
||||
Log('Weed Plant Respawned At ' .. plants.weed[loc].location, 'weed')
|
||||
--Log('Weed Plant Respawned At ' .. plants.weed[loc].location, 'weed')
|
||||
end)
|
||||
end,
|
||||
allow = Config.Drugs.weed
|
||||
|
||||
+2
-1
@@ -136,7 +136,8 @@ local recipe = {
|
||||
}
|
||||
|
||||
function GetRecipe(source, type, method, tier)
|
||||
ps.craftItem(source,recipe[type][method][tier])
|
||||
print(ps.craftItem(source,recipe[type][method][tier]))
|
||||
return ps.craftItem(source,recipe[type][method][tier])
|
||||
end
|
||||
|
||||
ps.registerCallback('md-drugs:server:GetRecipe', function(source, type, cat)
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@ RegisterServerEvent("md-drugs:server:purchaseGoods", function(amount, money, ite
|
||||
if not table[i].price == price then return end
|
||||
if Player.Functions.RemoveMoney(tostring(money), tonumber(table[i].price) * tonumber(amount)) then
|
||||
AddItem(src, item, amount)
|
||||
Log(GetName(src) .. ' Bought ' .. amount .. ' Of ' .. item .. ' For ' .. tonumber(price) * tonumber(amount) .. '!', 'merchant')
|
||||
--Log(GetName(src) .. ' Bought ' .. amount .. ' Of ' .. item .. ' For ' .. tonumber(price) * tonumber(amount) .. '!', 'merchant')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
+2
-2
@@ -3,8 +3,8 @@ CUI('shrooms', function(source, item)
|
||||
local src = source
|
||||
if TriggerClientEvent('md-drugs:client:takeshrooms', src, item.name) then
|
||||
RemoveItem(src, 'shrooms', 1)
|
||||
Log(GetName(source) .. ' Took Some Mushrooms', 'shrooms')
|
||||
Notifys(src, 'You Took Some Shrooms!', 'success')
|
||||
--Log(GetName(source) .. ' Took Some Mushrooms', 'shrooms')
|
||||
ps.notify(src, 'You Took Some Shrooms!', 'success')
|
||||
end
|
||||
end)
|
||||
|
||||
+4
-4
@@ -7,9 +7,9 @@ RegisterServerEvent('md-drugs:server:dryoutweed', function()
|
||||
local Player = getPlayer(src)
|
||||
if RemoveItem(src,"wetcannabis", 1) then
|
||||
AddItem(src,"drycannabis", 1)
|
||||
Log(GetName(source) .. ' Dried Weed', 'weed')
|
||||
--Log(GetName(source) .. ' Dried Weed', 'weed')
|
||||
else
|
||||
Notifys(src, Lang.Weed.nodry, "error")
|
||||
ps.notify(src, Lang.Weed.nodry, "error")
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -49,7 +49,7 @@ CUI("dabrig", function(source, item)
|
||||
TriggerClientEvent("md-drugs:client:dodabs", src)
|
||||
end
|
||||
else
|
||||
Notifys(src, 'You Need A Butane Torch', 'error')
|
||||
ps.notify(src, 'You Need A Butane Torch', 'error')
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -57,7 +57,7 @@ CUI("weedgrinder", function(source, item)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
local has = Player.Functions.GetItemByName("drycannabis")
|
||||
if not has then Notifys(src, 'You Need Dried Cannabis', 'error') return end
|
||||
if not has then ps.notify(src, 'You Need Dried Cannabis', 'error') return end
|
||||
local check = ps.callback('md-drugs:client:uncuff', src, 'Grinding Weed')
|
||||
if not check then return end
|
||||
if RemoveItem(src, "drycannabis",1 ) then
|
||||
|
||||
@@ -19,10 +19,10 @@ for k, v in pairs (burners) do
|
||||
CUI(k, function(source, item)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
if getCops() < Config.PoliceCount then return Notifys(src, Lang.Wholesale.na, 'error') end
|
||||
if getCops() < Config.PoliceCount then return ps.notify(src, Lang.Wholesale.na, 'error') end
|
||||
for m, d in pairs (active) do
|
||||
if d.cid == Player.PlayerData.citizenid then
|
||||
return Notifys(src, Lang.Wholesale.al, 'error' )
|
||||
return ps.notify(src, Lang.Wholesale.al, 'error' )
|
||||
end
|
||||
end
|
||||
local tab = ''
|
||||
|
||||
+7
-7
@@ -125,9 +125,9 @@ RegisterServerEvent('md-drugs:server:buypress', function()
|
||||
|
||||
if Player.Functions.RemoveMoney("cash", 20000) then
|
||||
AddItem(src, "singlepress", 1)
|
||||
Log(GetName(source) .. ' Bought A Pill Press', 'xtc')
|
||||
--Log(GetName(source) .. ' Bought A Pill Press', 'xtc')
|
||||
else
|
||||
Notifys(Lang.xtc.cash, "error")
|
||||
ps.notify(Lang.xtc.cash, "error")
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -140,7 +140,7 @@ RegisterServerEvent('md-drugs:server:upgradepress', function(data)
|
||||
elseif data == 'quad' then
|
||||
if not GetRecipe(src, 'xtc', 'press', 'quad') then return end
|
||||
else
|
||||
Notifys(src, 'huh', 'error')
|
||||
ps.notify(src, 'huh', 'error')
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -170,7 +170,7 @@ RegisterServerEvent('md-drugs:server:stampwhite', function(num)
|
||||
elseif RemoveItem(src, "white_xtc4", 1) then
|
||||
AddItem(src, four[chance], 1)
|
||||
else
|
||||
Notifys('You Dont Have Unstamped White Pills', 'error')
|
||||
ps.notify('You Dont Have Unstamped White Pills', 'error')
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -192,7 +192,7 @@ RegisterServerEvent('md-drugs:server:stampred', function(num)
|
||||
elseif RemoveItem(src, "red_xtc4", 1) then
|
||||
AddItem(src, four[chance], 1)
|
||||
else
|
||||
Notifys('You Dont Have Unstamped red Pills', 'error')
|
||||
ps.notify('You Dont Have Unstamped red Pills', 'error')
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -214,7 +214,7 @@ RegisterServerEvent('md-drugs:server:stamporange', function(num)
|
||||
elseif RemoveItem(src, "orange_xtc4", 1) then
|
||||
AddItem(src, four[chance], 1)
|
||||
else
|
||||
Notifys('You Dont Have Unstamped orange Pills', 'error')
|
||||
ps.notify('You Dont Have Unstamped orange Pills', 'error')
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -235,7 +235,7 @@ RegisterServerEvent('md-drugs:server:stampblue', function(num)
|
||||
elseif RemoveItem(src, "blue_xtc4", 1) then
|
||||
AddItem(src, four[chance], 1)
|
||||
else
|
||||
Notifys('You Dont Have Unstamped blue Pills', 'error')
|
||||
ps.notify('You Dont Have Unstamped blue Pills', 'error')
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
Reference in new issue
Block a user