- holy fuck a lot
This commit is contained in:
1 parent
94c6458037
commit
2fd900ec22
33 files changed
+639
-869
No files matched your search
@@ -1,164 +1,5 @@
|
|||||||
local started = nil
|
local started = nil
|
||||||
|
|
||||||
local function loadParticle(dict)
|
|
||||||
if not HasNamedPtfxAssetLoaded(dict) then
|
|
||||||
RequestNamedPtfxAsset(dict)
|
|
||||||
end
|
|
||||||
while not HasNamedPtfxAssetLoaded(dict) do
|
|
||||||
Wait(0)
|
|
||||||
end
|
|
||||||
SetPtfxAssetNextCall(dict)
|
|
||||||
end
|
|
||||||
|
|
||||||
function MethCooking()
|
|
||||||
local animDict, animName = "anim@amb@business@meth@meth_monitoring_cooking@cooking@", "chemical_pour_short_cooker"
|
|
||||||
ps.requestAnim(animDict, 500)
|
|
||||||
SetEntityCoords(PlayerPedId(), vector3(1005.773, -3200.402, -38.524))
|
|
||||||
local targetPosition = GetEntityCoords(PlayerPedId())
|
|
||||||
local animDuration = GetAnimDuration(animDict, animName) * 800
|
|
||||||
FreezeEntityPosition(PlayerPedId(), true)
|
|
||||||
local scenePos, sceneRot = vector3(1010.656, -3198.445, -38.925), vector3(0.0, 0.0, 0.0)
|
|
||||||
local netScene = NetworkCreateSynchronisedScene(scenePos, sceneRot, 2, false, false, 1065353216, 0, 1.3)
|
|
||||||
NetworkAddPedToSynchronisedScene(PlayerPedId(), netScene, animDict, animName, 1.5, -4.0, 1, 16, 1148846080, 0)
|
|
||||||
local sacid = CreateObjectNoOffset("bkr_prop_meth_sacid", targetPosition, 1, 1, 0)
|
|
||||||
NetworkAddEntityToSynchronisedScene(sacid, netScene, animDict, "chemical_pour_short_sacid", 4.0, -8.0, 1)
|
|
||||||
local ammonia = CreateObjectNoOffset("bkr_prop_meth_ammonia", targetPosition, 1, 1, 0)
|
|
||||||
NetworkAddEntityToSynchronisedScene(ammonia, netScene, animDict, "chemical_pour_short_ammonia", 4.0, -8.0, 1)
|
|
||||||
NetworkStartSynchronisedScene(netScene)
|
|
||||||
Wait(animDuration)
|
|
||||||
NetworkStopSynchronisedScene(netScene)
|
|
||||||
DeleteObject(sacid) DeleteObject(ammonia)
|
|
||||||
FreezeEntityPosition(PlayerPedId(), false)
|
|
||||||
ps.requestModel('hei_prop_heist_thermite', 2000)
|
|
||||||
loadParticle('scr_ornate_heist')
|
|
||||||
local thermite = CreateObject('hei_prop_heist_thermite', vector3(1005.76, -3201.3, -39.25), true, false, false)
|
|
||||||
FreezeEntityPosition(thermite, true)
|
|
||||||
SetEntityRotation(thermite, 190.0, 90.0, 140.0, 3, true )
|
|
||||||
Wait(1000)
|
|
||||||
local therm = StartParticleFxLoopedOnEntity('scr_heist_ornate_thermal_burn', thermite, 0.0, 1.4, 0.0, 0.0, 0.0, 0.0, 1.5, false, false, false)
|
|
||||||
Wait(math.random(10000, 20000))
|
|
||||||
StopParticleFxLooped(therm, true)
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
function SmashMeth()
|
|
||||||
local ver = ""
|
|
||||||
local animDict, animName = "anim@amb@business@meth@meth_smash_weight_check@", "break_weigh_"..ver.."char02"
|
|
||||||
ps.requestAnim(animDict, 500)
|
|
||||||
local ped = PlayerPedId()
|
|
||||||
local targetPosition = vector3(1012.628, -3194.619, -39.589)
|
|
||||||
SetEntityCoords(ped, targetPosition)
|
|
||||||
Wait(1)
|
|
||||||
local animDuration = GetAnimDuration(animDict, animName) * 800
|
|
||||||
FreezeEntityPosition(ped, true)
|
|
||||||
local scenePos, sceneRot = vector3(1008.734, -3196.646, -39.99), vector3(0.0, 0.0, 1.08)
|
|
||||||
local netScene = NetworkCreateSynchronisedScene(scenePos, sceneRot, 2, false, false, 1065353216, 0, 1.3)
|
|
||||||
NetworkAddPedToSynchronisedScene(ped, netScene, animDict, animName, 1.5, -4.0, 1, 16, 1148846080, 0)
|
|
||||||
local objects, sceneObjects = {}, {
|
|
||||||
{ hash = "w_me_hammer", animName = "break_weigh_" .. ver .. "hammer"},
|
|
||||||
{ hash = "bkr_Prop_Meth_SmashedTray_01_frag_", animName = "break_weigh_"..ver.."tray01"},
|
|
||||||
{ hash = "bkr_Prop_Meth_Tray_02a", animName = "break_weigh_"..ver.."tray01^1"},
|
|
||||||
{ hash = "bkr_Prop_Meth_Tray_02a", animName = "break_weigh_"..ver.."tray01^2"},
|
|
||||||
{ hash = "bkr_Prop_Meth_SmashedTray_01_frag_", animName = "break_weigh_"..ver.."tray01^3"},
|
|
||||||
}
|
|
||||||
for i=1, #sceneObjects, 1 do
|
|
||||||
local obj = CreateObjectNoOffset(sceneObjects[i].hash, targetPosition, true, true, true)
|
|
||||||
NetworkAddEntityToSynchronisedScene(obj, netScene, animDict, sceneObjects[i].animName, 4.0, -8.0, 1)
|
|
||||||
objects[#objects+1] = obj
|
|
||||||
end
|
|
||||||
NetworkStartSynchronisedScene(netScene)
|
|
||||||
Wait(animDuration)
|
|
||||||
NetworkStopSynchronisedScene(netScene)
|
|
||||||
for i=1, #objects, 1 do
|
|
||||||
DeleteObject(objects[i])
|
|
||||||
end
|
|
||||||
RemoveAnimDict(animDict)
|
|
||||||
FreezeEntityPosition(ped, false)
|
|
||||||
end
|
|
||||||
|
|
||||||
function BagMeth()
|
|
||||||
local ver = ""
|
|
||||||
local animDict, animName = "anim@amb@business@meth@meth_smash_weight_check@", "break_weigh_"..ver.."char01"
|
|
||||||
ps.requestAnim(animDict, 500)
|
|
||||||
local animDuration = GetAnimDuration(animDict, animName) * 1000
|
|
||||||
local ped = PlayerPedId()
|
|
||||||
local coords = GetEntityCoords(ped)
|
|
||||||
local scenePos, sceneRot = vector3(1008.734, -3196.646, -39.99), vector3(0.0, 0.0, 1.08)
|
|
||||||
local scenes = {
|
|
||||||
{
|
|
||||||
{ hash = "bkr_prop_meth_bigbag_04a", animName = "break_weigh_"..ver.."box01"},
|
|
||||||
{ hash = "bkr_prop_meth_bigbag_03a", animName = "break_weigh_"..ver.."box01^1"},
|
|
||||||
{ hash = "bkr_prop_meth_openbag_02", animName = "break_weigh_"..ver.."methbag01"}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{ hash = "bkr_prop_meth_openbag_02", animName = "break_weigh_"..ver.."methbag01^1"},
|
|
||||||
{ hash = "bkr_prop_meth_openbag_02", animName = "break_weigh_"..ver.."methbag01^2"},
|
|
||||||
{ hash = "bkr_prop_meth_openbag_02", animName = "break_weigh_"..ver.."methbag01^3"}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{ hash = "bkr_prop_meth_openbag_02", animName = "break_weigh_"..ver.."methbag01^4"},
|
|
||||||
{ hash = "bkr_prop_meth_openbag_02", animName = "break_weigh_"..ver.."methbag01^5"},
|
|
||||||
{ hash = "bkr_prop_meth_openbag_02", animName = "break_weigh_"..ver.."methbag01^6"}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{ hash = "bkr_prop_meth_scoop_01a", animName = "break_weigh_"..ver.."scoop"},
|
|
||||||
{ hash = "bkr_prop_coke_scale_01", animName = "break_weigh_"..ver.."scale"},
|
|
||||||
{ hash = "bkr_prop_fakeid_penclipboard", animName = "break_weigh_"..ver.."pen"}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{ hash = "bkr_prop_fakeid_clipboard_01a", animName = "break_weigh_"..ver.."clipboard"},
|
|
||||||
{ hash = "bkr_Prop_Meth_Tray_02a", animName = "break_weigh_"..ver.."tray01^5"}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
local scenesList, entitiesList = {}, {}
|
|
||||||
for i=1, #scenes, 1 do
|
|
||||||
local scene = NetworkCreateSynchronisedScene(scenePos, sceneRot, 2, false, false, 1065353216, 0, 1.3)
|
|
||||||
NetworkAddPedToSynchronisedScene(ped, scene, animDict, animName, 1.5, -4.0, 1, 16, 1148846080, 0)
|
|
||||||
for j=1, #scenes[i], 1 do
|
|
||||||
local s = scenes[i][j]
|
|
||||||
RequestModel(s.hash)
|
|
||||||
while not HasModelLoaded(s.hash) do
|
|
||||||
Wait(0)
|
|
||||||
end
|
|
||||||
local obj = CreateObjectNoOffset(s.hash, coords, true, true, true)
|
|
||||||
SetModelAsNoLongerNeeded(s.hash)
|
|
||||||
entitiesList[#entitiesList+1] = obj
|
|
||||||
NetworkAddEntityToSynchronisedScene(obj, scene, animDict, s.animName, 4.0, -8.0, 1)
|
|
||||||
end
|
|
||||||
scenesList[#scenesList+1] = scene
|
|
||||||
end
|
|
||||||
DisableCamCollisionForEntity(ped)
|
|
||||||
FreezeEntityPosition(ped, true)
|
|
||||||
for i=1, #scenesList, 1 do
|
|
||||||
NetworkStartSynchronisedScene(scenesList[i])
|
|
||||||
end
|
|
||||||
|
|
||||||
Wait(animDuration-11000)
|
|
||||||
for i=1, #scenesList, 1 do
|
|
||||||
NetworkStopSynchronisedScene(scenesList[i])
|
|
||||||
end
|
|
||||||
for i=1, #entitiesList, 1 do
|
|
||||||
DeleteEntity(entitiesList[i])
|
|
||||||
end
|
|
||||||
RemoveAnimDict(animDict)
|
|
||||||
FreezeEntityPosition(ped, false)
|
|
||||||
end
|
|
||||||
|
|
||||||
function Tray()
|
|
||||||
local pos = GetEntityCoords(PlayerPedId(), true)
|
|
||||||
RequestAnimDict('anim@heists@box_carry@')
|
|
||||||
while (not HasAnimDictLoaded('anim@heists@box_carry@')) do
|
|
||||||
Wait(7)
|
|
||||||
end
|
|
||||||
TaskPlayAnim(PlayerPedId(), 'anim@heists@box_carry@', 'idle', 5.0, -1, -1, 50, 0, false, false, false)
|
|
||||||
RequestModel("bkr_prop_meth_tray_02a")
|
|
||||||
while not HasModelLoaded("bkr_prop_meth_tray_02a") do
|
|
||||||
Wait(0)
|
|
||||||
end
|
|
||||||
local trays = CreateObject("bkr_prop_meth_tray_02a", pos.x, pos.y, pos.z, true, true, true)
|
|
||||||
AttachEntityToEntity(trays, PlayerPedId(), GetPedBoneIndex(PlayerPedId(), 28422), 0.01,-0.2, -0.2, 20.0, 0.0, 0.0, true, true, false, true, 1, true)
|
|
||||||
end
|
|
||||||
|
|
||||||
function CutCoke(coords, offset, rotation)
|
function CutCoke(coords, offset, rotation)
|
||||||
local animDict, animName = "anim@amb@business@coc@coc_unpack_cut_left@", "coke_cut_v5_coccutter"
|
local animDict, animName = "anim@amb@business@coc@coc_unpack_cut_left@", "coke_cut_v5_coccutter"
|
||||||
ps.requestAnim(animDict, 500)
|
ps.requestAnim(animDict, 500)
|
||||||
@@ -365,11 +206,11 @@ end
|
|||||||
|
|
||||||
local hit = 0
|
local hit = 0
|
||||||
function SpawnCarPedChase()
|
function SpawnCarPedChase()
|
||||||
|
ps.debug("SpawnCarPedChase")
|
||||||
local stoploc = vector3(-1157.63, -3056.71, 13.94)
|
local stoploc = vector3(-1157.63, -3056.71, 13.94)
|
||||||
local config = ps.callback('md-drugs:server:getLocs', false)
|
local start = GlobalState.MDDrugsLocs.StartLoc[math.random(1,#GlobalState.MDDrugsLocs.StartLoc)]
|
||||||
local start = config.StartLoc[math.random(1,#config.StartLoc)]
|
|
||||||
if started then
|
if started then
|
||||||
Notify(Lang.lean.act,'error')
|
ps.notify(Lang.lean.act,'error')
|
||||||
else
|
else
|
||||||
started = true
|
started = true
|
||||||
ps.requestModel("pounder", Config.RequestModelTime)
|
ps.requestModel("pounder", Config.RequestModelTime)
|
||||||
@@ -391,7 +232,11 @@ function SpawnCarPedChase()
|
|||||||
until #(GetEntityCoords(driver) - stoploc) < 20.0 or GetEntityHealth(driver) == 0
|
until #(GetEntityCoords(driver) - stoploc) < 20.0 or GetEntityHealth(driver) == 0
|
||||||
RemoveBlip(leancar)
|
RemoveBlip(leancar)
|
||||||
if GetEntityHealth(driver) == 0 then
|
if GetEntityHealth(driver) == 0 then
|
||||||
AddSingleModel(leancar, { name = 'leancar', icon = 'fa-solid fa-car', label = Lang.targets.lean.st,
|
ps.entityTarget(leancar, {
|
||||||
|
{
|
||||||
|
name = 'leancar',
|
||||||
|
icon = 'fa-solid fa-car',
|
||||||
|
label = Lang.targets.lean.st,
|
||||||
action = function()
|
action = function()
|
||||||
hit = hit + 1
|
hit = hit + 1
|
||||||
if not minigame() then return end
|
if not minigame() then return end
|
||||||
@@ -403,7 +248,9 @@ function SpawnCarPedChase()
|
|||||||
DeleteEntity(driver)
|
DeleteEntity(driver)
|
||||||
DeleteEntity(pilot2)
|
DeleteEntity(pilot2)
|
||||||
end
|
end
|
||||||
end}, nil)
|
end
|
||||||
|
}
|
||||||
|
})
|
||||||
else
|
else
|
||||||
DeleteVehicle(leancar) DeleteEntity(driver) DeleteEntity(pilot2)
|
DeleteVehicle(leancar) DeleteEntity(driver) DeleteEntity(pilot2)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -230,7 +230,7 @@ end
|
|||||||
function GetCops(number)
|
function GetCops(number)
|
||||||
if number == 0 then return true end
|
if number == 0 then return true end
|
||||||
local amount = ps.callback('md-drugs:server:GetCoppers')
|
local amount = ps.callback('md-drugs:server:GetCoppers')
|
||||||
if amount >= number then return true else Notify('You Need '.. number - amount .. ' More Cops To Do This', 'error') end
|
if amount >= number then return true else ps.notify('You Need '.. number - amount .. ' More Cops To Do This', 'error') end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+72
-38
@@ -1,41 +1,75 @@
|
|||||||
RegisterNetEvent("md-drugs:client:getsyruplocationtobuy", function()
|
|
||||||
Notify(Lang.Lean.marked, "success")
|
|
||||||
SpawnCarPedChase()
|
|
||||||
end)
|
|
||||||
|
|
||||||
RegisterNetEvent('md-drugs:client:leancraft', function()
|
local started = false
|
||||||
local store = {}
|
local hit = 0
|
||||||
local label = {}
|
|
||||||
local items = ps.callback('md-drugs:server:GetRecipe', false,'lean', 'cups')
|
function SpawnCarPedChase()
|
||||||
for k, v in pairs (items) do
|
local stoploc = vector3(-1157.63, -3056.71, 13.94)
|
||||||
label = {}
|
local start = GlobalState.MDDrugsLocs.StartLoc[math.random(1,#GlobalState.MDDrugsLocs.StartLoc)]
|
||||||
local item = ''
|
if started then ps.notify(Lang.lean.act,'error') return end
|
||||||
for m, d in pairs (items[k].take) do table.insert(label, GetLabel(m) .. ' X ' .. d) end
|
started = true
|
||||||
for m,d in pairs (items[k].give) do item = m end
|
ps.callback('md-drugs:server:RegisterLean')
|
||||||
store[#store + 1] = {
|
ps.requestModel("pounder", Config.RequestModelTime)
|
||||||
icon = GetImage(item),
|
ps.requestModel("ig_priest", Config.RequestModelTime)
|
||||||
description = table.concat(label, ", "),
|
ps.requestModel("cargobob3", Config.RequestModelTime)
|
||||||
title = GetLabel(item),
|
|
||||||
event = 'md-drugs:client:stirlean',
|
local leancar = CreateVehicle("pounder", start.x+3, start.y-2, start.z-1, 52.0, true, false)
|
||||||
args = {
|
local driver = CreatePed(26, "ig_priest", start.x, start.y, start.z, 268.9422, false, false)
|
||||||
item = item,
|
local pilot2 = CreatePed(26, "ig_priest", stoploc.x-3, stoploc.y-3, stoploc.z-1, 268.9422, false, false)
|
||||||
recipe = 'lean',
|
|
||||||
num = k,
|
FreezeEntityPosition(pilot2, true)
|
||||||
label = 'Cooking Up ' .. GetLabel(item),
|
SetEntityInvincible(pilot2, true)
|
||||||
table = 'cups'
|
SetEntityAsMissionEntity(leancar)
|
||||||
}
|
AddBlipForEntity(leancar)
|
||||||
}
|
SetPedIntoVehicle(driver, leancar, -1)
|
||||||
sorter(store, 'title')
|
SetPedFleeAttributes(driver,false)
|
||||||
lib.registerContext({id = 'leanCraft',title = "Make Lean", options = store})
|
TaskVehicleDriveToCoordLongrange(driver, leancar, stoploc.x, stoploc.y, stoploc.z-1, 50.0, 524288, 25.0)
|
||||||
|
SetPedKeepTask(driver, true)
|
||||||
|
|
||||||
|
repeat
|
||||||
|
Wait(1000)
|
||||||
|
until #(GetEntityCoords(driver) - stoploc) < 20.0 or GetEntityHealth(driver) == 0
|
||||||
|
|
||||||
|
RemoveBlip(leancar)
|
||||||
|
|
||||||
|
if GetEntityHealth(driver) == 0 then
|
||||||
|
ps.entityTarget(leancar, {
|
||||||
|
{
|
||||||
|
name = 'leancar',
|
||||||
|
icon = 'fa-solid fa-car',
|
||||||
|
label = Lang.targets.lean.st,
|
||||||
|
action = function()
|
||||||
|
hit = hit + 1
|
||||||
|
if not minigame() then return end
|
||||||
|
TriggerServerEvent('md-drugs:server:givelean')
|
||||||
|
started = false
|
||||||
|
if math.random(1,100) <= 30 or hit == 4 then
|
||||||
|
hit = 0
|
||||||
|
DeleteVehicle(leancar)
|
||||||
|
DeleteEntity(driver)
|
||||||
|
DeleteEntity(pilot2)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
}
|
||||||
|
})
|
||||||
|
else
|
||||||
|
DeleteVehicle(leancar)
|
||||||
|
DeleteEntity(driver)
|
||||||
|
DeleteEntity(pilot2)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
lib.showContext('leanCraft')
|
|
||||||
end)
|
|
||||||
|
|
||||||
local busy = false
|
local leanPeds = {}
|
||||||
RegisterNetEvent('md-drugs:client:stirlean', function(data)
|
for k, v in pairs (GlobalState.MDDrugsLocs.SyrupVendor) do
|
||||||
if busy then return end
|
ps.requestModel(v.ped)
|
||||||
busy = true
|
leanPeds[k] = CreatePed(0, v.ped, v.loc.x, v.loc.y, v.loc.z, false, false)
|
||||||
if not progressbar(data.label, 4000, 'uncuff') then busy = false return end
|
Freeze(leanPeds[k], true, v.loc.w)
|
||||||
TriggerServerEvent('md-drugs:server:finishcup', data)
|
ps.entityTarget(leanPeds[k], {
|
||||||
busy = false
|
{
|
||||||
end)
|
icon = "fa-solid fa-hand-holding-medical",
|
||||||
|
label = ps.lang('Lean.buylean'),
|
||||||
|
action = function()
|
||||||
|
SpawnCarPedChase()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
||||||
+10
-7
@@ -13,8 +13,8 @@ local function createLabKit(coord, head)
|
|||||||
action = function()
|
action = function()
|
||||||
local dict = "scr_ie_svm_technical2"
|
local dict = "scr_ie_svm_technical2"
|
||||||
if not ps.hasItems({
|
if not ps.hasItems({
|
||||||
{name = 'lysergic_acid', amount = 1},
|
lysergic_acid = 1,
|
||||||
{name = 'diethylamide', amount = 1}
|
diethylamide = 1
|
||||||
}) then
|
}) then
|
||||||
ps.notify(ps.lang('lsd.need'), 'error')
|
ps.notify(ps.lang('lsd.need'), 'error')
|
||||||
return
|
return
|
||||||
@@ -90,7 +90,7 @@ local function createLabKit(coord, head)
|
|||||||
canInteract = function() if dirtylsd then return true end end
|
canInteract = function() if dirtylsd then return true end end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ps.targetEntity(labkit, options)
|
ps.entityTarget(labkit, options)
|
||||||
end
|
end
|
||||||
|
|
||||||
for k, v in pairs (GlobalState.MDDrugsLocs.lysergicacid) do
|
for k, v in pairs (GlobalState.MDDrugsLocs.lysergicacid) do
|
||||||
@@ -147,16 +147,19 @@ for k,v in pairs (GlobalState.MDDrugsLocs.gettabs) do
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
local seller = {}
|
||||||
for k, v in pairs (GlobalState.MDDrugsLocs.buykit) do
|
for k, v in pairs (GlobalState.MDDrugsLocs.buyLSDkit) do
|
||||||
ps.boxTarget('buykit'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
|
ps.requestModel(v.ped, 1000)
|
||||||
|
seller[k] = CreatePed(4, v.ped, v.loc.x, v.loc.y, v.loc.z, v.loc.w, false, false)
|
||||||
|
Freeze(seller[k], true, v.loc.w)
|
||||||
|
ps.entityTarget(seller[k], {
|
||||||
{
|
{
|
||||||
label = ps.lang('targets.lsd.buy'),
|
label = ps.lang('targets.lsd.buy'),
|
||||||
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.havlabkit'), 'error') return end
|
||||||
if not ps.progressbar(ps.lang('lsd.buykit'), 4000, 'uncuff') then return end
|
if not ps.progressbar(ps.lang('lsd.buykit'), 4000, 'uncuff') then return end
|
||||||
TriggerEvent("md-drugs:client:buylabkit")
|
TriggerServerEvent('md-drugs:server:getlabkit', k)
|
||||||
end,
|
end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
if not handleGang(v.gang) then return false end
|
if not handleGang(v.gang) then return false end
|
||||||
|
|||||||
+18
-7
@@ -1,16 +1,27 @@
|
|||||||
|
|
||||||
|
for k, v in pairs (GlobalState.MDDrugsLocs.DryOutMescaline) do
|
||||||
RegisterNetEvent("md-drugs:client:drymescaline", function()
|
ps.boxTarget('dryoutMesc'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
|
||||||
if not ItemCheck('cactusbulb') then return end
|
{
|
||||||
if not progressbar(Lang.mescaline.dry, 4000, 'uncuff') then return end
|
label = ps.lang('mescaline.dry'),
|
||||||
TriggerServerEvent("md-drugs:server:drymescaline")
|
icon = 'fa-solid fa-temperature-high',
|
||||||
end)
|
action = function()
|
||||||
|
if not ps.hasItem('cactusbulb') then ps.notify(ps.lang('mescaline.needbulb'), 'error') return end
|
||||||
|
if not ps.progressbar(ps.lang('mescaline.dry'), 4000, 'drymescaline') then return end
|
||||||
|
TriggerServerEvent("md-drugs:server:drymescaline", k)
|
||||||
|
end,
|
||||||
|
canInteract = function()
|
||||||
|
if not handleGang(v.gang) then return false end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
RegisterNetEvent("md-drugs:client:takemescaline", function()
|
RegisterNetEvent("md-drugs:client:takemescaline", function()
|
||||||
local chance, chance2 = math.random(1,100), math.random(1,100)
|
local chance, chance2 = math.random(1,100), math.random(1,100)
|
||||||
local weapon = ''
|
local weapon = ''
|
||||||
if chance2 == 100 then weapon = 'weapon_rpg' else weapon = 'weapon_flaregun' end
|
if chance2 == 100 then weapon = 'weapon_rpg' else weapon = 'weapon_flaregun' end
|
||||||
if not progressbar(Lang.mescaline.eat, 4000, 'uncuff') then return end
|
if not ps.progressbar(ps.lang('mescaline.eat'), 4000, 'uncuff') then return end
|
||||||
if chance <= Config.Badtrip then
|
if chance <= Config.Badtrip then
|
||||||
AlienEffect()
|
AlienEffect()
|
||||||
local clone = ClonePed(PlayerPedId(), false, false, true)
|
local clone = ClonePed(PlayerPedId(), false, false, true)
|
||||||
|
|||||||
+272
-77
@@ -1,78 +1,223 @@
|
|||||||
local amonia = nil
|
local amonia = false
|
||||||
local tray = nil
|
local tray = false
|
||||||
local heated = nil
|
local heated = false
|
||||||
local active = nil
|
local active = false
|
||||||
|
local trays = nil
|
||||||
|
---- start animation shit
|
||||||
|
local function loadParticle(dict)
|
||||||
|
if not HasNamedPtfxAssetLoaded(dict) then
|
||||||
|
RequestNamedPtfxAsset(dict)
|
||||||
|
end
|
||||||
|
while not HasNamedPtfxAssetLoaded(dict) do
|
||||||
|
Wait(0)
|
||||||
|
end
|
||||||
|
SetPtfxAssetNextCall(dict)
|
||||||
|
end
|
||||||
|
|
||||||
local function startcook()
|
local function MethCooking(coords, offset, rotation)
|
||||||
if not ItemCheck('empty_weed_bag') then return end
|
local animDict, animName = "anim@amb@business@meth@meth_monitoring_cooking@cooking@", "chemical_pour_short_cooker"
|
||||||
if not ItemCheck('acetone') then return end
|
ps.requestAnim(animDict, 500)
|
||||||
if not ItemCheck('ephedrine') then return end
|
SetEntityCoords(PlayerPedId(), coords)
|
||||||
if amonia == nil then
|
local targetPosition = GetEntityCoords(PlayerPedId())
|
||||||
|
local animDuration = GetAnimDuration(animDict, animName) * 800
|
||||||
|
FreezeEntityPosition(PlayerPedId(), true)
|
||||||
|
local scenePos, sceneRot = vector3(coords.x + offset.x, coords.y + offset.y, coords.z + offset.z), rotation
|
||||||
|
local netScene = NetworkCreateSynchronisedScene(scenePos, sceneRot, 2, false, false, 1065353216, 0, 1.3)
|
||||||
|
NetworkAddPedToSynchronisedScene(PlayerPedId(), netScene, animDict, animName, 1.5, -4.0, 1, 16, 1148846080, 0)
|
||||||
|
local sacid = CreateObjectNoOffset("bkr_prop_meth_sacid", targetPosition, 1, 1, 0)
|
||||||
|
NetworkAddEntityToSynchronisedScene(sacid, netScene, animDict, "chemical_pour_short_sacid", 4.0, -8.0, 1)
|
||||||
|
local ammonia = CreateObjectNoOffset("bkr_prop_meth_ammonia", targetPosition, 1, 1, 0)
|
||||||
|
NetworkAddEntityToSynchronisedScene(ammonia, netScene, animDict, "chemical_pour_short_ammonia", 4.0, -8.0, 1)
|
||||||
|
NetworkStartSynchronisedScene(netScene)
|
||||||
|
Wait(animDuration)
|
||||||
|
NetworkStopSynchronisedScene(netScene)
|
||||||
|
DeleteObject(sacid) DeleteObject(ammonia)
|
||||||
|
FreezeEntityPosition(PlayerPedId(), false)
|
||||||
|
ps.requestModel('hei_prop_heist_thermite', 2000)
|
||||||
|
loadParticle('scr_ornate_heist')
|
||||||
|
local thermite = CreateObject('hei_prop_heist_thermite', vector3(1005.76, -3201.3, -39.25), true, false, false)
|
||||||
|
FreezeEntityPosition(thermite, true)
|
||||||
|
SetEntityRotation(thermite, 190.0, 90.0, 140.0, 3, true )
|
||||||
|
Wait(1000)
|
||||||
|
local therm = StartParticleFxLoopedOnEntity('scr_heist_ornate_thermal_burn', thermite, 0.0, 1.4, 0.0, 0.0, 0.0, 0.0, 1.5, false, false, false)
|
||||||
|
Wait(math.random(10000, 20000))
|
||||||
|
StopParticleFxLooped(therm, true)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
local function SmashMeth(coords, offset, rotation)
|
||||||
|
local ver = ""
|
||||||
|
local animDict, animName = "anim@amb@business@meth@meth_smash_weight_check@", "break_weigh_"..ver.."char02"
|
||||||
|
ps.requestAnim(animDict, 500)
|
||||||
|
local ped = PlayerPedId()
|
||||||
|
local targetPosition = coords
|
||||||
|
SetEntityCoords(ped, targetPosition)
|
||||||
|
Wait(1)
|
||||||
|
local animDuration = GetAnimDuration(animDict, animName) * 800
|
||||||
|
FreezeEntityPosition(ped, true)
|
||||||
|
local scenePos, sceneRot = vector3(coords.x + offset.x, coords.y + offset.y, coords.z + offset.z), rotation
|
||||||
|
local netScene = NetworkCreateSynchronisedScene(scenePos, sceneRot, 2, false, false, 1065353216, 0, 1.3)
|
||||||
|
NetworkAddPedToSynchronisedScene(ped, netScene, animDict, animName, 1.5, -4.0, 1, 16, 1148846080, 0)
|
||||||
|
local objects, sceneObjects = {}, {
|
||||||
|
{ hash = "w_me_hammer", animName = "break_weigh_" .. ver .. "hammer"},
|
||||||
|
{ hash = "bkr_Prop_Meth_SmashedTray_01_frag_", animName = "break_weigh_"..ver.."tray01"},
|
||||||
|
{ hash = "bkr_Prop_Meth_Tray_02a", animName = "break_weigh_"..ver.."tray01^1"},
|
||||||
|
{ hash = "bkr_Prop_Meth_Tray_02a", animName = "break_weigh_"..ver.."tray01^2"},
|
||||||
|
{ hash = "bkr_Prop_Meth_SmashedTray_01_frag_", animName = "break_weigh_"..ver.."tray01^3"},
|
||||||
|
}
|
||||||
|
for i=1, #sceneObjects, 1 do
|
||||||
|
local obj = CreateObjectNoOffset(sceneObjects[i].hash, targetPosition, true, true, true)
|
||||||
|
NetworkAddEntityToSynchronisedScene(obj, netScene, animDict, sceneObjects[i].animName, 4.0, -8.0, 1)
|
||||||
|
objects[#objects+1] = obj
|
||||||
|
end
|
||||||
|
NetworkStartSynchronisedScene(netScene)
|
||||||
|
Wait(animDuration)
|
||||||
|
NetworkStopSynchronisedScene(netScene)
|
||||||
|
for i=1, #objects, 1 do
|
||||||
|
DeleteObject(objects[i])
|
||||||
|
end
|
||||||
|
RemoveAnimDict(animDict)
|
||||||
|
FreezeEntityPosition(ped, false)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function BagMeth(coords, offset, rotation)
|
||||||
|
local ver = ""
|
||||||
|
local animDict, animName = "anim@amb@business@meth@meth_smash_weight_check@", "break_weigh_"..ver.."char01"
|
||||||
|
ps.requestAnim(animDict, 500)
|
||||||
|
local animDuration = GetAnimDuration(animDict, animName) * 1000
|
||||||
|
local ped = PlayerPedId()
|
||||||
|
SetEntityCoords(ped, coords)
|
||||||
|
local scenePos, sceneRot = vector3(coords.x + offset.x, coords.y + offset.y, coords.z + offset.z), rotation
|
||||||
|
local scenes = {
|
||||||
|
{
|
||||||
|
{ hash = "bkr_prop_meth_bigbag_04a", animName = "break_weigh_"..ver.."box01"},
|
||||||
|
{ hash = "bkr_prop_meth_bigbag_03a", animName = "break_weigh_"..ver.."box01^1"},
|
||||||
|
{ hash = "bkr_prop_meth_openbag_02", animName = "break_weigh_"..ver.."methbag01"}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
{ hash = "bkr_prop_meth_openbag_02", animName = "break_weigh_"..ver.."methbag01^1"},
|
||||||
|
{ hash = "bkr_prop_meth_openbag_02", animName = "break_weigh_"..ver.."methbag01^2"},
|
||||||
|
{ hash = "bkr_prop_meth_openbag_02", animName = "break_weigh_"..ver.."methbag01^3"}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
{ hash = "bkr_prop_meth_openbag_02", animName = "break_weigh_"..ver.."methbag01^4"},
|
||||||
|
{ hash = "bkr_prop_meth_openbag_02", animName = "break_weigh_"..ver.."methbag01^5"},
|
||||||
|
{ hash = "bkr_prop_meth_openbag_02", animName = "break_weigh_"..ver.."methbag01^6"}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
{ hash = "bkr_prop_meth_scoop_01a", animName = "break_weigh_"..ver.."scoop"},
|
||||||
|
{ hash = "bkr_prop_coke_scale_01", animName = "break_weigh_"..ver.."scale"},
|
||||||
|
{ hash = "bkr_prop_fakeid_penclipboard", animName = "break_weigh_"..ver.."pen"}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
{ hash = "bkr_prop_fakeid_clipboard_01a", animName = "break_weigh_"..ver.."clipboard"},
|
||||||
|
{ hash = "bkr_Prop_Meth_Tray_02a", animName = "break_weigh_"..ver.."tray01^5"}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
local scenesList, entitiesList = {}, {}
|
||||||
|
for i=1, #scenes, 1 do
|
||||||
|
local scene = NetworkCreateSynchronisedScene(scenePos, sceneRot, 2, false, false, 1065353216, 0, 1.3)
|
||||||
|
NetworkAddPedToSynchronisedScene(ped, scene, animDict, animName, 1.5, -4.0, 1, 16, 1148846080, 0)
|
||||||
|
for j=1, #scenes[i], 1 do
|
||||||
|
local s = scenes[i][j]
|
||||||
|
RequestModel(s.hash)
|
||||||
|
while not HasModelLoaded(s.hash) do
|
||||||
|
Wait(0)
|
||||||
|
end
|
||||||
|
local obj = CreateObjectNoOffset(s.hash, coords, true, true, true)
|
||||||
|
SetModelAsNoLongerNeeded(s.hash)
|
||||||
|
entitiesList[#entitiesList+1] = obj
|
||||||
|
NetworkAddEntityToSynchronisedScene(obj, scene, animDict, s.animName, 4.0, -8.0, 1)
|
||||||
|
end
|
||||||
|
scenesList[#scenesList+1] = scene
|
||||||
|
end
|
||||||
|
DisableCamCollisionForEntity(ped)
|
||||||
|
FreezeEntityPosition(ped, true)
|
||||||
|
for i=1, #scenesList, 1 do
|
||||||
|
NetworkStartSynchronisedScene(scenesList[i])
|
||||||
|
end
|
||||||
|
|
||||||
|
Wait(animDuration-11000)
|
||||||
|
for i=1, #scenesList, 1 do
|
||||||
|
NetworkStopSynchronisedScene(scenesList[i])
|
||||||
|
end
|
||||||
|
for i=1, #entitiesList, 1 do
|
||||||
|
DeleteEntity(entitiesList[i])
|
||||||
|
end
|
||||||
|
RemoveAnimDict(animDict)
|
||||||
|
FreezeEntityPosition(ped, false)
|
||||||
|
end
|
||||||
|
---------------------- end animation shit
|
||||||
|
---
|
||||||
|
|
||||||
|
local function startcook(num, coords, offset, rotation)
|
||||||
|
if not amonia then
|
||||||
|
local adding = ps.callback('md-drugs:server:startcook', num)
|
||||||
|
if not adding then return end
|
||||||
active = true
|
active = true
|
||||||
TriggerServerEvent("md-drugs:server:startcook")
|
amonia = true
|
||||||
MethCooking()
|
MethCooking(coords, offset, rotation)
|
||||||
amonia = true
|
amonia = true
|
||||||
else
|
else
|
||||||
Notify(Lang.meth.inside, "error")
|
ps.notify(ps.lang('meth.inside'), "error")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function dials()
|
|
||||||
|
local function dials(coords)
|
||||||
if amonia == true then
|
if amonia == true then
|
||||||
if not minigame() then
|
if not ps.minigame('ps-circle', {amount = 2, speed = 8}) then
|
||||||
AddExplosion(1005.773, -3200.402, -38.524, 49, 10, true, false, true)
|
AddExplosion(coords.x, coords.y,coords.z, 49, 10, true, false, true)
|
||||||
ClearPedTasks(PlayerPedId())
|
amonia = false
|
||||||
amonia = nil
|
active = false
|
||||||
active = nil
|
|
||||||
return end
|
return end
|
||||||
Notify(Lang.meth.increaseheat, "success")
|
ps.notify(ps.lang('meth.increaseheat'), "success")
|
||||||
ClearPedTasks(PlayerPedId())
|
|
||||||
heated = true
|
heated = true
|
||||||
else
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function smash()
|
local function smash(coords, offset, rotation, buckets, k)
|
||||||
if tray then
|
if tray then
|
||||||
tray = false
|
tray = false
|
||||||
DeleteObject(trays)
|
DeleteObject(trays)
|
||||||
local bucket = CreateObject("bkr_prop_meth_bigbag_03a", vector3(1012.85, -3194.29, -39.2), true, true, true)
|
local bucket = CreateObject("bkr_prop_meth_bigbag_03a", buckets.x, buckets.y, buckets.z, true, true, true)
|
||||||
Freeze(bucket, true, 90.0)
|
Freeze(bucket, true, buckets.w)
|
||||||
SmashMeth()
|
ps.entityTarget(bucket, {
|
||||||
Wait(100)
|
{
|
||||||
AddSingleModel(bucket,
|
name = 'bucket',
|
||||||
{name = 'bucket',icon = "fa-solid fa-sack-xmark",label = Lang.targets.meth.bag, canInteract = function() if active == nil then return false end end,
|
icon = "fa-solid fa-sack-xmark",
|
||||||
|
label = ps.lang('targets.meth.bag'),
|
||||||
|
canInteract = function()
|
||||||
|
if active == false then return false end
|
||||||
|
end,
|
||||||
action = function()
|
action = function()
|
||||||
active = nil
|
|
||||||
DeleteObject(bucket)
|
DeleteObject(bucket)
|
||||||
amonia = nil
|
active = false
|
||||||
heated = nil
|
amonia = false
|
||||||
tray = nil
|
heated = false
|
||||||
BagMeth()
|
tray = false
|
||||||
TriggerServerEvent('md-drugs:server:getmeth')
|
BagMeth(GlobalState.MDDrugsLocs.BagMeth[k].loc, GlobalState.MDDrugsLocs.BagMeth[k].offset, GlobalState.MDDrugsLocs.BagMeth[k].rotation)
|
||||||
end,}, bucket)
|
TriggerServerEvent('md-drugs:server:getmeth', k)
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
SmashMeth(coords, offset, rotation)
|
||||||
|
Wait(100)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function trayscarry()
|
local function trayscarry()
|
||||||
if amonia then
|
if amonia then
|
||||||
local pos = GetEntityCoords(PlayerPedId(), true)
|
local pos = GetEntityCoords(PlayerPedId(), true)
|
||||||
RequestAnimDict('anim@heists@box_carry@')
|
ps.requestAnim('anim@heists@box_carry@')
|
||||||
while (not HasAnimDictLoaded('anim@heists@box_carry@')) do
|
TaskPlayAnim(PlayerPedId(), 'anim@heists@box_carry@', 'idle', 5.0, -1, -1, 50, 0, false, false, false)
|
||||||
Wait(7)
|
ps.requestModel('bkr_prop_meth_tray_02a')
|
||||||
end
|
|
||||||
TaskPlayAnim(PlayerPedId(), 'anim@heists@box_carry@', 'idle', 5.0, -1, -1, 50, 0, false, false,
|
|
||||||
false)
|
|
||||||
RequestModel("bkr_prop_meth_tray_02a")
|
|
||||||
while not HasModelLoaded("bkr_prop_meth_tray_02a") do
|
|
||||||
Wait(0)
|
|
||||||
end
|
|
||||||
trays = CreateObject("bkr_prop_meth_tray_02a", pos.x, pos.y, pos.z, true, true, true)
|
trays = CreateObject("bkr_prop_meth_tray_02a", pos.x, pos.y, pos.z, true, true, true)
|
||||||
AttachEntityToEntity(trays, PlayerPedId(), GetPedBoneIndex(PlayerPedId(), 28422), 0.01, -0.2,
|
AttachEntityToEntity(trays, PlayerPedId(), GetPedBoneIndex(PlayerPedId(), 28422), 0.01, -0.2,-0.2, 20.0, 0.0, 0.0, true, true, false, true, 1, true)
|
||||||
-0.2, 20.0, 0.0, 0.0, true, true, false, true, 1, true)
|
|
||||||
tray = true
|
tray = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
CreateThread(function()
|
CreateThread(function()
|
||||||
BikerMethLab = exports['bob74_ipl']:GetBikerMethLabObject()
|
BikerMethLab = exports['bob74_ipl']:GetBikerMethLabObject()
|
||||||
BikerMethLab.Style.Set(BikerMethLab.Style.upgrade)
|
BikerMethLab.Style.Set(BikerMethLab.Style.upgrade)
|
||||||
@@ -81,46 +226,96 @@ CreateThread(function()
|
|||||||
RefreshInterior(BikerMethLab.interiorId)
|
RefreshInterior(BikerMethLab.interiorId)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
CreateThread(function()
|
for k, v in pairs (GlobalState.MDDrugsLocs.CookMeth) do
|
||||||
local config = ps.callback('md-drugs:server:getLocs', false)
|
ps.boxTarget('cookMeth'..k, v.loc, {length = v.l, width = v.w, rotation = v.rot, height = 1.0},{
|
||||||
AddBoxZoneSingle("methTeleOut",config.singleSpot.MethTeleIn, {name = 'teleout', icon = "fa-solid fa-door-open", label = Lang.targets.meth.enter, action = function() SetEntityCoords(PlayerPedId(), config.singleSpot.MethTeleOut) end} )
|
{
|
||||||
AddBoxZoneSingle("methtelein",config.singleSpot.MethTeleOut, {name = 'teleout', icon = "fa-solid fa-door-closed", label = Lang.targets.meth.exit, action = function() SetEntityCoords(PlayerPedId(), config.singleSpot.MethTeleIn) end} )
|
label = 'Cook Meth',
|
||||||
local options = {
|
icon = 'fa-solid fa-temperature-high',
|
||||||
{ name = 'methcook', icon = "fa-solid fa-temperature-high", label = Lang.targets.meth.cook, distance = 2.5, action = function() startcook() end,
|
action = function()
|
||||||
|
startcook(k, v.loc, v.offset or vec3(0,0,0), v.rotation or vector3(0,0,180.0))
|
||||||
|
end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
if amonia == nil and active == nil then
|
if not amonia and not active then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{ name = 'grabtray', icon = "fas fa-sign-in-alt", label = Lang.targets.meth.tray, distance = 2.5, action = function() trayscarry() end,
|
{
|
||||||
|
icon = "fas fa-sign-in-alt",
|
||||||
|
label = ps.lang('targets.meth.tray'),
|
||||||
|
action = function() trayscarry() end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
if heated and amonia and tray == nil then return true end
|
if heated and amonia and not tray then
|
||||||
|
return true
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
|
||||||
AddBoxZoneMultiOptions("cookmeth",vector3(1005.72, -3200.33, -38.52), options )
|
|
||||||
AddBoxZoneSingle('boxmeth', vector3(1012.15, -3194.04, -39.20), {name = 'boxmeth',icon = "fa-solid fa-weight-scale",label = Lang.targets.meth.box,action = function() smash()end,
|
|
||||||
canInteract = function()
|
|
||||||
if tray then return true end
|
|
||||||
end})
|
|
||||||
AddBoxZoneSingle('adjustdials',vector3(1007.89, -3201.17, -38.99),{ name = 'adjustdials', icon = "fa-solid fa-temperature-three-quarters", label = Lang.targets.meth.adjust,
|
|
||||||
distance = 5, action = function() dials() end,
|
|
||||||
canInteract = function()
|
|
||||||
if amonia and heated == nil then return true end end
|
|
||||||
})
|
})
|
||||||
if Config.MethHeist == false then
|
|
||||||
AddBoxZoneMulti('methep', config.MethEph, {icon = "fa-solid fa-bucket", label = Lang.targets.meth.eph, event = 'md-drugs:client:stealeph'})
|
|
||||||
AddBoxZoneMulti('methace', config.Methace, {icon = "fa-solid fa-bucket", label = Lang.targets.meth.ace, event = 'md-drugs:client:stealace'})
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
for k, v in pairs (GlobalState.MDDrugsLocs.MethDials) do
|
||||||
|
ps.boxTarget('adjustMethDials'..k, v.loc, {length = v.l, width = v.w, rotation = v.rot, height = 1.0},{
|
||||||
|
{
|
||||||
|
name = 'adjustdials',
|
||||||
|
icon = "fa-solid fa-temperature-three-quarters",
|
||||||
|
label = ps.lang('targets.meth.adjust'),
|
||||||
|
action = function()
|
||||||
|
dials(GlobalState.MDDrugsLocs.CookMeth[k].loc)
|
||||||
|
end,
|
||||||
|
canInteract = function()
|
||||||
|
if amonia and heated == false then return true end
|
||||||
|
end
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
for k, v in pairs (GlobalState.MDDrugsLocs.MethSmash) do
|
||||||
|
ps.boxTarget('smashMeth'..k, v.loc, {length = v.l, width = v.w, rotation = v.rot, height = 1.0},{
|
||||||
|
{
|
||||||
|
name = 'smash',
|
||||||
|
icon = "fa-solid fa-weight-scale",
|
||||||
|
label = ps.lang('targets.meth.smash'),
|
||||||
|
action = function()
|
||||||
|
smash(v.loc, v.offset, v.rotation, v.bucket,k)
|
||||||
|
end,
|
||||||
|
canInteract = function()
|
||||||
|
if heated and amonia and tray then return true end
|
||||||
|
end
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
RegisterCommand('offset', function()
|
||||||
|
local pos = GetEntityCoords(PlayerPedId())
|
||||||
|
Wait(4000)
|
||||||
|
local offset = GetEntityCoords(PlayerPedId()) - pos
|
||||||
|
print("Offset: ", offset)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
RegisterNetEvent("md-drugs:client:stealeph", function(data)
|
if not Config.MethHeist then
|
||||||
if not progressbar('Stealing Ephedrine', 4000, 'uncuff') then return end
|
for k, v in pairs (GlobalState.MDDrugsLocs.MethEph) do
|
||||||
TriggerServerEvent("md-drugs:server:geteph", data.data)
|
ps.boxTarget('stealMethEph'..k, v.loc, {length = v.l, width = v.w, rotation = v.rot, height = 1.0},{
|
||||||
end)
|
{
|
||||||
|
label = 'Steal Ephedrine',
|
||||||
|
icon = 'fa-solid fa-bucket',
|
||||||
|
action = function()
|
||||||
|
if not ps.progressbar('Stealing Ephedrine', 4000, 'uncuff') then return end
|
||||||
|
TriggerServerEvent("md-drugs:server:geteph", k)
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
RegisterNetEvent("md-drugs:client:stealace", function(data)
|
for k, v in pairs (GlobalState.MDDrugsLocs.Methace) do
|
||||||
if not progressbar('Stealing Acetone', 4000, 'uncuff') then return end
|
ps.boxTarget('stealMethAce'..k, v.loc, {length = v.l, width = v.w, rotation = v.rot, height = 1.0},{
|
||||||
TriggerServerEvent("md-drugs:server:getace", data.data)
|
{
|
||||||
end)
|
label = 'Steal Acetone',
|
||||||
|
icon = 'fa-solid fa-bucket',
|
||||||
|
action = function()
|
||||||
|
if not ps.progressbar('Stealing Acetone', 4000, 'uncuff') then return end
|
||||||
|
TriggerServerEvent("md-drugs:server:getace", k)
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
+6
-6
@@ -9,7 +9,7 @@ RegisterNetEvent("md-drugs:client:GetOxyCar", function()
|
|||||||
local oxycar = CreateVehicle("burrito3",loc.x, loc.y,loc.z, loc.w, true, false)
|
local oxycar = CreateVehicle("burrito3",loc.x, loc.y,loc.z, loc.w, true, false)
|
||||||
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))
|
||||||
Notify(Lang.oxy.truck, 'success')
|
ps.notify(Lang.oxy.truck, 'success')
|
||||||
TriggerEvent("md-drugs:client:getoxylocationroute")
|
TriggerEvent("md-drugs:client:getoxylocationroute")
|
||||||
AddSingleModel(oxycar, { event = "md-drugs:client:getfromtrunk", icon = "fa-solid fa-box", label = Lang.targets.oxy.pack}, nil )
|
AddSingleModel(oxycar, { event = "md-drugs:client:getfromtrunk", icon = "fa-solid fa-box", label = Lang.targets.oxy.pack}, nil )
|
||||||
end)
|
end)
|
||||||
@@ -30,14 +30,14 @@ RegisterNetEvent("md-drugs:client:getoxylocationroute", function()
|
|||||||
AddSingleModel(oxybuyer, { type = "client", label = Lang.targets.oxy.talk, icon = "fa-solid fa-dollar-sign",
|
AddSingleModel(oxybuyer, { type = "client", label = Lang.targets.oxy.talk, icon = "fa-solid fa-dollar-sign",
|
||||||
action = function()
|
action = function()
|
||||||
if carryPackage then
|
if carryPackage then
|
||||||
if not progressbar(Lang.oxy.hand, 4000, 'uncuff') then return end
|
if not ps.progressbar(Lang.oxy.hand, 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)
|
||||||
DeleteObject(carryPackage)
|
DeleteObject(carryPackage)
|
||||||
carryPackage = nil
|
carryPackage = nil
|
||||||
else
|
else
|
||||||
Notify(Lang.oxy.empty, "error")
|
ps.notify(Lang.oxy.empty, "error")
|
||||||
end
|
end
|
||||||
end}, oxybuyer)
|
end}, oxybuyer)
|
||||||
end
|
end
|
||||||
@@ -46,7 +46,7 @@ end)
|
|||||||
|
|
||||||
RegisterNetEvent("md-drugs:client:getfromtrunk", function()
|
RegisterNetEvent("md-drugs:client:getfromtrunk", function()
|
||||||
if carryPackage then
|
if carryPackage then
|
||||||
Notify(Lang.oxy.cantcarry, "error")
|
ps.notify(Lang.oxy.cantcarry, "error")
|
||||||
else
|
else
|
||||||
local pos = GetEntityCoords(PlayerPedId(), true)
|
local pos = GetEntityCoords(PlayerPedId(), true)
|
||||||
lib.requestAnimDict('anim@heists@box_carry@')
|
lib.requestAnimDict('anim@heists@box_carry@')
|
||||||
@@ -61,14 +61,14 @@ end)
|
|||||||
|
|
||||||
RegisterNetEvent("md-drugs:client:giveoxybox", function(data)
|
RegisterNetEvent("md-drugs:client:giveoxybox", function(data)
|
||||||
if carryPackage then
|
if carryPackage then
|
||||||
if not progressbar(Lang.oxy.hand, 4000, 'uncuff') then return end
|
if not ps.progressbar(Lang.oxy.hand, 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:giveoxybox")
|
TriggerServerEvent("md-drugs:server:giveoxybox")
|
||||||
DeleteEntity(data.ped)
|
DeleteEntity(data.ped)
|
||||||
DetachEntity(carryPackage, true, true)
|
DetachEntity(carryPackage, true, true)
|
||||||
DeleteObject(carryPackage)
|
DeleteObject(carryPackage)
|
||||||
carryPackage = nil
|
carryPackage = nil
|
||||||
else
|
else
|
||||||
Notify(Lang.oxy.empty, "error")
|
ps.notify(Lang.oxy.empty, "error")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@@ -22,6 +22,6 @@ CreateThread(function()
|
|||||||
AddSingleModel(heroinkitdealer, { label = Lang.targets.heroin.kit, icon = "fa-solid fa-money-bill", event = "md-drugs:client:buyheroinlabkit", distance = 2.0}, nil )
|
AddSingleModel(heroinkitdealer, { label = Lang.targets.heroin.kit, icon = "fa-solid fa-money-bill", event = "md-drugs:client:buyheroinlabkit", distance = 2.0}, nil )
|
||||||
AddSingleModel(SyrupLocation, { type = "client", label = Lang.targets.lean.git, icon = "fa-solid fa-circle-info", event = "md-drugs:client:getsyruplocationtobuy", distance = 2.0}, nil )
|
AddSingleModel(SyrupLocation, { type = "client", label = Lang.targets.lean.git, icon = "fa-solid fa-circle-info", event = "md-drugs:client:getsyruplocationtobuy", distance = 2.0}, nil )
|
||||||
AddSingleModel(WeedGuy, {label = "Weed Shop",icon = "fa-solid fa-cannabis", action = function() makeMenu('WeedShop') lib.showContext('WeedShop')end}, nil)
|
AddSingleModel(WeedGuy, {label = "Weed Shop",icon = "fa-solid fa-cannabis", action = function() makeMenu('WeedShop') lib.showContext('WeedShop')end}, nil)
|
||||||
AddSingleModel(methdealer,{label = Lang.targets.meth.mission, icon = "fa-solid fa-circle-info", action = function() Notify(Lang.meth.mission, "success") SpawnMethCarPedChase() end,},nil )
|
AddSingleModel(methdealer,{label = Lang.targets.meth.mission, icon = "fa-solid fa-circle-info", action = function() ps.notify(Lang.meth.mission, "success") SpawnMethCarPedChase() end,},nil )
|
||||||
AddSingleModel(travellingmerchant, {label = Lang.targets.travel.travel, icon = "fa-solid fa-cart-shopping", action = function() makeMenu('travellingMerchant') lib.showContext('travellingMerchant') end}, nil)
|
AddSingleModel(travellingmerchant, {label = Lang.targets.travel.travel, icon = "fa-solid fa-cart-shopping", action = function() makeMenu('travellingMerchant') lib.showContext('travellingMerchant') end}, nil)
|
||||||
end)
|
end)
|
||||||
+4
-4
@@ -1,20 +1,20 @@
|
|||||||
|
|
||||||
ps.registerCallback("md-drugs:client:prescriptionpad", function(data, op)
|
ps.registerCallback("md-drugs:client:prescriptionpad", function(data, op)
|
||||||
if getJobType() ~= 'ems' then return end
|
if ps.getJobType() ~= 'ems' then return end
|
||||||
local input = lib.inputDialog('Who To Give A Prescription To?',{
|
local input = lib.inputDialog('Who To Give A Prescription To?',{
|
||||||
{type = 'select', label = 'Player Name', options = data},
|
{type = 'select', label = 'Player Name', options = data},
|
||||||
{type = 'select', label = 'Prescription', options = op}})
|
{type = 'select', label = 'Prescription', options = op}})
|
||||||
if not input[1] then return end
|
if not input[1] then return end
|
||||||
if not progressbar(Lang.Pharma.write, 4000, 'notepad') then return end
|
if not ps.progressbar(Lang.Pharma.write, 4000, 'notepad') then return end
|
||||||
return {who = input[1], what = input[2]}
|
return {who = input[1], what = input[2]}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
RegisterNetEvent("md-drugs:client:fillprescription", function(data)
|
RegisterNetEvent("md-drugs:client:fillprescription", function(data)
|
||||||
if not progressbar(Lang.Pharma.fill, 4000, 'uncuff') then return end
|
if not ps.progressbar(Lang.Pharma.fill, 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:fillprescription", data.data)
|
TriggerServerEvent("md-drugs:server:fillprescription", data.data)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
ps.registerCallback("md-drugs:client:unbottle", function()
|
ps.registerCallback("md-drugs:client:unbottle", function()
|
||||||
if not progressbar(Lang.Pharma.open, 4000, 'uncuff') then return end
|
if not ps.progressbar(Lang.Pharma.open, 4000, 'uncuff') then return end
|
||||||
return true
|
return true
|
||||||
end)
|
end)
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
RegisterNetEvent('md-drugs:client:takeshrooms', function()
|
RegisterNetEvent('md-drugs:client:takeshrooms', function()
|
||||||
if not progressbar(Lang.Shrooms.eat, 500, 'eat') then return end
|
if not ps.progressbar(Lang.Shrooms.eat, 500, 'eat') then return end
|
||||||
TriggerEvent("evidence:client:SetStatus", "widepupils", 300)
|
TriggerEvent("evidence:client:SetStatus", "widepupils", 300)
|
||||||
EcstasyEffect()
|
EcstasyEffect()
|
||||||
end)
|
end)
|
||||||
+10
-10
@@ -19,15 +19,15 @@ CreateThread(function()
|
|||||||
action = function()
|
action = function()
|
||||||
if not ItemCheck('wetcannabis') then return end
|
if not ItemCheck('wetcannabis') then return end
|
||||||
if drying then
|
if drying then
|
||||||
Notify(Lang.Weed.busy, "error")
|
ps.notify(Lang.Weed.busy, "error")
|
||||||
else
|
else
|
||||||
local loc = GetEntityCoords(PlayerPedId())
|
local loc = GetEntityCoords(PlayerPedId())
|
||||||
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)
|
||||||
Notify(Lang.Weed.wait, "success")
|
ps.notify(Lang.Weed.wait, "success")
|
||||||
Wait(math.random(1000,5000))
|
Wait(math.random(1000,5000))
|
||||||
Notify(Lang.Weed.take, "success")
|
ps.notify(Lang.Weed.take, "success")
|
||||||
AddSingleModel(weedplant, {
|
AddSingleModel(weedplant, {
|
||||||
icon = "fa-solid fa-cannabis",
|
icon = "fa-solid fa-cannabis",
|
||||||
label = Lang.targets.weed.dpick,
|
label = Lang.targets.weed.dpick,
|
||||||
@@ -65,11 +65,11 @@ AddBoxZoneSingle('makeoil',config.singleSpot.MakeOil, {
|
|||||||
local loc = GetEntityCoords(PlayerPedId())
|
local loc = GetEntityCoords(PlayerPedId())
|
||||||
AddExplosion(loc.x, loc.y, loc.z, 49, 10, true, false, true)
|
AddExplosion(loc.x, loc.y, loc.z, 49, 10, true, false, true)
|
||||||
exploded = true
|
exploded = true
|
||||||
Notify(Lang.Weed.stovehot, "error")
|
ps.notify(Lang.Weed.stovehot, "error")
|
||||||
Wait(1000 * 30)
|
Wait(1000 * 30)
|
||||||
exploded = false
|
exploded = false
|
||||||
return end
|
return end
|
||||||
if not progressbar(Lang.Weed.shat, 4000, 'uncuff') then return end
|
if not ps.progressbar(Lang.Weed.shat, 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:makeoil")
|
TriggerServerEvent("md-drugs:server:makeoil")
|
||||||
end,
|
end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
@@ -97,7 +97,7 @@ CreateThread(function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
RegisterNetEvent("md-drugs:client:dodabs", function()
|
RegisterNetEvent("md-drugs:client:dodabs", function()
|
||||||
if not progressbar('Doing Dabs', 4000, 'bong2') then AlienEffect() return end
|
if not ps.progressbar('Doing Dabs', 4000, 'bong2') then AlienEffect() return end
|
||||||
AlienEffect()
|
AlienEffect()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@@ -128,14 +128,14 @@ local function createBluntOptions(contextId, contextTitle, eventLabelPrefix, tab
|
|||||||
end
|
end
|
||||||
|
|
||||||
CreateThread(function()
|
CreateThread(function()
|
||||||
createBluntOptions('ButterCraft', "Edible Cooking", 'Cooking A ', 'edibles')
|
--createBluntOptions('ButterCraft', "Edible Cooking", 'Cooking A ', 'edibles')
|
||||||
createBluntOptions('mddrugsblunts', "Roll Blunts", 'Rolling A ', 'blunts')
|
--createBluntOptions('mddrugsblunts', "Roll Blunts", 'Rolling A ', 'blunts')
|
||||||
createBluntOptions('mddrugsbluntwraps', "Dipping Syrup", 'Dipping Syrup To Make ', 'bluntwrap')
|
--createBluntOptions('mddrugsbluntwraps', "Dipping Syrup", 'Dipping Syrup To Make ', 'bluntwrap')
|
||||||
end)
|
end)
|
||||||
|
|
||||||
RegisterNetEvent("md-drugs:client:MakeWeedItems", function(data)
|
RegisterNetEvent("md-drugs:client:MakeWeedItems", function(data)
|
||||||
if not minigame() then return end
|
if not minigame() then return end
|
||||||
if not progressbar('Making ' .. data.item, 4000, 'uncuff') then return end
|
if not ps.progressbar('Making ' .. data.item, 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent('md-drugs:server:MakeWeedItems', data)
|
TriggerServerEvent('md-drugs:server:MakeWeedItems', data)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ local miss = false
|
|||||||
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
|
||||||
Notify(Lang.Wholesale.al, 'error')
|
ps.notify(Lang.Wholesale.al, 'error')
|
||||||
else
|
else
|
||||||
local loc = drug.location
|
local loc = drug.location
|
||||||
local timer = 0
|
local timer = 0
|
||||||
@@ -20,10 +20,10 @@ RegisterNetEvent("md-drugs:client:GetLocation", function(drug)
|
|||||||
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 progressbar("Wholesaling Drugs", 4000, 'uncuff') then return end
|
if not ps.progressbar("Wholesaling Drugs", 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:SuccessSale", drug)
|
TriggerServerEvent("md-drugs:server:SuccessSale", drug)
|
||||||
else
|
else
|
||||||
progressbar("YOU FUCKED NOW", 4000, 'uncuff')
|
ps.progressbar("YOU FUCKED NOW", 4000, 'uncuff')
|
||||||
SetUpPeds()
|
SetUpPeds()
|
||||||
end
|
end
|
||||||
Wait(3000)
|
Wait(3000)
|
||||||
@@ -39,7 +39,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
|
||||||
Notify('The Buyer Waited To Long', 'error')
|
ps.notify('The Buyer Waited To Long', 'error')
|
||||||
DeleteEntity(drugdealer)
|
DeleteEntity(drugdealer)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
+21
-21
@@ -2,11 +2,11 @@ local xtcpress = false
|
|||||||
|
|
||||||
RegisterNetEvent("md-drugs:client:setpress", function(type)
|
RegisterNetEvent("md-drugs:client:setpress", function(type)
|
||||||
if xtcpress then
|
if xtcpress then
|
||||||
Notify(Lang.xtc.out, 'error')
|
ps.notify(Lang.xtc.out, 'error')
|
||||||
else
|
else
|
||||||
local coords, head = StartRay2()
|
local coords, head = StartRay2()
|
||||||
xtcpress = true
|
xtcpress = true
|
||||||
progressbar('Setting Press On The Ground', 4000, 'uncuff')
|
ps.progressbar('Setting Press On The Ground', 4000, 'uncuff')
|
||||||
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)
|
||||||
@@ -24,12 +24,12 @@ end)
|
|||||||
|
|
||||||
ps.registerCallback('md-drugs:client:setpress', function(type)
|
ps.registerCallback('md-drugs:client:setpress', function(type)
|
||||||
if xtcpress then
|
if xtcpress then
|
||||||
Notify(Lang.xtc.out, 'error')
|
ps.notify(Lang.xtc.out, 'error')
|
||||||
return false
|
return false
|
||||||
else
|
else
|
||||||
local coords, head = StartRay2()
|
local coords, head = StartRay2()
|
||||||
xtcpress = true
|
xtcpress = true
|
||||||
progressbar('Setting Press On The Ground', 4000, 'uncuff')
|
ps.progressbar('Setting Press On The Ground', 4000, 'uncuff')
|
||||||
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)
|
||||||
@@ -62,34 +62,34 @@ RegisterNetEvent("md-drugs:client:XTCMenu", function(type)
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
RegisterNetEvent("md-drugs:client:GetPressBack", function(type, press)
|
RegisterNetEvent("md-drugs:client:GetPressBack", function(type, press)
|
||||||
if not progressbar(Lang.xtc.pickup, 5000, 'uncuff') then return end
|
if not ps.progressbar(Lang.xtc.pickup, 5000, 'uncuff') then return end
|
||||||
DeleteObject(press)
|
DeleteObject(press)
|
||||||
xtcpress = false
|
xtcpress = false
|
||||||
TriggerServerEvent("md-drugs:server:getpressback", type)
|
TriggerServerEvent("md-drugs:server:getpressback", type)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
RegisterNetEvent("md-drugs:client:stealisosafrole", function(data)
|
RegisterNetEvent("md-drugs:client:stealisosafrole", function(data)
|
||||||
if not minigame() then Notify(Lang.xtc.fail, "error") return end
|
if not minigame() then ps.notify(Lang.xtc.fail, "error") return end
|
||||||
if not progressbar(Lang.xtc.iso, 4000, 'uncuff') then return end
|
if not ps.progressbar(Lang.xtc.iso, 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:stealisosafrole",data.data)
|
TriggerServerEvent("md-drugs:server:stealisosafrole",data.data)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
RegisterNetEvent("md-drugs:client:stealmdp2p", function(data)
|
RegisterNetEvent("md-drugs:client:stealmdp2p", function(data)
|
||||||
if not minigame() then Notify(Lang.xtc.fail, "error") return end
|
if not minigame() then ps.notify(Lang.xtc.fail, "error") return end
|
||||||
if not progressbar(Lang.xtc.mdp2p, 4000, 'uncuff') then return end
|
if not ps.progressbar(Lang.xtc.mdp2p, 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:stealmdp2p", data.data)
|
TriggerServerEvent("md-drugs:server:stealmdp2p", data.data)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
RegisterNetEvent("md-drugs:client:makingrawxtc", function(data)
|
RegisterNetEvent("md-drugs:client:makingrawxtc", function(data)
|
||||||
if not ItemCheck('isosafrole') then return end
|
if not ItemCheck('isosafrole') then return end
|
||||||
if not ItemCheck('mdp2p') then return end
|
if not ItemCheck('mdp2p') then return end
|
||||||
if not progressbar(Lang.xtc.raw, 4000, 'uncuff') then return end
|
if not ps.progressbar(Lang.xtc.raw, 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:makingrawxtc",data.data)
|
TriggerServerEvent("md-drugs:server:makingrawxtc",data.data)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
RegisterNetEvent("md-drugs:client:MakeXTC", function(data)
|
RegisterNetEvent("md-drugs:client:MakeXTC", function(data)
|
||||||
if not ItemCheck('raw_xtc') then return end
|
if not ItemCheck('raw_xtc') then return end
|
||||||
if not progressbar(Lang.xtc.pressing, 4000, 'uncuff') then return end
|
if not ps.progressbar(Lang.xtc.pressing, 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:makextc",data)
|
TriggerServerEvent("md-drugs:server:makextc",data)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@@ -98,29 +98,29 @@ RegisterNetEvent("md-drugs:client:stampwhite", function(data)
|
|||||||
options = {
|
options = {
|
||||||
{ icon = GetImage('white_xtc'), title = 'White XTC',
|
{ icon = GetImage('white_xtc'), title = 'White XTC',
|
||||||
onSelect = function()
|
onSelect = function()
|
||||||
if not minigame() then Notify(Lang.xtc.fail, "error") return end
|
if not minigame() then ps.notify(Lang.xtc.fail, "error") return end
|
||||||
if not progressbar(string.format(Lang.xtc.stamp, 'White'), 4000, 'uncuff') then return end
|
if not ps.progressbar(string.format(Lang.xtc.stamp, 'White'), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:stampwhite",data.data)
|
TriggerServerEvent("md-drugs:server:stampwhite",data.data)
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
{ icon = GetImage('red_xtc'), title = 'Red XTC',
|
{ icon = GetImage('red_xtc'), title = 'Red XTC',
|
||||||
onSelect = function()
|
onSelect = function()
|
||||||
if not minigame() then Notify(Lang.xtc.fail, "error") return end
|
if not minigame() then ps.notify(Lang.xtc.fail, "error") return end
|
||||||
if not progressbar(string.format(Lang.xtc.stamp, 'Red'), 4000, 'uncuff') then return end
|
if not ps.progressbar(string.format(Lang.xtc.stamp, 'Red'), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:stampred", data.data)
|
TriggerServerEvent("md-drugs:server:stampred", data.data)
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
{ icon = GetImage('orange_xtc'), title = 'Orange XTC',
|
{ icon = GetImage('orange_xtc'), title = 'Orange XTC',
|
||||||
onSelect = function()
|
onSelect = function()
|
||||||
if not minigame() then Notify(Lang.xtc.fail, "error") return end
|
if not minigame() then ps.notify(Lang.xtc.fail, "error") return end
|
||||||
if not progressbar(string.format(Lang.xtc.stamp, 'Orange'), 4000, 'uncuff') then return end
|
if not ps.progressbar(string.format(Lang.xtc.stamp, 'Orange'), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:stamporange", data.data)
|
TriggerServerEvent("md-drugs:server:stamporange", data.data)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{ icon = GetImage('blue_xtc'), title = 'Blue XTC',
|
{ icon = GetImage('blue_xtc'), title = 'Blue XTC',
|
||||||
onSelect = function()
|
onSelect = function()
|
||||||
if not minigame() then Notify(Lang.xtc.fail, "error") return end
|
if not minigame() then ps.notify(Lang.xtc.fail, "error") return end
|
||||||
if not progressbar(string.format(Lang.xtc.stamp, 'Blue'), 4000, 'uncuff') then return end
|
if not ps.progressbar(string.format(Lang.xtc.stamp, 'Blue'), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:stampblue", data.data)
|
TriggerServerEvent("md-drugs:server:stampblue", data.data)
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
@@ -130,13 +130,13 @@ RegisterNetEvent("md-drugs:client:stampwhite", function(data)
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
RegisterNetEvent("md-drugs:client:getsinglepress", function()
|
RegisterNetEvent("md-drugs:client:getsinglepress", function()
|
||||||
if not progressbar(Lang.xtc.buyp, 4000, 'uncuff') then return end
|
if not ps.progressbar(Lang.xtc.buyp, 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:buypress")
|
TriggerServerEvent("md-drugs:server:buypress")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
RegisterNetEvent("md-drugs:client:exchangepresses", function(data)
|
RegisterNetEvent("md-drugs:client:exchangepresses", function(data)
|
||||||
if not progressbar(Lang.xtc.buyp, 4000, 'uncuff') then return end
|
if not ps.progressbar(Lang.xtc.buyp, 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:upgradepress", data.data)
|
TriggerServerEvent("md-drugs:server:upgradepress", data.data)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
local QBCore = exports['qb-core']:GetCoreObject()
|
|
||||||
--[[
|
--[[
|
||||||
effect options
|
effect options
|
||||||
alien
|
alien
|
||||||
@@ -21,7 +21,7 @@ strength = number -- how long you are strong boi
|
|||||||
]]
|
]]
|
||||||
local Consume = {
|
local Consume = {
|
||||||
-- meth
|
-- meth
|
||||||
methbags = { time = 4000, effect = 'meth', anim = "smoke", progressbartext = "Injesting",
|
methbags = { time = 4000, effect = 'meth', anim = "smoke", ps.progressbartext = "Injesting",
|
||||||
add = {health = -20, stress = -10, speed = 40, strength = 10, thirst = -30}},
|
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 }},
|
||||||
@@ -148,9 +148,9 @@ for k, v in pairs(Consume) do
|
|||||||
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 progressbartext = v.progressbartext or Consumables.defaultprogresstext
|
local ps.progressbartext = v.ps.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, progressbartext, add, k)
|
local done = ps.callback('md-drugs:client:consumedrugs', source, time, effect, anim, ps.progressbartext, add, k)
|
||||||
if done then
|
if done then
|
||||||
RemoveItem(source, k, 1)
|
RemoveItem(source, k, 1)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ RegisterNetEvent('md-drugs:server:sellCornerDrugs', function(item, amount, price
|
|||||||
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')
|
--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)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
local QBCore = exports['qb-core']:GetCoreObject()
|
|
||||||
|
|
||||||
local dloc = {
|
local dloc = {
|
||||||
{coords = vector4(282.48, -1814.32, 27.23, 145.11)},
|
{coords = vector4(282.48, -1814.32, 27.23, 145.11)},
|
||||||
@@ -122,8 +122,8 @@ ps.registerCallback('md-drugs:server:GetDeliveryItem', function(data)
|
|||||||
local time = os.time()
|
local 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}) Notifys(src, 'You Failed To Make It In Time!', 'error' ) return false end
|
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
|
||||||
Notifys(src,'You Already Have A Delivery To Make', 'error' ) return false, item, amount, coord
|
ps.notify(src,'You Already Have A Delivery To Make', 'error' ) return false, item, amount, coord
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@@ -135,7 +135,7 @@ RegisterNetEvent('md-drugs:server:giveDeliveryItems', function(item, amount)
|
|||||||
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}) Notifys(source, 'You Failed To Make It In Time!', 'error' ) return end
|
if timeout >= 15 then MySQL.query.await('DELETE FROM deliveriesdealer WHERE cid = ?', {Player.PlayerData.citizenid}) ps.notify(source, 'You Failed To Make It In Time!', 'error' ) return end
|
||||||
if item ~= itemData.item then return end
|
if 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 RemoveItem(src, item, amount) then
|
||||||
@@ -169,7 +169,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 Notifys(source,"Already Exists", "error")
|
return ps.notify(source,"Already Exists", "error")
|
||||||
end
|
end
|
||||||
|
|
||||||
MySQL.insert('INSERT INTO dealers (name, coords, time, createdby) VALUES (?, ?, ?, ?)', {
|
MySQL.insert('INSERT INTO dealers (name, coords, time, createdby) VALUES (?, ?, ?, ?)', {
|
||||||
@@ -202,8 +202,8 @@ lib.addCommand("deletedealer", {
|
|||||||
MySQL.query('DELETE FROM dealers WHERE name = ?', { dealerName })
|
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:Notify', source, "Dealer Deleted", "success")
|
TriggerClientEvent('QBCore:ps.notify', source, "Dealer Deleted", "success")
|
||||||
else
|
else
|
||||||
TriggerClientEvent('QBCore:Notify', source, "Who You Tryna Delete", "error")
|
TriggerClientEvent('QBCore:ps.notify', source, "Who You Tryna Delete", "error")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
+5
-398
@@ -1,7 +1,3 @@
|
|||||||
local QBCore, ESX, qbx = {}, {}, nil
|
|
||||||
local notify = Config.Notify -- qb or ox
|
|
||||||
local inventory = Config.Inventory -- qb or ox
|
|
||||||
local invname = ''
|
|
||||||
|
|
||||||
------------------------------------------ logging stuff
|
------------------------------------------ logging stuff
|
||||||
local logs = false
|
local logs = false
|
||||||
@@ -12,311 +8,7 @@ local headers = {
|
|||||||
['Content-Type'] = 'application/json',
|
['Content-Type'] = 'application/json',
|
||||||
}
|
}
|
||||||
|
|
||||||
if Config.Framework == 'qb' then
|
|
||||||
QBCore = exports['qb-core']:GetCoreObject()
|
|
||||||
elseif Config.Framework == 'esx' then
|
|
||||||
ESX = exports['es_extended']:getSharedObject()
|
|
||||||
elseif Config.Framework == 'qbx' then
|
|
||||||
qbx = exports.qbx_core
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
CreateThread(function()
|
|
||||||
if logs then
|
|
||||||
print'^2 Logs Enabled for md-drugs'
|
|
||||||
if logapi == 'insert string here' then
|
|
||||||
print'^1 homie you gotta set your api on line 4'
|
|
||||||
else
|
|
||||||
print'^2 API Key Looks Good, Dont Trust Me Though, Im Not Smart'
|
|
||||||
end
|
|
||||||
else
|
|
||||||
print'^1 logs disabled for md-drugs'
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
function Log(message, type)
|
|
||||||
if logs == false then return end
|
|
||||||
local buffer = { level = "info", message = message, resource = GetCurrentResourceName(),
|
|
||||||
metadata = { drugs = type, playerid = source}
|
|
||||||
}
|
|
||||||
SetTimeout(500, function()
|
|
||||||
PerformHttpRequest(endpoint, function(status, _, _, response)
|
|
||||||
if status ~= 200 then
|
|
||||||
if type(response) == 'string' then
|
|
||||||
response = json.decode(response) or response
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end, 'POST', json.encode(buffer), headers)
|
|
||||||
buffer = nil
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
------------------------------------ Player Stuff functions
|
|
||||||
function getPlayer(source)
|
|
||||||
local src = source
|
|
||||||
if Config.Framework == 'qb' then
|
|
||||||
local Player = QBCore.Functions.GetPlayer(src)
|
|
||||||
return Player
|
|
||||||
elseif Config.Framework == 'esx' then
|
|
||||||
local Player = ESX.GetPlayerFromId(src)
|
|
||||||
return Player
|
|
||||||
elseif Config.Framework == 'qbx' then
|
|
||||||
local Player = qbx:GetPlayer(source)
|
|
||||||
return Player
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function getPlayerByCid(cid)
|
|
||||||
if Config.Framework == 'qb' then
|
|
||||||
local Player = QBCore.Functions.GetPlayerByCitizenId(cid)
|
|
||||||
return Player
|
|
||||||
elseif Config.Framework == 'esx' then
|
|
||||||
local Player = ESX.GetPlayerFromIdentifier(cid)
|
|
||||||
return Player
|
|
||||||
elseif Config.Framework == 'qbx' then
|
|
||||||
local Player = qbx:GetPlayerByCitizenId(cid)
|
|
||||||
return Player
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function GetName(source)
|
|
||||||
local src = source
|
|
||||||
if Config.Framework == 'qb' then
|
|
||||||
local Player = getPlayer(src)
|
|
||||||
return Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname
|
|
||||||
elseif Config.Framework == 'esx' then
|
|
||||||
local Player = getPlayer(src)
|
|
||||||
return Player.getName()
|
|
||||||
elseif Config.Framework == 'qbx' then
|
|
||||||
local Player = getPlayer(src)
|
|
||||||
return Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function getCid(source)
|
|
||||||
local src = source
|
|
||||||
if Config.Framework == 'qb' then
|
|
||||||
local Player = getPlayer(src)
|
|
||||||
return Player.PlayerData.citizenid
|
|
||||||
elseif Config.Framework == 'esx' then
|
|
||||||
local Player = getPlayer(src)
|
|
||||||
return Player.getIdentifier()
|
|
||||||
elseif Config.Framework == 'qbx' then
|
|
||||||
local Player = getPlayer(src)
|
|
||||||
return Player.PlayerData.citizenid
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function GetCoords(source)
|
|
||||||
local ped = GetPlayerPed(source)
|
|
||||||
local playerCoords = GetEntityCoords(ped)
|
|
||||||
return playerCoords
|
|
||||||
end
|
|
||||||
|
|
||||||
function dist(source, coords)
|
|
||||||
local playerPed = GetPlayerPed(source)
|
|
||||||
local pcoords = GetEntityCoords(playerPed)
|
|
||||||
local dist = #(pcoords - coords)
|
|
||||||
|
|
||||||
return dist
|
|
||||||
end
|
|
||||||
|
|
||||||
function CheckDist(source, coords)
|
|
||||||
local playerPed = GetPlayerPed(source)
|
|
||||||
local pcoords = GetEntityCoords(playerPed)
|
|
||||||
local ok
|
|
||||||
if #(pcoords - coords) < 4.0 then
|
|
||||||
return ok
|
|
||||||
else
|
|
||||||
DropPlayer(source, 'md-drugs: You Were A Total Of ' .. #(pcoords - coords) .. ' Too Far Away To Trigger This Event')
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
function Notifys(source, text, type)
|
|
||||||
local src = source
|
|
||||||
if notify == 'qb' then
|
|
||||||
TriggerClientEvent("QBCore:Notify", src, text, type)
|
|
||||||
elseif notify == 'ox' then
|
|
||||||
lib.notify(src, { title = text, type = type})
|
|
||||||
elseif notify == 'okok' then
|
|
||||||
TriggerClientEvent('okokNotify:Alert', src, '', text, 4000, type, false)
|
|
||||||
else
|
|
||||||
print"^1 Look At The Config For Proper Alert Options"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function GetLabels(item)
|
|
||||||
if inventory == 'qb' then
|
|
||||||
return QBCore.Shared.Items[item].label
|
|
||||||
elseif inventory == 'ox' then
|
|
||||||
local items = exports.ox_inventory:Items()
|
|
||||||
return items[item].label
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function CUI(item, useFunction)
|
|
||||||
if Config.Framework == 'qb' then
|
|
||||||
QBCore.Functions.CreateUseableItem(item, useFunction)
|
|
||||||
elseif Config.Framework == 'esx' then
|
|
||||||
ESX.RegisterUsableItem(item, useFunction)
|
|
||||||
elseif Config.Framework == 'qbx' then
|
|
||||||
qbx:CreateUseableItem(item, useFunction)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function Itemcheck(source, item, amount)
|
|
||||||
if inventory == 'qb' then
|
|
||||||
local Player = getPlayer(source)
|
|
||||||
local itemchecks = Player.Functions.GetItemByName(item)
|
|
||||||
if itemchecks and itemchecks.amount >= amount then
|
|
||||||
return true
|
|
||||||
else
|
|
||||||
Notifys(source, 'You Need ' .. amount .. ' Of ' .. GetLabels(item) .. ' To Do this', 'error')
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
elseif inventory == 'ox' then
|
|
||||||
local items = exports.ox_inventory:GetItem(source, item, nil, false)
|
|
||||||
if items.count >= amount then
|
|
||||||
return true
|
|
||||||
else
|
|
||||||
Notifys(source, 'You Need ' .. amount .. ' Of ' .. GetLabels(item) .. ' To Do This', 'error')
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function hasItem(source, item, amount)
|
|
||||||
if inventory == 'qb' then
|
|
||||||
local Player = getPlayer(source)
|
|
||||||
local itemchecks = Player.Functions.GetItemByName(item)
|
|
||||||
if itemchecks and itemchecks.amount >= amount then
|
|
||||||
return true
|
|
||||||
else
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
elseif inventory == 'ox' then
|
|
||||||
local items = exports.ox_inventory:GetItem(source, item, nil, false)
|
|
||||||
if items == nil then return false end
|
|
||||||
if items.count >= amount then
|
|
||||||
return true
|
|
||||||
else
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function getItemCount(source, item)
|
|
||||||
if inventory == 'qb' then
|
|
||||||
local Player = getPlayer(source)
|
|
||||||
local itemchecks = Player.Functions.GetItemByName(item)
|
|
||||||
if itemchecks then
|
|
||||||
return itemchecks.amount
|
|
||||||
else
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
elseif inventory == 'ox' then
|
|
||||||
local items = exports.ox_inventory:GetItem(source, item, nil, false)
|
|
||||||
if items == nil then
|
|
||||||
print('You are missing ' .. item)
|
|
||||||
return 0
|
|
||||||
end
|
|
||||||
if items.count >= 1 then
|
|
||||||
return items.count
|
|
||||||
else
|
|
||||||
return 0
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
function RemoveItem(source, item, amount)
|
|
||||||
if inventory == 'qb' then
|
|
||||||
local Player = getPlayer(source)
|
|
||||||
if Player.Functions.RemoveItem(item, amount) then
|
|
||||||
TriggerClientEvent(invname ..":client:ItemBox", source, QBCore.Shared.Items[item], "remove", amount)
|
|
||||||
return true
|
|
||||||
else
|
|
||||||
Notifys(source, 'You Need ' .. amount .. ' Of ' .. GetLabels(item) .. ' To Do This', 'error')
|
|
||||||
end
|
|
||||||
elseif inventory == 'ox' then
|
|
||||||
if exports.ox_inventory:RemoveItem(source, item, amount) then
|
|
||||||
return true
|
|
||||||
else
|
|
||||||
Notifys(source, 'You Need ' .. amount .. ' Of ' .. GetLabels(item) .. ' To Do This', 'error')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function AddItem(source, item, amount)
|
|
||||||
if inventory == 'qb' then
|
|
||||||
local Player = getPlayer(source)
|
|
||||||
if Player.Functions.AddItem(item, amount) then
|
|
||||||
TriggerClientEvent(invname ..":client:ItemBox", source, QBCore.Shared.Items[item], "add", amount)
|
|
||||||
return true
|
|
||||||
else
|
|
||||||
print('Failed To Give Item: ' .. item .. ' Check Your qb-core/shared/items.lua')
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
else
|
|
||||||
if exports.ox_inventory:AddItem(source, item, amount) then
|
|
||||||
return true
|
|
||||||
else
|
|
||||||
print('Failed To Give Item: ' .. item .. ' Check Your ox_inventory/data/items.lua')
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function addMoney(source, type, amount)
|
|
||||||
if Config.Framework == 'qb' then
|
|
||||||
local Player = getPlayer(source)
|
|
||||||
if Player.Functions.AddMoney(type, amount) then
|
|
||||||
return true
|
|
||||||
else
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
elseif Config.Framework == 'esx' then
|
|
||||||
local Player = getPlayer(source)
|
|
||||||
if Player.addMoney(amount) then
|
|
||||||
return true
|
|
||||||
else
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
elseif Config.Framework == 'qbx' then
|
|
||||||
if qbx:AddMoney(source, type, amount) then
|
|
||||||
return true
|
|
||||||
else
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function removeMoney(source, type, amount)
|
|
||||||
if Config.Framework == 'qb' then
|
|
||||||
local Player = getPlayer(source)
|
|
||||||
if Player.Functions.RemoveMoney(type, amount) then
|
|
||||||
return true
|
|
||||||
else
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
elseif Config.Framework == 'esx' then
|
|
||||||
if type == 'bank' then
|
|
||||||
print('Does Not Support Bank Funds Removing From ESX Defaulted To Cash')
|
|
||||||
end
|
|
||||||
local Player = getPlayer(source)
|
|
||||||
if Player.getMoney() >= amount then
|
|
||||||
Player.removeMoney(amount)
|
|
||||||
return true
|
|
||||||
else
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
elseif Config.Framework == 'qbx' then
|
|
||||||
if qbx:RemoveMoney(source, type, amount) then
|
|
||||||
return true
|
|
||||||
else
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local function handleFresh(source)
|
local function handleFresh(source)
|
||||||
local table = json.encode({
|
local table = json.encode({
|
||||||
coke = 0,lsd = 0,heroin = 0,dealerrep = 0,
|
coke = 0,lsd = 0,heroin = 0,dealerrep = 0,
|
||||||
@@ -351,7 +43,7 @@ end
|
|||||||
function AddRep(source, type, amount)
|
function AddRep(source, type, amount)
|
||||||
if not Config.TierSystem then return false end
|
if not Config.TierSystem then return false end
|
||||||
if not amount then amount = 1 end
|
if not amount then amount = 1 end
|
||||||
local sql = MySQL.query.await('SELECT * FROM drugrep WHERE cid = ?', {getCid(source)})
|
local sql = MySQL.query.await('SELECT * FROM drugrep WHERE cid = ?', {ps.getIdentifier(source)})
|
||||||
local reps = json.decode(sql[1].drugrep)
|
local reps = json.decode(sql[1].drugrep)
|
||||||
local update
|
local update
|
||||||
local rep = ''
|
local rep = ''
|
||||||
@@ -367,11 +59,11 @@ function AddRep(source, type, amount)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if update == '' then return false end
|
if update == '' then return false end
|
||||||
MySQL.update('UPDATE drugrep SET drugrep = ? WHERE cid = ?', {update, getCid(source)})
|
MySQL.update('UPDATE drugrep SET drugrep = ? WHERE cid = ?', {update, ps.getIdentifier(source)})
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
rep[type] = rep[type] + amount
|
rep[type] = rep[type] + amount
|
||||||
MySQL.update('UPDATE drugrep SET drugrep = ? WHERE cid = ?', {json.encode(rep), getCid(source)})
|
MySQL.update('UPDATE drugrep SET drugrep = ? WHERE cid = ?', {json.encode(rep), ps.getIdentifier(source)})
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -408,73 +100,6 @@ function sortTab(tbl, type)
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function getCops()
|
|
||||||
local amount = 0
|
|
||||||
if Config.Framework == 'qb' then
|
|
||||||
local players = QBCore.Functions.GetQBPlayers()
|
|
||||||
for k, v in pairs(players) do
|
|
||||||
if v.PlayerData.job.type == 'leo' and v.PlayerData.job.onduty then
|
|
||||||
amount = amount + 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return amount
|
|
||||||
elseif Config.Framework == 'esx' then
|
|
||||||
local players = ESX.GetPlayers()
|
|
||||||
for k, v in pairs(players) do
|
|
||||||
local xPlayer = ESX.GetPlayerFromId(v)
|
|
||||||
if xPlayer.job.name == 'police' and xPlayer.job.onduty then
|
|
||||||
amount = amount + 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return amount
|
|
||||||
elseif Config.Framework == 'qbx' then
|
|
||||||
return qbx:GetDutyCountType('leo')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function getNear(src)
|
|
||||||
if Config.Framework == 'qb' then
|
|
||||||
local near = {}
|
|
||||||
local players = QBCore.Functions.GetPlayers()
|
|
||||||
for k, v in pairs (players) do
|
|
||||||
local targ = QBCore.Functions.GetPlayerByCitizenId(v.PlayerData.citizenid)
|
|
||||||
local tname = GetName(v.PlayerData.source)
|
|
||||||
local ped, tped = GetPlayerPed(src), GetPlayerPed(v.PlayerData.source)
|
|
||||||
local dist = #(GetEntityCoords(ped) - GetEntityCoords(tped))
|
|
||||||
if dist < 5.0 then
|
|
||||||
table.insert(near, {label = tname, value = targ.PlayerData.citizenid})
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return near
|
|
||||||
elseif Config.Framework == 'esx' then
|
|
||||||
local near = {}
|
|
||||||
local players = ESX.GetPlayers()
|
|
||||||
for k, v in pairs (players) do
|
|
||||||
local targ = ESX.GetPlayerFromId(v)
|
|
||||||
local tname = GetName(v)
|
|
||||||
local ped, tped = GetPlayerPed(src), GetPlayerPed(v)
|
|
||||||
local dist = #(GetEntityCoords(ped) - GetEntityCoords(tped))
|
|
||||||
if dist < 5.0 then
|
|
||||||
table.insert(near, {label = tname, value = getCid(v)})
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return near
|
|
||||||
elseif Config.Framework == 'qbx' then
|
|
||||||
local near = {}
|
|
||||||
local players = qbx:GetPlayers()
|
|
||||||
for k, v in pairs (players) do
|
|
||||||
local targ = qbx:GetPlayer(v)
|
|
||||||
local tname = GetName(v)
|
|
||||||
local ped, tped = GetPlayerPed(src), GetPlayerPed(v)
|
|
||||||
local dist = #(GetEntityCoords(ped) - GetEntityCoords(tped))
|
|
||||||
if dist < 5.0 then
|
|
||||||
table.insert(near, {label = tname, value = getCid(v)})
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return near
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function handleCornersell(source, item, amount, price)
|
function handleCornersell(source, item, amount, price)
|
||||||
if RemoveItem(source, item, amount) then
|
if RemoveItem(source, item, amount) then
|
||||||
if inventory == 'qb' then
|
if inventory == 'qb' then
|
||||||
@@ -501,27 +126,9 @@ lib.callback.register('md-drugs:server:GetCoppers', function(source, cb, args)
|
|||||||
return getCops()
|
return getCops()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
lib.callback.register('md-drugs:server:GetRep', function(source, cb, args)
|
ps.registerCallback('md-drugs:server:GetRep', function(source, cb, args)
|
||||||
local rep = GetAllRep(source)
|
local rep = GetAllRep(source)
|
||||||
return rep
|
return rep
|
||||||
end)
|
end)
|
||||||
|
|
||||||
CreateThread(function()
|
ps.versionCheck('md-drugs', 'https://raw.githubusercontent.com/Mustachedom/md-drugs/refs/heads/hushhushmotherfucker/version.txt', 'https://github.com/Mustachedom/md-drugs/')
|
||||||
if GetResourceState('ps-inventory') == 'started' then
|
|
||||||
invname = 'ps-inventory'
|
|
||||||
elseif GetResourceState('qb-inventory') == 'started' then
|
|
||||||
invname = 'qb-inventory'
|
|
||||||
else
|
|
||||||
invname = 'inventory'
|
|
||||||
end
|
|
||||||
local url = "https://raw.githubusercontent.com/Mustachedom/md-drugs/main/version.txt"
|
|
||||||
local version = GetResourceMetadata('md-drugs', "version" )
|
|
||||||
PerformHttpRequest(url, function(err, text, headers)
|
|
||||||
if (text ~= nil) then
|
|
||||||
print('^2 Your Version:' .. version .. ' | Current Version:' .. text .. '' )
|
|
||||||
end
|
|
||||||
end, "GET", "", "")
|
|
||||||
if GetResourceState('ox_lib') ~= 'started' then
|
|
||||||
print('^1 ox_lib Is A Depndancy, Not An Optional ')
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
+2
-2
@@ -164,7 +164,7 @@ RegisterServerEvent('md-drugs:server:fillneedle', function(num)
|
|||||||
if vh then
|
if vh then
|
||||||
if not GetRecipe(src, 'heroin', 'fillneedle', v.tier) then return end
|
if not GetRecipe(src, 'heroin', 'fillneedle', v.tier) then return end
|
||||||
AddRep(src, 'heroin')
|
AddRep(src, 'heroin')
|
||||||
Log(ps.getPlayerName(src) .. v.log, 'heroin')
|
--Log(ps.getPlayerName(src) .. v.log, 'heroin')
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -176,7 +176,7 @@ end)
|
|||||||
|
|
||||||
RegisterServerEvent('md-drugs:server:failheroin', function()
|
RegisterServerEvent('md-drugs:server:failheroin', function()
|
||||||
local src = source
|
local src = source
|
||||||
Log(ps.getPlayerName(src) ..' Sucks And Burned Their Heroin', 'heroin')
|
--Log(ps.getPlayerName(src) ..' Sucks And Burned Their Heroin', 'heroin')
|
||||||
if Config.TierSystem then
|
if Config.TierSystem then
|
||||||
local itemList = {
|
local itemList = {
|
||||||
heroinvial = 1,
|
heroinvial = 1,
|
||||||
|
|||||||
+58
-17
@@ -1,27 +1,68 @@
|
|||||||
local QBCore = exports['qb-core']:GetCoreObject()
|
|
||||||
|
|
||||||
|
local onRun = {}
|
||||||
|
|
||||||
|
local function setTimeout(identifier)
|
||||||
|
if onRun[identifier] then
|
||||||
|
CreateThread(function()
|
||||||
|
Wait(10 * 60 * 1000)
|
||||||
|
onRun[identifier] = nil
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
end
|
||||||
RegisterServerEvent('md-drugs:server:givelean', function()
|
RegisterServerEvent('md-drugs:server:givelean', function()
|
||||||
local chance = math.random(1,100)
|
local src = source
|
||||||
local amount = math.random(1,5)
|
local amount = math.random(1,5)
|
||||||
if chance <= 50 then
|
if not onRun[ps.getIdentifier(src)] then return ps.notify(src, Lang.lean.err, "error") end
|
||||||
if AddItem(source, 'mdlean', amount) then
|
onRun[ps.getIdentifier(src)] = onRun[ps.getIdentifier(src)] + 1
|
||||||
Notifys(Lang.Lean.lean, "success")
|
if math.random(1,100) <= 50 then
|
||||||
Log(GetName(source) .. ' Got ' .. amount .. ' Of Lean' , 'lean')
|
ps.addItem(src, "mdlean", amount)
|
||||||
end
|
|
||||||
else
|
else
|
||||||
if AddItem(source, 'mdreddextro', amount) then
|
ps.addItem(src, "mdreddextro", amount)
|
||||||
Notifys(Lang.Lean.dextro, "success")
|
|
||||||
Log(GetName(source) .. ' Got ' .. amount .. ' Of Red Dextro' , 'lean')
|
|
||||||
end
|
end
|
||||||
|
if onRun[ps.getIdentifier(src)] >= 4 then
|
||||||
|
onRun[ps.getIdentifier(src)] = nil
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
CUI('leancup', function(source, item)
|
exports.ps_lib:registerCrafter({
|
||||||
if Itemcheck(source, 'leancup', 1) then
|
loc = GlobalState.MDDrugsLocs.MakeLean,
|
||||||
TriggerClientEvent('md-drugs:client:leancraft', source)
|
recipes = {
|
||||||
|
cupoflean = {
|
||||||
|
amount = 1,
|
||||||
|
time = 5000,
|
||||||
|
anim = 'uncuff',
|
||||||
|
recipe = {
|
||||||
|
leancup = 1,
|
||||||
|
mdlean = 1,
|
||||||
|
sprunk = 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
cupofdextro = {
|
||||||
|
amount = 1,
|
||||||
|
time = 5000,
|
||||||
|
anim = 'uncuff',
|
||||||
|
recipe = {
|
||||||
|
leancup = 1,
|
||||||
|
mdreddextro = 1,
|
||||||
|
sprunk = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
targetData = {
|
||||||
|
size = {height = 1.0, width = 1.0, length = 1.0, rotation = 180.0},
|
||||||
|
label = 'Make Lean',
|
||||||
|
icon = 'fa-solid fa-mug-saucer',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
ps.registerCallback('md-drugs:server:RegisterLean', function(source)
|
||||||
|
local identifier = ps.getIdentifier(source)
|
||||||
|
if not identifier then return false end
|
||||||
|
if onRun[identifier] then
|
||||||
|
return false
|
||||||
|
else
|
||||||
|
onRun[identifier] = 0
|
||||||
|
setTimeout(identifier)
|
||||||
|
return true
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
RegisterServerEvent('md-drugs:server:finishcup', function(data)
|
|
||||||
if not GetRecipe(source, 'lean','cups', data.item) then return end
|
|
||||||
end)
|
|
||||||
+39
-32
@@ -30,6 +30,9 @@ local Target = {
|
|||||||
{loc = vector3(-1370.77, -314.51, 39.58), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
|
{loc = vector3(-1370.77, -314.51, 39.58), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
|
||||||
{loc = vector3(2409.59, 5012.45, 46.09), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
|
{loc = vector3(2409.59, 5012.45, 46.09), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
|
||||||
},
|
},
|
||||||
|
buyLSDkit = {
|
||||||
|
{ped = 'g_f_y_families_01', loc = vector4(2598.47, 5033.06, 105.86, 283.51), l = 1.0, w = 1.0, rot = 283.51, gang = ""},
|
||||||
|
},
|
||||||
dryplant = { -- turn resin into powder
|
dryplant = { -- turn resin into powder
|
||||||
{loc = vector3(-1353.77, -335.58, 43.92), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
|
{loc = vector3(-1353.77, -335.58, 43.92), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
|
||||||
},
|
},
|
||||||
@@ -54,15 +57,47 @@ local Target = {
|
|||||||
FillPrescription = { -- where to fill out your prescription
|
FillPrescription = { -- where to fill out your prescription
|
||||||
{loc = vector3(2855.62, 4446.73, 48.53), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
|
{loc = vector3(2855.62, 4446.73, 48.53), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
|
||||||
},
|
},
|
||||||
|
DryOutMescaline = { -- where to dry out mescaline
|
||||||
|
{loc = vector3(2638.22, 4237.93, 44.78), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
|
||||||
|
},
|
||||||
|
MakeLean = {
|
||||||
|
{
|
||||||
|
loc = vector3(2635.81, 4240.57, 45.32),
|
||||||
|
checks = { -- these can be arrays like {'police', 'ambulance'} or just a single string like 'police'
|
||||||
|
--gang = {},
|
||||||
|
--item = {},
|
||||||
|
--job = {},
|
||||||
|
--citizenid = {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
CookMeth = {
|
||||||
|
{loc = vector3(1006.09, -3200.59, -38.52), l = 1.0, w = 1.0, rot = 45.0, offset = vec3(4.79, 2.13, -0.41), rotation = vector3(0,0,0.0), gang = ""},
|
||||||
|
},
|
||||||
|
MethDials = {
|
||||||
|
{loc = vector3(1007.89, -3201.17, -38.99),l = 1.0, w = 1.0, rot = 45.0, gang = ""},
|
||||||
|
},
|
||||||
|
MethSmash = {
|
||||||
|
{loc = vector3(1012.04, -3194.96, -38.99), bucket = vector4(1012.86, -3194.13, -39.20, 90.00), l = 1.0, w = 1.0, rot = 45.0, offset = vec3(-3.143311, -1.666748, -1.010128), rotation = vector3(0,0,0.0), gang = ""},
|
||||||
|
},
|
||||||
|
BagMeth = {
|
||||||
|
{loc = vector3(1014.25, -3194.93, -38.99), l = 1.0, w = 1.0, rot = 45.0, offset = vec3(-4.9, -1.70, -1.01), rotation = vector3(0,0,0.0), gang = ""},
|
||||||
|
},
|
||||||
|
MethEph = { -- get ephedrine
|
||||||
|
{loc = vector3(3559.86, 3673.9, 28.13), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
|
||||||
|
},
|
||||||
|
Methace = { -- get acetone
|
||||||
|
{loc = vector3(3535.41, 3661.05, 28.12), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
|
||||||
|
},
|
||||||
|
SyrupVendor = {
|
||||||
|
{ped = 'a_m_m_farmer_01', loc = vector4(365.21, -578.77, 39.30, 347.23), l = 1.0, w = 1.0, rot = 347.23, gang = ""},
|
||||||
|
},
|
||||||
singleSpot = {
|
singleSpot = {
|
||||||
|
|
||||||
CokeTeleIn = vector3(198.16, -1276.92, 29.33), -- where you target to go inside coke
|
CokeTeleIn = vector3(198.16, -1276.92, 29.33), -- where you target to go inside coke
|
||||||
CokeTeleOut = vector3(1088.81, -3187.57, -38.99), -- where you target to leave coke
|
CokeTeleOut = vector3(1088.81, -3187.57, -38.99), -- where you target to leave coke
|
||||||
buylsdlabkit = vector4(2598.47, 5033.06, 105.86, 283.51), -- buy lab kit for lsd
|
buylsdlabkit = vector4(2598.47, 5033.06, 105.86, 283.51), -- buy lab kit for lsd
|
||||||
buyheroinlabkit = vector4(-1358.77, -339.12, 43.92, 302.13), -- buy lab kit for heroin
|
buyheroinlabkit = vector4(-1358.77, -339.12, 43.92, 302.13), -- buy lab kit for heroin
|
||||||
buypress = vector3(845.82, -884.79, 25.18), -- buy lab kit for xtc
|
buypress = vector3(845.82, -884.79, 25.18), -- buy lab kit for xtc
|
||||||
DryOut = vector3(2638.22, 4237.93, 44.78), -- Place to dry out mescaline into usuable drug
|
|
||||||
SyrupVendor = vector4(365.21, -578.77, 39.30, 347.23), -- where the mission ped starts
|
|
||||||
weedTelein = vector3(244.74, 374.54, 105.74), -- where you target to tele in
|
weedTelein = vector3(244.74, 374.54, 105.74), -- where you target to tele in
|
||||||
weedTeleout = vector3(1066.31, -3183.36, -39.16), -- where you target to tele out
|
weedTeleout = vector3(1066.31, -3183.36, -39.16), -- where you target to tele out
|
||||||
MakeButter = vector3(1045.48, -3198.49, -38.22), -- where you make cannabutter and baked edibles
|
MakeButter = vector3(1045.48, -3198.49, -38.22), -- where you make cannabutter and baked edibles
|
||||||
@@ -74,12 +109,7 @@ local Target = {
|
|||||||
truckspawn = vector4(1450.87, -1482.13, 63.22, 69.95), --- where the truck will spawn when you pay for it
|
truckspawn = vector4(1450.87, -1482.13, 63.22, 69.95), --- where the truck will spawn when you pay for it
|
||||||
Payfortruck = vector3(1437.64, -1491.91, 63.62), --- where you pay for the truck
|
Payfortruck = vector3(1437.64, -1491.91, 63.62), --- where you pay for the truck
|
||||||
},
|
},
|
||||||
MethEph = { -- get ephedrine
|
|
||||||
{loc = vector3(3559.86, 3673.9, 28.13), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
|
|
||||||
},
|
|
||||||
Methace = { -- get acetone
|
|
||||||
{loc = vector3(3535.41, 3661.05, 28.12), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
|
|
||||||
},
|
|
||||||
StartLoc = { -- where truck spawns for lean and meth missions
|
StartLoc = { -- where truck spawns for lean and meth missions
|
||||||
vector3(-2307.22, 434.77, 174.47),
|
vector3(-2307.22, 434.77, 174.47),
|
||||||
vector3(614.75, 1786.26, 199.39),
|
vector3(614.75, 1786.26, 199.39),
|
||||||
@@ -112,31 +142,8 @@ local Target = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
GlobalState.MDDrugsLocs = Target
|
GlobalState.MDDrugsLocs = Target
|
||||||
function checkLoc(source, event, num)
|
|
||||||
local ped = source
|
|
||||||
local pos = GetPlayerPed(ped)
|
|
||||||
local coord = GetEntityCoords(pos)
|
|
||||||
local loc
|
|
||||||
if type(num) == 'string' then
|
|
||||||
loc = vector3(Target[event][num].x, Target[event][num].y, Target[event][num].z)
|
|
||||||
else
|
|
||||||
loc = Target[event][num].loc
|
|
||||||
end
|
|
||||||
local dist = #(coord - loc)
|
|
||||||
if dist < 2.5 then
|
|
||||||
Log(GetName(source) .. ' Triggered the table ' .. event .. ' Within The Correct Distance', 'locations')
|
|
||||||
return true
|
|
||||||
else
|
|
||||||
Log(GetName(source) .. ' Triggered the table ' .. event .. ' Not Within The Correct Distance', 'locations')
|
|
||||||
Notifys(source, 'You are not in the correct location', 'error')
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local loc = Target.Travellingmerchant[math.random(1, #Target.Travellingmerchant)]
|
local loc = Target.Travellingmerchant[math.random(1, #Target.Travellingmerchant)]
|
||||||
ps.registerCallback('md-drugs:server:getLocs', function()
|
|
||||||
return Target
|
|
||||||
end)
|
|
||||||
|
|
||||||
ps.registerCallback('md-drugs:server:GetMerchant', function(source)
|
ps.registerCallback('md-drugs:server:GetMerchant', function(source)
|
||||||
return loc
|
return loc
|
||||||
|
|||||||
+16
-13
@@ -30,7 +30,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, GlobalState.MDDrugsLocs.diethylamide[num].loc, 2.0) then
|
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.diethylamide[num].loc, 2.0) then
|
||||||
Notifys(src, Lang.lsd.notinloc, "error")
|
ps.notify(src, Lang.lsd.notinloc, "error")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
timeout(src, 3000)
|
timeout(src, 3000)
|
||||||
@@ -89,14 +89,14 @@ RegisterServerEvent('md-drugs:server:failheating', function()
|
|||||||
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('prices.lsd.failed'), "error")
|
||||||
Log(ps.getPlayerName(src) ..' Failed Basic LSD Like An Idiot!', 'lsd')
|
--Log(ps.getPlayerName(src) ..' Failed Basic LSD Like An Idiot!', 'lsd')
|
||||||
end)
|
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.itemCheck(src, 'lsd_one_vial', 1) then return end
|
if not ps.hasItem(src, 'lsd_one_vial', 1) then return end
|
||||||
if Config.TierSystem then
|
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
|
||||||
@@ -112,7 +112,7 @@ if not ps.itemCheck(src, 'lsd_one_vial', 1) then return end
|
|||||||
ps.addItem(src,'lsd_vial_six', 1)
|
ps.addItem(src,'lsd_vial_six', 1)
|
||||||
end
|
end
|
||||||
AddRep(src,'lsd')
|
AddRep(src,'lsd')
|
||||||
ps.log(ps.getPlayerName(src) ..' Refined Acid and Now Has A Rep Of ' .. lsd + 1 .. '!', 'lsd')
|
--ps.log(ps.getPlayerName(src) ..' Refined Acid and Now Has A Rep Of ' .. lsd + 1 .. '!', 'lsd')
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
local randomchance = math.random(1,100)
|
local randomchance = math.random(1,100)
|
||||||
@@ -128,7 +128,7 @@ if not ps.itemCheck(src, 'lsd_one_vial', 1) then return end
|
|||||||
else
|
else
|
||||||
ps.addItem(src,'lsd_vial_six', 1)
|
ps.addItem(src,'lsd_vial_six', 1)
|
||||||
end
|
end
|
||||||
ps.log(ps.getPlayerName(src) ..' Refined Acid!', 'lsd')
|
--ps.log(ps.getPlayerName(src) ..' Refined Acid!', 'lsd')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
@@ -136,7 +136,6 @@ end)
|
|||||||
RegisterServerEvent('md-drugs:server:failrefinequality', function()
|
RegisterServerEvent('md-drugs:server:failrefinequality', 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
|
|
||||||
ps.removeItem(src,'lsd_one_vial', 1)
|
ps.removeItem(src,'lsd_one_vial', 1)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@@ -144,17 +143,21 @@ 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, GlobalState.MDDrugsLocs.gettabs[num].loc, 3.0) then return end
|
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.gettabs[num].loc, 3.0) then return end
|
||||||
if ps.removeMoney('cash', prices.tabcost * 10) then
|
if ps.removeMoney(src, 'cash', prices.tabcost * 10) then
|
||||||
ps.addItem(src,'tab_paper', 10)
|
ps.addItem(src,'tab_paper', 10)
|
||||||
else
|
else
|
||||||
ps.notify(src, Lang.lsd.broke, "error")
|
ps.notify(src, Lang.lsd.broke, "error")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
RegisterServerEvent('md-drugs:server:getlabkit', function()
|
RegisterServerEvent('md-drugs:server:getlabkit', function(num)
|
||||||
local src = source
|
local src = source
|
||||||
if not ps.checkDistance(src,'singleSpot', 'buylsdlabkit') then return end
|
if ps.hasItem(src,'lsdlabkit', 1) then
|
||||||
if ps.removeMoney('cash', prices.lsdlabkitcost) then
|
ps.notify(src, ps.lang('lsd.havlabkit'), 'error')
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.buyLSDkit[num].loc, 3.0) then return end
|
||||||
|
if ps.removeMoney(src, 'cash', prices.lsdlabkitcost) then
|
||||||
ps.addItem(src,'lsdlabkit', 1)
|
ps.addItem(src,'lsdlabkit', 1)
|
||||||
else
|
else
|
||||||
ps.notify(src, Lang.lsd.broke, "error")
|
ps.notify(src, Lang.lsd.broke, "error")
|
||||||
@@ -174,7 +177,7 @@ RegisterServerEvent('md-drugs:server:maketabpaper', function()
|
|||||||
{vial = 'lsd_vial_six', sheet = 'gratefuldeadsheet', log = 'Made A Maze Sheet'}
|
{vial = 'lsd_vial_six', sheet = 'gratefuldeadsheet', log = 'Made A Maze Sheet'}
|
||||||
}
|
}
|
||||||
for k, v in ipairs (vialdata) do
|
for k, v in ipairs (vialdata) do
|
||||||
local check = ps.hasItem(src, v.vial)
|
local check = ps.hasItem(src, v.vial) and ps.hasItem(src, 'tab_paper')
|
||||||
if check then
|
if check then
|
||||||
if ps.removeItem(src, v.vial, 1) and ps.removeItem(src, 'tab_paper', 1) then
|
if ps.removeItem(src, v.vial, 1) and ps.removeItem(src, 'tab_paper', 1) then
|
||||||
ps.addItem(src, v.sheet, 1)
|
ps.addItem(src, v.sheet, 1)
|
||||||
@@ -193,12 +196,12 @@ local sheets = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for k, v in pairs (sheets) do
|
for k, v in pairs (sheets) do
|
||||||
CUI(v.item, function(source)
|
ps.createUseable(v.item, function(source)
|
||||||
local src = source
|
local src = source
|
||||||
local math = math.random(1,10)
|
local math = math.random(1,10)
|
||||||
if ps.removeItem(src, v.item, 1) then
|
if ps.removeItem(src, v.item, 1) then
|
||||||
ps.addItem(src, v.recieve, math)
|
ps.addItem(src, v.recieve, math)
|
||||||
ps.log(ps.getPlayerName(src) ..' Made ' .. math .. 'Tabs of ' .. v.recieve .. '!', 'lsd')
|
--ps.log(ps.getPlayerName(src) ..' Made ' .. math .. 'Tabs of ' .. v.recieve .. '!', 'lsd')
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,15 +1,18 @@
|
|||||||
|
|
||||||
|
|
||||||
RegisterNetEvent("md-drugs:server:drymescaline", function()
|
RegisterNetEvent("md-drugs:server:drymescaline", function(num)
|
||||||
local src = source
|
local src = source
|
||||||
if not checkLoc(src, 'singleSpot', 'DryOut') then return end
|
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.DryOutMescaline[num].loc, 3.0) then
|
||||||
|
ps.notify(src, "You are not in the right location", "error")
|
||||||
|
return
|
||||||
|
end
|
||||||
if not GetRecipe(src, 'mescaline', 'dry', 'dried') then return end
|
if not GetRecipe(src, 'mescaline', 'dry', 'dried') then return end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
CUI("driedmescaline", function(source, item)
|
ps.createUseable("driedmescaline", function(source, item)
|
||||||
local src = source
|
local src = source
|
||||||
if RemoveItem(src, "driedmescaline", 1) then
|
if ps.removeItem(src, "driedmescaline", 1) then
|
||||||
TriggerClientEvent("md-drugs:client:takemescaline", src)
|
TriggerClientEvent("md-drugs:client:takemescaline", src)
|
||||||
Log(GetName(source) .. ' Consumed Mescaline', 'consume')
|
--Log(GetName(source) .. ' Consumed Mescaline', 'consume')
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
+34
-16
@@ -1,28 +1,38 @@
|
|||||||
local QBCore = exports['qb-core']:GetCoreObject()
|
|
||||||
|
|
||||||
RegisterServerEvent('md-drugs:server:startcook', function()
|
local onRun = {}
|
||||||
local src = source
|
|
||||||
if not GetRecipe(source, 'meth', 'cook', 'heat') then return end
|
local function setTimeout(identifier)
|
||||||
Notifys(src, "Adding Things To The Mix", "success")
|
if onRun[identifier] then
|
||||||
|
CreateThread(function()
|
||||||
|
Wait(10 * 60 * 1000)
|
||||||
|
onRun[identifier] = nil
|
||||||
end)
|
end)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
RegisterServerEvent('md-drugs:server:givemethingridients', function()
|
RegisterServerEvent('md-drugs:server:givemethingridients', function()
|
||||||
local src = source
|
local src = source
|
||||||
local chance = math.random(1,100)
|
|
||||||
local amount = math.random(1,5)
|
local amount = math.random(1,5)
|
||||||
if chance <= 50 then
|
if not onRun[ps.getIdentifier(src)] then return ps.notify(src, Lang.lean.err, "error") end
|
||||||
if AddItem(src,'ephedrine', amount) then
|
onRun[ps.getIdentifier(src)] = onRun[ps.getIdentifier(src)] + 1
|
||||||
Log(GetName(src) .. ' Got ' .. amount .. ' Of Ephedrine', 'Meth')
|
if math.random(1,100) <= 50 then
|
||||||
end
|
ps.addItem(src, "ephedrine", amount)
|
||||||
else
|
else
|
||||||
if AddItem(src, 'acetone', amount) then
|
ps.addItem(src, "acetone", amount)
|
||||||
Log(GetName(src) .. ' Got ' .. amount .. ' Of Acetone', 'Meth')
|
|
||||||
end
|
end
|
||||||
|
if onRun[ps.getIdentifier(src)] >= 4 then
|
||||||
|
onRun[ps.getIdentifier(src)] = nil
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
RegisterServerEvent('md-drugs:server:startcook', function(num)
|
||||||
RegisterServerEvent('md-drugs:server:getmeth', function()
|
|
||||||
local src = source
|
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)
|
||||||
|
local src = source
|
||||||
|
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.BagMeth[num].loc, 2.5) then return end
|
||||||
if not GetRecipe(src, 'meth', 'bag', 'bags') then return end
|
if not GetRecipe(src, 'meth', 'bag', 'bags') then return end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@@ -30,7 +40,7 @@ RegisterServerEvent('md-drugs:server:geteph', function(num)
|
|||||||
local src = source
|
local src = source
|
||||||
if not checkLoc(src, 'MethEph', num) then return end
|
if not checkLoc(src, 'MethEph', num) then return end
|
||||||
if AddItem(src, 'ephedrine', 1) then
|
if AddItem(src, 'ephedrine', 1) then
|
||||||
Notifys(src, 'Got Ephedrine!', "success")
|
ps.notify(src, 'Got Ephedrine!', "success")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@@ -38,6 +48,14 @@ RegisterServerEvent('md-drugs:server:getace', function(num)
|
|||||||
local src = source
|
local src = source
|
||||||
if not checkLoc(src, 'Methace', num) then return end
|
if not checkLoc(src, 'Methace', num) then return end
|
||||||
if AddItem(src, 'acetone', 1) then
|
if AddItem(src, 'acetone', 1) then
|
||||||
Log(GetName(src) .. ' Got ' .. 1 .. 'Of Acetone', 'Meth')
|
--Log(GetName(src) .. ' Got ' .. 1 .. 'Of Acetone', 'Meth')
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
ps.registerCallback('md-drugs:server:startcook', function(source, num)
|
||||||
|
local src = source
|
||||||
|
if not ps.checkDistance(src, GlobalState.MDDrugsLocs.CookMeth[num].loc, 2.5) then return false end
|
||||||
|
local recipe = GetRecipe(src, 'meth', 'cook', 'heat')
|
||||||
|
ps.debug(recipe)
|
||||||
|
return recipe
|
||||||
|
end)
|
||||||
+4
-4
@@ -8,10 +8,10 @@ ps.registerCallback('md-drugs:server:payfortruck', function()
|
|||||||
local src = source
|
local src = source
|
||||||
local Player = getPlayer(src)
|
local Player = getPlayer(src)
|
||||||
if Player.Functions.RemoveMoney('cash', prices.payfortruck) or Player.Functions.RemoveMoney('bank', prices.payfortruck) then
|
if Player.Functions.RemoveMoney('cash', prices.payfortruck) or Player.Functions.RemoveMoney('bank', prices.payfortruck) then
|
||||||
Log(GetName(src) .. ' Rented A Van For OxyRuns', 'oxy')
|
--Log(GetName(src) .. ' Rented A Van For OxyRuns', 'oxy')
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
Notifys(src, Lang.oxy.broke, "error")
|
ps.notify(src, Lang.oxy.broke, "error")
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
@@ -29,13 +29,13 @@ RegisterServerEvent('md-drugs:server:giveoxybox', function()
|
|||||||
}
|
}
|
||||||
local item = itemList[math.random(1, #itemList)]
|
local item = itemList[math.random(1, #itemList)]
|
||||||
if chance <= prices.hotchance then
|
if chance <= prices.hotchance then
|
||||||
Notifys(src, Lang.oxy.hot, "error")
|
ps.notify(src, Lang.oxy.hot, "error")
|
||||||
Player.Functions.AddMoney("cash", cash * 0.5)
|
Player.Functions.AddMoney("cash", cash * 0.5)
|
||||||
if itemchance <= prices.itemChance then
|
if itemchance <= prices.itemChance then
|
||||||
AddItem(src, item.item, item.amount)
|
AddItem(src, item.item, item.amount)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
Notifys(Lang.oxy.next, "success")
|
ps.notify(Lang.oxy.next, "success")
|
||||||
TriggerClientEvent("md-drugs:client:getoxylocationroute", src)
|
TriggerClientEvent("md-drugs:client:getoxylocationroute", src)
|
||||||
Player.Functions.AddMoney("cash", cash)
|
Player.Functions.AddMoney("cash", cash)
|
||||||
if itemchance <= prices.itemChance then
|
if itemchance <= prices.itemChance then
|
||||||
|
|||||||
+4
-4
@@ -6,7 +6,7 @@ local function GetJob(source)
|
|||||||
if Player.PlayerData.job.type == 'ems' then
|
if Player.PlayerData.job.type == 'ems' then
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
Notifys(src, 'You Must Be EMS To Do This', 'error')
|
ps.notify(src, 'You Must Be EMS To Do This', 'error')
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -54,8 +54,8 @@ CUI(d, function(source, item)
|
|||||||
if d == k then
|
if d == k then
|
||||||
RemoveItem(src, d, 1)
|
RemoveItem(src, d, 1)
|
||||||
AddItem(src, v, math.random(10,30))
|
AddItem(src, v, math.random(10,30))
|
||||||
Notifys(src,Lang.Pharma.unbottle, "success")
|
ps.notify(src,Lang.Pharma.unbottle, "success")
|
||||||
Log(GetName(src) .. ' Unbottled 30 Of ' .. v .. '!', 'pharma')
|
--Log(GetName(src) .. ' Unbottled 30 Of ' .. v .. '!', 'pharma')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -73,5 +73,5 @@ RegisterServerEvent('md-drugs:server:fillprescription', function()
|
|||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Log(GetName(src) .. ' Filled A Prescription!', 'pharma')
|
--Log(GetName(src) .. ' Filled A Prescription!', 'pharma')
|
||||||
end)
|
end)
|
||||||
@@ -102,7 +102,7 @@ local plantData = {
|
|||||||
plants.cocaine[loc].taken = false
|
plants.cocaine[loc].taken = false
|
||||||
GlobalState.CocaPlant = plants.cocaine
|
GlobalState.CocaPlant = plants.cocaine
|
||||||
TriggerClientEvent('coke:respawnCane', -1, loc)
|
TriggerClientEvent('coke:respawnCane', -1, loc)
|
||||||
Log('Coca Plant Respawned At ' .. plants.cocaine[loc].location, 'coke')
|
--Log('Coca Plant Respawned At ' .. plants.cocaine[loc].location, 'coke')
|
||||||
end)
|
end)
|
||||||
end,
|
end,
|
||||||
allow = Config.Drugs.cocaine
|
allow = Config.Drugs.cocaine
|
||||||
@@ -122,7 +122,7 @@ local plantData = {
|
|||||||
plants.heroin[loc].taken = false
|
plants.heroin[loc].taken = false
|
||||||
GlobalState.PoppyPlants = plants.heroin
|
GlobalState.PoppyPlants = plants.heroin
|
||||||
TriggerClientEvent('heroin:respawnCane', -1, loc)
|
TriggerClientEvent('heroin:respawnCane', -1, loc)
|
||||||
Log('Heroin Plant Respawned At ' .. plants.heroin[loc].location, 'heroin')
|
--Log('Heroin Plant Respawned At ' .. plants.heroin[loc].location, 'heroin')
|
||||||
end)
|
end)
|
||||||
end,
|
end,
|
||||||
allow = Config.Drugs.heroin
|
allow = Config.Drugs.heroin
|
||||||
@@ -142,7 +142,7 @@ local plantData = {
|
|||||||
plants.mescaline[loc].taken = false
|
plants.mescaline[loc].taken = false
|
||||||
GlobalState.Mescaline = plants.mescaline
|
GlobalState.Mescaline = plants.mescaline
|
||||||
TriggerClientEvent('Mescaline:respawnCane', -1, loc)
|
TriggerClientEvent('Mescaline:respawnCane', -1, loc)
|
||||||
Log('Mescaline Plant Respawned At ' .. plants.mescaline[loc].location, 'mescaline')
|
--Log('Mescaline Plant Respawned At ' .. plants.mescaline[loc].location, 'mescaline')
|
||||||
end)
|
end)
|
||||||
end,
|
end,
|
||||||
allow = Config.Drugs.mescaline
|
allow = Config.Drugs.mescaline
|
||||||
@@ -162,7 +162,7 @@ local plantData = {
|
|||||||
plants.shrooms[loc].taken = false
|
plants.shrooms[loc].taken = false
|
||||||
GlobalState.shrooms = plants.shrooms
|
GlobalState.shrooms = plants.shrooms
|
||||||
TriggerClientEvent('shrooms:respawnCane', -1, loc)
|
TriggerClientEvent('shrooms:respawnCane', -1, loc)
|
||||||
Log('Shroom Respawned At ' .. plants.shrooms[loc].location, 'shrooms')
|
--Log('Shroom Respawned At ' .. plants.shrooms[loc].location, 'shrooms')
|
||||||
end)
|
end)
|
||||||
end,
|
end,
|
||||||
allow = Config.Drugs.shrooms
|
allow = Config.Drugs.shrooms
|
||||||
@@ -182,7 +182,7 @@ local plantData = {
|
|||||||
plants.weed[loc].taken = false
|
plants.weed[loc].taken = false
|
||||||
GlobalState.WeedPlant = plants.weed
|
GlobalState.WeedPlant = plants.weed
|
||||||
TriggerClientEvent('weed:respawnCane', -1, loc)
|
TriggerClientEvent('weed:respawnCane', -1, loc)
|
||||||
Log('Weed Plant Respawned At ' .. plants.weed[loc].location, 'weed')
|
--Log('Weed Plant Respawned At ' .. plants.weed[loc].location, 'weed')
|
||||||
end)
|
end)
|
||||||
end,
|
end,
|
||||||
allow = Config.Drugs.weed
|
allow = Config.Drugs.weed
|
||||||
|
|||||||
+2
-1
@@ -136,7 +136,8 @@ local recipe = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function GetRecipe(source, type, method, tier)
|
function GetRecipe(source, type, method, tier)
|
||||||
ps.craftItem(source,recipe[type][method][tier])
|
print(ps.craftItem(source,recipe[type][method][tier]))
|
||||||
|
return ps.craftItem(source,recipe[type][method][tier])
|
||||||
end
|
end
|
||||||
|
|
||||||
ps.registerCallback('md-drugs:server:GetRecipe', function(source, type, cat)
|
ps.registerCallback('md-drugs:server:GetRecipe', function(source, type, cat)
|
||||||
|
|||||||
+1
-1
@@ -73,7 +73,7 @@ RegisterServerEvent("md-drugs:server:purchaseGoods", function(amount, money, ite
|
|||||||
if not table[i].price == price then return end
|
if not table[i].price == price then return end
|
||||||
if Player.Functions.RemoveMoney(tostring(money), tonumber(table[i].price) * tonumber(amount)) then
|
if Player.Functions.RemoveMoney(tostring(money), tonumber(table[i].price) * tonumber(amount)) then
|
||||||
AddItem(src, item, amount)
|
AddItem(src, item, amount)
|
||||||
Log(GetName(src) .. ' Bought ' .. amount .. ' Of ' .. item .. ' For ' .. tonumber(price) * tonumber(amount) .. '!', 'merchant')
|
--Log(GetName(src) .. ' Bought ' .. amount .. ' Of ' .. item .. ' For ' .. tonumber(price) * tonumber(amount) .. '!', 'merchant')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
+2
-2
@@ -3,8 +3,8 @@ CUI('shrooms', function(source, item)
|
|||||||
local src = source
|
local src = source
|
||||||
if TriggerClientEvent('md-drugs:client:takeshrooms', src, item.name) then
|
if TriggerClientEvent('md-drugs:client:takeshrooms', src, item.name) then
|
||||||
RemoveItem(src, 'shrooms', 1)
|
RemoveItem(src, 'shrooms', 1)
|
||||||
Log(GetName(source) .. ' Took Some Mushrooms', 'shrooms')
|
--Log(GetName(source) .. ' Took Some Mushrooms', 'shrooms')
|
||||||
Notifys(src, 'You Took Some Shrooms!', 'success')
|
ps.notify(src, 'You Took Some Shrooms!', 'success')
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
+4
-4
@@ -7,9 +7,9 @@ RegisterServerEvent('md-drugs:server:dryoutweed', function()
|
|||||||
local Player = getPlayer(src)
|
local Player = getPlayer(src)
|
||||||
if RemoveItem(src,"wetcannabis", 1) then
|
if RemoveItem(src,"wetcannabis", 1) then
|
||||||
AddItem(src,"drycannabis", 1)
|
AddItem(src,"drycannabis", 1)
|
||||||
Log(GetName(source) .. ' Dried Weed', 'weed')
|
--Log(GetName(source) .. ' Dried Weed', 'weed')
|
||||||
else
|
else
|
||||||
Notifys(src, Lang.Weed.nodry, "error")
|
ps.notify(src, Lang.Weed.nodry, "error")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ CUI("dabrig", function(source, item)
|
|||||||
TriggerClientEvent("md-drugs:client:dodabs", src)
|
TriggerClientEvent("md-drugs:client:dodabs", src)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
Notifys(src, 'You Need A Butane Torch', 'error')
|
ps.notify(src, 'You Need A Butane Torch', 'error')
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ CUI("weedgrinder", function(source, item)
|
|||||||
local src = source
|
local src = source
|
||||||
local Player = getPlayer(src)
|
local Player = getPlayer(src)
|
||||||
local has = Player.Functions.GetItemByName("drycannabis")
|
local has = Player.Functions.GetItemByName("drycannabis")
|
||||||
if not has then Notifys(src, 'You Need Dried Cannabis', 'error') return end
|
if not has then ps.notify(src, 'You Need Dried Cannabis', 'error') return end
|
||||||
local check = ps.callback('md-drugs:client:uncuff', src, 'Grinding Weed')
|
local check = ps.callback('md-drugs:client:uncuff', src, 'Grinding Weed')
|
||||||
if not check then return end
|
if not check then return end
|
||||||
if RemoveItem(src, "drycannabis",1 ) then
|
if RemoveItem(src, "drycannabis",1 ) then
|
||||||
|
|||||||
@@ -19,10 +19,10 @@ for k, v in pairs (burners) do
|
|||||||
CUI(k, function(source, item)
|
CUI(k, function(source, item)
|
||||||
local src = source
|
local src = source
|
||||||
local Player = getPlayer(src)
|
local Player = getPlayer(src)
|
||||||
if getCops() < Config.PoliceCount then return Notifys(src, Lang.Wholesale.na, 'error') end
|
if getCops() < Config.PoliceCount then return ps.notify(src, Lang.Wholesale.na, 'error') end
|
||||||
for m, d in pairs (active) do
|
for m, d in pairs (active) do
|
||||||
if d.cid == Player.PlayerData.citizenid then
|
if d.cid == Player.PlayerData.citizenid then
|
||||||
return Notifys(src, Lang.Wholesale.al, 'error' )
|
return ps.notify(src, Lang.Wholesale.al, 'error' )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local tab = ''
|
local tab = ''
|
||||||
|
|||||||
+7
-7
@@ -125,9 +125,9 @@ RegisterServerEvent('md-drugs:server:buypress', function()
|
|||||||
|
|
||||||
if Player.Functions.RemoveMoney("cash", 20000) then
|
if Player.Functions.RemoveMoney("cash", 20000) then
|
||||||
AddItem(src, "singlepress", 1)
|
AddItem(src, "singlepress", 1)
|
||||||
Log(GetName(source) .. ' Bought A Pill Press', 'xtc')
|
--Log(GetName(source) .. ' Bought A Pill Press', 'xtc')
|
||||||
else
|
else
|
||||||
Notifys(Lang.xtc.cash, "error")
|
ps.notify(Lang.xtc.cash, "error")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@@ -140,7 +140,7 @@ RegisterServerEvent('md-drugs:server:upgradepress', function(data)
|
|||||||
elseif data == 'quad' then
|
elseif data == 'quad' then
|
||||||
if not GetRecipe(src, 'xtc', 'press', 'quad') then return end
|
if not GetRecipe(src, 'xtc', 'press', 'quad') then return end
|
||||||
else
|
else
|
||||||
Notifys(src, 'huh', 'error')
|
ps.notify(src, 'huh', 'error')
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@@ -170,7 +170,7 @@ RegisterServerEvent('md-drugs:server:stampwhite', function(num)
|
|||||||
elseif RemoveItem(src, "white_xtc4", 1) then
|
elseif RemoveItem(src, "white_xtc4", 1) then
|
||||||
AddItem(src, four[chance], 1)
|
AddItem(src, four[chance], 1)
|
||||||
else
|
else
|
||||||
Notifys('You Dont Have Unstamped White Pills', 'error')
|
ps.notify('You Dont Have Unstamped White Pills', 'error')
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@@ -192,7 +192,7 @@ RegisterServerEvent('md-drugs:server:stampred', function(num)
|
|||||||
elseif RemoveItem(src, "red_xtc4", 1) then
|
elseif RemoveItem(src, "red_xtc4", 1) then
|
||||||
AddItem(src, four[chance], 1)
|
AddItem(src, four[chance], 1)
|
||||||
else
|
else
|
||||||
Notifys('You Dont Have Unstamped red Pills', 'error')
|
ps.notify('You Dont Have Unstamped red Pills', 'error')
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@@ -214,7 +214,7 @@ RegisterServerEvent('md-drugs:server:stamporange', function(num)
|
|||||||
elseif RemoveItem(src, "orange_xtc4", 1) then
|
elseif RemoveItem(src, "orange_xtc4", 1) then
|
||||||
AddItem(src, four[chance], 1)
|
AddItem(src, four[chance], 1)
|
||||||
else
|
else
|
||||||
Notifys('You Dont Have Unstamped orange Pills', 'error')
|
ps.notify('You Dont Have Unstamped orange Pills', 'error')
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@@ -235,7 +235,7 @@ RegisterServerEvent('md-drugs:server:stampblue', function(num)
|
|||||||
elseif RemoveItem(src, "blue_xtc4", 1) then
|
elseif RemoveItem(src, "blue_xtc4", 1) then
|
||||||
AddItem(src, four[chance], 1)
|
AddItem(src, four[chance], 1)
|
||||||
else
|
else
|
||||||
Notifys('You Dont Have Unstamped blue Pills', 'error')
|
ps.notify('You Dont Have Unstamped blue Pills', 'error')
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -57,10 +57,10 @@ Config.Drugs = {
|
|||||||
cornerselling = true,
|
cornerselling = true,
|
||||||
heroin = true,
|
heroin = true,
|
||||||
deliveries = false,
|
deliveries = false,
|
||||||
lean = false,
|
lean = true,
|
||||||
lsd = false,
|
lsd = true,
|
||||||
mescaline = true,
|
mescaline = true,
|
||||||
meth = false,
|
meth = true,
|
||||||
oxyruns = false,
|
oxyruns = false,
|
||||||
pharma = false,
|
pharma = false,
|
||||||
shrooms = true,
|
shrooms = true,
|
||||||
|
|||||||
Reference in new issue
Block a user