finished locales EN

This commit is contained in:
Mustache Dom committed 2025-08-09 03:10:00 -06:00
1 parent 37f86bf50d
commit 683eaff7de
46 files changed
+949 -1033

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
local function spawn()
local location, menus = ps.callback('md-drugs:server:GetMerchant')
local model = 's_m_m_trucker_01'
ps.requestModel(model)
local ped = CreatePed(4, model, location.x, location.y, location.z, location.w, false, true)
Freeze(ped, true, location.w)
ps.entityTarget(ped, {
{
label = ps.lang('merchant.targetOpen'),
action = function()
local options = {}
for k, v in pairs (menus) do
options[#options+1] = {
title = ps.getLabel(k),
description = '$'..v,
action = function()
ps.triggerServerEvent('md-drugs:server:purchaseGoods', k)
end
}
end
ps.menu('Travelling Merchant', 'Travelling Merchant', options)
end
}
})
end
spawn()
-22
View File
@@ -87,25 +87,3 @@ function AlienEffect()
StopScreenEffect("DrugsMichaelAliensFight") StopScreenEffect("DrugsMichaelAliensFight")
StopScreenEffect("DrugsMichaelAliensFightOut") StopScreenEffect("DrugsMichaelAliensFightOut")
end end
function SetUpPeds()
AddRelationshipGroup('setups')
local ped = GetEntityCoords(PlayerPedId())
local peds = {
{x = ped.x+3, y = ped.y-5, z = ped.z-1, },
{x = ped.x+6, y = ped.y-10, z = ped.z-1,},
{x = ped.x+-2,y = ped.y+5, z = ped.z-1,},
{x = ped.x+8, y = ped.y-12, z = ped.z-1,},
{x = ped.x+5, y = ped.y-2, z = ped.z-1, },
{x = ped.x+2, y = ped.y-20, z = ped.z-1,},
{x = ped.x+1, y = ped.y-10, z = ped.z-1,},
}
for i = 1, #peds do
local k = peds[i]
i = CreatePed(0, "g_m_y_famdnf_01", k.x, k.y, k.z, 90.0, true, true)
SetPedRelationshipGroupHash(i, 'setups')
GiveWeaponToPed(i, "weapon_pistol", 1, false, true)
TaskCombatPed(i, PlayerPedId(), 0, 16)
SetPedCombatAttributes(i, 46, true)
end
end
+15 -9
View File
@@ -114,14 +114,14 @@ end
for k, v in pairs (locations.MakePowder) do for k, v in pairs (locations.MakePowder) do
ps.boxTarget('cocaplant'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, { ps.boxTarget('cocaplant'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
{ {
label = ps.lang('.targets.coke.pick'), label = ps.lang('coke.makePow'),
icon = 'fa-solid fa-seedling', icon = 'fa-solid fa-seedling',
action = function() action = function()
if not ps.hasItem('coca_leaf') then if not ps.hasItem('coca_leaf') then
ps.notify('You Need A Coke Leaf') ps.notify(ps.lang('coke.noleaf'), 'error')
return return
end end
if not ps.progressbar(ps.lang('Coke.makepow'), 4000, 'uncuff') then return end if not ps.progressbar(ps.lang('coke.makePow'), 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:makepowder", k) TriggerServerEvent("md-drugs:server:makepowder", k)
end, end,
canInteract = function() canInteract = function()
@@ -134,7 +134,7 @@ end
for k, v in pairs (locations.CuttingCoke) do for k, v in pairs (locations.CuttingCoke) do
ps.boxTarget('cutcoke'..k, v.loc, {length = 1.0, width = 1.0, height = 1.0, rotation = 180.0}, { ps.boxTarget('cutcoke'..k, v.loc, {length = 1.0, width = 1.0, height = 1.0, rotation = 180.0}, {
{ {
label = ps.lang('targets.coke.cut'), label = ps.lang('coke.targetCutCoke'),
icon = 'fa-solid fa-mortar-pestle', icon = 'fa-solid fa-mortar-pestle',
action = function() action = function()
CutCoke(v.loc, v.offset, v.rotation) CutCoke(v.loc, v.offset, v.rotation)
@@ -151,7 +151,7 @@ end
for k, v in pairs (locations.BaggingCoke) do for k, v in pairs (locations.BaggingCoke) do
ps.boxTarget('bagcoke'..k, v.loc, {length = 1.0, width = 1.0, height = 1.0, rotation = 180.0}, { ps.boxTarget('bagcoke'..k, v.loc, {length = 1.0, width = 1.0, height = 1.0, rotation = 180.0}, {
{ {
label = ps.lang('targets.coke.bag'), label = ps.lang('coke.targetBagCoke'),
icon = 'fa-solid fa-sack-xmark', icon = 'fa-solid fa-sack-xmark',
action = function() action = function()
BagCoke(v.loc, v.offset, v.rotation) BagCoke(v.loc, v.offset, v.rotation)
@@ -169,19 +169,25 @@ for k, v in pairs (locations.cokeTele) do
ps.boxTarget('coke_tele'..k, v.inside, {length = v.l, width = v.w, heading = v.rot}, { ps.boxTarget('coke_tele'..k, v.inside, {length = v.l, width = v.w, heading = v.rot}, {
{ {
icon = 'fa-solid fa-door-open', icon = 'fa-solid fa-door-open',
label = ps.lang('targets.coke.telein'), label = ps.lang('coke.teleOut'),
action = function() action = function()
SetEntityCoords(PlayerPedId(), v.outside) SetEntityCoords(PlayerPedId(), v.outside)
end end,
canInteract = function()
return handleGang(v.gang)
end
} }
}) })
ps.boxTarget('coke_teleout'..k, v.outside, {length = v.l, width = v.w, heading = v.rot}, { ps.boxTarget('coke_teleout'..k, v.outside, {length = v.l, width = v.w, heading = v.rot}, {
{ {
icon = 'fa-solid fa-door-closed', icon = 'fa-solid fa-door-closed',
label = ps.lang('targets.coke.teleout'), label = ps.lang('coke.teleIn'),
action = function() action = function()
SetEntityCoords(PlayerPedId(), v.inside) SetEntityCoords(PlayerPedId(), v.inside)
end end,
canInteract = function()
return handleGang(v.gang)
end
} }
}) })
end end
+1 -3
View File
@@ -1,7 +1,7 @@
ps.registerCallback('md-drugs:client:consumedrugs', function(time, effect, anim, progresstext, status, item) ps.registerCallback('md-drugs:client:consumedrugs', function(time, effect, anim, progresstext, status, item)
if not progressbar(progresstext .. GetLabel(item).. "!", time, anim ) then return end if not progressbar(progresstext .. ps.getLabel(item).. "!", time, anim ) then return end
for k, v in pairs (status) do for k, v in pairs (status) do
if k == 'health' then if k == 'health' then
local cur = GetEntityHealth(PlayerPedId()) local cur = GetEntityHealth(PlayerPedId())
@@ -56,7 +56,5 @@ RegisterNetEvent('md-drugs:client:applyFeeling', function(effect)
CokeBaggyEffect() CokeBaggyEffect()
elseif effect == "trevor" then elseif effect == "trevor" then
TrevorEffect() TrevorEffect()
else
end end
end) end)
+8 -8
View File
@@ -10,7 +10,7 @@ end
local function sellDrug(item, amount, price, targ) local function sellDrug(item, amount, price, targ)
-- PoliceCall(20) -- PoliceCall(20)
if ps.vehicleData() then if ps.vehicleData() then
ps.notify(ps.lang('Cornerselling.inveh', 'error')) ps.notify(ps.lang('Cornerselling.inVeh'), 'error')
walkAway(targ) walkAway(targ)
return return
end end
@@ -47,7 +47,7 @@ local function findPed()
buyers[targ] = true buyers[targ] = true
ps.drawText('Waiting For Customer') ps.drawText(ps.lang('Cornerselling.wait'))
repeat repeat
Wait(1000) Wait(1000)
@@ -89,7 +89,7 @@ local function Cornersell()
return return
end end
ps.drawText('Searching For Nearby Customers') ps.drawText(ps.lang('Cornerselling.searching'))
local targ = findPed() local targ = findPed()
local data = ps.callback('md-drugs:server:cornerselling:getAvailableDrugs', targ) local data = ps.callback('md-drugs:server:cornerselling:getAvailableDrugs', targ)
@@ -105,7 +105,7 @@ local function Cornersell()
local got = false local got = false
ps.entityTarget(targ, { ps.entityTarget(targ, {
{ {
label = "Take Back Drugs", label = ps.lang('Cornerselling.targetTakeBack'),
icon ="fa-solid fa-money-bill", icon ="fa-solid fa-money-bill",
action = function() action = function()
got = true got = true
@@ -124,7 +124,7 @@ local function Cornersell()
FreezeEntityPosition(targ, true) FreezeEntityPosition(targ, true)
ps.entityTarget(data.ped, { ps.entityTarget(data.ped, {
{ {
label = string.format(ps.lang('targets.CornerSell.sell', data.amount, ps.getLabel(data.item), data.price)), label = string.format(ps.lang('Cornerselling.targetSell'), data.amount, ps.getLabel(data.item), data.price),
icon ="fa-solid fa-money-bill", icon ="fa-solid fa-money-bill",
action = function() action = function()
sellDrug(data.item, data.amount, data.price, targ) sellDrug(data.item, data.amount, data.price, targ)
@@ -137,7 +137,7 @@ local function Cornersell()
end, end,
}, },
{ {
label = ps.lang('targets.CornerSell.deny'), label = ps.lang('Cornerselling.targetDeny'),
icon = "fa-solid fa-person-harassing", icon = "fa-solid fa-person-harassing",
action = function() action = function()
deny(targ) deny(targ)
@@ -161,14 +161,14 @@ RegisterNetEvent('md-drugs:client:cornerselling', function()
ps.notify(ps.lang('Cornerselling.stopped', 'error')) ps.notify(ps.lang('Cornerselling.stopped', 'error'))
else else
sell = true sell = true
ps.notify(ps.lang('Cornerselling.started', 'success')) ps.notify(ps.lang('Cornerselling.start', 'success'))
Cornersell() Cornersell()
end end
end) end)
CreateThread(function() CreateThread(function()
for k, v in pairs (QBConfig.NoSellZones) do for k, v in pairs (QBConfig.NoSellZones) do
local box = lib.zones.box({ coords = v.loc, size = vec3(v.width, v.length, v.height), rotation = 180.0, debug = false, local box = ps.zones.box({ coords = v.loc, size = vec3(v.width, v.length, v.height), rotation = 180.0, debug = false,
onEnter = function() inZone = true end, onExit = function() inZone = false end}) onEnter = function() inZone = true end, onExit = function() inZone = false end})
end end
end) end)
+4 -4
View File
@@ -2,12 +2,12 @@ local locations = ps.callback('md-drugs:server:GetCrackLocations')
for k, v in pairs (locations.makecrack) do for k, v in pairs (locations.makecrack) do
ps.boxTarget('makeCrack'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, { ps.boxTarget('makeCrack'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
{ {
label = ps.lang('targets.crack.makecrack'), label = ps.lang('crack.targetMake'),
icon = 'fa-solid fa-temperature-high', icon = 'fa-solid fa-temperature-high',
action = function() action = function()
if not ps.hasItem('bakingsoda') then return end if not ps.hasItem('bakingsoda') then return end
if not minigame() then TriggerServerEvent("md-drugs:server:failcrackone", k) return end if not minigame() then TriggerServerEvent("md-drugs:server:failcrackone", k) return end
if not ps.progressbar(ps.lang('Crack.makecrack'), 4000, 'uncuff') then return end if not ps.progressbar(ps.lang('crack.cook'), 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:makecrack", k) TriggerServerEvent("md-drugs:server:makecrack", k)
end, end,
canInteract = function() canInteract = function()
@@ -21,11 +21,11 @@ end
for k, v in pairs (locations.bagcrack) do for k, v in pairs (locations.bagcrack) do
ps.boxTarget('bagCrack'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, { ps.boxTarget('bagCrack'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
{ {
label = ps.lang('targets.crack.bagcrack'), label = ps.lang('crack.targetBag'),
icon = 'fa-solid fa-weight-scale', icon = 'fa-solid fa-weight-scale',
action = function() action = function()
if not ps.hasItem('empty_weed_bag') then return end if not ps.hasItem('empty_weed_bag') then return end
if not ps.progressbar(ps.lang('Crack.bagcrack'), 4000, 'uncuff') then return end if not ps.progressbar(ps.lang('crack.bag'), 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:bagcrack", k) TriggerServerEvent("md-drugs:server:bagcrack", k)
end, end,
canInteract = function() canInteract = function()
+38 -23
View File
@@ -1,33 +1,48 @@
local isActive = false local isActive = false
local dealer = {} local dealer = {}
RegisterNetEvent('md-drugs:client:opendealermenu', function()
local rep = GetRep()
makeMenu('dealermenu', rep)
lib.showContext('dealermenu')
end)
local function SpawnDealer() local function SpawnDealer()
local getDealers = ps.callback('md-drugs:server:getDealers') local getDealers = ps.callback('md-drugs:server:getDealers')
for k,v in pairs(getDealers) do for k,v in pairs(getDealers) do
local Ped = "g_m_y_famdnf_01" local Ped = "g_m_y_famdnf_01"
lib.requestModel(Ped, Config.RequestModelTime) ps.requestModel(Ped, Config.RequestModelTime)
local loc = json.decode(v.coords) local loc = json.decode(v.coords)
dealer[k] = CreatePed(0, Ped,loc.x,loc.y, loc.z-1, loc.h, false, false) dealer[k] = CreatePed(0, Ped,loc.x,loc.y, loc.z-1, loc.h, false, false)
Freeze(dealer[k], true, loc.h) Freeze(dealer[k], true, loc.h)
AddMultiModel(dealer[k], { ps.entityTarget(dealer[k], {
{ icon = 'fas fa-user-secret', label = string.format(Lang.targets.Delivery.Deliver, v.name), {
action = function() icon = 'fas fa-user-secret',
local bool, item, amount, coords = ps.callback('md-drugs:server:GetDeliveryItem', false, k) label = ps.lang('Deliveries.targetGetDel'),
if bool then action = function()
Email(Lang.Delivery.emailn, Lang.Delivery.emailsub, string.format(Lang.Delivery.emailcon, amount, GetLabel(item))) local bool, item, amount, coords = ps.callback('md-drugs:server:GetDeliveryItem', false, k)
TriggerEvent('md-drugs:client:setLocation', {bool = bool, item = item, amount = amount, coords = coords}) if bool then
end TriggerEvent('md-drugs:client:setLocation', {bool = bool, item = item, amount = amount, coords = coords})
end, end
}, end,
{ icon = "fa-solid fa-store", label = string.format(Lang.targets.Delivery.open, v.name), },
action = function() TriggerEvent('md-drugs:client:opendealermenu') end, {
}}, dealer[k]) icon = "fa-solid fa-store",
label = ps.lang('Deliveries.targetOpenShop'),
action = function()
local rep = GetRep()
local items = ps.callback('md-drugs:server:dealerList')
local options = {}
for m, d in pairs (items) do
if rep.dealerrep >= d.minrep then
options[#options+1] = {
title = ps.getLabel(d.name),
description = '$' .. d.price,
icon = ps.getImage(d.name),
action = function()
TriggerServerEvent('md-drugs:server:buyItemDealer', m)
end,
}
end
end
ps.menu(ps.lang('Deliveries.shopHeader'), ps.lang('Deliveries.shopHeader'), options)
end,
}
})
end end
end end
@@ -46,11 +61,11 @@ RegisterNetEvent('md-drugs:client:setLocation', function(data)
isActive = true isActive = true
local Buyer = CreatePed(0, "g_m_y_famdnf_01",coord.x, coord.y, coord.z-1, coord.w, false, false) local Buyer = CreatePed(0, "g_m_y_famdnf_01",coord.x, coord.y, coord.z-1, coord.w, false, false)
Freeze(Buyer, true, coord.w) Freeze(Buyer, true, coord.w)
AddSingleModel(Buyer, { ps.entityTarget(Buyer, {
icon = 'fas fa-user-secret', icon = 'fas fa-user-secret',
label = Lang.targets.Delivery.hand, label = ps.lang('Deliveries.targetHandOff'),
action = function() action = function()
if not progressbar(Lang.Delivery.pack, 4000, 'uncuff') then return end if not progressbar(ps.lang('Deliveries.delivering'), 4000, 'uncuff') then return end
isActive = false isActive = false
DeletePed(Buyer) DeletePed(Buyer)
TriggerServerEvent('md-drugs:server:giveDeliveryItems', data.item, data.amount) TriggerServerEvent('md-drugs:server:giveDeliveryItems', data.item, data.amount)
+26 -124
View File
@@ -13,49 +13,23 @@ function loadParticle(dict)
SetPtfxAssetNextCall(dict) SetPtfxAssetNextCall(dict)
end end
function LoadModel(hash)
RequestModel(hash)
while not HasModelLoaded(hash) do
Wait(0)
end
end
function minigame() function minigame()
local time = 0 local time = 0
local game = Config.Minigames local game = Config.Minigames
if minigametype == 'ps_circle' then if minigametype == 'ps_circle' then
local check local check = exports['ps-ui']:Circle(false, game['ps_circle'].amount, game['ps_circle'].speed)
exports['ps-ui']:Circle(function(success)
check = success
end, game['ps_circle'].amount, game['ps_circle'].speed)
return check return check
elseif minigametype == 'ps_maze' then elseif minigametype == 'ps_maze' then
local check local check = exports['ps-ui']:Maze(false, game['ps_maze'].timelimit)
exports['ps-ui']:Maze(function(success)
check = success
end, game['ps_maze'].timelimit)
repeat Wait(10) until check ~= nil
return check return check
elseif minigametype == 'ps_scrambler' then elseif minigametype == 'ps_scrambler' then
local check local check = exports['ps-ui']:Scrambler(false, game['ps_scrambler'].type, game['ps_scrambler'].time, game['ps_scrambler'].mirrored)
exports['ps-ui']:Scrambler(function(success)
check = success
end, game['ps_scrambler'].type, game['ps_scrambler'].time, game['ps_scrambler'].mirrored)
repeat Wait(10) until check ~= nil
return check return check
elseif minigametype == 'ps_var' then elseif minigametype == 'ps_var' then
local check local check = exports['ps-ui']:VarHack(false, game['ps_var'].numBlocks, game['ps_var'].time)
exports['ps-ui']:VarHack(function(success)
check = success
end, game['ps_var'].numBlocks, game['ps_var'].time)
repeat Wait(10) until check ~= nil
return check return check
elseif minigametype == 'ps_thermite' then elseif minigametype == 'ps_thermite' then
local check local check = exports['ps-ui']:Thermite(false, game['ps_thermite'].time, game['ps_thermite'].gridsize, game['ps_thermite'].incorrect)
exports['ps-ui']:Thermite(function(success)
check = success
end, game['ps_thermite'].time, game['ps_thermite'].gridsize, game['ps_thermite'].incorrect)
repeat Wait(10) until check ~= nil
return check return check
elseif minigametype == 'ox' then elseif minigametype == 'ox' then
local success = lib.skillCheck(game['ox'], {'1', '2', '3', '4'}) local success = lib.skillCheck(game['ox'], {'1', '2', '3', '4'})
@@ -129,63 +103,6 @@ function sorter(sorting, value)
table.sort(sorting, function(a, b) return a[value] < b[value] end) table.sort(sorting, function(a, b) return a[value] < b[value] end)
end end
function makeMenu(name, rep)
local menu = {}
local data = ps.callback('md-drugs:server:menu', name)
for k, v in pairs (data.table) do
local allow = false
if rep == nil then
allow = true
else
if rep.dealerrep >= v.minrep then allow = true end
end
if allow then
menu[#menu + 1] = {
icon = GetImage(v.name),
description = '$'.. v.price,
title = GetLabel(v.name),
onSelect = function()
local settext = "Cost: $"..v.price
local dialog = exports.ox_lib:inputDialog(v.name .."!", {
{ type = 'select', label = "Payment Type", default = "cash", options = { { value = "cash"}, { value = "bank"},}},
{ type = 'number', label = "Amount to buy", description = settext, min = 0, max = v.amount, default = 1 },
})
if not dialog[1] then return end
TriggerServerEvent("md-drugs:server:purchaseGoods", dialog[2], dialog[1], v.name, v.price, data.table, k)
end,
}
end
end
sorter(menu, 'title')
lib.registerContext({id = data.id, title = data.title, options = menu})
end
function Email(sender, subject, message)
if Config.Phone == 'yflip' then
local receiver = GetPlayerServerId(PlayerId())
local insertId, received = exports["yflip-phone"]:SendMail({
title = subject,
sender = sender,
senderDisplayName = sender,
content = message,
}, 'phoneNumber', receiver)
elseif Config.Phone == 'qs' then
TriggerServerEvent('qs-smartphone:server:sendNewMail', {
sender = sender,
subject = subject,
message = message,
button = {}
})
else
TriggerServerEvent('qb-phone:server:sendNewMail', {
sender = sender,
subject = subject,
message = message,
})
end
end
function PoliceCall(chance) function PoliceCall(chance)
local math = math.random(1,100) local math = math.random(1,100)
if math <= chance then if math <= chance then
@@ -242,28 +159,18 @@ function Freeze(entity, toggle, head)
SetBlockingOfNonTemporaryEvents(entity, toggle) SetBlockingOfNonTemporaryEvents(entity, toggle)
end end
function tele(coords)
DoScreenFadeOut(500)
Wait(1000)
SetEntityCoords(PlayerPedId(),coords.x, coords.y, coords.z)
Wait(1000)
DoScreenFadeIn(500)
end
local created = false local created = false
local heading = 180.0 local heading = 180.0
function StartRay() function StartRay()
local run = true local run = true
local pedcoord = GetEntityCoords(PlayerPedId()) local pedcoord = GetEntityCoords(PlayerPedId())
lib.requestModel('v_ret_ml_tablea', 30000) ps.requestModel('v_ret_ml_tablea', 30000)
local table = CreateObject('v_ret_ml_tablea', pedcoord.x, pedcoord.y, pedcoord.z+1, heading, false, false) local table = CreateObject('v_ret_ml_tablea', pedcoord.x, pedcoord.y, pedcoord.z+1, heading, false, false)
repeat repeat
local hit, entityHit, endCoords, surfaceNormal, matHash = lib.raycast.cam(511, 4, 10) local hit, endCoords, surfaceNormal, entityHit = ps.raycast()
if not created then if not created then
created = true created = true
lib.showTextUI([[[E] To Place ps.drawText([[[E] To Place
[DEL] To Cancel [DEL] To Cancel
[<-] To Move Left [<-] To Move Left
[->] To Move Right]]) [->] To Move Right]])
@@ -280,7 +187,7 @@ function StartRay()
heading = heading + 2 heading = heading + 2
end end
if IsControlPressed(0, 38) then if IsControlPressed(0, 38) then
lib.hideTextUI() ps.hideText()
run = false run = false
DeleteObject(table) DeleteObject(table)
created = false created = false
@@ -288,7 +195,7 @@ function StartRay()
end end
if IsControlPressed(0, 178) then if IsControlPressed(0, 178) then
lib.hideTextUI() ps.hideText()
run = false run = false
created = false created = false
DeleteObject(table) DeleteObject(table)
@@ -301,13 +208,13 @@ end
function StartRay2() function StartRay2()
local run = true local run = true
local pedcoord = GetEntityCoords(PlayerPedId()) local pedcoord = GetEntityCoords(PlayerPedId())
lib.requestModel('bkr_prop_coke_press_01aa', 30000) ps.requestModel('bkr_prop_coke_press_01aa', 30000)
local table = CreateObject('bkr_prop_coke_press_01aa', pedcoord.x, pedcoord.y, pedcoord.z+1, heading, false, false) local table = CreateObject('bkr_prop_coke_press_01aa', pedcoord.x, pedcoord.y, pedcoord.z+1, heading, false, false)
repeat repeat
local hit, entityHit, endCoords, surfaceNormal, matHash = lib.raycast.cam(511, 4, 10) local hit, endCoords, surfaceNormal, entityHit = ps.raycast()
if not created then if not created then
created = true created = true
lib.showTextUI([[[E] To Place ps.drawText([[[E] To Place
[DEL] To Cancel [DEL] To Cancel
[<-] To Move Left [<-] To Move Left
[->] To Move Right]]) [->] To Move Right]])
@@ -324,7 +231,7 @@ function StartRay2()
heading = heading + 2 heading = heading + 2
end end
if IsControlPressed(0, 38) then if IsControlPressed(0, 38) then
lib.hideTextUI() ps.hideText()
run = false run = false
DeleteObject(table) DeleteObject(table)
created = false created = false
@@ -332,7 +239,7 @@ function StartRay2()
end end
if IsControlPressed(0, 178) then if IsControlPressed(0, 178) then
lib.hideTextUI() ps.hideText()
run = false run = false
created = false created = false
DeleteObject(table) DeleteObject(table)
@@ -343,10 +250,10 @@ function StartRay2()
end end
CreateThread(function() CreateThread(function()
LoadModel('prop_plant_01b') ps.requestModel('prop_plant_01b')
LoadModel('prop_plant_01a') ps.requestModel('prop_plant_01a')
LoadModel('prop_cactus_03') ps.requestModel('prop_cactus_03')
LoadModel('prop_weed_01') ps.requestModel('prop_weed_01')
TriggerEvent('weed:init') TriggerEvent('weed:init')
TriggerEvent('heroin:init') TriggerEvent('heroin:init')
TriggerEvent('coke:init') TriggerEvent('coke:init')
@@ -363,18 +270,13 @@ end)
RegisterCommand('DrugRep', function() RegisterCommand('DrugRep', function()
if not Config.TierSystem then return end if not Config.TierSystem then return end
local rep = ps.callback('md-drugs:server:GetRep', false) local rep = ps.callback('md-drugs:server:GetRep', false)
lib.registerContext({ ps.menu('Drug Rep', 'Drug Rep', {
id = 'DrugRep', {icon = "fa-solid fa-face-flushed", title = 'Cocaine: '..rep.coke},
title = 'Drug Reputation', {icon = "fa-solid fa-syringe", title = 'Heroin: '..rep.heroin},
options = { {icon = "fa-solid fa-vial", title = 'LSD: '..rep.lsd},
{icon = "fa-solid fa-face-flushed", title = 'Cocaine: '..rep.coke}, {icon = "fa-solid fa-plug", title = 'Dealer: '..rep.dealerrep},
{icon = "fa-solid fa-syringe", title = 'Heroin: '..rep.heroin}, {icon = "fa-solid fa-money-bill", title = 'Corner Selling: ' .. rep.cornerselling.rep, description = 'Rank: ' .. rep.cornerselling.label }
{icon = "fa-solid fa-vial", title = 'LSD: '..rep.lsd}, })
{icon = "fa-solid fa-plug", title = 'Dealer: '..rep.dealerrep},
{icon = "fa-solid fa-money-bill", title = 'Corner Selling: ' .. rep.cornerselling.rep, description = 'Rank: ' .. rep.cornerselling.label }
}
})
lib.showContext('DrugRep')
end, false) end, false)
function handleGang(gang) function handleGang(gang)
+19 -20
View File
@@ -9,19 +9,18 @@ local function createLabKit(coord, head)
ps.entityTarget(heroinlabkit, { ps.entityTarget(heroinlabkit, {
{ {
icon = "fa-solid fa-temperature-high", icon = "fa-solid fa-temperature-high",
label = ps.lang('Heroin.cook'), label = ps.lang('heroin.targetCook'),
action = function() action = function()
if not ps.hasItem('emptyvial') then return end if not ps.hasItem('emptyvial') then return end
if not minigame() then if not minigame() then
dirty = true dirty = true
TriggerServerEvent("md-drugs:server:failheatingheroin") TriggerServerEvent("md-drugs:server:failheatingheroin")
ps.requestPTFX("core") ps.requestPTFX("core")
lib.requestNamedPtfxAsset("core")
local heroinkit = StartParticleFxLoopedOnEntity("exp_air_molotov", heroinlabkit, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.5, false, false, false) local heroinkit = StartParticleFxLoopedOnEntity("exp_air_molotov", heroinlabkit, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.5, false, false, false)
SetParticleFxLoopedAlpha(heroinkit, 3.0) SetParticleFxLoopedAlpha(heroinkit, 3.0)
SetPedToRagdoll(PlayerPedId(), 1300, 1300, 0, 0, 0, 0) SetPedToRagdoll(PlayerPedId(), 1300, 1300, 0, 0, 0, 0)
return end return end
if not ps.progressbar(ps.lang('Heroin.success'), 4000, 'uncuff') then return end if not ps.progressbar(ps.lang('heroin.pbCook'), 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:heatliquidheroin") TriggerServerEvent("md-drugs:server:heatliquidheroin")
end, end,
canInteract = function() canInteract = function()
@@ -30,9 +29,9 @@ local function createLabKit(coord, head)
}, },
{ {
icon = "fas fa-box-circle-check", icon = "fas fa-box-circle-check",
label = ps.lang('Heroin.up'), label = ps.lang('heroin.targetPickup'),
action = function() action = function()
if not ps.progressbar(ps.lang('Heroin.pickup'), 4000, 'uncuff') then return end if not ps.progressbar(ps.lang('heroin.pbPickup'), 4000, 'uncuff') then return end
herointable = false herointable = false
DeleteObject(heroinlabkit) DeleteObject(heroinlabkit)
TriggerServerEvent("md-drugs:server:getheroinlabkitback") TriggerServerEvent("md-drugs:server:getheroinlabkitback")
@@ -43,12 +42,11 @@ local function createLabKit(coord, head)
end end
}, },
{ {
event = "md-drugs:client:cleanheroinlabkit",
icon = "fa-solid fa-hand-sparkles", icon = "fa-solid fa-hand-sparkles",
label = ps.lang('Heroin.clean'), label = ps.lang('heroin.targetClean'),
action = function() action = function()
if not ps.hasItem('cleaningkit') then return end if not ps.hasItem('cleaningkit') then return end
if not ps.progressbar(ps.lang('Heroin.clean'), 4000, 'clean') then return end if not ps.progressbar(ps.lang('heroin.pbClean'), 4000, 'clean') then return end
local done = ps.callback('removeCleaningkit', false) local done = ps.callback('removeCleaningkit', false)
if done then dirty = false end if done then dirty = false end
end, end,
@@ -62,10 +60,10 @@ end
for k, v in pairs (locations.dryplant) do for k, v in pairs (locations.dryplant) do
ps.boxTarget('dryHeroin'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, { ps.boxTarget('dryHeroin'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
{ {
label = ps.lang('targets.heroin.dry'), label = ps.lang('heroin.targetDry'),
icon = 'fa-solid fa-temperature-high', icon = 'fa-solid fa-temperature-high',
action = function() action = function()
if not ps.progressbar(ps.lang('Heroin.dryout'), 4000, 'uncuff') then return end if not ps.progressbar(ps.lang('heroin.pbDry'), 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:dryplant", k) TriggerServerEvent("md-drugs:server:dryplant", k)
end, end,
canInteract = function() canInteract = function()
@@ -78,11 +76,11 @@ end
for k, v in pairs (locations.cutheroinone) do for k, v in pairs (locations.cutheroinone) do
ps.boxTarget('cutHeroin'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, { ps.boxTarget('cutHeroin'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
{ {
label = ps.lang('targets.heroin.cut'), label = ps.lang('heroin.targetCutHeroin'),
icon = 'fa-solid fa-seedling', icon = 'fa-solid fa-seedling',
action = function() action = function()
if not ps.hasItem('bakingsoda') then return end if not ps.hasItem('bakingsoda') then return end
if not ps.progressbar(ps.lang('Heroin.cutting'), 4000, 'uncuff') then return end if not ps.progressbar(ps.lang('heroin.pbCutHeroin'), 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:cutheroin", k) TriggerServerEvent("md-drugs:server:cutheroin", k)
end, end,
canInteract = function() canInteract = function()
@@ -100,15 +98,16 @@ for k, v in pairs (locations.buyKit) do
SetEntityInvincible(peds[k], true) SetEntityInvincible(peds[k], true)
ps.entityTarget(peds[k], { ps.entityTarget(peds[k], {
{ {
label = ps.lang('targets.heroin.buykit'), label = ps.lang('heroin.targetBuyKit'),
icon = 'fa-solid fa-box-open', icon = 'fa-solid fa-box-open',
action = function() action = function()
if not ps.progressbar(ps.lang('Heroin.secret'), 4000, 'uncuff') then return end if not ps.progressbar(ps.lang('heroin.pbBuyKit'), 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:getheroinlabkit", k) TriggerServerEvent("md-drugs:server:getheroinlabkit", k)
end, end,
canInteract = function() canInteract = function()
return true if not handleGang(v.gang) then return false end
end return true
end
} }
}) })
end end
@@ -116,13 +115,13 @@ end
ps.registerCallback("md-drugs:client:setheroinlabkit", function() ps.registerCallback("md-drugs:client:setheroinlabkit", function()
if herointable then if herointable then
ps.notify(ps.lang('Heroin.tableout'), 'error') ps.notify(ps.lang('heroin.tableout'), 'error')
return false return false
else else
herointable = true herointable = true
local location, head = StartRay() local location, head = StartRay()
if not location then herointable = false return end if not location then herointable = false return end
if not ps.progressbar(ps.lang('Heroin.table'), 4000, 'uncuff') then return end if not ps.progressbar(ps.lang('heroin.placing'), 4000, 'uncuff') then return end
createLabKit(location, head) createLabKit(location, head)
return true, location return true, location
end end
@@ -131,11 +130,11 @@ end)
for k, v in pairs (locations.fillneedle) do for k, v in pairs (locations.fillneedle) do
ps.boxTarget('fillNeedle'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, { ps.boxTarget('fillNeedle'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
{ {
label = ps.lang('targets.heroin.fill'), label = ps.lang('heroin.targetFill'),
icon = 'fa-solid fa-syringe', icon = 'fa-solid fa-syringe',
action = function() action = function()
if not minigame() then TriggerServerEvent("md-drugs:server:failheroin", k) return end if not minigame() then TriggerServerEvent("md-drugs:server:failheroin", k) return end
if not ps.progressbar(ps.lang('Heroin.needles'), 4000, 'uncuff') then return end if not ps.progressbar(ps.lang('heroin.pbFill'), 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:fillneedle", k) TriggerServerEvent("md-drugs:server:fillneedle", k)
end, end,
canInteract = function() canInteract = function()
+6 -2
View File
@@ -38,7 +38,7 @@ local function SpawnCarPedChase()
{ {
name = 'leancar', name = 'leancar',
icon = 'fa-solid fa-car', icon = 'fa-solid fa-car',
label = Lang.targets.lean.st, label = ps.lang('lean.stealFromTruck'),
action = function() action = function()
hit = hit + 1 hit = hit + 1
if not minigame() then return end if not minigame() then return end
@@ -68,10 +68,14 @@ for k, v in pairs (location.SyrupVendor) do
ps.entityTarget(leanPeds[k], { ps.entityTarget(leanPeds[k], {
{ {
icon = "fa-solid fa-hand-holding-medical", icon = "fa-solid fa-hand-holding-medical",
label = ps.lang('Lean.buylean'), label = ps.lang('lean.startMission'),
action = function() action = function()
SpawnCarPedChase() SpawnCarPedChase()
end, end,
canInteract = function()
if not handleGang(v.gang) then return false end
return true
end
}, },
}) })
end end
+20 -29
View File
@@ -11,16 +11,9 @@ local function createLabKit(coord, head)
local options = { local options = {
{ {
icon = "fa-solid fa-temperature-high", icon = "fa-solid fa-temperature-high",
label = ps.lang('targets.lsd.heat'), label = ps.lang('lsd.targetHeat'),
action = function() action = function()
local dict = "scr_ie_svm_technical2" local dict = "scr_ie_svm_technical2"
if not ps.hasItems({
lysergic_acid = 1,
diethylamide = 1
}) then
ps.notify(ps.lang('lsd.need'), 'error')
return
end
if not minigame() then if not minigame() then
dirtylsd = true dirtylsd = true
loadParticle(dict) loadParticle(dict)
@@ -28,7 +21,7 @@ local function createLabKit(coord, head)
SetParticleFxLoopedAlpha(exitPtfx, 3.0) SetParticleFxLoopedAlpha(exitPtfx, 3.0)
return return
end end
if not ps.progressbar(ps.lang('lsd.heat'), 7000, 'uncuff') then return end if not ps.progressbar(ps.lang('lsd.heating'), 7000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:heatliquid") TriggerServerEvent("md-drugs:server:heatliquid")
end, end,
canInteract = function() canInteract = function()
@@ -37,11 +30,11 @@ local function createLabKit(coord, head)
}, },
{ {
icon = "fa-solid fa-temperature-high", icon = "fa-solid fa-temperature-high",
label = ps.lang('targets.lsd.refine'), label = ps.lang('lsd.targetRefine'),
action = function() action = function()
if not ps.hasItem('lsd_one_vial') then return end if not ps.hasItem('lsd_one_vial') then return end
if not minigame() then TriggerServerEvent("md-drugs:server:failrefinequality") return end if not minigame() then TriggerServerEvent("md-drugs:server:failrefinequality") return end
if not ps.progressbar(ps.lang('lsd.refine'), 4000, 'uncuff') then return end if not ps.progressbar(ps.lang('lsd.refining'), 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:refinequalityacid") TriggerServerEvent("md-drugs:server:refinequalityacid")
end, end,
canInteract = function() canInteract = function()
@@ -50,11 +43,11 @@ local function createLabKit(coord, head)
}, },
{ {
icon = "fa-regular fa-note-sticky", icon = "fa-regular fa-note-sticky",
label = ps.lang('targets.lsd.dab'), label = ps.lang('lsd.targetDipping'),
action = function() action = function()
if not ps.hasItem('tab_paper') then return end if not ps.hasItem('tab_paper') then return end
if not minigame() then TriggerServerEvent("md-drugs:server:failtabs") return end if not minigame() then TriggerServerEvent("md-drugs:server:failtabs") return end
if not ps.progressbar(ps.lang('lsd.dip'), 4000, 'uncuff') then return end if not ps.progressbar(ps.lang('lsd.dipping'), 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:maketabpaper") TriggerServerEvent("md-drugs:server:maketabpaper")
end, end,
canInteract = function() canInteract = function()
@@ -64,9 +57,9 @@ local function createLabKit(coord, head)
{ {
event = "md-drugs:client:getlabkitback", event = "md-drugs:client:getlabkitback",
icon = "fas fa-box-circle-check", icon = "fas fa-box-circle-check",
label = ps.lang('targets.lsd.back'), label = ps.lang('lsd.targetPickup'),
action = function() action = function()
if not ps.progressbar(ps.lang('lsd.tablepack'), 4000, 'uncuff') then return end if not ps.progressbar(ps.lang('lsd.packup'), 4000, 'uncuff') then return end
DeleteObject(labkit) DeleteObject(labkit)
TriggerServerEvent('md-drugs:server:getlabkitback') TriggerServerEvent('md-drugs:server:getlabkitback')
tableout = false tableout = false
@@ -77,13 +70,13 @@ local function createLabKit(coord, head)
}, },
{ {
icon = "fa-solid fa-hand-sparkles", icon = "fa-solid fa-hand-sparkles",
label = ps.lang('targets.lsd.clean'), label = ps.lang('lsd.targetClean'),
action = function() action = function()
if not ps.hasItem('cleaningkit') then if not ps.hasItem('cleaningkit') then
ps.notify(ps.lang('lsd.needclean'), 'error') ps.notify(ps.lang('lsd.needCleaning'), 'error')
return return
end end
if not ps.progressbar(ps.lang('lsd.clean'), 4000, 'clean') then return end if not ps.progressbar(ps.lang('lsd.cleaning'), 4000, 'clean') then return end
local check = ps.callback('md-drugs:server:removecleaningkit') local check = ps.callback('md-drugs:server:removecleaningkit')
if check then if check then
dirtylsd = false dirtylsd = false
@@ -98,12 +91,11 @@ end
for k, v in pairs (locations.lysergicacid) do for k, v in pairs (locations.lysergicacid) do
ps.boxTarget('lysergicacid'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, { ps.boxTarget('lysergicacid'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
{ {
label = ps.lang('targets.lsd.lys'), label = ps.lang('lsd.targetLys'),
icon = 'fa-solid fa-temperature-high', icon = 'fa-solid fa-temperature-high',
action = function() action = function()
if not ps.hasItem('empty_weed_bag') then return end
if not minigame() then TriggerServerEvent("md-drugs:server:faillysergic") return end if not minigame() then TriggerServerEvent("md-drugs:server:faillysergic") return end
if not ps.progressbar(ps.lang('lsd.steallys'), 4000, 'uncuff') then return end if not ps.progressbar(ps.lang('lsd.stealLys'), 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:getlysergic", k) TriggerServerEvent("md-drugs:server:getlysergic", k)
end, end,
canInteract = function() canInteract = function()
@@ -117,12 +109,12 @@ end
for k, v in pairs (locations.diethylamide) do for k, v in pairs (locations.diethylamide) do
ps.boxTarget('diethylamide'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, { ps.boxTarget('diethylamide'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
{ {
label = ps.lang('targets.lsd.die'), label = ps.lang('lsd.targetDie'),
icon = 'fa-solid fa-temperature-high', icon = 'fa-solid fa-temperature-high',
action = function() action = function()
if not ps.hasItem('empty_weed_bag') then return end if not ps.hasItem('empty_weed_bag') then return end
if not minigame() then TriggerServerEvent("md-drugs:server:faildiethylamide") return end if not minigame() then TriggerServerEvent("md-drugs:server:faildiethylamide") return end
if not ps.progressbar(ps.lang('lsd.stealdie'), 4000, 'uncuff') then return end if not ps.progressbar(ps.lang('lsd.stealDie'), 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:getdiethylamide", k) TriggerServerEvent("md-drugs:server:getdiethylamide", k)
end, end,
canInteract = function() canInteract = function()
@@ -136,10 +128,9 @@ end
for k, v in pairs (locations.gettabs) do for k, v in pairs (locations.gettabs) do
ps.boxTarget('gettabs'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, { ps.boxTarget('gettabs'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
{ {
label = ps.lang('targets.lsd.buyt'), label = ps.lang('lsd.targetBuyTab'),
icon = 'fa-solid fa-hand-holding-dollar', icon = 'fa-solid fa-hand-holding-dollar',
action = function() action = function()
if not ps.hasItem('lsdlabkit') then ps.notify(ps.lang('lsd.havlabkit'), 'error') return end
TriggerEvent("md-drugs:client:buytabs", k) TriggerEvent("md-drugs:client:buytabs", k)
end, end,
canInteract = function() canInteract = function()
@@ -156,11 +147,11 @@ for k, v in pairs (locations.buyLSDkit) do
Freeze(seller[k], true, v.loc.w) Freeze(seller[k], true, v.loc.w)
ps.entityTarget(seller[k], { ps.entityTarget(seller[k], {
{ {
label = ps.lang('targets.lsd.buy'), label = ps.lang('lsd.targetBuyKit'),
icon = 'fa-solid fa-hand-holding-dollar', icon = 'fa-solid fa-hand-holding-dollar',
action = function() action = function()
if ps.hasItem('lsdlabkit') then ps.notify(ps.lang('lsd.havlabkit'), 'error') return end if ps.hasItem('lsdlabkit') then ps.notify(ps.lang('lsd.alreadyOwn'), 'error') return end
if not ps.progressbar(ps.lang('lsd.buykit'), 4000, 'uncuff') then return end if not ps.progressbar(ps.lang('lsd.buyingKit'), 4000, 'uncuff') then return end
TriggerServerEvent('md-drugs:server:getlabkit', k) TriggerServerEvent('md-drugs:server:getlabkit', k)
end, end,
canInteract = function() canInteract = function()
@@ -179,7 +170,7 @@ ps.registerCallback("md-drugs:client:setlsdlabkit", function()
tableout = true tableout = true
local loc, head = StartRay() local loc, head = StartRay()
if not loc then tableout = false return end if not loc then tableout = false return end
if not ps.progressbar(ps.lang('lsd.place'), 4000, 'uncuff') then return end if not ps.progressbar(ps.lang('lsd.placing'), 4000, 'uncuff') then return end
createLabKit(loc, head) createLabKit(loc, head)
return true, loc return true, loc
end end
+3 -3
View File
@@ -2,11 +2,11 @@ local locations = ps.callback('md-drugs:server:GetMescalineLocs')
for k, v in pairs (locations.DryOutMescaline) do for k, v in pairs (locations.DryOutMescaline) do
ps.boxTarget('dryoutMesc'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, { ps.boxTarget('dryoutMesc'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
{ {
label = ps.lang('mescaline.dry'), label = ps.lang('mesc.targetDry'),
icon = 'fa-solid fa-temperature-high', icon = 'fa-solid fa-temperature-high',
action = function() action = function()
if not ps.hasItem('cactusbulb') then ps.notify(ps.lang('mescaline.needbulb'), 'error') return end if not ps.hasItem('cactusbulb') then ps.notify(ps.lang('Catches.itemNeeded', ps.getLabel('cactusbulb')), 'error') return end
if not ps.progressbar(ps.lang('mescaline.dry'), 4000, 'drymescaline') then return end if not ps.progressbar(ps.lang('mescaline.dry'), 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:drymescaline", k) TriggerServerEvent("md-drugs:server:drymescaline", k)
end, end,
canInteract = function() canInteract = function()
+45 -37
View File
@@ -11,7 +11,7 @@ local function SpawnMethCarPedChase()
local stoploc = vector3(-1157.63, -3056.71, 13.94) local stoploc = vector3(-1157.63, -3056.71, 13.94)
local start = locations.StartLoc[math.random(1,#locations.StartLoc)] local start = locations.StartLoc[math.random(1,#locations.StartLoc)]
if startedmeth then if startedmeth then
ps.notify(ps.lang('meth.act'),'error') ps.notify(ps.lang('meth.alreadyChasing'),'error')
else else
startedmeth = true startedmeth = true
ps.callback('md-drugs:server:RegisterMeth') ps.callback('md-drugs:server:RegisterMeth')
@@ -42,7 +42,7 @@ local function SpawnMethCarPedChase()
{ {
name = 'methcar', name = 'methcar',
icon = 'fa-solid fa-car', icon = 'fa-solid fa-car',
label = Lang.targets.meth.stealfromcar, label = ps.lang('meth.targetStealFromCar'),
action = function() action = function()
if not minigame() then return end if not minigame() then return end
TriggerServerEvent('md-drugs:server:givemethingridients') TriggerServerEvent('md-drugs:server:givemethingridients')
@@ -71,9 +71,9 @@ for k, v in pairs (locations.MethHeist) do
{ {
name = 'methheist'..k, name = 'methheist'..k,
icon = 'fa-solid fa-user-secret', icon = 'fa-solid fa-user-secret',
label = ps.lang('targets.meth.heist'), label = ps.lang('meth.targetHeist'),
action = function() action = function()
if startedmeth then ps.notify(ps.lang('meth.act'),'error') return end if startedmeth then ps.notify(ps.lang('meth.alreadyChasing'),'error') return end
SpawnMethCarPedChase() SpawnMethCarPedChase()
end, end,
canInteract = function() canInteract = function()
@@ -239,7 +239,7 @@ local function startcook(num, coords, offset, rotation)
MethCooking(coords, offset, rotation) MethCooking(coords, offset, rotation)
amonia = true amonia = true
else else
ps.notify(ps.lang('meth.inside'), "error") ps.notify(ps.lang('meth.started'), "error")
end end
end end
@@ -251,7 +251,7 @@ local function dials(coords)
amonia = false amonia = false
active = false active = false
return end return end
ps.notify(ps.lang('meth.increaseheat'), "success") ps.notify(ps.lang('meth.increaseHeat'), "success")
heated = true heated = true
end end
end end
@@ -266,7 +266,7 @@ local function smash(coords, offset, rotation, buckets, k)
{ {
name = 'bucket', name = 'bucket',
icon = "fa-solid fa-sack-xmark", icon = "fa-solid fa-sack-xmark",
label = ps.lang('targets.meth.bag'), label = ps.lang('meth.targetBag'),
canInteract = function() canInteract = function()
if active == false then return false end if active == false then return false end
end, end,
@@ -309,22 +309,25 @@ end)
for k, v in pairs (locations.CookMeth) do for k, v in pairs (locations.CookMeth) do
ps.boxTarget('cookMeth'..k, v.loc, {length = v.l, width = v.w, rotation = v.rot, height = 1.0},{ ps.boxTarget('cookMeth'..k, v.loc, {length = v.l, width = v.w, rotation = v.rot, height = 1.0},{
{ {
label = 'Cook Meth', label = ps.lang('meth.targetCook'),
icon = 'fa-solid fa-temperature-high', icon = 'fa-solid fa-temperature-high',
action = function() action = function()
startcook(k, v.loc, v.offset or vec3(0,0,0), v.rotation or vector3(0,0,180.0)) startcook(k, v.loc, v.offset or vec3(0,0,0), v.rotation or vector3(0,0,180.0))
end, end,
canInteract = function() canInteract = function()
if not handleGang(v.gang) then return false end
if not amonia and not active then if not amonia and not active then
return true return true
end end
end, end,
}, },
{ {
icon = "fas fa-sign-in-alt", icon = "fas fa-sign-in-alt",
label = ps.lang('targets.meth.tray'), label = ps.lang('meth.targetGrabTray'),
action = function() trayscarry() end, action = function() trayscarry() end,
canInteract = function() canInteract = function()
if not handleGang(v.gang) then return false end
if heated and amonia and not tray then if heated and amonia and not tray then
return true return true
end end
@@ -338,11 +341,12 @@ for k, v in pairs (locations.MethDials) do
{ {
name = 'adjustdials', name = 'adjustdials',
icon = "fa-solid fa-temperature-three-quarters", icon = "fa-solid fa-temperature-three-quarters",
label = ps.lang('targets.meth.adjust'), label = ps.lang('meth.targetHeat'),
action = function() action = function()
dials(locations.CookMeth[k].loc) dials(locations.CookMeth[k].loc)
end, end,
canInteract = function() canInteract = function()
if not handleGang(v.gang) then return false end
if amonia and heated == false then return true end if amonia and heated == false then return true end
end end
} }
@@ -354,11 +358,12 @@ for k, v in pairs (locations.MethSmash) do
{ {
name = 'smash', name = 'smash',
icon = "fa-solid fa-weight-scale", icon = "fa-solid fa-weight-scale",
label = ps.lang('targets.meth.smash'), label = ps.lang('meth.targetSmash'),
action = function() action = function()
smash(v.loc, v.offset, v.rotation, v.bucket,k) smash(v.loc, v.offset, v.rotation, v.bucket,k)
end, end,
canInteract = function() canInteract = function()
if not handleGang(v.gang) then return false end
if heated and amonia and tray then return true end if heated and amonia and tray then return true end
end end
} }
@@ -372,30 +377,33 @@ RegisterCommand('offset', function()
print("Offset: ", offset) print("Offset: ", offset)
end) end)
if not Config.MethHeist then for k, v in pairs (locations.MethEph) do
for k, v in pairs (locations.MethEph) do ps.boxTarget('stealMethEph'..k, v.loc, {length = v.l, width = v.w, rotation = v.rot, height = 1.0},{
ps.boxTarget('stealMethEph'..k, v.loc, {length = v.l, width = v.w, rotation = v.rot, height = 1.0},{ {
{ label = ps.lang('meth.targetStealEPH'),
label = 'Steal Ephedrine', icon = 'fa-solid fa-bucket',
icon = 'fa-solid fa-bucket', action = function()
action = function() if not ps.progressbar(ps.lang('meth.stealingEPH'), 4000, 'uncuff') then return end
if not ps.progressbar('Stealing Ephedrine', 4000, 'uncuff') then return end TriggerServerEvent("md-drugs:server:geteph", k)
TriggerServerEvent("md-drugs:server:geteph", k) end,
end, canInteract = function()
} return handleGang(v.gang)
}) end
end }
})
for k, v in pairs (locations.Methace) do end
ps.boxTarget('stealMethAce'..k, v.loc, {length = v.l, width = v.w, rotation = v.rot, height = 1.0},{ for k, v in pairs (locations.Methace) do
{ ps.boxTarget('stealMethAce'..k, v.loc, {length = v.l, width = v.w, rotation = v.rot, height = 1.0},{
label = 'Steal Acetone', {
icon = 'fa-solid fa-bucket', label = ps.lang('meth.targetStealACE'),
action = function() icon = 'fa-solid fa-bucket',
if not ps.progressbar('Stealing Acetone', 4000, 'uncuff') then return end action = function()
TriggerServerEvent("md-drugs:server:getace", k) if not ps.progressbar(ps.lang('meth.stealingACE'), 4000, 'uncuff') then return end
end, TriggerServerEvent("md-drugs:server:getace", k)
} end,
}) canInteract = function()
end return handleGang(v.gang)
end
}
})
end end
+12 -8
View File
@@ -1,10 +1,11 @@
local carryPackage = nil local carryPackage = nil
local onMission = false local onMission = false
local locations = ps.callback('md-drugs:server:GetOxyLocs') local locations = ps.callback('md-drugs:server:GetOxyLocs')
local function getRoute() local function getRoute()
local Route = ps.callback('md-drugs:server:getRoute') local Route = ps.callback('md-drugs:server:getRoute')
if not Route then if not Route then
ps.notify(ps.lang('oxy.done'), "success") ps.notify(ps.lang('oxy.ditchCar'), "error")
onMission = false onMission = false
return false return false
end end
@@ -23,11 +24,11 @@ local function getRoute()
PoliceCall(Config.PoliceAlertOxy) PoliceCall(Config.PoliceAlertOxy)
ps.entityTarget(oxybuyer,{ ps.entityTarget(oxybuyer,{
{ {
label = ps.lang('targets.oxy.talk'), label = ps.lang('oxy.targetHandoff'),
icon = "fa-solid fa-dollar-sign", icon = "fa-solid fa-dollar-sign",
action = function() action = function()
if carryPackage then if carryPackage then
if not ps.progressbar(ps.lang('oxy.hand'), 4000, 'uncuff') then return end if not ps.progressbar(ps.lang('oxy.handingoff'), 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:giveoxybox") TriggerServerEvent("md-drugs:server:giveoxybox")
DeleteEntity(oxybuyer) DeleteEntity(oxybuyer)
DetachEntity(carryPackage, true, true) DetachEntity(carryPackage, true, true)
@@ -35,7 +36,7 @@ local function getRoute()
carryPackage = nil carryPackage = nil
getRoute() getRoute()
else else
ps.notify(ps.lang('oxy.empty'), "error") ps.notify(ps.lang('oxy.emptyHands'), "error")
end end
end end
} }
@@ -46,7 +47,7 @@ for k, v in pairs(locations.OxyPayForTruck) do
ps.boxTarget('oxyTruckPur' ..k , v.loc, {length = v.l, width = v.w, heading = v.rot}, { ps.boxTarget('oxyTruckPur' ..k , v.loc, {length = v.l, width = v.w, heading = v.rot}, {
{ {
icon = 'fa-solid fa-truck-fast', icon = 'fa-solid fa-truck-fast',
label = ps.lang('targets.oxy.buytruck'), label = ps.lang('oxy.targetPay'),
action = function() action = function()
ps.requestModel("burrito3", Config.RequestModelTime) ps.requestModel("burrito3", Config.RequestModelTime)
@@ -56,17 +57,17 @@ for k, v in pairs(locations.OxyPayForTruck) do
exports[Config.Fuel]:SetFuel(oxycar, 100.0) exports[Config.Fuel]:SetFuel(oxycar, 100.0)
TriggerEvent("vehiclekeys:client:SetOwner", GetVehicleNumberPlateText(oxycar)) TriggerEvent("vehiclekeys:client:SetOwner", GetVehicleNumberPlateText(oxycar))
ps.notify(ps.lang('oxy.truck'), 'success') ps.notify(ps.lang('oxy.keys'), 'success')
onMission = true onMission = true
getRoute() getRoute()
ps.entityTarget(oxycar, { ps.entityTarget(oxycar, {
{ {
icon = "fa-solid fa-box", icon = "fa-solid fa-box",
label = ps.lang('targets.oxy.pack'), label = ps.lang('oxy.targetGetPackage'),
action = function() action = function()
if carryPackage then if carryPackage then
ps.notify(ps.lang('oxy.cantcarry'), "error") ps.notify(ps.lang('oxy.alreadyCarrying'), "error")
else else
local pos = GetEntityCoords(PlayerPedId(), true) local pos = GetEntityCoords(PlayerPedId(), true)
ps.requestAnim('anim@heists@box_carry@') ps.requestAnim('anim@heists@box_carry@')
@@ -76,6 +77,9 @@ for k, v in pairs(locations.OxyPayForTruck) do
AttachEntityToEntity(carryPackage, PlayerPedId(), GetPedBoneIndex(PlayerPedId(), 57005), 0.05, 0.1, -0.3, 300.0, 250.0, 20.0, true, true, false, true, 1, true) AttachEntityToEntity(carryPackage, PlayerPedId(), GetPedBoneIndex(PlayerPedId(), 57005), 0.05, 0.1, -0.3, 300.0, 250.0, 20.0, true, true, false, true, 1, true)
end end
end, end,
canInteract = function()
return handleGang(v.gang)
end
} }
}) })
end, end,
+9 -8
View File
@@ -1,17 +1,18 @@
local locations = ps.callback('md-drugs:server:GetPharmaLocs') local locations = ps.callback('md-drugs:server:GetPharmaLocs')
ps.registerCallback("md-drugs:client:prescriptionpad", function(data, op) ps.registerCallback("md-drugs:client:prescriptionpad", function(data, op)
if ps.getJobType() ~= 'ems' then return end if ps.getJobType() ~= 'ems' then return end
local input = exports.ps_lib:input('Who To Give A Prescription To?',{ local input = ps.input(ps.lang('pharma.input.header'), {
{type = 'select', title = 'Player Name', options = data}, {type = 'select', title = ps.lang('pharma.input.title1'), options = data},
{type = 'select', title = 'Prescription', options = op} {type = 'select', title = ps.lang('pharma.input.title2'), options = op}
}) })
if not input[1] then return end if not input[1] then return end
if not ps.progressbar(ps.lang('Pharma.write'), 4000, 'notepad') then return end if not ps.progressbar(ps.lang('pharma.write'), 4000, 'notepad') then return end
return {who = input[1], what = input[2]} return {who = input[1], what = input[2]}
end) end)
ps.registerCallback("md-drugs:client:unbottle", function() ps.registerCallback("md-drugs:client:unbottle", function()
if not ps.progressbar(ps.lang('Pharma.open'), 4000, 'uncuff') then return end if not ps.progressbar(ps.lang('pharma.opening'), 4000, 'uncuff') then return end
return true return true
end) end)
@@ -20,11 +21,11 @@ for k, v in pairs (locations.FillPrescription) do
ps.boxTarget('pharma' ..k , v.loc, {length = v.l, width = v.w, heading = v.rot}, { ps.boxTarget('pharma' ..k , v.loc, {length = v.l, width = v.w, heading = v.rot}, {
{ {
icon = 'fa-solid fa-capsules', icon = 'fa-solid fa-capsules',
label = ps.lang('Pharma.fillprescription'), label = ps.lang('pharma.targetFill'),
action = function() action = function()
if not ps.progressbar(ps.lang('Pharma.fill'), 4000, 'uncuff') then return end if not ps.progressbar(ps.lang('pharma.fill'), 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:fillprescription", k) TriggerServerEvent("md-drugs:server:fillprescription", k)
end end,
} }
}) })
end end
+10 -30
View File
@@ -1,64 +1,44 @@
local DrugPlants = { local DrugPlants = {
{model = 'prop_plant_01a', label = 'coke', langs = ps.lang('targets.coke.pick'), tbl = GlobalState.CocaPlant, plantTbl = {}, {model = 'prop_plant_01a', label = 'coke', langs = ps.lang('coke.targetPick'), tbl = GlobalState.CocaPlant, plantTbl = {},
pick = function(loc) pick = function(loc)
if not ps.progressbar(ps.lang('Coke.picking'), 4000, 'uncuff') then return end if not ps.progressbar(ps.lang('coke.picking'), 4000, 'uncuff') then return end
TriggerServerEvent("coke:pickupCane", loc) TriggerServerEvent("coke:pickupCane", loc)
return true return true
end, end,
target = {
icon = "fa-solid fa-seedling",
label = ps.lang('targets.coke.pick'),
},
allow = Config.Drugs.cocaine, allow = Config.Drugs.cocaine,
}, },
{model = 'prop_plant_01b', label = 'heroin',langs = ps.lang('targets.heroin.pick'), tbl = GlobalState.PoppyPlants, plantTbl = {}, {model = 'prop_plant_01b', label = 'heroin',langs = ps.lang('heroin.targetPick'), tbl = GlobalState.PoppyPlants, plantTbl = {},
pick = function(loc) pick = function(loc)
if not ps.progressbar(ps.lang('Heroin.pick'), 4000, 'uncuff') then return end if not ps.progressbar(ps.lang('heroin.picking'), 4000, 'uncuff') then return end
TriggerServerEvent("heroin:pickupCane", loc) TriggerServerEvent("heroin:pickupCane", loc)
return true return true
end, end,
target = {
icon = "fa-solid fa-seedling",
label = ps.lang('targets.heroin.pick'),
},
allow = Config.Drugs.heroin, allow = Config.Drugs.heroin,
}, },
{model = 'prop_cactus_03', label = 'Mescaline', langs = ps.lang('targets.mescaline.pick'), tbl = GlobalState.Mescaline, plantTbl = {}, {model = 'prop_cactus_03', label = 'Mescaline', langs = ps.lang('mesc.targetPick'), tbl = GlobalState.Mescaline, plantTbl = {},
pick = function(loc) pick = function(loc)
if not ps.progressbar(ps.lang('mescaline.pick'), 4000, 'uncuff') then return end if not ps.progressbar(ps.lang('mesc.picking'), 4000, 'uncuff') then return end
TriggerServerEvent("Mescaline:pickupCane", loc) TriggerServerEvent("Mescaline:pickupCane", loc)
return true return true
end, end,
target = {
icon = "fa-solid fa-seedling",
label = ps.lang('targets.mescaline.pick'),
},
allow = Config.Drugs.mescaline, allow = Config.Drugs.mescaline,
}, },
{model = 'prop_weed_01', label = 'weed', langs = ps.lang('targets.weed.pick'), tbl = GlobalState.WeedPlant, plantTbl = {}, {model = 'prop_weed_01', label = 'weed', langs = ps.lang('weed.targetPick'), tbl = GlobalState.WeedPlant, plantTbl = {},
pick = function(loc) pick = function(loc)
if not ps.progressbar(ps.lang('Weed.picking'), 4000, 'uncuff') then return end if not ps.progressbar(ps.lang('weed.picking'), 4000, 'uncuff') then return end
TriggerServerEvent("weed:pickupCane", loc) TriggerServerEvent("weed:pickupCane", loc)
return true return true
end, end,
target = {
icon = "fa-solid fa-seedling",
label = ps.lang('targets.weed.pick'),
},
allow = Config.Drugs.weed, allow = Config.Drugs.weed,
}, },
{model = 'mushroom', label = 'shrooms', langs = ps.lang('targets.shrooms.pick'), tbl = GlobalState.shrooms, plantTbl = {}, {model = 'mushroom', label = 'shrooms', langs = ps.lang('shrooms.targetPick'), tbl = GlobalState.shrooms, plantTbl = {},
pick = function(loc) pick = function(loc)
if not ps.progressbar(ps.lang('Shrooms.pick'), 4000, 'uncuff') then return end if not ps.progressbar(ps.lang('shrooms.picking'), 4000, 'uncuff') then return end
TriggerServerEvent("shrooms:pickupCane", loc) TriggerServerEvent("shrooms:pickupCane", loc)
return true return true
end, end,
target = {
icon = "fa-solid fa-hand",
label = ps.lang('targets.shrooms.pick'),
},
allow = Config.Drugs.shrooms, allow = Config.Drugs.shrooms,
}, },
} }
+1 -1
View File
@@ -1,6 +1,6 @@
ps.registerCallback("md-drugs:client:shrooms", function() ps.registerCallback("md-drugs:client:shrooms", function()
if not ps.progressbar(ps.lang('Shrooms.eat'), 5000, 'eat') then return end if not ps.progressbar(ps.lang('shrooms.eat'), 5000, 'eat') then return end
CreateThread(function() CreateThread(function()
EcstasyEffect() EcstasyEffect()
end) end)
+13 -13
View File
@@ -4,10 +4,10 @@ for k, v in pairs (locations.WeedDry) do
ps.boxTarget('weed_dry'..k, v.loc, {length = v.l, width = v.w, heading = v.rot}, { ps.boxTarget('weed_dry'..k, v.loc, {length = v.l, width = v.w, heading = v.rot}, {
{ {
icon = 'fa-solid fa-cannabis', icon = 'fa-solid fa-cannabis',
label = ps.lang('targets.weed.dry'), label = ps.lang('weed.targetDry'),
action = function() action = function()
if not ps.hasItem('wetcannabis', 1) then if not ps.hasItem('wetcannabis', 1) then
ps.notify(ps.lang('Weed.nodry'), "error") ps.notify(ps.lang('weed.nodry'), "error")
return return
end end
if drying then return end if drying then return end
@@ -15,12 +15,12 @@ for k, v in pairs (locations.WeedDry) do
local weedplant = CreateObject("bkr_prop_weed_drying_01a", loc.x, loc.y+.2, loc.z, true, false) local weedplant = CreateObject("bkr_prop_weed_drying_01a", loc.x, loc.y+.2, loc.z, true, false)
drying = true drying = true
FreezeEntityPosition(weedplant, true) FreezeEntityPosition(weedplant, true)
ps.notify(ps.lang('Weed.wait'), "success") ps.notify(ps.lang('weed.wait'), "success")
Wait(math.random(1000,5000)) Wait(math.random(1000,5000))
ps.notify(ps.lang('Weed.take'), "success") ps.notify(ps.lang('weed.take'), "success")
ps.entityTarget(weedplant, { ps.entityTarget(weedplant, {
icon = "fa-solid fa-cannabis", icon = "fa-solid fa-cannabis",
label = ps.lang('targets.weed.dpick'), label = ps.lang('weed.targetDryed'),
action = function() action = function()
DeleteEntity(weedplant) DeleteEntity(weedplant)
drying = false drying = false
@@ -36,7 +36,7 @@ for k, v in pairs (locations.WeedTele) do
ps.boxTarget('weed_tele'..k, v.inside, {length = v.l, width = v.w, heading = v.rot}, { ps.boxTarget('weed_tele'..k, v.inside, {length = v.l, width = v.w, heading = v.rot}, {
{ {
icon = 'fa-solid fa-door-open', icon = 'fa-solid fa-door-open',
label = ps.lang('targets.weed.telein'), label = ps.lang('weed.teleportOut'),
action = function() action = function()
SetEntityCoords(PlayerPedId(), v.outside) SetEntityCoords(PlayerPedId(), v.outside)
end end
@@ -45,7 +45,7 @@ for k, v in pairs (locations.WeedTele) do
ps.boxTarget('weed_teleout'..k, v.outside, {length = v.l, width = v.w, heading = v.rot}, { ps.boxTarget('weed_teleout'..k, v.outside, {length = v.l, width = v.w, heading = v.rot}, {
{ {
icon = 'fa-solid fa-door-closed', icon = 'fa-solid fa-door-closed',
label = ps.lang('targets.weed.teleout'), label = ps.lang('weed.teleportIn'),
action = function() action = function()
SetEntityCoords(PlayerPedId(), v.inside) SetEntityCoords(PlayerPedId(), v.inside)
end end
@@ -66,13 +66,13 @@ CreateThread(function()
end) end)
RegisterNetEvent("md-drugs:client:dodabs", function() RegisterNetEvent("md-drugs:client:dodabs", function()
if not ps.progressbar('Doing Dabs', 4000, 'bong2') then AlienEffect() return end if not ps.progressbar(ps.lang('weed.dabs'), 4000, 'bong2') then AlienEffect() return end
AlienEffect() AlienEffect()
end) end)
local function createBluntOptions(contextId, contextTitle, eventLabelPrefix, tableName) local function createBluntOptions(contextId, contextTitle, eventLabelPrefix, tableName)
local options = {} local options = {}
local items = ps.callback('md-drugs:server:GetRecipe', 'weed',tableName) local items = ps.callback('md-drugs:server:GetWeedRecipe', 'weed', tableName)
for k, v in pairs(items) do for k, v in pairs(items) do
local label = {} local label = {}
local item = '' local item = ''
@@ -94,11 +94,11 @@ local function createBluntOptions(contextId, contextTitle, eventLabelPrefix, tab
end end
RegisterNetEvent('md-drugs:client:makeBluntWrap', function(data) RegisterNetEvent('md-drugs:client:makeBluntWrap', function(data)
createBluntOptions('mddrugsbluntwraps', "Dipping Syrup", 'Dipping Syrup To Make ', 'bluntwrap') createBluntOptions('mddrugsbluntwraps', "Dipping Syrup", ps.lang('weed.bluntWrap'), 'bluntwrap')
end) end)
RegisterNetEvent('md-drugs:client:rollBlunt', function(data) RegisterNetEvent('md-drugs:client:rollBlunt', function(data)
createBluntOptions('mddrugsblunts', "Roll Blunts", 'Rolling A ', 'blunts') createBluntOptions('mddrugsblunts', "Roll Blunts", ps.lang('weed.blunts'), 'blunts')
end) end)
for k, v in pairs (locations.WeedSalesman) do for k, v in pairs (locations.WeedSalesman) do
@@ -110,7 +110,7 @@ for k, v in pairs (locations.WeedSalesman) do
ps.entityTarget(ped, { ps.entityTarget(ped, {
{ {
icon = "fa-solid fa-cannabis", icon = "fa-solid fa-cannabis",
label = ps.lang('targets.weed.salesman'), label = ps.lang('weed.targetSales'),
action = function() action = function()
local itemList = ps.callback('md-drugs:server:getWeedItems') local itemList = ps.callback('md-drugs:server:getWeedItems')
local options = {} local options = {}
@@ -124,7 +124,7 @@ for k, v in pairs (locations.WeedSalesman) do
{type = 'number', title = 'How Many To Buy', min = 1, max = 1000} {type = 'number', title = 'How Many To Buy', min = 1, max = 1000}
}) })
if not input and input[1] then return end if not input and input[1] then return end
if not ps.progressbar('Buying ' .. ps.getLabel(m), 2000, 'uncuff') then return end if not ps.progressbar(ps.lang('weed.buying', ps.getLabel(m)), 2000, 'uncuff') then return end
TriggerServerEvent('md-drugs:server:buyWeedItem', k, m, input[1]) TriggerServerEvent('md-drugs:server:buyWeedItem', k, m, input[1])
end end
} }
+29 -10
View File
@@ -1,29 +1,48 @@
local miss = false local miss = false
local function SetUpPeds()
AddRelationshipGroup('setups')
local ped = GetEntityCoords(PlayerPedId())
local peds = {
{x = ped.x+3, y = ped.y-5, z = ped.z-1, },
{x = ped.x+6, y = ped.y-10, z = ped.z-1,},
{x = ped.x+-2,y = ped.y+5, z = ped.z-1,},
{x = ped.x+8, y = ped.y-12, z = ped.z-1,},
{x = ped.x+5, y = ped.y-2, z = ped.z-1, },
{x = ped.x+2, y = ped.y-20, z = ped.z-1,},
{x = ped.x+1, y = ped.y-10, z = ped.z-1,},
}
for i = 1, #peds do
local k = peds[i]
i = CreatePed(0, "g_m_y_famdnf_01", k.x, k.y, k.z, 90.0, true, true)
SetPedRelationshipGroupHash(i, 'setups')
GiveWeaponToPed(i, "weapon_pistol", 1, false, true)
TaskCombatPed(i, PlayerPedId(), 0, 16)
SetPedCombatAttributes(i, 46, true)
end
end
RegisterNetEvent("md-drugs:client:GetLocation", function(drug) RegisterNetEvent("md-drugs:client:GetLocation", function(drug)
if not GetCops(Config.PoliceCount) then return end if not GetCops(Config.PoliceCount) then return end
if miss then if miss then
ps.notify(Lang.Wholesale.al, 'error') ps.notify(ps.lang('wholesale.alreadyWholesale'), 'error')
else else
local loc = drug.location local loc = drug.location
local timer = 0 local timer = 0
miss = true miss = true
SetNewWaypoint(loc.x, loc.y) SetNewWaypoint(loc.x, loc.y)
lib.requestModel("g_m_y_famdnf_01", Config.RequestModelTime) ps.requestModel("g_m_y_famdnf_01", Config.RequestModelTime)
local current = "g_m_y_famdnf_01" local drugdealer = CreatePed(0, "g_m_y_famdnf_01",loc.x,loc.y,loc.z-1, 90.0, false, false)
local drugdealer = CreatePed(0, current,loc.x,loc.y,loc.z-1, 90.0, false, false)
FreezeEntityPosition(drugdealer, true) FreezeEntityPosition(drugdealer, true)
SetEntityInvincible(drugdealer, true) SetEntityInvincible(drugdealer, true)
AddMultiModel(drugdealer, {{ ps.entityTarget(drugdealer, {{
label = Lang.targets.Wholesale.talk, label = ps.lang('wholesale.targetBuyer'),
icon = "fas fa-eye", icon = "fas fa-eye",
action = function() action = function()
local luck = math.random(1,100) local luck = math.random(1,100)
if luck <= Config.SuccessfulChance then if luck <= Config.SuccessfulChance then
if not ps.progressbar("Wholesaling Drugs", 4000, 'uncuff') then return end if not ps.progressbar(ps.lang('wholesale.wholesaling'), 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:SuccessSale", drug) TriggerServerEvent("md-drugs:server:SuccessSale", drug)
else else
ps.progressbar("YOU FUCKED NOW", 4000, 'uncuff') ps.notify(ps.lang('wholesale.uhoh'), 'error')
SetUpPeds() SetUpPeds()
end end
Wait(3000) Wait(3000)
@@ -39,7 +58,7 @@ RegisterNetEvent("md-drugs:client:GetLocation", function(drug)
if timer <= Config.WholesaleTimeout or #(GetEntityCoords(PlayerPedId()) - vector3(loc.x, loc.y, loc.z) ) < 4.0 then if timer <= Config.WholesaleTimeout or #(GetEntityCoords(PlayerPedId()) - vector3(loc.x, loc.y, loc.z) ) < 4.0 then
timer = 0 timer = 0
else else
ps.notify('The Buyer Waited To Long', 'error') ps.notify(ps.lang('wholesale.tooLong'), 'error')
DeleteEntity(drugdealer) DeleteEntity(drugdealer)
end end
end end
+29 -19
View File
@@ -9,19 +9,19 @@ end
ps.registerCallback('md-drugs:client:setpress', function(xtcData) ps.registerCallback('md-drugs:client:setpress', function(xtcData)
if xtcpress then if xtcpress then
ps.notify(Lang.xtc.out, 'error') ps.notify(ps.lang('xtc.alreadyOut'), 'error')
return return
end end
local coords, head = StartRay2() local coords, head = StartRay2()
xtcpress = true xtcpress = true
if not ps.progressbar('Setting Press On The Ground', 4000, 'uncuff') then return end if not ps.progressbar(ps.lang('xtc.settingDown'), 4000, 'uncuff') then return end
local press = CreateObject("bkr_prop_coke_press_01aa", coords.x, coords.y, coords.z, true, false, false) local press = CreateObject("bkr_prop_coke_press_01aa", coords.x, coords.y, coords.z, true, false, false)
PlaceObjectOnGroundProperly(press) PlaceObjectOnGroundProperly(press)
Freeze(press, true, head) Freeze(press, true, head)
local options = { local options = {
{ {
icon = "fas fa-eye", icon = "fas fa-eye",
label = ps.lang('targets.xtc.make'), label = ps.lang('xtc.targetMake'),
distance = 2.0, distance = 2.0,
action = function() action = function()
local options = {} local options = {}
@@ -33,7 +33,7 @@ ps.registerCallback('md-drugs:client:setpress', function(xtcData)
description = descript, description = descript,
action = function() action = function()
if not minigame() then ps.notify(ps.lang('xtc.fail'), "error") return end if not minigame() then ps.notify(ps.lang('xtc.fail'), "error") return end
if not ps.progressbar(string.format(ps.lang('xtc.make'), ps.getLabel(k)), 4000, 'uncuff') then return end if not ps.progressbar(ps.lang('xtc.making', ps.getLabel(k)), 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:makextc", k) TriggerServerEvent("md-drugs:server:makextc", k)
end, end,
distance = 2.0 distance = 2.0
@@ -47,9 +47,9 @@ ps.registerCallback('md-drugs:client:setpress', function(xtcData)
}, },
{ {
icon = "fas fa-eye", icon = "fas fa-eye",
label = ps.lang('targets.xtc.pick'), label = ps.lang('xtc.targetPickup'),
action = function() action = function()
if not ps.progressbar(ps.lang('xtc.pickup'), 5000, 'uncuff') then return end if not ps.progressbar(ps.lang('xtc.picking'), 5000, 'uncuff') then return end
DeleteObject(press) DeleteObject(press)
xtcpress = false xtcpress = false
TriggerServerEvent("md-drugs:server:getpressback") TriggerServerEvent("md-drugs:server:getpressback")
@@ -67,11 +67,14 @@ for k, v in pairs(locations.mdp2p) do
ps.boxTarget('mdp2p'..k, v.loc, {length = v.l, width = v.w, heading = v.rot}, { ps.boxTarget('mdp2p'..k, v.loc, {length = v.l, width = v.w, heading = v.rot}, {
{ {
icon = 'fa-solid fa-flask', icon = 'fa-solid fa-flask',
label = ps.lang('targets.xtc.mdp2p'), label = ps.lang('xtc.targetStealMDP2P'),
action = function() action = function()
if not minigame() then ps.notify(ps.lang('xtc.fail'), "error") return end if not minigame() then ps.notify(ps.lang('xtc.fail'), "error") return end
if not ps.progressbar(ps.lang('xtc.mdp2p'), 4000, 'uncuff') then return end if not ps.progressbar(ps.lang('xtc.stealingMDP2P'), 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:stealmdp2p", k) TriggerServerEvent("md-drugs:server:stealmdp2p", k)
end,
canInteract = function()
return handleGang(v.gang)
end end
} }
}) })
@@ -80,11 +83,14 @@ for k, v in pairs(locations.isosafrole) do
ps.boxTarget('isosafrole'..k, v.loc, {length = v.l, width = v.w, heading = v.rot}, { ps.boxTarget('isosafrole'..k, v.loc, {length = v.l, width = v.w, heading = v.rot}, {
{ {
icon = 'fa-solid fa-flask', icon = 'fa-solid fa-flask',
label = ps.lang('targets.xtc.isosafrole'), label = ps.lang('xtc.targetStealIsosafrole'),
action = function() action = function()
if not minigame() then ps.notify(ps.lang('xtc.fail'), "error") return end if not minigame() then ps.notify(ps.lang('xtc.fail'), "error") return end
if not ps.progressbar(ps.lang('xtc.isosafrole'), 4000, 'uncuff') then return end if not ps.progressbar(ps.lang('xtc.stealingIsosafrole'), 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:stealisosafrole", k) TriggerServerEvent("md-drugs:server:stealisosafrole", k)
end,
canInteract = function()
return handleGang(v.gang)
end end
} }
}) })
@@ -94,11 +100,14 @@ for k, v in pairs(locations.rawxtcloc) do
ps.boxTarget('xtc'..k, v.loc, {length = v.l, width = v.w, heading = v.rot}, { ps.boxTarget('xtc'..k, v.loc, {length = v.l, width = v.w, heading = v.rot}, {
{ {
icon = 'fa-solid fa-flask', icon = 'fa-solid fa-flask',
label = ps.lang('targets.xtc.raw'), label = ps.lang('xtc.targetRaw'),
action = function() action = function()
if not minigame() then ps.notify(ps.lang('xtc.fail'), "error") return end if not minigame() then ps.notify(ps.lang('xtc.fail'), "error") return end
if not ps.progressbar(ps.lang('xtc.raw'), 4000, 'uncuff') then return end if not ps.progressbar(ps.lang('xtc.makingRaw'), 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:makingrawxtc", k) TriggerServerEvent("md-drugs:server:makingrawxtc", k)
end,
canInteract = function()
return handleGang(v.gang)
end end
} }
}) })
@@ -111,7 +120,7 @@ for k, v in pairs(locations.xtcpress) do
ps.entityTarget(ped, { ps.entityTarget(ped, {
{ {
icon = 'fa-solid fa-flask', icon = 'fa-solid fa-flask',
label = ps.lang('targets.xtc.press'), label = ps.lang('xtc.getPress'),
action = function() action = function()
local options = {} local options = {}
local recipeList = ps.callback('md-drugs:server:getpressrecipes') local recipeList = ps.callback('md-drugs:server:getpressrecipes')
@@ -120,14 +129,13 @@ for k, v in pairs(locations.xtcpress) do
options[#options + 1] = { options[#options + 1] = {
icon = ps.getImage(m), icon = ps.getImage(m),
title = ps.getLabel(m), title = ps.getLabel(m),
description = ps.lang('xtc.press.buysingle', d.cash), description = ps.lang('xtc.buySingle', d.cash),
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', m) TriggerServerEvent('md-drugs:server:buypress', m)
end, end,
} }
else else
ps.debug(d.take)
local descript = getRecipeList(d.take) local descript = getRecipeList(d.take)
options[#options + 1] = { options[#options + 1] = {
icon = ps.getImage(m), icon = ps.getImage(m),
@@ -142,7 +150,8 @@ for k, v in pairs(locations.xtcpress) do
end end
end end
ps.menu('XTC Presses', 'XTC Presses', options) ps.menu('XTC Presses', 'XTC Presses', options)
end end,
canInteract = function() return handleGang(v.gang) end
} }
}) })
end end
@@ -151,7 +160,7 @@ for k, v in pairs (locations.stamp) do
ps.boxTarget('xtc'..k, v.loc, {length = v.l, width = v.w, heading = v.rot}, { ps.boxTarget('xtc'..k, v.loc, {length = v.l, width = v.w, heading = v.rot}, {
{ {
icon = 'fa-solid fa-flask', icon = 'fa-solid fa-flask',
label = ps.lang('targets.xtc.' .. k), label = ps.lang('xtc.targetStamp'),
action = function() action = function()
local item = { local item = {
{item = 'white_xtc', label = ps.getLabel('white_xtc'), color = 'white'}, {item = 'white_xtc', label = ps.getLabel('white_xtc'), color = 'white'},
@@ -167,14 +176,15 @@ for k, v in pairs (locations.stamp) do
description = ps.lang('xtc.stamp_desc', d.color), description = ps.lang('xtc.stamp_desc', d.color),
action = function() action = function()
if not minigame() then ps.notify(ps.lang('xtc.fail'), "error") return end if not minigame() then ps.notify(ps.lang('xtc.fail'), "error") return end
if not ps.progressbar(string.format(ps.lang('xtc.stamp'), d.label), 4000, 'uncuff') then return end if not ps.progressbar(ps.lang('xtc.stamping'), d.label, 4000, 'uncuff') then return end
TriggerServerEvent("md-drugs:server:stamp", k, d.color) TriggerServerEvent("md-drugs:server:stamp", k, d.color)
end, end,
distance = 2.0 distance = 2.0
} }
end end
ps.menu('Stamp Pills', 'Stamp Pills', options) ps.menu('Stamp Pills', 'Stamp Pills', options)
end end,
canInteract = function() return handleGang(v.gang) end
} }
}) })
end end
+1 -1
View File
@@ -16,7 +16,7 @@ function loadFile(filePath)
ps.error("Error executing Lua chunk from '" .. filePath .. "': " .. tostring(execErr)) ps.error("Error executing Lua chunk from '" .. filePath .. "': " .. tostring(execErr))
return false return false
end end
ps.success("Successfully loaded module '" .. filePath .. "' from resource '" .. resourceName .. "'.")
return true return true
end end
-3
View File
@@ -13,8 +13,6 @@ client_scripts {
server_scripts { server_scripts {
'server/functions.lua', 'server/functions.lua',
'server/locations.lua',
'server/recipes.lua',
'server/plantSpawns.lua', 'server/plantSpawns.lua',
'serverRun.lua', 'serverRun.lua',
'@oxmysql/lib/MySQL.lua', '@oxmysql/lib/MySQL.lua',
@@ -22,7 +20,6 @@ server_scripts {
shared_scripts { shared_scripts {
'shared/**.lua', 'shared/**.lua',
'@ox_lib/init.lua',
} }
lua54 'yes' lua54 'yes'
+211 -262
View File
@@ -1,298 +1,247 @@
Lang = {} Lang = {}
Lang.targets = { Lang.Catches = {
coke = { notIn = 'You Are Not In The Correct Location',
pick = 'Pick Cocaine', needItems = 'You Do Not Have The Required Items',
cut = 'Cut Cocaine', notEnoughMoney = 'Youre To Broke',
bag = 'Bag Cocaine', buySuccess = 'You Bought %s %s For $%s',
enter = 'Enter Building', itemMissings = 'You Need \n',
exit = 'Exit Building', itemNeeded = 'You Need %s',
chop = 'Chop Coca Leaves', cooldown = 'Slow Down Speed Racer',
invalidItem = 'This Item Is Not Sold Here',
},
CornerSell = {
sell = 'Sell %s Of %s For $%s',
deny = 'Deny Price'
},
crack = {
cook = 'Cook Crack',
bag = 'Bag Crack'
},
Delivery = {
Deliver = 'Deliver For %s',
open = 'Open %s Shop',
hand = 'Hand Over'
},
heroin = {
pick = 'Pick Poppies',
up = 'Pick Up Table',
dry = 'Dry Poppies',
cut = 'Cut Heroin',
cook = 'Cook Heroin',
kit = 'Buy Heroin Lab Kit',
clean = 'Clean Table',
fill = 'Fill Syringe',
vial = 'Make Vial',
},
lean = {
git = 'Get Task',
st = 'Steal From Car'
},
lsd = {
buy = 'Buy LSD Lab Kit',
heat = 'Heat Liquid',
refine = 'Refine Quality',
paper = 'Make Tab Paper',
back = 'Pick Up Lab Kit',
dab = 'Dab LSD on sheets',
clean = 'Clean Table',
lys = 'Steal Lysergic Acid',
die = 'Steal Diethylamide',
buyt = 'Buy Tabs',
},
mescaline = {
pick = 'Pick Cactus',
dry = 'Dry Out Cactus',
},
meth = {
bag = 'Bag Up Meth',
enter = 'Enter Buidling',
exit = 'Exit Building',
cook = 'Cook Meth',
tray = 'Grab Tray',
box = 'Box Up Meth',
adjust = 'Adjust Temperature',
eph = 'Steal Ephedrine',
ace = 'Steal Acetone',
mission = 'Get Mission',
stealfromcar = 'Steal From Car',
},
oxy = {
pack = 'Get Oxy Package',
talk = 'Talk To Buyer',
pay = 'Pay For Truck',
},
pha = {
fill = 'Fill Prescription',
},
shrooms = {
pick = 'Pick Shrooms',
},
travel = {
travel = 'Open Travelling Merchant',
},
xtc = {
iso = 'Steal Isosafrole',
mdp = 'Steal MDP2P',
raw = 'Make Raw XTC',
press = 'Buy XTC Press',
stamp = 'Stamp Pills',
make = 'Make XTC',
pick = 'Pick Up Press',
},
weed = {
pick = 'Pick Weed',
dry = 'Dry Weed',
dpick = 'Pick Dried Weed',
butt = 'Open Edible Menu',
oil = 'Make Oil'
},
Wholesale = {
talk = 'Talk To Buyer'
},
} }
Lang.Coke = { Lang.coke = {
-- client side progressbars targetPick = 'Pick Coca Leaf',
picking = "Picking Leaves", picking = 'Picking Coca Leaf',
makepow = 'Chopping Leaves Into A Powder', targetMakePow = 'Make Cocaine Powder',
cutting = 'Cutting Coke With Baking Soda', noleaf = 'You Need A Coke Leaf',
bagging = "Bilbo Baggins This Bitch", makePow = 'Chopping Leaves into Powder',
-- end progressbars targetCutCoke = 'Cut Cocaine',
cut = "You Cut Some Coke", targetBagCoke = 'Bag Cocaine',
nocutcoke = "You Cant Cut Coke With No Coke Idiot", teleIn = 'Enter the Lab',
bagcoke = "You Bagged Up Coke", teleOut = 'Exit the Lab',
nobagcoke = "You Cant Bag Up Coke Without Coke Idiot", needBakingSoda = 'You Need Baking Soda For This',
}
Lang.Crack = {
--client side
cookcrack = "Cooking Some Crack",
bagcrack = 'Bilbo Baggin This Bitch',
-- server
makecrack = 'Nice Crack',
nocoke = 'You Cant Make This Without Coke'
} }
Lang.Cornerselling = { Lang.Cornerselling = {
-- client side notifys inVeh = 'Stranger Danger!',
inveh = 'STRANGER DANGER, I WONT GET IN THE CAR WITH YOU', selling = 'Selling %s for $%s',
toofar = "To Far From Your Corner Homie", deny = 'Fuck That Offer',
selling = 'Selling %s For $%s', wait = 'Waiting For Customer',
deny = "Fuck That Offer", nodrugs = 'You Do Not Have Any Drugs To Sell',
start = "Get That Paper", searching = 'Searching For Nearby Customers',
stop = "Lazy Ass Cant Even Sell Drugs", targetTakeBack = 'Take Back Drugs',
nodrugs = "What You Gonna sell? Air?", targetSell = 'Sell %s Of %s For $%s',
notcops = "Not Enough Cops", targetDeny = 'Deny Offer',
no = 'You Cant Sell Drugs Here!', stopped = 'Your Lazy Ass Cant Even Sell Drugs!',
-- end client side notifys start = 'Go Make Your Mom Proud',
-- progressbars gotRobbed = 'You Got Robbed Nerd!',
sell = "Selling Drugs", gotBack = 'You Got Your Stuff Back!',
} notEnough = 'You Dont Have Enough Of This Item',
Lang.Delivery = { comDes = 'Sell Things On The Corner'
-- client side
emailn = 'Not A Drug Dealer',
emailsub = 'Hurry Up And Get The Package To The Buyer',
emailcon = 'I Swear To God If It Doesnt Get There I Will Tell Your Mom You Said Fuck Just Bring %s Of %s',
search = "Searching For A Delivery ...",
none = "Nothing Close By",
busy = "You Havent Even Finished The One I Told You Too",
found = "Marked On Your Map",
already = "Already Deliverying",
checkrep = "Current Dealer Rep: ",
-- progressbars
pack = 'Handing Off Package',
-- end client side
} }
Lang.Heroin = { Lang.crack = {
--client targetMake = 'Cook Some Crack',
pick = " Picking Poppies Up", cook = 'Cooking Crack',
tableout = 'You Already Have A Table Out', targetBag = 'Bag Crack',
dryout = "Drying Out Poppies", bag = 'Bagging Crack',
cutting = "Cutting Heroin With Baking Soda",
secret = "SHHHHHHHHH",
table = "Placing Table Down",
success = "Heated Heroin Properly",
clean = 'Cleaning Heroin Table',
needles = 'Filling Syringe',
pickup = 'Picking Up The Heroin Table',
--
cutheroin = 'You Made Some Cut Heroin',
noheroin = "How Can You Cut Heroin Without Heroin Idiot",
vial = 'You Made A Vial Of Heroin',
novial = "How Can You Make Heroin Vials Without Heroin Idiot",
fail = 'You Over Heated Them Idiot',
fill = 'Filled The Syringe',
nofill = 'How Are You Going To Fill Needles Of Heroin Without Heroin',
haskit = 'You Already Have A Heroin Lab Kit'
} }
Lang.Lean = {
marked = ' Car Has Been Marked On Your Map', Lang.Deliveries = {
lean = 'You Got Purple Lean', targetGetDel = 'Get Delivery Mission',
dextro = ' You Got Red Dextro', targetOpenShop = 'Open Dealer Shop',
act = 'You Already Have A Lean Task', shopHeader = 'Dealer Shop',
targetHandOff = 'Hand Off Delivery',
delivering = 'Handing The Package To Drug Dealer',
alreadyDelivering = 'You Are Already Delivering A Package',
slowAf = 'You Took To Long!',
newDealerHelp = {
help = 'Place A Dealer',
name = 'Dealer Name',
timeMin = 'Minimum Time',
timeMax = 'Maximum Time'
},
DealerExists = 'Dealer Already Exists',
deleteDealer = {
help = 'Delete A Dealer',
name = 'Dealer Name',
},
deleteDealerSuccess = 'Deleted Dealer',
deleteDealerFail = 'Failed To Delete Dealer',
}
Lang.heroin = {
targetPick = 'Pick Heroin',
picking = 'Picking Heroin',
targetCook = 'Cook Heroin',
pbCook = 'Cooking Up Heroin',
targetPickup = 'Pick Up Lab',
pbPickup = 'Picking Up Lab',
targetClean = 'Clean Lab',
pbClean = 'Cleaning Lab',
targetDry = 'Dry Out Plant',
pbDry = 'Drying Out Plant',
targetCutHeroin = 'Cut Heroin',
pbCutHeroin = 'Cutting Heroin',
targetBuyKit = 'Buy Heroin Lab Kit',
pbBuyKit = 'Buying Heroin Lab Kit',
tableout = 'You Already Have A Table Out',
placing = 'Placing Down Table',
targetFill = 'Fill Syringe',
pbFill = 'Filling Syringe',
hasKitAlready = 'You Already Have A Heroin Lab Kit',
notEnoughMoney = 'You Need $%s In Cash For This',
placedKit = 'You Placed Down Your Heroin Lab Kit',
failed = 'You Failed To Make Heroin And Lost Your Ingredients',
}
Lang.lean = {
stealFromTruck = 'Steal From Truck',
startMission = 'Start Lean Mission',
notOnRun = 'You Are Not On A Lean Run'
} }
Lang.lsd = { Lang.lsd = {
steallys = 'Stealing Lysergic Acid', targetHeat = 'Heating LSD',
stealdie = 'Stealing Lysergic Acid', heating = 'Heating Up LSD',
targetRefine = 'Refine The Acid',
refining = 'Refining The Acid',
targetDipping = 'Dip Tabs',
dipping = 'Dipping Tabs',
targetPickup = 'Pick Up Lab Kit',
packup = 'Packing Up Lab Kit',
targetClean = 'Clean Lab Kit',
needCleaning = 'You Need A Cleaning Kit To Clean The Lab',
cleaning = 'Cleaning Lab Kit',
targetLys = 'Steal Lysergic Acid',
stealLys = 'Stealing Lysergic Acid',
targetDie = 'Steal Diethylamide',
stealDie = 'Stealing Diethylamide',
targetBuyTab = 'Buy Tab Paper',
targetBuyKit = 'Buy LSD Lab Kit',
alreadyOwn = 'You Already Own This Item',
buyingKit = 'Buying LSD Lab Kit',
tableout = 'You Already Have A Table Out', tableout = 'You Already Have A Table Out',
tablepack = 'Packing Table Up', placing = 'Placing Lab Kit Down!',
heat = 'Heating Up Liquids', failed = 'You Suck At Making Drugs',
clean = 'Cleaning The Table',
refine = 'Refining The Quality',
dip = 'Dipping LSD On The Paper',
buypaper = 'Buying Tab Paper',
buykit = 'Buying Lab Kit',
place = 'Placing Table Down',
hav = 'You Already Have A Table',
-- server
lys = 'You Got Lysergic Acid',
die = 'You Got Diethylamide',
cleaned = 'You Cleaned It Perfectly',
madelsd = 'You Made LSD!',
failed = 'You Over Heated Them Idiot',
refined = 'You Refined Them!',
broke = 'Your Broke Ass Cant Afford these!',
novial = 'No LSD Vials Idiot',
} }
Lang.mescaline = {
pick = "Picking Cactus", Lang.mesc = {
dry = 'Drying Out Cactus', targetPick = 'Pick Cactus',
nocactus = 'No Cactus Bulbs', picking = 'Picking Cactus',
eat = 'eating mescaline' targetDry = 'Dry Cactus',
dry = 'Drying Cactus',
} }
Lang.meth = { Lang.meth = {
inside = 'Stuff Inside Already', alreadyChasing = 'You Already Are Chasing A Truck',
increaseheat = 'Increasing Heat', targetStealFromCar = 'Steal From Meth Car',
mission = 'Car Has Been Marked On Your Map', targetHeist = 'Start Meth Mission',
ace = 'You Got Some Acetone', started = 'You Already Have Meth Cooking',
eph = 'You Got Some Ephedrine', increaseHeat = 'You Increased The Heat',
mix = 'Adding Things To The Mix', targetBag = 'Bag Meth',
nobag = 'No Bags', targetCook = 'Cook Meth',
act = 'You Already Have A Meth Task', targetGrabTray = 'Grab Meth Tray',
targetHeat = 'Adjust The Dials',
targetSmash = 'Smash The Tray',
targetStealEPH = 'Steal Ephedrine',
stealingEPH = 'Stealing Ephedrine',
targetStealACE = 'Steal Acetone',
stealingACE = 'Stealing Acetone',
notOnRun = 'You Are Not On A Meth Run',
onCooldown = 'You Are On A Cooldown'
} }
Lang.oxy = { Lang.oxy = {
truck = 'Your Truck Is Here', ditchCar = 'The Van Is Hot, Leave It Somewhere',
cantcarry = 'You Aint That Strong, You Can Only Carry One', targetHandoff = 'Hand Off The Package',
hand = 'Handing Over oxy', handingoff = 'Handing Off The Package',
empty = 'You Cant Be Empty Handed Idiot', emptyHands = 'You Are Not Carrying Anything',
broke = 'Your Broke Ass Cant Afford This', targetPay = 'Rent Oxy Van',
hot = 'Car Is Hot Dump It Now', keys = 'The Keys Are In The Van',
next = 'Get To the Next Location' targetGetPackage = 'Grab Package',
alreadyCarrying = 'You Are Already Carrying A Package',
paid = 'You Paid $%s To Rent The Van',
notOn = 'You Are Not On A Route',
} }
Lang.Pharma = { Lang.pharma = {
notems = 'You Are Not A Medical Person', input = {
header = 'Who To Give A Prescription To?',
title1 = 'Player Name',
title2 = 'Prescription',
},
write = 'Writing Prescription', write = 'Writing Prescription',
fill = 'Filling Prescription', opening = 'Opening Prescription Bottle',
open = 'Opening Bottle', targetFill = 'Fill Prescription',
pills = 'You Got Some Pills!', fill = 'Getting Prescription Filled',
no = 'You Dont Have A Prescription' canceled = 'You Canceled The Prescription',
unbottle = 'You Opened The Bottle',
} }
Lang.Shrooms = { Lang.shrooms = {
pick = 'Picking Shrooms', targetPick = 'Pick Shrooms',
picking = 'Picking Shrooms',
eat = 'Eating Shrooms', eat = 'Eating Shrooms',
trip = 'Have A Good Trip!' cancel = 'Decided To Not Do Shrooms',
took = 'You Took Some Shrooms!'
} }
Lang.Weed = { Lang.weed = {
pick = 'Harvesting Weed', targetPick = 'Pick Weed',
busy = 'Already Drying One Out', picking = 'Picking Weed',
canna = 'Making Canna-butter', targetDry = 'Dry Weed',
brown = 'Making Special Brownies', noDry = 'You Need Wet Weed For This',
cook = 'Making Special Cookies', wait = 'Waiting For Weed To Dry...',
Choc = 'Making Special Chocolate', take = 'Ready To Take Weed',
muff = 'Making Special Muffin', targetDryed = 'Pickup Weed',
stovehot = 'Stove Is Too Hot Wait 30 Seconds To Cool Down', teleportIn = 'Enter The Grow House',
shat = 'Making Shatter', teleportOut = 'Leave The Grow House',
roll = 'Rolling Blunts', dabs = 'Doing Some Dabs',
wait = 'Wait A Little Bit For To Drive', bluntWrap = 'Dipping Syrup To Make %s',
take = 'Taking Down The Weed', rollBlunt = 'Rolling A %s',
-- targetSales = 'Buy From Dealer',
nodry = 'You Need Wet Cannabis To Dry', buying = 'Buying %s From Dealer',
noweed = 'Cant Roll A Blunt With Air', itemDoesntExist = 'This Item Does Not Exist Here',
noshat = 'You Need Shatter To Do A Dab', needItem = 'You Need A %s For This',
notorch = 'You Need A butane Torch' crackBlunt = 'Cracking Open A Blunt'
}
Lang.wholesale = {
alreadyWholesale = 'Already Wholesaling',
targetBuyer = 'Talk To The Buyer',
wholesaling = 'Wholesaling Drugs',
uhoh = 'The Buyer Is Getting Sketchy',
tooLong = 'The Buyer Waited Too Long',
notEnoughCops = 'Not Enough Cops On Duty'
} }
Lang.xtc = { Lang.xtc = {
out = 'You Have A Press Out Already', alreadyOut = 'You Have A Press Out Already',
pressing = 'Pressing Pills', settingDown = 'Setting Down The Press',
raw = 'Making Raw XTC', noPressOut = 'You Do Not Have A Press Out',
mdp2p = 'Stealing MDP2P', targetMake = 'Press Pills',
iso = 'Stealing Isosafrole', making = 'Pressing A %s',
fail = 'Dude Its A Circle Not Rocket Science', targetPickup = 'Pick Up Press',
pickup = 'Picking Up The Press', picking = 'Picking Up Press',
stamp = 'Stamping %s Pills', targetStealMDP2P = 'Steal MDP2P',
buyp = "Buying Press", stealingMDP2P = 'Stealing MDP2P',
-- fail = 'Damn Dude You Suck',
cash = 'I need 20k In Cash', targetStealIsosafrole = 'Steal Isosafrole',
press = { stealingIsosafrole = 'Stealing Isosafrole',
title = {single = 'Single Press', dual = 'Dual Press', triple = 'Triple Press', quad = 'Quad Press'}, targetRaw = 'Make Raw XTC',
des = {single ='Buy a single press for 20k', dual = '20 of each unstamped single stack pill and your single press ', makingRaw = 'Making Raw XTC',
triple = '50 of each unstamped dual stack pill and your dual press ', quad = '150 of each unstamped Triple stack pill and your triple press' getPress = 'Get Press',
} buySingle = 'Buy Single Press For $%s',
} buyp = 'Buying Press',
targetStamp = 'Stamp XTC',
stamp_desc = 'Stamp %s Pills',
stamping = 'Stamping %s Pills',
noPills = 'You Dont Have Any Unstamped Pills'
} }
Lang.Wholesale = {
al = 'You Already Have A Delivery To Make',
na = 'No One Answered, Try Again Later',
}
return Lang return Lang
+64
View File
@@ -0,0 +1,64 @@
local Target = {
Travellingmerchant = {
vector4(-119.66, -977.43, 304.25, 88.21),
vector4(-1522.93, 1476.01, 111.45, 41.25),
vector4(-3278.98, 973.38, 5.35, 101.53),
},
}
local loc = Target.Travellingmerchant[math.random(1, #Target.Travellingmerchant)]
local stores = {
travel = {
tab_paper = 50,
bakingsoda = 25,
isosafrole = 25,
mdp2p = 25,
lysergic_acid = 25,
diethylamide = 25,
lockpick = 2,
emptyvial = 2,
needle = 2,
cokeburner = 25,
crackburner = 2,
lsdburner = 2,
heroinburner = 2,
mdlean = 50,
weedgrinder = 25,
mdbutter = 25,
flour = 25,
chocolate = 25,
butane = 25,
butanetorch = 2,
dabrig = 2,
mdwoods = 2,
leancup = 25,
xtcburner = 25,
},
}
ps.registerCallback('md-drugs:server:GetMerchant', function(source)
return loc, stores.travel
end)
RegisterServerEvent("md-drugs:server:purchaseGoods", function(item)
local src = source
if not ps.checkDistance(src, loc, 10) then
ps.notify(src, ps.lang('Catches.notIn'), "error")
return
end
if not stores.travel[item] then
ps.notify(src, ps.lang('Catches.invalidItem'), "error")
return
end
if ps.removeMoney(src, 'cash', stores.travel[item]) then
ps.addItem(src, item, 1)
else
ps.notify(src, ps.lang('Catches.notEnoughMoney'), "error")
end
end)
+8 -8
View File
@@ -42,7 +42,7 @@ end)
RegisterServerEvent('md-drugs:server:makepowder', function(num) RegisterServerEvent('md-drugs:server:makepowder', function(num)
local src = source local src = source
if not ps.checkDistance(src, cocaineLocations.MakePowder[num].loc, 3.5) then if not ps.checkDistance(src, cocaineLocations.MakePowder[num].loc, 3.5) then
ps.notify(src, 'You are not in the correct location', 'error') ps.notify(src, ps.lang('Catches.notIn'), 'error')
return return
end end
local tier = 'tier1' local tier = 'tier1'
@@ -55,7 +55,7 @@ RegisterServerEvent('md-drugs:server:makepowder', function(num)
end end
end end
if not ps.craftItem(src, cocaineRecipes['cocaine']['cokepowder'][tier]) then if not ps.craftItem(src, cocaineRecipes['cocaine']['cokepowder'][tier]) then
ps.notify(src, 'You do not have the required items', 'error') verifyHas(src, cocaineRecipes['cocaine']['cokepowder'][tier].take)
return return
end end
end) end)
@@ -64,7 +64,7 @@ RegisterServerEvent('md-drugs:server:cutcokeone', function(num)
local src = source local src = source
local tier = 'tier1' local tier = 'tier1'
if not ps.checkDistance(src, cocaineLocations.CuttingCoke[num].loc, 2.5) then if not ps.checkDistance(src, cocaineLocations.CuttingCoke[num].loc, 2.5) then
ps.notify(src, 'You are not in the correct location', 'error') ps.notify(src, ps.lang('Catches.notIn'), 'error')
return return
end end
if Config.TierSystem then if Config.TierSystem then
@@ -81,7 +81,7 @@ RegisterServerEvent('md-drugs:server:cutcokeone', function(num)
end end
end end
if not ps.craftItem(src, cocaineRecipes['cocaine']['cutcoke'][tier]) then if not ps.craftItem(src, cocaineRecipes['cocaine']['cutcoke'][tier]) then
ps.notify(src, 'You do not have the required items', 'error') verifyHas(src, cocaineRecipes['cocaine']['cutcoke'][tier].take)
return return
end end
end) end)
@@ -90,7 +90,7 @@ RegisterServerEvent('md-drugs:server:bagcoke', function(num)
local src = source local src = source
local tier = 'tier1' local tier = 'tier1'
if not ps.checkDistance(src, cocaineLocations.BaggingCoke[num].loc, 2.5) then if not ps.checkDistance(src, cocaineLocations.BaggingCoke[num].loc, 2.5) then
ps.notify(src, 'You are not in the correct location', 'error') ps.notify(src, ps.lang('Catches.notIn'), 'error')
return return
end end
if Config.TierSystem then if Config.TierSystem then
@@ -106,13 +106,13 @@ RegisterServerEvent('md-drugs:server:bagcoke', function(num)
end end
end end
if not ps.craftItem(src, cocaineRecipes['cocaine']['bagcoke'][tier]) then if not ps.craftItem(src, cocaineRecipes['cocaine']['bagcoke'][tier]) then
ps.notify(src, 'You do not have the required items', 'error') verifyHas(src, cocaineRecipes['cocaine']['bagcoke'][tier].take)
return return
end end
AddRep(src, 'coke') AddRep(src, 'coke')
else else
if not ps.craftItem(src, cocaineRecipes['cocaine']['bagcoke'][tier]) then if not ps.craftItem(src, cocaineRecipes['cocaine']['bagcoke'][tier]) then
ps.notify(src, 'You do not have the required items', 'error') verifyHas(src, cocaineRecipes['cocaine']['bagcoke'][tier].take)
return return
end end
end end
@@ -122,7 +122,7 @@ local cokecut = {loosecokestagetwo = 2, loosecokestagethree = 3}
for k, v in pairs (cokecut) do for k, v in pairs (cokecut) do
ps.createUseable(k, function(source, item) ps.createUseable(k, function(source, item)
local src = source local src = source
if not ps.hasItem(src, 'bakingsoda') then ps.notify(src, 'You Need Baking Soda For this', 'error') return end if not ps.hasItem(src, 'bakingsoda') then ps.notify(src, ps.lang('coke.needBakingSoda'), 'error') return end
if ps.hasItem(src,item.name) then if ps.hasItem(src,item.name) then
local check = ps.callback('md-drugs:client:uncuff', src, 'Cutting It Further') local check = ps.callback('md-drugs:client:uncuff', src, 'Cutting It Further')
if not check then return end if not check then return end
+8 -9
View File
@@ -21,8 +21,8 @@ strength = number -- how long you are strong boi
]] ]]
local Consume = { local Consume = {
-- meth -- meth
methbags = { time = 4000, effect = 'meth', anim = "smoke", ps.progressbartext = "Injesting", methbags = { time = 4000, effect = 'meth', anim = "smoke", progressbartext = "Injesting",
add = {health = -20, stress = -10, speed = 40, strength = 10, thirst = -30}}, add = {health = -20, stress = -10, speed = 40, strength = 10, thirst = -30}},
cokebaggy = { anim = 'smell', time = 1000, effect = 'coke', add = { stress = -10 }}, cokebaggy = { anim = 'smell', time = 1000, effect = 'coke', add = { stress = -10 }},
cokebaggystagetwo = { anim = 'smell', time = 1000, effect = 'coke', add = { stress = -10 }}, cokebaggystagetwo = { anim = 'smell', time = 1000, effect = 'coke', add = { stress = -10 }},
cokebaggystagethree = { anim = 'smell', time = 1000, effect = 'coke', add = { stress = -10 }}, cokebaggystagethree = { anim = 'smell', time = 1000, effect = 'coke', add = { stress = -10 }},
@@ -143,22 +143,22 @@ xanax = { anim = 'pill', effect = 'none', add = { stress = -40
} }
for k, v in pairs(Consume) do for k, v in pairs(Consume) do
CUI(k, function(source, item) ps.createUseable(k, function(source, item)
if not Itemcheck(source, k, 1) then return end if not ps.hasItem(source, k, 1) then return end
local time = v.time or Consumables.defaulttime local time = v.time or Consumables.defaulttime
local effect = v.effect or 0 local effect = v.effect or 0
local anim = v.anim or Consumables.defaultanim local anim = v.anim or Consumables.defaultanim
local ps.progressbartext = v.ps.progressbartext or Consumables.defaultprogresstext local progressbartext = v.progressbartext or Consumables.defaultprogresstext
local add = v.add or {hunger = 0} local add = v.add or {hunger = 0}
local done = ps.callback('md-drugs:client:consumedrugs', source, time, effect, anim, ps.progressbartext, add, k) local done = ps.callback('md-drugs:client:consumedrugs', source, time, effect, anim, progressbartext, add, k)
if done then if done then
RemoveItem(source, k, 1) ps.removeItem(source, k, 1)
end end
end) end)
end end
RegisterNetEvent('md-drugs:server:updatestatus', function(stat, statval) RegisterNetEvent('md-drugs:server:updatestatus', function(stat, statval)
local Player = getPlayer(source) local Player = ps.getPlayer(source)
local hunger, thirst = Player.PlayerData.metadata.hunger, Player.PlayerData.metadata.thirst local hunger, thirst = Player.PlayerData.metadata.hunger, Player.PlayerData.metadata.thirst
if stat == "thirst" then if stat == "thirst" then
local value = thirst + statval local value = thirst + statval
@@ -176,6 +176,5 @@ RegisterNetEvent('md-drugs:server:updatestatus', function(stat, statval)
local value = Player.PlayerData.metadata.armor + statval local value = Player.PlayerData.metadata.armor + statval
TriggerEvent('hospital:server:SetArmor', value) TriggerEvent('hospital:server:SetArmor', value)
TriggerClientEvent('hud:client:UpdateStress', source, Player.PlayerData.metadata.armor, value) TriggerClientEvent('hud:client:UpdateStress', source, Player.PlayerData.metadata.armor, value)
else
end end
end) end)
+6 -7
View File
@@ -135,7 +135,7 @@ local function beingRobbed(source, item, amount, ped)
local math = math.random(1,100) local math = math.random(1,100)
if math <= robChance then if math <= robChance then
ps.removeItem(src, item, amount) ps.removeItem(src, item, amount)
ps.notify(src, 'You Got Robbed Nerd', 'error') ps.notify(src, ps.lang('Cornerselling.gotRobbed'), 'error')
RobbedDrugs[ps.getIdentifier(source)] = {item = item, amount = amount, ped = ped} RobbedDrugs[ps.getIdentifier(source)] = {item = item, amount = amount, ped = ped}
return true return true
else else
@@ -148,7 +148,7 @@ local function getDrugBack(source, item, amount)
if RobbedDrugs[ps.getIdentifier(source)] then if RobbedDrugs[ps.getIdentifier(source)] then
if RobbedDrugs[ps.getIdentifier(source)].item == item and RobbedDrugs[ps.getIdentifier(source)].amount == amount then if RobbedDrugs[ps.getIdentifier(source)].item == item and RobbedDrugs[ps.getIdentifier(source)].amount == amount then
ps.addItem(src, item, amount) ps.addItem(src, item, amount)
ps.notify(src, 'You Got Your Drugs Back', 'success') ps.notify(src, ps.lang('Cornerselling.gotBack'), 'success')
RobbedDrugs[ps.getIdentifier(source)] = nil RobbedDrugs[ps.getIdentifier(source)] = nil
return true return true
end end
@@ -180,7 +180,7 @@ end)
ps.registerCallback('md-drugs:server:hasDrugs', function(source) ps.registerCallback('md-drugs:server:hasDrugs', function(source)
for k, v in pairs(Drugs) do for k, v in pairs(Drugs) do
if hasItem(source, k, 1) then if ps.hasItem(source, k, 1) then
return true return true
end end
end end
@@ -208,12 +208,11 @@ RegisterNetEvent('md-drugs:server:sellCornerDrugs', function(item, amount, price
local src = source local src = source
if not csCheck(src, item, amount, price) then return end if not csCheck(src, item, amount, price) then return end
if not ps.removeItem(src, item, amount) then if not ps.removeItem(src, item, amount) then
ps.notify(src, 'You Do Not Have Enough Of This Item', 'error') ps.notify(src, ps.lang('Cornerselling.notEnough'), 'error')
DrugDeals[ps.getIdentifier(src)] = nil DrugDeals[ps.getIdentifier(src)] = nil
return return
end end
AddRep(src, 'cornerselling', Drugs[item].rep * amount) 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')
DrugDeals[ps.getIdentifier(src)] = nil DrugDeals[ps.getIdentifier(src)] = nil
ps.addMoney(src, 'cash', price) ps.addMoney(src, 'cash', price)
end) end)
@@ -225,8 +224,8 @@ RegisterNetEvent('md-drugs:server:getBackRobbed', function()
RobbedDrugs[ps.getIdentifier(source)] = nil RobbedDrugs[ps.getIdentifier(source)] = nil
end) end)
lib.addCommand('cornersell', { ps.registerCommand('cornersell', {
help = 'Sell Things On The Corner', help = ps.lang('Cornerselling.comDes'),
params = { params = {
}, },
}, function(source, args, raw) }, function(source, args, raw)
+6 -6
View File
@@ -27,7 +27,7 @@ RegisterServerEvent('md-drugs:server:makecrackone', function(num)
local src = source local src = source
local tier = 'tier1' local tier = 'tier1'
if not ps.checkDistance(src, CrackLocations.makecrack[num].loc, 2.0) then if not ps.checkDistance(src, CrackLocations.makecrack[num].loc, 2.0) then
ps.notify(src, 'You are not in the correct location', 'error') ps.notify(src, ps.lang('Catches.notIn'), 'error')
return return
end end
if Config.TierSystem then if Config.TierSystem then
@@ -44,7 +44,7 @@ RegisterServerEvent('md-drugs:server:makecrackone', function(num)
end end
end end
if not ps.craftItem(src, crackRecipe['crack']['cookcrack'][tier]) then if not ps.craftItem(src, crackRecipe['crack']['cookcrack'][tier]) then
ps.notify(src, 'You do not have the required items', 'error') verifyHas(src, crackRecipe['crack']['cookcrack'][tier].take)
return return
end end
end) end)
@@ -54,7 +54,7 @@ RegisterServerEvent('md-drugs:server:bagcrack', function(num)
local src = source local src = source
local tier = 'tier1' local tier = 'tier1'
if not ps.checkDistance(src, CrackLocations.bagcrack[num].loc, 2.0) then if not ps.checkDistance(src, CrackLocations.bagcrack[num].loc, 2.0) then
ps.notify(src, 'You are not in the correct location', 'error') ps.notify(src, ps.lang('Catches.notIn'), 'error')
return return
end end
if Config.TierSystem then if Config.TierSystem then
@@ -71,7 +71,7 @@ RegisterServerEvent('md-drugs:server:bagcrack', function(num)
end end
end end
if not ps.craftItem(src, crackRecipe['crack']['bagcrack'][tier]) then if not ps.craftItem(src, crackRecipe['crack']['bagcrack'][tier]) then
ps.notify(src, 'You do not have the required items', 'error') verifyHas(src, crackRecipe['crack']['bagcrack'][tier].take)
return return
end end
end) end)
@@ -93,8 +93,8 @@ end
RegisterNetEvent("md-drugs:server:failcrackone", function(num) RegisterNetEvent("md-drugs:server:failcrackone", function(num)
local src = source local src = source
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.makecrack[num].loc, 2.0) then if not ps.checkDistance(src, CrackLocations.makecrack[num].loc, 2.0) then
ps.notify(src, 'You are not in the correct location', 'error') ps.notify(src, ps.lang('Catches.notIn'), 'error')
return return
end end
local items = { local items = {
+66 -31
View File
@@ -80,13 +80,25 @@ local dloc = {
{coords = vector4(223.98, 121.53, 102.76, 259.68)}, {coords = vector4(223.98, 121.53, 102.76, 259.68)},
{coords = vector4(102.19, -255.02, 50.05, 83.59)}, {coords = vector4(102.19, -255.02, 50.05, 83.59)},
} }
ps.registerCallback('md-drugs:server:getDealers', function(data) local Products = {
{name = "weed_whitewidow_seed", price = 15, amount = 150, minrep = 0},
{name = "weed_skunk_seed", price = 15, amount = 150, minrep = 0},
{name = "weed_purplehaze_seed", price = 15, amount = 150, minrep = 0},
{name = "weed_ogkush_seed", price = 15, amount = 150, minrep = 0},
{name = "weed_amnesia_seed", price = 15, amount = 150, minrep = 0},
}
ps.registerCallback('md-drugs:server:dealerList', function()
return Products
end)
ps.registerCallback('md-drugs:server:getDealers', function(source)
local check = MySQL.query.await('SELECT * FROM dealers', {}) local check = MySQL.query.await('SELECT * FROM dealers', {})
local loc = json.encode({x = 899.98, y = -2603.24, z = 6.11, h = 176.12 }) local loc = json.encode({x = 899.98, y = -2603.24, z = 6.11, h = 176.12 })
if not check[1] then if not check[1] then
MySQL.insert('INSERT INTO dealers SET name = ?, coords = ?, time = ?, createdby = ?', {'MD', loc, 'any', 'code Newb'}) MySQL.insert('INSERT INTO dealers SET name = ?, coords = ?, time = ?, createdby = ?', {'MD', loc, 'any', 'code Newb'})
Wait(2000) Wait(2000)
local check2 = MySQL.query.await('SELECT * FROM dealers', {}) local check2 = MySQL.query.await('SELECT * FROM dealers', {})
return check2 return check2
else else
return check return check
@@ -99,9 +111,9 @@ local DeliveryItems = {
{ item = "coke_brick", minrep = 0, payout = {min = 10, max = 50}}, { item = "coke_brick", minrep = 0, payout = {min = 10, max = 50}},
} }
ps.registerCallback('md-drugs:server:GetDeliveryItem', function(data) ps.registerCallback('md-drugs:server:GetDeliveryItem', function(source, data)
local src = source local src = source
local Player = getPlayer(src) local Player = ps.getPlayer(src)
local itemnum = math.random(1, #DeliveryItems) local itemnum = math.random(1, #DeliveryItems)
local item = DeliveryItems[itemnum].item local item = DeliveryItems[itemnum].item
local amount = math.random(1,4) local amount = math.random(1,4)
@@ -115,53 +127,62 @@ ps.registerCallback('md-drugs:server:GetDeliveryItem', function(data)
}) })
if not check[1] then if not check[1] then
MySQL.insert('INSERT INTO deliveriesdealer SET cid = ?, itemdata = ?, timestart = ?, maxtime = ?, location = ?', MySQL.insert('INSERT INTO deliveriesdealer SET cid = ?, itemdata = ?, timestart = ?, maxtime = ?, location = ?',
{Player.PlayerData.citizenid, json.encode({item = item, amount = amount}), os.time(), os.time() + (15 * 60), coord }) {ps.getIdentifier(src), json.encode({item = item, amount = amount}), os.time(), os.time() + (15 * 60), coord })
AddItem(Player.PlayerData.source, item, amount) ps.addItem(src, item, amount)
return true, item, amount, coord return true, item, amount, coord
else else
local time = os.time() local time = os.time()
local timeout = math.floor(os.difftime(time, check[1].maxtime) / 60) 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}) ps.notify(src, 'You Failed To Make It In Time!', 'error' ) return false end if timeout > 15 then
ps.notify(src,'You Already Have A Delivery To Make', 'error' ) return false, item, amount, coord MySQL.query.await('DELETE FROM deliveriesdealer WHERE cid = ?', {ps.getIdentifier(src)})
ps.notify(src, ps.lang('Deliveries.slowAf'), 'error' )
return false
end
ps.notify(src,ps.lang('Deliveries.alreadyDelivering'), 'error' )
return false, item, amount, coord
end end
end) end)
RegisterNetEvent('md-drugs:server:giveDeliveryItems', function(item, amount) RegisterNetEvent('md-drugs:server:giveDeliveryItems', function(item, amount)
local src = source local src = source
local Player = getPlayer(src) local Player = ps.getPlayer(src)
local check = MySQL.query.await('SELECT * FROM deliveriesdealer WHERE cid = ?', {Player.PlayerData.citizenid}) local check = MySQL.query.await('SELECT * FROM deliveriesdealer WHERE cid = ?', {ps.getIdentifier(src)})
if not check[1] then return end if not check[1] then return end
local time = os.time() local time = os.time()
local timeout = math.floor(os.difftime(time, check[1].maxtime) / 60) local timeout = math.floor(os.difftime(time, check[1].maxtime) / 60)
local itemData = json.decode(check[1].itemdata) local itemData = json.decode(check[1].itemdata)
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 timeout >= 15 then
MySQL.query.await('DELETE FROM deliveriesdealer WHERE cid = ?', {ps.getIdentifier(src)})
ps.notify(src, ps.lang('Deliveries.slowAf'), 'error' )
return
end
if item ~= itemData.item then return end if item ~= itemData.item then return end
if amount ~= itemData.amount then return end if amount ~= itemData.amount then return end
if RemoveItem(src, item, amount) then if ps.removeItem(src, item, amount) then
for k, v in pairs (DeliveryItems) do for k, v in pairs (DeliveryItems) do
if v.item == item then if v.item == item then
local income = math.random(v.payout.min, v.payout.max) local income = math.random(v.payout.min, v.payout.max)
Player.Functions.AddMoney('cash', income) ps.addMoney(src, 'cash', income)
AddRep(src, 'dealerrep') AddRep(src, 'dealerrep')
end end
end end
MySQL.query.await('DELETE FROM deliveriesdealer WHERE cid = ?', {Player.PlayerData.citizenid}) MySQL.query.await('DELETE FROM deliveriesdealer WHERE cid = ?', {ps.getIdentifier(src)})
end end
end) end)
lib.addCommand("newdealer", { ps.registerCommand("newdealer", {
help = "Place a dealer (Admin Only)", help = ps.lang('Deliveries.newDealerHelp.help'),
params = { description = {
{ name = "name", help = "Dealer Name", type = "string" }, { name = "name", help = ps.lang('Deliveries.newDealerHelp.name'), type = "string" },
{ name = "min", help = "Minimum Time", type = "number" }, { name = "min", help = ps.lang('Deliveries.newDealerHelp.timeMin'), type = "number" },
{ name = "max", help = "Maximum Time", type = "number" } { name = "max", help = ps.lang('Deliveries.newDealerHelp.timeMax'), type = "number" }
}, },
restricted = "admin" admin = true,
}, function(source, args) }, function(source, args)
local ped = GetPlayerPed(source) local ped = GetPlayerPed(source)
local coords = GetEntityCoords(ped) local coords = GetEntityCoords(ped)
local Player = getPlayer(source) local Player = ps.getPlayer(source)
if not Player then return end if not Player then return end
local dealerName = args.name local dealerName = args.name
@@ -169,7 +190,7 @@ lib.addCommand("newdealer", {
local result = MySQL.scalar.await('SELECT name FROM dealers WHERE name = ?', { dealerName }) local result = MySQL.scalar.await('SELECT name FROM dealers WHERE name = ?', { dealerName })
if result then if result then
return ps.notify(source,"Already Exists", "error") return ps.notify(source,ps.lang('Deliveries.DealerExists'), "error")
end end
MySQL.insert('INSERT INTO dealers (name, coords, time, createdby) VALUES (?, ?, ?, ?)', { MySQL.insert('INSERT INTO dealers (name, coords, time, createdby) VALUES (?, ?, ?, ?)', {
@@ -188,12 +209,12 @@ lib.addCommand("newdealer", {
end) end)
end) end)
lib.addCommand("deletedealer", { ps.registerCommand("deletedealer", {
help = "Delete a dealer (Admin Only)", help = ps.lang('Deliveries.deleteDealerHelp.help'),
params = { description = {
{ name = "name", help = "Dealer Name", type = "string" } { name = "name", help = ps.lang('Deliveries.deleteDealerHelp.name'), type = "string" }
}, },
restricted = 'group.admin' admin = true
}, function(source, args) }, function(source, args)
local dealerName = args.name local dealerName = args.name
local result = MySQL.scalar.await('SELECT * FROM dealers WHERE name = ?', { dealerName }) local result = MySQL.scalar.await('SELECT * FROM dealers WHERE name = ?', { dealerName })
@@ -202,8 +223,22 @@ lib.addCommand("deletedealer", {
MySQL.query('DELETE FROM dealers WHERE name = ?', { dealerName }) MySQL.query('DELETE FROM dealers WHERE name = ?', { dealerName })
QBConfig.Dealers[dealerName] = nil QBConfig.Dealers[dealerName] = nil
TriggerClientEvent('md-drugs:client:RefreshDealers', -1, QBConfig.Dealers) TriggerClientEvent('md-drugs:client:RefreshDealers', -1, QBConfig.Dealers)
TriggerClientEvent('QBCore:ps.notify', source, "Dealer Deleted", "success") ps.notify(source, ps.lang('Deliveries.deleteDealerSuccess'), "success")
else else
TriggerClientEvent('QBCore:ps.notify', source, "Who You Tryna Delete", "error") ps.notify(source, ps.lang('Deliveries.deleteDealerFail'), "error")
end end
end) end)
RegisterNetEvent('md-drugs:server:buyItemDealer', function(num)
local src = source
local itemData = Products[num]
if not itemData then return end
local Player = ps.getPlayer(src)
if not Player then return end
if not ps.removeMoney(src, 'cash', itemData.price) or not ps.removeMoney(src,'bank', itemData.price) then
ps.notify(src, ps.lang('Catches.notEnoughMoney'), 'error')
return
end
ps.addItem(src, itemData.name, 1)
ps.notify(src, string.format(ps.lang('Deliveries.buyItemSuccess'), 1, ps.getLabel(itemData.name), itemData.price), 'success')
end)
+33 -64
View File
@@ -1,13 +1,36 @@
function verifyHas(source, items)
local need = 0
local have = 0
local missingList = {}
------------------------------------------ logging stuff for k, v in pairs(items) do
local logs = false need = need + 1
local logapi = GetConvar("fivemerrLogs", "") if ps.hasItem(source, k, v) then
local endpoint = 'https://api.fivemerr.com/v1/logs' have = have + 1
local headers = { else
['Authorization'] = logapi, local label = ps.getItemLabel(k) or k
['Content-Type'] = 'application/json', table.insert(missingList, v .. " " .. label)
} end
end
if need == have then
return true
end
local message = ps.lang('Catches.itemMissings') .. table.concat(missingList, "\n")
ps.notify(source, message, 'error')
return false
end
RegisterCommand('TestMissing', function(source)
local items = {
coke = 5,
heroin = 2,
lsd = 1
}
local src = source
verifyHas(src, items)
end)
local function handleFresh(source) local function handleFresh(source)
local table = json.encode({ local table = json.encode({
@@ -68,62 +91,8 @@ function AddRep(source, type, amount)
end end
end end
lib.addCommand('addCornerSellingTOREP', { ps.registerCallback('md-drugs:server:GetCoppers', function(source, cb, args)
help = 'RUN THIS ONCE AND DELETE', return ps.getJobTypeCount('leo')
restricted = 'group.admin'
}, function(source, args, raw)
local sql = MySQL.query.await('SELECT * FROM drugrep', {})
for k, v in pairs (sql) do
local new = {}
local old = json.decode(v.drugrep)
local get = old[1] or old
table.insert(new, {
coke = get.coke,
lsd = get.lsd,
heroin = get.heroin,
dealerrep = get.dealerrep,
cornerselling = {
price = QBConfig.SellLevel[1].price,
rep = 0,
label = QBConfig.SellLevel[1].label,
level = 1
}
})
local news = json.encode(new)
MySQL.query.await('UPDATE drugrep SET drugrep = ? WHERE cid = ?', {news, v.cid})
end
end)
function sortTab(tbl, type)
table.sort(tbl, function(a, b)
return a[type] < b[type]
end)
end
function handleCornersell(source, item, amount, price)
if RemoveItem(source, item, amount) then
if inventory == 'qb' then
local Player = getPlayer(source)
if QBConfig.MarkedBills == true then
Player.Functions.AddItem('markedbills',1,false, {worth = price})
return true
end
if QBConfig.CustomDirtyMoney == true then
AddItem(source, QBConfig.CustomDirtyMoneyitem,price)
return true
end
Player.Functions.AddMoney('cash', price)
elseif inventory == 'ox' then
AddItem(source, 'black_money', price)
return true
end
else
return false
end
end
lib.callback.register('md-drugs:server:GetCoppers', function(source, cb, args)
return getCops()
end) end)
ps.registerCallback('md-drugs:server:GetRep', function(source, cb, args) ps.registerCallback('md-drugs:server:GetRep', function(source, cb, args)
+35 -19
View File
@@ -59,8 +59,11 @@ end)
RegisterServerEvent('md-drugs:server:dryplant', function(num) RegisterServerEvent('md-drugs:server:dryplant', function(num)
local src = source local src = source
if not ps.checkDistance(src, heroinLocations.dryplant[num].loc, 3.0) then return end if not ps.checkDistance(src, heroinLocations.dryplant[num].loc, 3.0) then
if not ps.hasItem(src, 'poppyresin', 1) then return end ps.notify(src, ps.lang('Catches.notIn'), 'error')
return
end
local tier = 'tier1' local tier = 'tier1'
if Config.TierSystem then if Config.TierSystem then
local heroin = getRep(src, 'heroin') local heroin = getRep(src, 'heroin')
@@ -73,15 +76,17 @@ RegisterServerEvent('md-drugs:server:dryplant', function(num)
end end
end end
if not ps.craftItem(src, heroinRecipes['dryheroin'][tier]) then if not ps.craftItem(src, heroinRecipes['dryheroin'][tier]) then
ps.notify(src, 'You do not have the required items', 'error') verifyHas(src, heroinRecipes['dryheroin'][tier].take)
return return
end end
end) end)
RegisterServerEvent('md-drugs:server:cutheroin', function(num) RegisterServerEvent('md-drugs:server:cutheroin', function(num)
local src = source local src = source
if not ps.checkDistance(src, heroinLocations.cutheroinone[num].loc, 3.0) then return end if not ps.checkDistance(src, heroinLocations.cutheroinone[num].loc, 3.0) then
if not ps.hasItem(src, 'bakingsoda', 1) then return end ps.notify(src, ps.lang('Catches.notIn'), 'error')
return
end
if Config.TierSystem then if Config.TierSystem then
local itemList = { local itemList = {
heroin = 'tier1', heroin = 'tier1',
@@ -92,7 +97,7 @@ RegisterServerEvent('md-drugs:server:cutheroin', function(num)
local cuth = ps.hasItem(src, k) local cuth = ps.hasItem(src, k)
if cuth then if cuth then
if not ps.craftItem(src, heroinRecipes['cutheroin'][v]) then if not ps.craftItem(src, heroinRecipes['cutheroin'][v]) then
ps.notify(src, 'You do not have the required items', 'error') verifyHas(src, heroinRecipes['cutheroin'][v].take)
return return
end end
AddRep(src, 'heroin') AddRep(src, 'heroin')
@@ -101,7 +106,7 @@ RegisterServerEvent('md-drugs:server:cutheroin', function(num)
end end
else else
if not ps.craftItem(src, heroinRecipes['cutheroin']['tier1']) then if not ps.craftItem(src, heroinRecipes['cutheroin']['tier1']) then
ps.notify(src, 'You do not have the required items', 'error') verifyHas(src, heroinRecipes['cutheroin']['tier1'].take)
return return
end end
end end
@@ -109,13 +114,16 @@ end)
RegisterServerEvent('md-drugs:server:getheroinlabkit', function(num) RegisterServerEvent('md-drugs:server:getheroinlabkit', function(num)
local src = source local src = source
if not ps.checkDistance(src, heroinLocations.buyKit[num].loc, 3.0) then return end if not ps.checkDistance(src, heroinLocations.buyKit[num].loc, 3.0) then
ps.notify(src, ps.lang('Catches.notIn'), 'error')
return
end
local has = ps.hasItem(src, 'heroinlabkit') local has = ps.hasItem(src, 'heroinlabkit')
if has then ps.notify(src, Lang.Heroin.haskit, 'error') return end if has then ps.notify(src, ps.lang('heroin.hasKitAlready'), 'error') return end
if ps.removeMoney(src, 'cash', prices.heroinlabkitprice) then if ps.removeMoney(src, 'cash', prices.heroinlabkitprice) then
ps.addItem(src, 'heroinlabkit', 1) ps.addItem(src, 'heroinlabkit', 1)
else else
ps.notify(src, 'You Need '.. prices.heroinlabkitprice .. ' In Cash For This', 'error') ps.notify(src, ps.lang('heroin.notEnoughMoney', prices.heroinlabkitprice), 'error')
end end
end) end)
@@ -152,7 +160,7 @@ ps.createUseable('heroinlabkit', function(source, item)
coords = loc, coords = loc,
name = ps.getPlayerName(src) name = ps.getPlayerName(src)
}) })
ps.notify(src, ps.lang('Heroin.placed'), "success") ps.notify(src, ps.lang('heroin.placedKit'), "success")
end end
end) end)
@@ -170,7 +178,7 @@ RegisterServerEvent('md-drugs:server:heatliquidheroin', function()
local cuth = ps.hasItem(src, k) local cuth = ps.hasItem(src, k)
if cuth then if cuth then
if not ps.craftItem(src, heroinRecipes['fillvial'][v]) then if not ps.craftItem(src, heroinRecipes['fillvial'][v]) then
ps.notify(src, 'You do not have the required items', 'error') verifyHas(src, heroinRecipes['fillvial'][v].take)
return return
end end
AddRep(src, 'heroin') AddRep(src, 'heroin')
@@ -178,7 +186,10 @@ RegisterServerEvent('md-drugs:server:heatliquidheroin', function()
end end
end end
else else
if not ps.craftItem(src, heroinRecipes['fillvial']['tier1']) then return end if not ps.craftItem(src, heroinRecipes['fillvial']['tier1']) then
verifyHas(src, heroinRecipes['fillvial']['tier1'].take)
return
end
end end
end) end)
@@ -194,7 +205,7 @@ RegisterServerEvent('md-drugs:server:failheatingheroin', function()
local cuth = ps.hasItem(src, k) local cuth = ps.hasItem(src, k)
if cuth then if cuth then
ps.removeItem(src, k, v) ps.removeItem(src, k, v)
ps.notify(src, ps.lang('Heroin.fail'), "error") ps.notify(src, ps.lang('heroin.failed'), "error")
return return
end end
end end
@@ -202,8 +213,8 @@ end)
RegisterServerEvent('md-drugs:server:fillneedle', function(num) RegisterServerEvent('md-drugs:server:fillneedle', function(num)
local src = source local src = source
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.fillneedle[num].loc, 3.0) then if not ps.checkDistance(src, heroinLocations.fillNeedle[num].loc, 3.0) then
ps.notify(src, ps.lang('Heroin.noloc'), 'error') ps.notify(src, ps.lang('Catches.notIn'), 'error')
return return
end end
if not ps.hasItem(src, 'needle', 1) then return end if not ps.hasItem(src, 'needle', 1) then return end
@@ -216,14 +227,19 @@ RegisterServerEvent('md-drugs:server:fillneedle', function(num)
for k, v in pairs(itemList) do for k, v in pairs(itemList) do
local vh = ps.hasItem(src, v.item) local vh = ps.hasItem(src, v.item)
if vh then if vh then
if not ps.craftItem(src, heroinRecipes['fillneedle'][v.tier]) then return end if not ps.craftItem(src, heroinRecipes['fillneedle'][v.tier]) then
verifyHas(src, heroinRecipes['fillneedle'][v.tier].take)
return
end
AddRep(src, 'heroin') AddRep(src, 'heroin')
return return
end end
end end
ps.notify(src,Lang.Heroin.nofill, "error")
else else
if not ps.craftItem(src, heroinRecipes['fillneedle']['tier1']) then return end if not ps.craftItem(src, heroinRecipes['fillneedle']['tier1']) then
verifyHas(src, heroinRecipes['fillneedle']['tier1'].take)
return
end
end end
end) end)
+1 -1
View File
@@ -37,7 +37,7 @@ end
RegisterServerEvent('md-drugs:server:givelean', function() RegisterServerEvent('md-drugs:server:givelean', function()
local src = source local src = source
local amount = math.random(1,5) local amount = math.random(1,5)
if not onRun[ps.getIdentifier(src)] then return ps.notify(src, Lang.lean.err, "error") end if not onRun[ps.getIdentifier(src)] then return ps.notify(src, ps.lang('lean.notOnRun'), "error") end
onRun[ps.getIdentifier(src)] = onRun[ps.getIdentifier(src)] + 1 onRun[ps.getIdentifier(src)] = onRun[ps.getIdentifier(src)] + 1
if math.random(1,100) <= 50 then if math.random(1,100) <= 50 then
ps.addItem(src, "mdlean", amount) ps.addItem(src, "mdlean", amount)
+17 -12
View File
@@ -47,7 +47,7 @@ RegisterServerEvent('md-drugs:server:getlysergic', function(num)
local src = source local src = source
if timedOut[src] then return end if timedOut[src] then return end
if not ps.checkDistance(src, lsdLocations.lysergicacid[num].loc, 2.0) then if not ps.checkDistance(src, lsdLocations.lysergicacid[num].loc, 2.0) then
ps.notify(src, ps.lang('lsd.notinloc'), "error") ps.notify(src, ps.lang('Catches.notIn'), "error")
return return
end end
timeout(src, 3000) timeout(src, 3000)
@@ -58,7 +58,7 @@ RegisterServerEvent('md-drugs:server:getdiethylamide', function(num)
local src = source local src = source
if timedOut[src] then return end if timedOut[src] then return end
if not ps.checkDistance(src, lsdLocations.diethylamide[num].loc, 2.0) then if not ps.checkDistance(src, lsdLocations.diethylamide[num].loc, 2.0) then
ps.notify(src, Lang.lsd.notinloc, "error") ps.notify(src, ps.lang('Catches.notIn'), "error")
return return
end end
timeout(src, 3000) timeout(src, 3000)
@@ -109,7 +109,7 @@ RegisterServerEvent('md-drugs:server:heatliquid', function()
local src = source local src = source
if not hasLabKit(src) then return end if not hasLabKit(src) then return end
if not ps.craftItem(src, lsdRecipes['vial']['heat']) then if not ps.craftItem(src, lsdRecipes['vial']['heat']) then
ps.notify(src, ps.lang('lsd.noliquid'), "error") verifyHas(src, lsdRecipes['vial']['heat'].take)
return return
end end
end) end)
@@ -119,14 +119,14 @@ RegisterServerEvent('md-drugs:server:failheating', function()
if not hasLabKit(src) then return end if not hasLabKit(src) then return end
ps.removeItem(src, 'lysergic_acid', 1) ps.removeItem(src, 'lysergic_acid', 1)
ps.removeItem(src, 'diethylamide', 1) ps.removeItem(src, 'diethylamide', 1)
ps.notify(src, ps.lang('prices.lsd.failed'), "error") ps.notify(src, ps.lang('lsd.failed'), "error")
end) end)
RegisterServerEvent('md-drugs:server:refinequalityacid', function() RegisterServerEvent('md-drugs:server:refinequalityacid', function()
local src = source local src = source
if not hasLabKit(src) then return end if not hasLabKit(src) then return end
if not ps.hasItem(src, 'lsd_one_vial', 1) then return end if not ps.hasItem(src, 'lsd_one_vial', 1) then return end
if Config.TierSystem then if Config.TierSystem then
local lsd = getRep(src, 'lsd') local lsd = getRep(src, 'lsd')
if ps.removeItem(src, 'lsd_one_vial', 1) then if ps.removeItem(src, 'lsd_one_vial', 1) then
@@ -170,25 +170,30 @@ end)
RegisterServerEvent('md-drugs:server:gettabpaper', function(num) RegisterServerEvent('md-drugs:server:gettabpaper', function(num)
local src = source local src = source
if not ps.checkDistance(src, lsdLocations.gettabs[num].loc, 3.0) then return end if not ps.checkDistance(src, lsdLocations.gettabs[num].loc, 3.0) then
ps.notify(src, ps.lang('Catches.notIn'), "error")
return
end
if ps.removeMoney(src, 'cash', prices.tabcost * 10) then if ps.removeMoney(src, 'cash', prices.tabcost * 10) then
ps.addItem(src,'tab_paper', 10) ps.addItem(src,'tab_paper', 10)
else else
ps.notify(src, Lang.lsd.broke, "error") ps.notify(src, ps.lang('Catches.notEnoughMoney'), "error")
end end
end) end)
RegisterServerEvent('md-drugs:server:getlabkit', function(num) RegisterServerEvent('md-drugs:server:getlabkit', function(num)
local src = source local src = source
if ps.hasItem(src,'lsdlabkit', 1) then if ps.hasItem(src,'lsdlabkit', 1) then
ps.notify(src, ps.lang('lsd.havlabkit'), 'error')
return return
end end
if not ps.checkDistance(src, lsdLocations.buyLSDkit[num].loc, 3.0) then return end if not ps.checkDistance(src, lsdLocations.buyLSDkit[num].loc, 3.0) then
ps.notify(src, ps.lang('Catches.notIn'), "error")
return
end
if ps.removeMoney(src, 'cash', prices.lsdlabkitcost) then if ps.removeMoney(src, 'cash', prices.lsdlabkitcost) then
ps.addItem(src,'lsdlabkit', 1) ps.addItem(src,'lsdlabkit', 1)
else else
ps.notify(src, Lang.lsd.broke, "error") ps.notify(src, ps.lang('Catches.notEnoughMoney'), "error")
end end
end) end)
+13 -3
View File
@@ -3,23 +3,33 @@ local mescalineLocation = {
{loc = vector3(1850.12, 2595.23, 45.67), l = 1.0, w = 1.0, rot = 0.0, gang = ""}, {loc = vector3(1850.12, 2595.23, 45.67), l = 1.0, w = 1.0, rot = 0.0, gang = ""},
}, },
} }
local mescalineRecipes = {
mescaline = {
dry = {
dried = {take = {cactusbulb = 1}, give = {driedmescaline = 1} }
}
},
}
ps.registerCallback('md-drugs:server:GetMescalineLocs', function(source) ps.registerCallback('md-drugs:server:GetMescalineLocs', function(source)
return mescalineLocation return mescalineLocation
end) end)
RegisterNetEvent("md-drugs:server:drymescaline", function(num) RegisterNetEvent("md-drugs:server:drymescaline", function(num)
local src = source local src = source
if not ps.checkDistance(src, mescalineLocation.DryOutMescaline[num].loc, 3.0) then if not ps.checkDistance(src, mescalineLocation.DryOutMescaline[num].loc, 3.0) then
ps.notify(src, "You are not in the right location", "error") ps.notify(src, ps.lang('Catches.notIn'), "error")
return
end
if not ps.craftItem(src, mescalineRecipes.mescaline.dry.dried) then
verifyHas(src, mescalineRecipes.mescaline.dry.dried.take)
return return
end end
if not GetRecipe(src, 'mescaline', 'dry', 'dried') then return end
end) end)
ps.createUseable("driedmescaline", function(source, item) ps.createUseable("driedmescaline", function(source, item)
local src = source local src = source
if ps.removeItem(src, "driedmescaline", 1) then if ps.removeItem(src, "driedmescaline", 1) then
TriggerClientEvent("md-drugs:client:takemescaline", src) TriggerClientEvent("md-drugs:client:takemescaline", src)
end end
end) end)
+39 -19
View File
@@ -34,9 +34,19 @@ local methLocs = {
} }
} }
local methRecipes = {
cook = {
heat = {take = {ephedrine = 1, acetone = 1}, give = {}}
},
bag = {
bags = {take = {empty_weed_bag = 5}, give = {methbags = 5} }
}
}
ps.registerCallback('md-drugs:server:GetMethLocs', function(source) ps.registerCallback('md-drugs:server:GetMethLocs', function(source)
return methLocs return methLocs
end) end)
local function setTimeout(identifier) local function setTimeout(identifier)
if onRun[identifier] then if onRun[identifier] then
CreateThread(function() CreateThread(function()
@@ -62,7 +72,7 @@ end
RegisterServerEvent('md-drugs:server:givemethingridients', function() RegisterServerEvent('md-drugs:server:givemethingridients', function()
local src = source local src = source
local amount = math.random(1,5) local amount = math.random(1,5)
if not onRun[ps.getIdentifier(src)] then return ps.notify(src, Lang.lean.err, "error") end if not onRun[ps.getIdentifier(src)] then return ps.notify(src, ps.lang('meth.notOnRun'), "error") end
onRun[ps.getIdentifier(src)] = onRun[ps.getIdentifier(src)] + 1 onRun[ps.getIdentifier(src)] = onRun[ps.getIdentifier(src)] + 1
if math.random(1,100) <= 50 then if math.random(1,100) <= 50 then
ps.addItem(src, "ephedrine", amount) ps.addItem(src, "ephedrine", amount)
@@ -74,41 +84,51 @@ RegisterServerEvent('md-drugs:server:givemethingridients', function()
end end
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(num) RegisterServerEvent('md-drugs:server:getmeth', function(num)
local src = source local src = source
if not ps.checkDistance(src, methLocs.BagMeth[num].loc, 2.5) then return end if not ps.checkDistance(src, methLocs.BagMeth[num].loc, 2.5) then
if not GetRecipe(src, 'meth', 'bag', 'bags') then return end ps.notify(src, ps.lang('Catches.notIn'), "error")
return
end
if not ps.craftItem(src, methRecipes.meth.bag.bags) then
verifyHas(src, methRecipes.meth.bag.bags.take)
return
end
end) end)
RegisterServerEvent('md-drugs:server:geteph', function(num) RegisterServerEvent('md-drugs:server:geteph', function(num)
local src = source local src = source
if not ps.checkDistance(src, methLocs.MethEph[num].loc, 2.5) then return end if not ps.checkDistance(src, methLocs.MethEph[num].loc, 2.5) then
if not coolDown(ps.getIdentifier(src)) then return ps.notify(src, ps.lang('meth.wait'), "error") end ps.notify(src, ps.lang('Catches.notIn'), "error")
if ps.addItem(src, 'ephedrine', 1) then return
ps.notify(src, 'Got Ephedrine!', "success")
end end
if not coolDown(ps.getIdentifier(src)) then return ps.notify(src, ps.lang('meth.onCooldown'), "error") end
ps.addItem(src, 'ephedrine', 1)
end) end)
RegisterServerEvent('md-drugs:server:getace', function(num) RegisterServerEvent('md-drugs:server:getace', function(num)
local src = source local src = source
if not ps.checkDistance(src, methLocs.MethAce[num].loc, 2.5) then return end if not ps.checkDistance(src, methLocs.MethAce[num].loc, 2.5) then
if not coolDown(ps.getIdentifier(src)) then return ps.notify(src, ps.lang('meth.wait'), "error") end ps.notify(src, ps.lang('Catches.notIn'), "error")
if ps.addItem(src, 'acetone', 1) then return
ps.notify(src, 'Got Acetone!', "success")
end end
if not coolDown(ps.getIdentifier(src)) then return ps.notify(src, ps.lang('meth.onCooldown'), "error") end
ps.addItem(src, 'acetone', 1)
end) end)
ps.registerCallback('md-drugs:server:startcook', function(source, num) ps.registerCallback('md-drugs:server:startcook', function(source, num)
local src = source local src = source
if not ps.checkDistance(src, methLocs.CookMeth[num].loc, 2.5) then return false end if not ps.checkDistance(src, methLocs.CookMeth[num].loc, 2.5) then
local recipe = GetRecipe(src, 'meth', 'cook', 'heat') ps.notify(src, ps.lang('Catches.notIn'), "error")
return recipe return false
end
local recipe = ps.craftItem(src, methRecipes.meth.cook.heat)
if not recipe then
verifyHas(src, methRecipes.meth.cook.heat.take)
return false
end
return true
end) end)
ps.registerCallback('md-drugs:server:registerMeth', function(source) ps.registerCallback('md-drugs:server:registerMeth', function(source)
+4 -4
View File
@@ -32,10 +32,10 @@ ps.registerCallback('md-drugs:server:payfortruck', function(source)
local src = source local src = source
if ps.removeMoney(src, 'cash', prices.payfortruck) or ps.removeMoney(src, 'bank', prices.payfortruck) then if ps.removeMoney(src, 'cash', prices.payfortruck) or ps.removeMoney(src, 'bank', prices.payfortruck) then
onRoute[src] = true onRoute[src] = true
ps.notify(src, ps.lang('oxy.paid') .. prices.payfortruck, "success") ps.notify(src, ps.lang('oxy.paid', prices.payfortruck), "success")
return true return true
else else
ps.notify(src, ps.lang('oxy.broke'), "error") ps.notify(src, ps.lang('Catches.notEnoughMoney'), "error")
return false return false
end end
end) end)
@@ -44,12 +44,12 @@ end)
RegisterServerEvent('md-drugs:server:giveoxybox', function() RegisterServerEvent('md-drugs:server:giveoxybox', function()
local src = source local src = source
if not onRoute[src] then if not onRoute[src] then
ps.notify(src, ps.lang('oxy.notonroute'), "error") ps.notify(src, ps.lang('oxy.notOn'), "error")
return return
end end
if not ps.checkDistance(src, oxyLocs.oxylocations[onRoute[src]], 3.5) then if not ps.checkDistance(src, oxyLocs.oxylocations[onRoute[src]], 3.5) then
ps.notify(src, ps.lang('oxy.toofar'), "error") ps.notify(src, ps.lang('Catches.notIn'), "error")
return return
end end
+8 -8
View File
@@ -7,6 +7,7 @@ local pharmaLocations = {
ps.registerCallback('md-drugs:server:GetPharmaLocs', function() ps.registerCallback('md-drugs:server:GetPharmaLocs', function()
return pharmaLocations return pharmaLocations
end) end)
local function GetJob(source) local function GetJob(source)
local src = source local src = source
return ps.getJobType(src) == 'ems' return ps.getJobType(src) == 'ems'
@@ -17,15 +18,14 @@ ps.createUseable('prescription_pad', function(source, item)
local near = {} local near = {}
if GetJob(src) then if GetJob(src) then
near = ps.getNearbyPlayers(src, 5.0) near = ps.getNearbyPlayers(src, 5.0)
local options = { local options = {
{label = 'Vicodin', value = 'vicodin_prescription'}, {label = ps.getItemLabel('vicodin_prescription'), value = 'vicodin_prescription'},
{label = 'Adderal', value = 'adderal_prescription'}, {label = ps.getItemLabel('adderal_prescription'), value = 'adderal_prescription'},
{label = 'Morphine', value = 'morphine_prescription'}, {label = ps.getItemLabel('morphine_prescription'), value = 'morphine_prescription'},
{label = 'Xanax', value = 'xanax_prescription'} {label = ps.getItemLabel('xanax_prescription'), value = 'xanax_prescription'}
} }
local data = ps.callback('md-drugs:client:prescriptionpad', src, near, options) local data = ps.callback('md-drugs:client:prescriptionpad', src, near, options)
if not data then return ps.notify(src, ps.lang('Pharma.cancel'), "error") end if not data then return ps.notify(src, ps.lang('pharma.canceled'), "error") end
ps.addItem(ps.getSource(data.who), data.what, 1) ps.addItem(ps.getSource(data.who), data.what, 1)
end end
end) end)
@@ -46,7 +46,7 @@ for m, d in pairs (pharmabottle) do
if d == k then if d == k then
if ps.removeItem(src, d, 1) then if ps.removeItem(src, d, 1) then
ps.addItem(src, v, math.random(10,30)) ps.addItem(src, v, math.random(10,30))
ps.notify(src,ps.lang('Pharma.unbottle'), "success") ps.notify(src,ps.lang('pharma.unbottle'), "success")
end end
end end
end end
@@ -57,7 +57,7 @@ end
RegisterServerEvent('md-drugs:server:fillprescription', function(num) RegisterServerEvent('md-drugs:server:fillprescription', function(num)
local src = source local src = source
if not ps.checkDistance(src, pharmaLocations.FillPrescription[num].loc, 3.5) then if not ps.checkDistance(src, pharmaLocations.FillPrescription[num].loc, 3.5) then
return ps.notify(src, ps.lang('Pharma.toofar'), "error") return ps.notify(src, ps.lang('Catches.notIn'), "error")
end end
local pres = { local pres = {
vicodin_prescription = 'vicodinbottle', vicodin_prescription = 'vicodinbottle',
+1 -1
View File
@@ -12,7 +12,7 @@ local drugModelsBuzz = {
weed = "bzzz_plant_weed_pot_green_d" weed = "bzzz_plant_weed_pot_green_d"
} }
local function propsLabels(drugType) local function propsLabels(drugType)
if Config.Buzz[drugType] then if Config.Bzz[drugType] then
return drugModelsBuzz[drugType] return drugModelsBuzz[drugType]
else else
return drugModels[drugType] return drugModels[drugType]
-66
View File
@@ -1,66 +0,0 @@
recipe = {
mescaline = {
dry = {
dried = {take = {cactusbulb = 1}, give = {driedmescaline = 1} }
}
},
lean = {
cups = {
cupoflean = {take = {leancup = 1, sprunk = 1, mdlean = 1}, give = {cupoflean = 1}},
cupofdextro = {take = {leancup = 1, sprunk = 1, mdreddextro = 1}, give = {cupofdextro = 1}},
}
},
meth = {
cook = {
heat = {take = {ephedrine = 1, acetone = 1}, give = {}}
},
bag = {
bags = {take = {empty_weed_bag = 5}, give = {methbags = 5} }
}
},
weed = {
oil = {
shatter = {take = {butane = 1, grindedweed = 1}, give = {shatter = 1}}
},
blunts = {
blunt = {take = {bluntwrap = 1, grindedweed = 1}, give = {blunt = 1}},
chewyblunt = {take = {bluntwrap = 1, grindedweed = 1, loosecoke = 1}, give = {chewyblunt = 1}},
leanblunts = {take = {leanbluntwrap = 1, grindedweed = 1}, give = {leanblunts = 1}},
dextroblunts = {take = {dextrobluntwrap = 1, grindedweed = 1}, give = {dextroblunts = 1}}
},
bluntwrap = {
leanbluntwrap = {take = {bluntwrap = 5, mdlean = 1}, give = {leanbluntwrap = 5}},
dextrobluntwrap = {take = {bluntwrap = 5, mdreddextro = 1}, give = {dextrobluntwrap = 5}},
}
},
}
function GetRecipe(source, type, method, tier)
return ps.craftItem(source, recipe[type][method][tier])
end
ps.registerCallback('md-drugs:server:GetRecipe', function(source, type, cat)
if not source then return false end
return recipe[type][cat]
end)
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
-89
View File
@@ -1,89 +0,0 @@
local Target = {
Travellingmerchant = { -- where the travelling merchant can spawn
vector4(-119.66, -977.43, 304.25, 88.21),
vector4(-1522.93, 1476.01, 111.45, 41.25),
vector4(-3278.98, 973.38, 5.35, 101.53),
},
}
local loc = Target.Travellingmerchant[math.random(1, #Target.Travellingmerchant)]
ps.registerCallback('md-drugs:server:GetMerchant', function(source)
return loc
end)
function getRandW(src)
local rand = math.random(1, #Target.oxylocations)
return Target.oxylocations[rand]
end
local stores = {
travel = {
{name = "tab_paper", price = 50, amount = 50, },
{name = "bakingsoda", price = 25, amount = 50, },
{name = "isosafrole", price = 25, amount = 50, },
{name = "mdp2p", price = 25, amount = 50, },
{name = "lysergic_acid", price = 25, amount = 50, },
{name = "diethylamide", price = 25, amount = 50, },
{name = "lockpick", price = 2, amount = 1000, },
{name = "emptyvial", price = 2, amount = 1000, },
{name = "needle", price = 2, amount = 1000, },
{name = "cokeburner", price = 25, amount = 50, },
{name = "crackburner", price = 2, amount = 50, },
{name = "lsdburner", price = 2, amount = 50, },
{name = "heroinburner", price = 2, amount = 50, },
{name = "mdlean", price = 50, amount = 50, },
{name = "weedgrinder", price = 25, amount = 50, },
{name = "mdbutter", price = 25, amount = 50, },
{name = "flour", price = 25, amount = 50, },
{name = "chocolate", price = 25, amount = 50, },
{name = "butane", price = 25, amount = 50, },
{name = "butanetorch", price = 2, amount = 1000, },
{name = "dabrig", price = 2, amount = 1000, },
{name = "mdwoods", price = 2, amount = 1000, },
{name = "leancup", price = 25, amount = 50, },
{name = "xtcburner", price = 25, amount = 50, },
},
Products = {
{name = "weed_white-widow_seed", price = 15, amount = 150, minrep = 0},
{name = "weed_skunk_seed", price = 15, amount = 150, minrep = 0},
{name = "weed_purple-haze_seed", price = 15, amount = 150, minrep = 0},
{name = "weed_og-kush_seed", price = 15, amount = 150, minrep = 0},
{name = "weed_amnesia_seed", price = 15, amount = 150, minrep = 0},
},
ProductsStupidNameRewrite = {
{name = "weed_whitewidow_seed", price = 15, amount = 150, minrep = 0},
{name = "weed_skunk_seed", price = 15, amount = 150, minrep = 0},
{name = "weed_purplehaze_seed", price = 15, amount = 150, minrep = 0},
{name = "weed_ogkush_seed", price = 15, amount = 150, minrep = 0},
{name = "weed_amnesia_seed", price = 15, amount = 150, minrep = 0},
}
}
ps.registerCallback('md-drugs:server:menu', function(source, data)
local src = source
if data == 'travellingMerchant' then
return {table = stores.travel, des = '$', id = 'travellingMerchant', title = 'travelling Merchant'}
elseif data == 'dealermenu' then
local table
if Config.StupidassNewQbItemName then table = stores.ProductsStupidNameRewrite else table = stores.Products end
return {table = table, id = 'dealermenu', title = "Dealer Menu"}
elseif data == 'WeedShop' then
return {table = stores.Weed, id = 'WeedShop', title = "Weed Shop"}
end
end)
RegisterServerEvent("md-drugs:server:purchaseGoods", function(amount, money, item, price,table,num)
local src = source local Player = getPlayer(src)
for i = 1, #table do
if table[i].name == item then
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')
end
end
end
end)
+2 -2
View File
@@ -2,10 +2,10 @@
ps.createUseable('shrooms', function(source, item) ps.createUseable('shrooms', function(source, item)
local src = source local src = source
if not ps.callback("md-drugs:client:shrooms", src) then if not ps.callback("md-drugs:client:shrooms", src) then
ps.notify(src, ps.lang('Shrooms.cancel'), "error") ps.notify(src, ps.lang('shrooms.cancel'), "error")
return return
end end
ps.removeItem(src, 'shrooms', 1) ps.removeItem(src, 'shrooms', 1)
ps.notify(src, 'You Took Some Shrooms!', 'success') ps.notify(src, ps.lang('shrooms.took'), 'success')
end) end)
+30 -8
View File
@@ -30,6 +30,24 @@ local weedStore = {
mdwoods =2, mdwoods =2,
} }
local weed = {
blunts = {
blunt = {take = {bluntwrap = 1, grindedweed = 1}, give = {blunt = 1}},
chewyblunt = {take = {bluntwrap = 1, grindedweed = 1, loosecoke = 1}, give = {chewyblunt = 1}},
leanblunts = {take = {leanbluntwrap = 1, grindedweed = 1}, give = {leanblunts = 1}},
dextroblunts = {take = {dextrobluntwrap = 1, grindedweed = 1}, give = {dextroblunts = 1}}
},
bluntwrap = {
leanbluntwrap = {take = {bluntwrap = 5, mdlean = 1}, give = {leanbluntwrap = 5}},
dextrobluntwrap = {take = {bluntwrap = 5, mdreddextro = 1}, give = {dextrobluntwrap = 5}},
}
}
ps.registerCallback('md-drugs:server:GetWeedRecipe', function(source, tableName)
if not source then return false end
return weed[tableName]
end)
ps.registerCallback('md-drugs:server:GetWeedLocs', function(source) ps.registerCallback('md-drugs:server:GetWeedLocs', function(source)
return weedLocs return weedLocs
end) end)
@@ -37,20 +55,21 @@ end)
ps.registerCallback('md-drugs:server:getWeedItems', function(source) ps.registerCallback('md-drugs:server:getWeedItems', function(source)
return weedStore return weedStore
end) end)
RegisterNetEvent('md-drugs:server:buyWeedItem', function(loc, name, amount) RegisterNetEvent('md-drugs:server:buyWeedItem', function(loc, name, amount)
local src = source local src = source
if not ps.checkDistance(src, weedLocs.WeedSalesman[loc].loc, 3.5) then if not ps.checkDistance(src, weedLocs.WeedSalesman[loc].loc, 3.5) then
ps.notify(src, ps.lang('Weed.notHere'), "error") ps.notify(src, ps.lang('Checks.notIn'), "error")
return return
end end
if not weedStore[name] then if not weedStore[name] then
ps.notify(src, ps.lang('Weed.notHere'), "error") ps.notify(src, ps.lang('weed.itemDoesntExist'), "error")
return return
end end
if ps.removeMoney(src, 'cash', weedStore[name] * amount) or ps.removeMoney(src, 'bank', weedStore[name] * amount) then if ps.removeMoney(src, 'cash', weedStore[name] * amount) or ps.removeMoney(src, 'bank', weedStore[name] * amount) then
ps.addItem(src, name, amount) ps.addItem(src, name, amount)
else else
ps.notify(src, ps.lang('Weed.noMoney'), "error") ps.notify(src, ps.lang('Catches.notEnoughMoney'), "error")
end end
end) end)
@@ -59,7 +78,7 @@ RegisterServerEvent('md-drugs:server:dryoutweed', function()
if ps.removeItem(src,"wetcannabis", 1) then if ps.removeItem(src,"wetcannabis", 1) then
ps.addItem(src,"drycannabis", 1) ps.addItem(src,"drycannabis", 1)
else else
ps.notify(src, ps.lang('Weed.nodry'), "error") ps.notify(src, ps.lang('weed.noDry'), "error")
end end
end) end)
@@ -77,7 +96,10 @@ end
RegisterServerEvent('md-drugs:server:MakeWeedItems', function(data) RegisterServerEvent('md-drugs:server:MakeWeedItems', function(data)
local src = source local src = source
if not GetRecipe(src, data.recipe, data.table, data.item) then return end if not ps.craftItem(src, weed[data.table][data.item]) then
verifyHas(src, weed[data.table][data.item].take)
return
end
end) end)
@@ -88,13 +110,13 @@ ps.createUseable("dabrig", function(source, item)
TriggerClientEvent("md-drugs:client:dodabs", src) TriggerClientEvent("md-drugs:client:dodabs", src)
end end
else else
ps.notify(src, 'You Need A Butane Torch', 'error') ps.notify(src, ps.lang('weed.needItem', ps.getItemLabel("butanetorch")), 'error')
end end
end) end)
ps.createUseable("weedgrinder", function(source, item) ps.createUseable("weedgrinder", function(source, item)
local src = source local src = source
if not ps.hasItem(src, "drycannabis") then ps.notify(src, 'You Need Dried Cannabis', 'error') return end if not ps.hasItem(src, "drycannabis") then ps.notify(src, ps.lang('weed.needItem', ps.getItemLabel("drycannabis")), 'error') return end
local check = ps.callback('md-drugs:client:uncuff', src, 'Grinding Weed') local check = ps.callback('md-drugs:client:uncuff', src, 'Grinding Weed')
if not check then return end if not check then return end
if ps.removeItem(src, "drycannabis",1 ) then if ps.removeItem(src, "drycannabis",1 ) then
@@ -104,7 +126,7 @@ end)
ps.createUseable("mdwoods", function(source, item) ps.createUseable("mdwoods", function(source, item)
local src = source local src = source
local check = ps.callback('md-drugs:client:uncuff', src, 'Breaking Blunt Open') local check = ps.callback('md-drugs:client:uncuff', src, ps.lang('weed.crackBlunt'))
if not check then return end if not check then return end
if ps.removeItem(src, "mdwoods",1 ) then if ps.removeItem(src, "mdwoods",1 ) then
ps.addItem(src, "bluntwrap", 5) ps.addItem(src, "bluntwrap", 5)
+33 -12
View File
@@ -14,15 +14,33 @@ local Price = {
heroin = {min = 20, max = 60}, heroin = {min = 20, max = 60},
xtc = {min = 20, max = 60}, xtc = {min = 20, max = 60},
} }
local locs = {
vector4(-2352.32, 266.78, 165.3, 23.46),
vector4(-1467.49, 874.01, 183.59, 298.45),
vector4(-856.71, 874.26, 202.85, 205.3),
vector4(950.58, -128.49, 74.42, 205.3),
vector4(1152.71, -328.43, 69.21, 205.3),
vector4(112.66, -1955.67, 20.75, 37.94),
vector4(-544.4, -1684.8, 19.89, 252.07),
vector4(-1185.02, -1805.4, 3.91, 184.83),
vector4(-1641.4, -981.99, 7.58, 35.38),
vector4(-1827.93, 782.36, 138.29, 219.99),
vector4(-320.84, 2818.73, 59.45, 337.22),
vector4(474.88, 2609.56, 44.48, 357.0),
}
function getRandW(src)
local rand = math.random(1, #locs)
return locs[rand]
end
for k, v in pairs (burners) do for k, v in pairs (burners) do
CUI(k, function(source, item) ps.createUseable(k, function(source, item)
local src = source local src = source
local Player = getPlayer(src) local Player = getPlayer(src)
if getCops() < Config.PoliceCount then return ps.notify(src, Lang.Wholesale.na, 'error') end if getCops() < Config.PoliceCount then return ps.notify(src, ps.lang('wholesale.notEnoughCops'), 'error') end
for m, d in pairs (active) do for m, d in pairs (active) do
if d.cid == Player.PlayerData.citizenid then if d.cid == Player.PlayerData.citizenid then
return ps.notify(src, Lang.Wholesale.al, 'error' ) return ps.notify(src, ps.lang('wholesale.alreadyWholesale'), 'error' )
end end
end end
local tab = '' local tab = ''
@@ -31,17 +49,17 @@ for k, v in pairs (burners) do
if k == 'lsdburner' then tab = 'lsd' end if k == 'lsdburner' then tab = 'lsd' end
if k == 'heroinburner' then tab = 'heroin' end if k == 'heroinburner' then tab = 'heroin' end
if k == 'xtcburner' then tab = 'xtc' end if k == 'xtcburner' then tab = 'xtc' end
if RemoveItem(src, k, 1) then if ps.removeItem(src, k, 1) then
table.insert(active, { table.insert(active, {
src = src, src = src,
item = k, item = k,
location = getRandW(src), location = getRandW(src),
cid = Player.PlayerData.citizenid, cid = ps.getIdentifier(src),
type = v, type = v,
price = Price[tab] price = Price[tab]
}) })
for m, d in pairs (active) do for m, d in pairs (active) do
if d.cid == Player.PlayerData.citizenid then if d.cid == ps.getIdentifier(src) then
TriggerClientEvent("md-drugs:client:GetLocation", src, active[m]) TriggerClientEvent("md-drugs:client:GetLocation", src, active[m])
end end
end end
@@ -51,15 +69,18 @@ end
RegisterNetEvent('md-drugs:server:SuccessSale', function(data) RegisterNetEvent('md-drugs:server:SuccessSale', function(data)
local src = source local src = source
local Player = getPlayer(src)
for k, v in pairs (active) do for k, v in pairs (active) do
if v.cid == Player.PlayerData.citizenid then if v.cid == ps.getIdentifier(src) then
if not ps.checkDistance(src, v.location, 4.0) then
return ps.notify(src, ps.lang('Catches.notIn'), "error")
end
local payout = math.random(v.price.min, v.price.max) local payout = math.random(v.price.min, v.price.max)
for m, d in pairs (v.type) do for m, d in pairs (v.type) do
local git = Player.Functions.GetItemByName(d) local git = ps.getItemCount(src, d)
if git and git.amount >= 1 then if git >= 1 then
RemoveItem(src, d, git.amount) if ps.removeItem(src, d, git) then
Player.Functions.AddMoney('cash', git.amount * payout) ps.addMoney('cash', git * payout)
end
end end
table.remove(active, k) table.remove(active, k)
end end
+41 -13
View File
@@ -53,9 +53,30 @@ local xtcLocations = {
{loc = vector3(844.71, -900.56, 25.43), l = 1.0, w = 1.0, rot = 45.0, gang = ""}, {loc = vector3(844.71, -900.56, 25.43), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
}, },
} }
ps.registerCallback('md-drugs:server:GetXtcLocs', function(source) ps.registerCallback('md-drugs:server:GetXtcLocs', function(source)
return xtcLocations return xtcLocations
end) 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 = {} local activePresses = {}
local timeout = {} local timeout = {}
@@ -69,9 +90,12 @@ end
RegisterServerEvent('md-drugs:server:stealisosafrole', function(num) RegisterServerEvent('md-drugs:server:stealisosafrole', function(num)
local src = source local src = source
if not ps.checkDistance(src, xtcLocations.isosafrole[num].loc, 3.0) then return end if not ps.checkDistance(src, xtcLocations.isosafrole[num].loc, 3.0) then
ps.notify(src, ps.lang('Checks.notIn'), "error")
return
end
if timeout[ps.getIdentifier(src)] then if timeout[ps.getIdentifier(src)] then
ps.notify(src, 'You are still waiting for the last minigame to finish', 'error') ps.notify(src, ps.lang('Catches.cooldown'), 'error')
return return
end end
timeOut(src) timeOut(src)
@@ -80,9 +104,12 @@ end)
RegisterServerEvent('md-drugs:server:stealmdp2p', function(num) RegisterServerEvent('md-drugs:server:stealmdp2p', function(num)
local src = source local src = source
if not ps.checkDistance(src, xtcLocations.mdp2p[num].loc, 3.0) then return end if not ps.checkDistance(src, xtcLocations.mdp2p[num].loc, 3.0) then
ps.notify(src, ps.lang('Checks.notIn'), "error")
return
end
if timeout[ps.getIdentifier(src)] then if timeout[ps.getIdentifier(src)] then
ps.notify(src, 'You are still waiting for the last minigame to finish', 'error') ps.notify(src, ps.lang('Catches.cooldown'), 'error')
return return
end end
timeOut(src) timeOut(src)
@@ -126,7 +153,7 @@ end)
RegisterServerEvent('md-drugs:server:makextc', function(data) RegisterServerEvent('md-drugs:server:makextc', function(data)
local src = source local src = source
if not activePresses[ps.getIdentifier(src)] then if not activePresses[ps.getIdentifier(src)] then
ps.notify(src, 'You Dont Have A Pill Press', 'error') ps.notify(src, ps.lang('xtc.noPressOut'), 'error')
return return
end end
craft(src, RecipeList[activePresses[ps.getIdentifier(src)].press][data], data) craft(src, RecipeList[activePresses[ps.getIdentifier(src)].press][data], data)
@@ -137,14 +164,14 @@ RegisterServerEvent('md-drugs:server:buypress', function()
if ps.removeMoney(src,"cash", RecipeList.presses['singlepress'].cash) then if ps.removeMoney(src,"cash", RecipeList.presses['singlepress'].cash) then
ps.addItem(src, "singlepress", 1) ps.addItem(src, "singlepress", 1)
else else
ps.notify(ps.lang('xtc.cash'), "error") ps.notify(src, ps.lang('Catches.notEnoughMoney'), "error")
end end
end) end)
RegisterServerEvent('md-drugs:server:upgradepress', function(data) RegisterServerEvent('md-drugs:server:upgradepress', function(data)
local src = source local src = source
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('xtc.toofar'), "error") ps.notify(src, ps.lang('Catches.notIn'), "error")
return return
end end
craft(src, RecipeList.presses[data], data) craft(src, RecipeList.presses[data], data)
@@ -156,9 +183,12 @@ end)
------------- making powder ------------- making powder
RegisterServerEvent('md-drugs:server:makingrawxtc', function(num) RegisterServerEvent('md-drugs:server:makingrawxtc', function(num)
local src = source local src = source
if not ps.checkDistance(src, xtcLocations.rawxtcloc[num].loc, 3.0) then return end if not ps.checkDistance(src, xtcLocations.rawxtcloc[num].loc, 3.0) then
ps.notify(src, ps.lang('Checks.notIn'), "error")
return
end
if timeout[ps.getIdentifier(src)] then if timeout[ps.getIdentifier(src)] then
ps.notify(src, 'You are still waiting for the last minigame to finish', 'error') ps.notify(src, ps.lang('Catches.cooldown'), 'error')
return return
end end
timeOut(src) timeOut(src)
@@ -174,10 +204,8 @@ local function getColor(color)
} }
if colors[color] then if colors[color] then
return colors[color][math.random(#colors[color])] return colors[color][math.random(#colors[color])]
else
ps.notify('Invalid color specified', 'error')
return nil
end end
return nil
end end
RegisterServerEvent('md-drugs:server:stamp', function(num, color) RegisterServerEvent('md-drugs:server:stamp', function(num, color)
@@ -199,7 +227,7 @@ RegisterServerEvent('md-drugs:server:stamp', function(num, color)
elseif ps.removeItem(src, colors[color].."4", 1) then elseif ps.removeItem(src, colors[color].."4", 1) then
ps.addItem(src, item..'4', 1) ps.addItem(src, item..'4', 1)
else else
ps.notify('You Dont Have Unstamped '..color..' Pills', 'error') ps.notify(src, ps.lang('xtc.noPills'), 'error')
end end
end) end)
-1
View File
@@ -16,7 +16,6 @@ function loadFile(filePath)
ps.error("Error executing Lua chunk from '" .. filePath .. "': " .. tostring(execErr)) ps.error("Error executing Lua chunk from '" .. filePath .. "': " .. tostring(execErr))
return false return false
end end
ps.success("Successfully loaded module '" .. filePath .. "' from resource '" .. resourceName .. "'.")
return true return true
end end
+7 -11
View File
@@ -1,17 +1,12 @@
Config = {} --Ignore. Config = {} --Ignore.
ps = exports.ps_lib:init() ps = exports.ps_lib:init()
ps.loadLangs("wookie") ps.loadLangs("en")
Config.respawnTime = 3 -- Seconds
Config.respawnTime = 100 -- Seconds
Config.Fuel = "LegacyFuel" -- type the name of script you use i.e. ps-fuel, cdn-fuel, LegacyFuel Config.Fuel = "LegacyFuel" -- type the name of script you use i.e. ps-fuel, cdn-fuel, LegacyFuel
Config.TierSystem = true -- allows for three tiers of certain drugs ( coke, heroin, crack, lsd) Config.TierSystem = true -- allows for three tiers of certain drugs ( coke, heroin, crack, lsd)
Config.StupidassNewQbItemName = true -- true if you have updated your items.lua from base qb after november 2023 because changing item names this far in a framework is 3 IQ points total
Config.RequestModelTime = 30000 -- if you need more time than this, uhhhh wow Config.RequestModelTime = 30000 -- if you need more time than this, uhhhh wow
Config.FancyCokeAnims = true -- if you want multi location this needs to be false
Config.Joblock = false -- if you want weed to be a job
Config.weedjob = "" -- what the job name is
Config.Badtrip = 20 -- number means % chance to spawn a clone that chases and attacks while on mescaline Config.Badtrip = 20 -- number means % chance to spawn a clone that chases and attacks while on mescaline
Config.MethHeist = false
Config.SuccessfulChance = 90 --- this is the chance of a Success wholesale 1-100 Config.SuccessfulChance = 90 --- this is the chance of a Success wholesale 1-100
Config.AlertPoliceWholesale = 90 -- 1-100 of how often it will alert police Config.AlertPoliceWholesale = 90 -- 1-100 of how often it will alert police
Config.WholesaleTimeout = 600 -- time in seconds to get to the location Config.WholesaleTimeout = 600 -- time in seconds to get to the location
@@ -52,11 +47,11 @@ Config.minigametype = 'ox' -- look above for options or choose none if you dont
--- ---
Config.Drugs = { Config.Drugs = {
cocaine = true, cocaine = true,
consumables =false, consumables = true,
crack = true,
cornerselling = true, cornerselling = true,
crack = true,
deliveries = true,
heroin = true, heroin = true,
deliveries = false,
lean = true, lean = true,
lsd = true, lsd = true,
mescaline = true, mescaline = true,
@@ -64,6 +59,7 @@ Config.Drugs = {
oxyruns = true, oxyruns = true,
pharma = true, pharma = true,
shrooms = true, shrooms = true,
TravelingMerchant = true,
weed = true, weed = true,
wholesale = false, wholesale = false,
xtc = true, xtc = true,