Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
537e639045 | ||
|
|
0956b1d49c | ||
|
|
eaec5fc40f |
No files matched your search
@@ -21,7 +21,6 @@
|
|||||||
"heroinCooldown",
|
"heroinCooldown",
|
||||||
"checkLoc",
|
"checkLoc",
|
||||||
"getRandW",
|
"getRandW",
|
||||||
"shroomsCooldown",
|
"shroomsCooldown"
|
||||||
"targets"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -294,4 +294,4 @@ d. Nothing in this Public License constitutes or may be interpreted as a limitat
|
|||||||
|
|
||||||
Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” The text of the Creative Commons public licenses is dedicated to the public domain under the CC0 Public Domain Dedication. Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at creativecommons.org/policies, Creative Commons does not authorize the use of the trademark "Creative Commons" or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses.
|
Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” The text of the Creative Commons public licenses is dedicated to the public domain under the CC0 Public Domain Dedication. Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at creativecommons.org/policies, Creative Commons does not authorize the use of the trademark "Creative Commons" or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses.
|
||||||
|
|
||||||
Creative Commons may be contacted at creativecommons.org.
|
Creative Commons may be contacted at creativecommons.org.
|
||||||
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 22 KiB |
@@ -1,25 +0,0 @@
|
|||||||
fx_version 'cerulean'
|
|
||||||
game 'gta5'
|
|
||||||
|
|
||||||
lua54 'yes'
|
|
||||||
this_is_a_map 'yes'
|
|
||||||
|
|
||||||
author 'Atenea'
|
|
||||||
description 'Balloon / MD-Drugs'
|
|
||||||
version '1.0.1'
|
|
||||||
|
|
||||||
---------------------------------------------------------------------------
|
|
||||||
-- INCLUDED FILES
|
|
||||||
---------------------------------------------------------------------------
|
|
||||||
files {
|
|
||||||
'stream/*.ytyp',
|
|
||||||
}
|
|
||||||
|
|
||||||
data_file 'DLC_ITYP_REQUEST' 'stream/*.ytyp'
|
|
||||||
|
|
||||||
dependency '/assetpacks'
|
|
||||||
|
|
||||||
|
|
||||||
escrow_ignore {
|
|
||||||
'stream/*.ydr',
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
Thank you for your purchase!
|
|
||||||
We hope you enjoy this prop ♥
|
|
||||||
|
|
||||||
Author: Atenea Store | Atenea
|
|
||||||
|
|
||||||
-- IMPORTANT --
|
|
||||||
/Please read below.
|
|
||||||
|
|
||||||
► If you rename the folder or files I will not be responsible if it does not work correctly afterwards.
|
|
||||||
|
|
||||||
► If you encounter any problems, errors, or have any questions related to our prop, JOIN OUR DISCORD.
|
|
||||||
Don't hesitate to open a ticket, we’ll assist you as quickly as possible.
|
|
||||||
|
|
||||||
https://discord.gg/mam8Nmg49d
|
|
||||||
|
|
||||||
SCRIPTS
|
|
||||||
https://discord.gg/S5WZ7ecKDc
|
|
||||||
|
|
||||||
Make sure you’ve already READ our post on FiveM/Tebex/Discord.
|
|
||||||
Atenea from the Atenea Store Team.
|
|
||||||
@@ -1,35 +1,28 @@
|
|||||||
if not Config.Drugs['TravellingMerchant'] then return end
|
|
||||||
local function spawn()
|
local function spawn()
|
||||||
local data = Bridge.Callback.Trigger('md-drugs:server:GetMerchant')
|
local data = ps.callback('md-drugs:server:GetMerchant')
|
||||||
local model = 's_m_m_trucker_01'
|
local model = 's_m_m_trucker_01'
|
||||||
requestModel(model)
|
ps.requestModel(model)
|
||||||
local ped = CreatePed(4, model, data.loc.x, data.loc.y, data.loc.z, data.loc.w, false, true)
|
local ped = CreatePed(4, model, data.loc.x, data.loc.y, data.loc.z, data.loc.w, false, true)
|
||||||
Freeze(ped, true, data.loc.w)
|
Freeze(ped, true, data.loc.w)
|
||||||
Bridge.Target.AddLocalEntity(ped, {
|
ps.entityTarget(ped, {
|
||||||
{
|
{
|
||||||
icon = Bridge.Language.Locale('merchant.targetIcon'),
|
label = ps.lang('merchant.targetOpen'),
|
||||||
label = Bridge.Language.Locale('merchant.targetOpen'),
|
|
||||||
action = function()
|
action = function()
|
||||||
local options = {}
|
local options = {}
|
||||||
for k, v in pairs (data.items) do
|
for k, v in pairs (data.items) do
|
||||||
local itemInfo = Bridge.Inventory.GetItemInfo(k)
|
|
||||||
options[#options+1] = {
|
options[#options+1] = {
|
||||||
title = itemInfo.label,
|
title = ps.getLabel(k),
|
||||||
description = '$'..v,
|
description = '$'..v,
|
||||||
icon = itemInfo.image,
|
icon = ps.getImage(k),
|
||||||
onSelect = function()
|
action = function()
|
||||||
TriggerServerEvent('md-drugs:server:purchaseGoods', k)
|
TriggerServerEvent('md-drugs:server:purchaseGoods', k)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
Bridge.Menu.Open({
|
ps.menu('Travelling Merchant', 'Travelling Merchant', options)
|
||||||
id = 'merchant_menu',
|
|
||||||
title = Bridge.Language.Locale('merchant.menuTitle'),
|
|
||||||
options = options
|
|
||||||
})
|
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = ped
|
|
||||||
end
|
end
|
||||||
spawn()
|
spawn()
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
local started = nil
|
||||||
|
|
||||||
|
function EcstasyEffect()
|
||||||
|
local startStamina = 50
|
||||||
|
SetFlash(0, 0, 500, 20000, 500)
|
||||||
|
while startStamina > 0 do
|
||||||
|
Wait(1000)
|
||||||
|
startStamina = startStamina - 1
|
||||||
|
RestorePlayerStamina(PlayerId(), 1.0)
|
||||||
|
if math.random(1, 100) < 51 then
|
||||||
|
SetFlash(0, 0, 500, 7000, 500)
|
||||||
|
ShakeGameplayCam('SMALL_EXPLOSION_SHAKE', 0.08)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if IsPedRunning(PlayerPedId()) then
|
||||||
|
SetPedToRagdoll(PlayerPedId(), math.random(1000, 3000), math.random(1000, 3000), 3, 0, 0, 0)
|
||||||
|
end
|
||||||
|
startStamina = 0
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function MethBagEffect()
|
||||||
|
local startStamina = 30
|
||||||
|
TrevorEffect()
|
||||||
|
SetRunSprintMultiplierForPlayer(PlayerId(), 1.49)
|
||||||
|
while startStamina > 0 do
|
||||||
|
Wait(1000)
|
||||||
|
if math.random(5, 100) < 10 then
|
||||||
|
RestorePlayerStamina(PlayerId(), 1.0)
|
||||||
|
end
|
||||||
|
startStamina = startStamina - 1
|
||||||
|
if math.random(5, 100) < 51 then
|
||||||
|
TrevorEffect()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
startStamina = 0
|
||||||
|
SetRunSprintMultiplierForPlayer(PlayerId(), 1.0)
|
||||||
|
end
|
||||||
|
|
||||||
|
function TrevorEffect()
|
||||||
|
StartScreenEffect("DrugsTrevorClownsFightIn", 3.0, 0)
|
||||||
|
Wait(3000)
|
||||||
|
StartScreenEffect("DrugsTrevorClownsFight", 3.0, 0)
|
||||||
|
Wait(3000)
|
||||||
|
StartScreenEffect("DrugsTrevorClownsFightOut", 3.0, 0)
|
||||||
|
StopScreenEffect("DrugsTrevorClownsFight")
|
||||||
|
StopScreenEffect("DrugsTrevorClownsFightIn")
|
||||||
|
StopScreenEffect("DrugsTrevorClownsFightOut")
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function CokeBaggyEffect()
|
||||||
|
local startStamina = 20
|
||||||
|
local ped = PlayerPedId()
|
||||||
|
AlienEffect()
|
||||||
|
SetRunSprintMultiplierForPlayer(PlayerId(), 1.1)
|
||||||
|
while startStamina > 0 do
|
||||||
|
Wait(1000)
|
||||||
|
if math.random(1, 100) < 20 then
|
||||||
|
RestorePlayerStamina(PlayerId(), 1.0)
|
||||||
|
end
|
||||||
|
startStamina = startStamina - 1
|
||||||
|
if math.random(1, 100) < 10 and IsPedRunning(ped) then
|
||||||
|
SetPedToRagdoll(ped, math.random(1000, 3000), math.random(1000, 3000), 3, 0, 0, 0)
|
||||||
|
end
|
||||||
|
if math.random(1, 300) < 10 then
|
||||||
|
AlienEffect()
|
||||||
|
Wait(math.random(3000, 6000))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if IsPedRunning(ped) then
|
||||||
|
SetPedToRagdoll(ped, math.random(1000, 3000), math.random(1000, 3000), 3, 0, 0, 0)
|
||||||
|
end
|
||||||
|
|
||||||
|
startStamina = 0
|
||||||
|
SetRunSprintMultiplierForPlayer(PlayerId(), 1.0)
|
||||||
|
end
|
||||||
|
|
||||||
|
function AlienEffect()
|
||||||
|
StartScreenEffect("DrugsMichaelAliensFightIn", 3.0, 0)
|
||||||
|
Wait(math.random(5000, 8000))
|
||||||
|
StartScreenEffect("DrugsMichaelAliensFight", 3.0, 0)
|
||||||
|
Wait(math.random(5000, 8000))
|
||||||
|
StartScreenEffect("DrugsMichaelAliensFightOut", 3.0, 0)
|
||||||
|
StopScreenEffect("DrugsMichaelAliensFightIn")
|
||||||
|
StopScreenEffect("DrugsMichaelAliensFight")
|
||||||
|
StopScreenEffect("DrugsMichaelAliensFightOut")
|
||||||
|
end
|
||||||
@@ -1,11 +1,12 @@
|
|||||||
|
|
||||||
local cuttingcoke = nil
|
local cuttingcoke = nil
|
||||||
local baggingcoke = nil
|
local baggingcoke = nil
|
||||||
local locations = Config.Cocaine.Locations
|
local locations = ps.callback('md-drugs:server:GetCokeLocations')
|
||||||
|
|
||||||
|
|
||||||
local function CutCoke(coords, offset, rotation)
|
local function CutCoke(coords, offset, rotation)
|
||||||
cuttingcoke = true
|
|
||||||
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"
|
||||||
Bridge.Anim.RequestDict(animDict, 500)
|
ps.requestAnim(animDict, 500)
|
||||||
local animDuration = GetAnimDuration(animDict, animName) * 1000
|
local animDuration = GetAnimDuration(animDict, animName) * 1000
|
||||||
local ped = PlayerPedId()
|
local ped = PlayerPedId()
|
||||||
local scenePos, sceneRot = vector3(coords.x + offset.x, coords.y + offset.y,coords.z + offset.z), rotation
|
local scenePos, sceneRot = vector3(coords.x + offset.x, coords.y + offset.y,coords.z + offset.z), rotation
|
||||||
@@ -48,17 +49,15 @@ local function CutCoke(coords, offset, rotation)
|
|||||||
end
|
end
|
||||||
RemoveAnimDict(animDict)
|
RemoveAnimDict(animDict)
|
||||||
FreezeEntityPosition(ped, false)
|
FreezeEntityPosition(ped, false)
|
||||||
cuttingcoke = nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function BagCoke(coords, offset, rotation)
|
local function BagCoke(coords, offset, rotation)
|
||||||
baggingcoke = true
|
|
||||||
local ver = ""
|
local ver = ""
|
||||||
local animDict, animName = "anim@amb@business@meth@meth_smash_weight_check@", "break_weigh_"..ver.."char01"
|
local animDict, animName = "anim@amb@business@meth@meth_smash_weight_check@", "break_weigh_"..ver.."char01"
|
||||||
Bridge.Anim.RequestDict(animDict, 500)
|
ps.requestAnim(animDict, 500)
|
||||||
local animDuration = GetAnimDuration(animDict, animName) * 1000
|
local animDuration = GetAnimDuration(animDict, animName) * 1000
|
||||||
local ped = PlayerPedId()
|
local ped = PlayerPedId()
|
||||||
local scenePos, sceneRot = vector3(coords.x + offset.x, coords.y + offset.y,coords.z + offset.z +0.03), rotation
|
local scenePos, sceneRot = vector3(coords.x + offset.x, coords.y + offset.y,coords.z + offset.z), rotation
|
||||||
local scenes = {
|
local scenes = {
|
||||||
{
|
{
|
||||||
{ hash = "bkr_prop_coke_cutblock_01", animName = "break_weigh_"..ver.."box01"},
|
{ hash = "bkr_prop_coke_cutblock_01", animName = "break_weigh_"..ver.."box01"},
|
||||||
@@ -77,6 +76,7 @@ baggingcoke = true
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
{ hash = "bkr_prop_fakeid_clipboard_01a", animName = "break_weigh_"..ver.."clipboard"},
|
{ hash = "bkr_prop_fakeid_clipboard_01a", animName = "break_weigh_"..ver.."clipboard"},
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
local scenesList, entitiesList = {}, {}
|
local scenesList, entitiesList = {}, {}
|
||||||
@@ -111,94 +111,102 @@ baggingcoke = true
|
|||||||
end
|
end
|
||||||
RemoveAnimDict(animDict)
|
RemoveAnimDict(animDict)
|
||||||
FreezeEntityPosition(ped, false)
|
FreezeEntityPosition(ped, false)
|
||||||
baggingcoke = nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
for k, v in pairs (locations.MakePowder) do
|
for k, v in pairs (locations.MakePowder) do
|
||||||
Bridge.Target.AddBoxZone('cocaplant'..k, v.loc, v.size, v.loc.w or 180.0, {
|
ps.boxTarget('cocaplant'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
|
||||||
{
|
{
|
||||||
label = Bridge.Language.Locale('coke.targetMakePow'),
|
label = ps.lang('coke.targetMakePow'),
|
||||||
icon = Bridge.Language.Locale('coke.targetMakePowIcon'),
|
icon = 'fa-solid fa-seedling',
|
||||||
action = function()
|
action = function()
|
||||||
if not itemCheck('coca_leaf') then return end
|
if not ps.hasItem('coca_leaf') then
|
||||||
if not progressbar(Bridge.Language.Locale('coke.makePow')) then return end
|
ps.notify(ps.lang('Catches.itemMissings', ps.getLabel('coca_leaf')), 'error')
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if not ps.progressbar(ps.lang('coke.makePow'), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:makepowder", k)
|
TriggerServerEvent("md-drugs:server:makepowder", k)
|
||||||
end,
|
end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
return handleGang(v.gang)
|
if cocaineLab then return false end
|
||||||
end
|
return handleGang(v.gang)
|
||||||
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = 'cocaplant'..k
|
|
||||||
end
|
end
|
||||||
|
|
||||||
for k, v in pairs (locations.CuttingCoke) do
|
for k, v in pairs (locations.CuttingCoke) do
|
||||||
Bridge.Target.AddBoxZone('cutcoke'..k, v.loc, v.size, v.loc.w or 180.0, {
|
ps.boxTarget('cutcoke'..k, v.loc, {length = 1.0, width = 1.0, height = 1.0, rotation = 180.0}, {
|
||||||
{
|
{
|
||||||
label = Bridge.Language.Locale('coke.targetCutCoke'),
|
label = ps.lang('coke.targetCutCoke'),
|
||||||
icon = Bridge.Language.Locale('coke.targetCutCokeIcon'),
|
icon = 'fa-solid fa-mortar-pestle',
|
||||||
action = function()
|
action = function()
|
||||||
if not itemCheck('bakingsoda') then return end
|
if not ps.hasItem('bakingsoda') then
|
||||||
|
ps.notify(ps.lang('Catches.itemMissings', ps.getLabel('bakingsoda')), 'error')
|
||||||
|
return
|
||||||
|
end
|
||||||
CutCoke(v.loc, v.offset, v.rotation)
|
CutCoke(v.loc, v.offset, v.rotation)
|
||||||
TriggerServerEvent("md-drugs:server:cutcokeone", k)
|
TriggerServerEvent("md-drugs:server:cutcokeone", k)
|
||||||
end,
|
end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
|
if cocaineLab then return false end
|
||||||
if not handleGang(v.gang) then return false end
|
if not handleGang(v.gang) then return false end
|
||||||
if cuttingcoke ~= nil or baggingcoke ~= nil then return false end
|
if cuttingcoke ~= nil or baggingcoke ~= nil then return false end
|
||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = 'cutcoke'..k
|
|
||||||
end
|
end
|
||||||
|
|
||||||
for k, v in pairs (locations.BaggingCoke) do
|
for k, v in pairs (locations.BaggingCoke) do
|
||||||
Bridge.Target.AddBoxZone('bagcoke'..k, v.loc, v.size, v.loc.w or 180.0, {
|
ps.boxTarget('bagcoke'..k, v.loc, {length = 1.0, width = 1.0, height = 1.0, rotation = 180.0}, {
|
||||||
{
|
{
|
||||||
label = Bridge.Language.Locale('coke.targetBagCoke'),
|
label = ps.lang('coke.targetBagCoke'),
|
||||||
icon = Bridge.Language.Locale('coke.targetBagCokeIcon'),
|
icon = 'fa-solid fa-sack-xmark',
|
||||||
action = function()
|
action = function()
|
||||||
if not itemCheck('empty_weed_bag') then return end
|
if not ps.hasItem('empty_weed_bag') then
|
||||||
|
ps.notify(ps.lang('Catches.itemMissings', ps.getLabel('empty_weed_bag')), 'error')
|
||||||
|
return
|
||||||
|
end
|
||||||
BagCoke(v.loc, v.offset, v.rotation)
|
BagCoke(v.loc, v.offset, v.rotation)
|
||||||
TriggerServerEvent("md-drugs:server:bagcoke", k)
|
TriggerServerEvent("md-drugs:server:bagcoke", k)
|
||||||
end,
|
end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
|
if cocaineLab then return false end
|
||||||
if not handleGang(v.gang) then return false end
|
if not handleGang(v.gang) then return false end
|
||||||
if cuttingcoke ~= nil or baggingcoke ~= nil then return false end
|
if cuttingcoke ~= nil or baggingcoke ~= nil then return false end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = 'bagcoke'..k
|
|
||||||
end
|
end
|
||||||
|
|
||||||
for k, v in pairs (locations.cokeTele) do
|
for k, v in pairs (locations.cokeTele) do
|
||||||
Bridge.Target.AddBoxZone('coke_tele'..k, v.inside, v.size, v.inside.w or 180.0,{
|
ps.boxTarget('coke_tele'..k, v.inside, {length = v.l, width = v.w, heading = v.rot}, {
|
||||||
{
|
{
|
||||||
icon = Bridge.Language.Locale('coke.teleOutIcon'),
|
icon = 'fa-solid fa-door-open',
|
||||||
label = Bridge.Language.Locale('coke.teleOut'),
|
label = ps.lang('coke.teleOut'),
|
||||||
action = function()
|
action = function()
|
||||||
SetEntityCoords(PlayerPedId(), v.outside)
|
SetEntityCoords(PlayerPedId(), v.outside)
|
||||||
end,
|
end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
|
if cocaineLab then return false end
|
||||||
return handleGang(v.gang)
|
return handleGang(v.gang)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = 'coke_tele'..k
|
ps.boxTarget('coke_teleout'..k, v.outside, {length = v.l, width = v.w, heading = v.rot}, {
|
||||||
Bridge.Target.AddBoxZone('coke_teleout'..k, v.outside, v.size, v.outside.w or 180.0,{
|
|
||||||
{
|
{
|
||||||
icon = Bridge.Language.Locale('coke.teleInIcon'),
|
icon = 'fa-solid fa-door-closed',
|
||||||
label = Bridge.Language.Locale('coke.teleIn'),
|
label = ps.lang('coke.teleIn'),
|
||||||
action = function()
|
action = function()
|
||||||
SetEntityCoords(PlayerPedId(), v.inside)
|
SetEntityCoords(PlayerPedId(), v.inside)
|
||||||
end,
|
end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
|
if cocaineLab then return false end
|
||||||
return handleGang(v.gang)
|
return handleGang(v.gang)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = 'coke_teleout'..k
|
|
||||||
end
|
end
|
||||||
|
|
||||||
CreateThread(function()
|
CreateThread(function()
|
||||||
|
|||||||
@@ -0,0 +1,478 @@
|
|||||||
|
local inside = false
|
||||||
|
local peds = {}
|
||||||
|
local labData = {}
|
||||||
|
cocaineLab = false
|
||||||
|
local insideLocation = nil
|
||||||
|
|
||||||
|
local function CutCoke(coords, offset, rotation)
|
||||||
|
CreateThread(function()
|
||||||
|
local animDict, animName = "anim@amb@business@coc@coc_unpack_cut_left@", "coke_cut_v5_coccutter"
|
||||||
|
ps.requestAnim(animDict, 500)
|
||||||
|
local animDuration = GetAnimDuration(animDict, animName) * 1000
|
||||||
|
if not peds['CutCoke'] then
|
||||||
|
ps.requestModel('ig_priest', 500)
|
||||||
|
peds['CutCoke'] = CreatePed(4, 'ig_priest', coords.x + 1.0, coords.y + 1.0, coords.z - 1.0, 0.0, true, true)
|
||||||
|
FreezeEntityPosition(peds['CutCoke'], true)
|
||||||
|
SetEntityInvincible(peds['CutCoke'], true)
|
||||||
|
SetBlockingOfNonTemporaryEvents(peds['CutCoke'], true)
|
||||||
|
end
|
||||||
|
local ped = peds['CutCoke']
|
||||||
|
local scenePos, sceneRot = vector3(coords.x + offset.x, coords.y + offset.y,coords.z + offset.z), rotation
|
||||||
|
local scenes = {
|
||||||
|
{
|
||||||
|
{ hash = "bkr_prop_coke_bakingsoda_o", animName = "coke_cut_v5_bakingsoda"},
|
||||||
|
{ hash = "prop_cs_credit_card", animName = "coke_cut_v5_creditcard"},
|
||||||
|
{ hash = "prop_cs_credit_card", animName = "coke_cut_v5_creditcard^1"}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
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)
|
||||||
|
if inside then
|
||||||
|
CutCoke(coords, offset, rotation)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function BagCoke(coords, offset, rotation)
|
||||||
|
CreateThread(function()
|
||||||
|
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
|
||||||
|
if not peds['BagCoke'] then
|
||||||
|
ps.requestModel('ig_priest', 500)
|
||||||
|
peds['BagCoke'] = CreatePed(4, 'ig_priest', coords.x + 1.0, coords.y + 1.0, coords.z - 1.0, 0.0, true, true)
|
||||||
|
FreezeEntityPosition(peds['BagCoke'], true)
|
||||||
|
SetEntityInvincible(peds['BagCoke'], true)
|
||||||
|
SetBlockingOfNonTemporaryEvents(peds['BagCoke'], true)
|
||||||
|
end
|
||||||
|
local scenePos, sceneRot = vector3(coords.x + offset.x, coords.y + offset.y,coords.z + offset.z), rotation
|
||||||
|
local scenes = {
|
||||||
|
{
|
||||||
|
{ hash = "bkr_prop_coke_cutblock_01", animName = "break_weigh_"..ver.."box01"},
|
||||||
|
{ hash = "bkr_prop_coke_fullmetalbowl_02", animName = "break_weigh_"..ver.."box01^1"},
|
||||||
|
{ hash = "bkr_prop_coke_cutblock_01", animName = "break_weigh_"..ver.."methbag01"}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
{ hash = "xm3_prop_xm3_bag_coke_01a", animName = "break_weigh_"..ver.."methbag01^1"},
|
||||||
|
{ hash = "xm3_prop_xm3_bag_coke_01a", animName = "break_weigh_"..ver.."methbag01^2"},
|
||||||
|
{ hash = "xm3_prop_xm3_bag_coke_01a", animName = "break_weigh_"..ver.."methbag01^3"}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
{ hash = "bkr_prop_coke_fullscoop_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"},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
local scenesList, entitiesList = {}, {}
|
||||||
|
for i=1, #scenes, 1 do
|
||||||
|
local scene = NetworkCreateSynchronisedScene(scenePos, sceneRot, 2, false, false, 1065353216, 0, 1.3)
|
||||||
|
NetworkAddPedToSynchronisedScene(peds['BagCoke'], 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(peds['BagCoke'])
|
||||||
|
FreezeEntityPosition(peds['BagCoke'], 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(peds['BagCoke'], false)
|
||||||
|
if inside then
|
||||||
|
BagCoke(coords, offset, rotation)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
RegisterCommand('cocaineMake', function()
|
||||||
|
inside = true
|
||||||
|
CutCoke(vector3(1095.61, -3195.62, -39.13), vector3(-1.782227, 0.445068, -0.502701), vector3(0,0,0))
|
||||||
|
BagCoke(vector3(1093.16, -3195.78, -39.19), vector3(4.515137, 2.542969, -0.814194), vector3(0,0,180.0))
|
||||||
|
end)
|
||||||
|
|
||||||
|
local locs = ps.callback('md-drugs:server:GetCokeLabLocations')
|
||||||
|
|
||||||
|
for k, v in pairs (locs) do
|
||||||
|
v.coords = json.decode(v.coords)
|
||||||
|
local loc = vector3(v.coords.x, v.coords.y, v.coords.z)
|
||||||
|
ps.boxTarget('drugLabcoke'..k, loc, {},{
|
||||||
|
{
|
||||||
|
label = 'Purchase Lab',
|
||||||
|
action = function()
|
||||||
|
ps.debug(v)
|
||||||
|
end,
|
||||||
|
canInteract = function()
|
||||||
|
if v.owner then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label = 'Enter Lab',
|
||||||
|
action = function()
|
||||||
|
TriggerServerEvent('TestCokeLab', k)
|
||||||
|
insideLocation = k
|
||||||
|
end,
|
||||||
|
canInteract = function()
|
||||||
|
if v.owner == ps.getIdentifier() then return true end
|
||||||
|
if ps.tableContains(json.decode(v.allowedIn) or {}, ps.getIdentifier()) then return true end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label = 'Raid Lab',
|
||||||
|
action = function()
|
||||||
|
ps.debug(v)
|
||||||
|
end,
|
||||||
|
canInteract = function()
|
||||||
|
if v.owner and ps.getJobType() == 'leo' then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
ps.boxTarget('cokelabLeave', vector3(1088.64, -3187.21, -38.24), {length = 1.0, width = 1.0, height = 1.0, rotation = 180.0}, {
|
||||||
|
{
|
||||||
|
label = 'Leave Lab',
|
||||||
|
action = function()
|
||||||
|
inside = false
|
||||||
|
cocaineLab = false
|
||||||
|
TriggerServerEvent('RestoreCokeLab', insideLocation)
|
||||||
|
for k, v in pairs(peds) do
|
||||||
|
DeleteEntity(v)
|
||||||
|
end
|
||||||
|
labData = {}
|
||||||
|
end,
|
||||||
|
canInteract = function()
|
||||||
|
return inside and cocaineLab
|
||||||
|
end
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
local function getInputData()
|
||||||
|
if Config.TierSystem then
|
||||||
|
return {
|
||||||
|
{required = true, min = 0, type = 'number', title = ps.getLabel('coca_leaf'), max = ps.getItemCount('coca_leaf')},
|
||||||
|
{required = true, min = 0, type = 'number', title = ps.getLabel('bakingsoda'), max = ps.getItemCount('bakingsoda')},
|
||||||
|
{required = true, min = 0, type = 'number', title = ps.getLabel('loosecoke'), max = ps.getItemCount('loosecoke')},
|
||||||
|
{required = true, min = 0, type = 'number', title = ps.getLabel('loosecokestagetwo'), max = ps.getItemCount('loosecokestagetwo')},
|
||||||
|
{required = true, min = 0, type = 'number', title = ps.getLabel('loosecokestagethree'), max = ps.getItemCount('loosecokestagethree')},
|
||||||
|
{required = true, min = 0, type = 'number', title = ps.getLabel('empty_weed_bag'), max = ps.getItemCount('empty_weed_bag')},
|
||||||
|
}
|
||||||
|
end
|
||||||
|
return {
|
||||||
|
{required = true, min = 0, type = 'number', title = ps.getLabel('coca_leaf'), max = ps.getItemCount('coca_leaf')},
|
||||||
|
{required = true, min = 0, type = 'number', title = ps.getLabel('bakingsoda'), max = ps.getItemCount('bakingsoda')},
|
||||||
|
{required = true, min = 0, type = 'number', title = ps.getLabel('loosecoke'), max = ps.getItemCount('loosecoke')},
|
||||||
|
{required = true, min = 0, type = 'number', title = ps.getLabel('empty_weed_bag'), max = ps.getItemCount('empty_weed_bag')},
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
local function returnResults(data)
|
||||||
|
if Config.TierSystem then
|
||||||
|
local Items = {
|
||||||
|
coca_leaf = data[1] or 0,
|
||||||
|
bakingsoda = data[2] or 0,
|
||||||
|
loosecoke = data[3] or 0,
|
||||||
|
loosecokestagetwo = data[4] or 0,
|
||||||
|
loosecokestagethree = data[5] or 0,
|
||||||
|
empty_weed_bag = data[6] or 0,
|
||||||
|
}
|
||||||
|
for k, v in pairs (Items) do
|
||||||
|
if v == 0 then
|
||||||
|
Items[k] = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return Items
|
||||||
|
end
|
||||||
|
local Items = {
|
||||||
|
coca_leaf = data[1] or 0,
|
||||||
|
bakingsoda = data[2] or 0,
|
||||||
|
loosecoke = data[3] or 0,
|
||||||
|
empty_weed_bag = data[4] or 0,
|
||||||
|
}
|
||||||
|
for k, v in pairs (Items) do
|
||||||
|
if v == 0 then
|
||||||
|
Items[k] = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return Items
|
||||||
|
end
|
||||||
|
|
||||||
|
local function getDescript(employee)
|
||||||
|
local strings = ''
|
||||||
|
strings = strings .. 'Hiring Cost: $' .. employee.salary * 10 .. '\n'
|
||||||
|
strings = strings .. 'Salary: $'..employee.salary..'\n'
|
||||||
|
strings = strings .. 'Job: ' .. employee.type..'\n'
|
||||||
|
strings = strings .. 'Skills: \n'
|
||||||
|
for k, v in pairs (json.decode(employee.skills) or {}) do
|
||||||
|
strings = strings .. '- ' .. k .. ': ' .. v .. '\n'
|
||||||
|
end
|
||||||
|
return strings
|
||||||
|
end
|
||||||
|
local function openDrugLabMenu()
|
||||||
|
local options = {
|
||||||
|
{
|
||||||
|
title = 'Lab Management',
|
||||||
|
description = 'Manage the overall operations of your drug lab',
|
||||||
|
action = function()
|
||||||
|
local options = {
|
||||||
|
{
|
||||||
|
title = 'Add Funds',
|
||||||
|
description = 'Add money to your drug lab\'s budget',
|
||||||
|
action = function()
|
||||||
|
local input = ps.input('Enter the amount of money to add:', {
|
||||||
|
{type = 'number', min = 0, required = true}
|
||||||
|
})
|
||||||
|
if input and input[1] then
|
||||||
|
TriggerServerEvent('md-drugs:server:AddLabFunds', tonumber(input[1]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title = 'Withdraw Funds',
|
||||||
|
description = 'Withdraw money from your drug lab\'s budget',
|
||||||
|
action = function()
|
||||||
|
local input = ps.input('Enter the amount of money to withdraw:', {
|
||||||
|
{type = 'number', min = 0, required = true}
|
||||||
|
})
|
||||||
|
if input and input[1] then
|
||||||
|
TriggerServerEvent('md-drugs:server:WithdrawLabFunds', tonumber(input[1]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title = 'Give Access',
|
||||||
|
description = 'Grant other players access to your drug lab',
|
||||||
|
action = function()
|
||||||
|
local input = ps.input('Enter the player ID to give access:', {
|
||||||
|
{type = 'number', min = 1, required = true}
|
||||||
|
})
|
||||||
|
if input and input[1] then
|
||||||
|
TriggerServerEvent('md-drugs:server:GiveLabAccess', tonumber(input[1]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title = 'Revoke Access',
|
||||||
|
description = 'Remove other players\' access to your drug lab',
|
||||||
|
action = function()
|
||||||
|
local input = ps.input('Enter the player ID to revoke access:', {
|
||||||
|
{type = 'number', min = 1, required = true}
|
||||||
|
})
|
||||||
|
if input and input[1] then
|
||||||
|
TriggerServerEvent('md-drugs:server:RevokeLabAccess', tonumber(input[1]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ps.menu('Lab Management', 'Manage your drug lab', options)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title = 'Manage Employees',
|
||||||
|
description = 'View and manage your current drug lab employees',
|
||||||
|
action = function()
|
||||||
|
local options = {
|
||||||
|
{
|
||||||
|
title = 'Hire Employees',
|
||||||
|
description = 'Manage your drug lab employees',
|
||||||
|
action = function()
|
||||||
|
local employees = ps.callback('md-drugs:server:GetAvailableEmployees')
|
||||||
|
local options = {}
|
||||||
|
for k,v in pairs (employees) do
|
||||||
|
options[#options+1] = {
|
||||||
|
title = v.name,
|
||||||
|
description = getDescript(v),
|
||||||
|
action = function()
|
||||||
|
TriggerServerEvent('md-drugs:server:HireEmployee', v.id)
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
ps.menu('Drug Employees', 'Drug Employees', options)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title = 'Fire Employees',
|
||||||
|
description = 'Manage your drug lab employees',
|
||||||
|
action = function()
|
||||||
|
local employees = ps.callback('md-drugs:server:GetAvailableEmployees')
|
||||||
|
local options = {}
|
||||||
|
for k,v in pairs (employees) do
|
||||||
|
options[#options+1] = {
|
||||||
|
title = v.name,
|
||||||
|
description = getDescript(v),
|
||||||
|
action = function()
|
||||||
|
local input = ps.input('Are you sure you want to fire this employee?', {
|
||||||
|
{type = 'select', title = 'Confirm', options = {{label = 'Yes', value = true}, {label = 'No', value = false}}, required = true}
|
||||||
|
})
|
||||||
|
if input and input[1] == true then
|
||||||
|
TriggerServerEvent('md-drugs:server:FireEmployee', v.id)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
ps.menu('Drug Employees', 'Drug Employees', options)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title = 'Train Employees',
|
||||||
|
description = 'Improve the skills of your drug lab employees',
|
||||||
|
action = function()
|
||||||
|
local employees = ps.callback('md-drugs:server:GetAvailableEmployees')
|
||||||
|
local options = {}
|
||||||
|
for k,v in pairs (employees) do
|
||||||
|
options[#options+1] = {
|
||||||
|
title = v.name,
|
||||||
|
description = getDescript(v),
|
||||||
|
action = function()
|
||||||
|
TriggerServerEvent('md-drugs:server:TrainEmployee', v.id)
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
ps.menu('Train Employees', 'Select an employee to train', options)
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ps.menu('Manage Employees', 'Manage your drug lab employees', options)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title = 'Input Stock Management',
|
||||||
|
description = 'Manage the raw materials and supplies for your drug lab',
|
||||||
|
action = function()
|
||||||
|
local options = {
|
||||||
|
{
|
||||||
|
title = 'Input Stock',
|
||||||
|
description = 'Add raw materials to your drug lab inventory',
|
||||||
|
action = function()
|
||||||
|
local input = ps.input('Enter the amount of stock to add:',getInputData())
|
||||||
|
if not input or not input[1] then return end
|
||||||
|
TriggerServerEvent('md-drugs:server:cokeAddStock', returnResults(input))
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title = 'Take Drug Ingredients',
|
||||||
|
description = 'Withdraw finished products from your drug lab',
|
||||||
|
action = function()
|
||||||
|
local itemData = ps.callback('md-drugs:server:getCokeLabItemCount')
|
||||||
|
if not itemData.input or #itemData.input == 0 then
|
||||||
|
ps.notify('No drugs available to take.', 'error')
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local input = ps.input('Enter the amount of drugs to take:', itemData.input)
|
||||||
|
if not input or not input[1] then return end
|
||||||
|
local itemList = {}
|
||||||
|
for i = 1, #input do
|
||||||
|
local itemInfo = itemData.input[i]
|
||||||
|
local value = tonumber(input[i])
|
||||||
|
|
||||||
|
if not value or value < 0 then
|
||||||
|
ps.notify('Invalid amount entered.', 'error')
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if value > 0 and itemInfo and itemInfo.item then
|
||||||
|
itemList[itemInfo.item] = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
TriggerServerEvent('md-drugs:server:cokeTakeDrugs', itemList)
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ps.menu('Input Stock Management', 'Manage your drug lab\'s raw materials and supplies', options)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
ps.menu('Cocaine Lab Management', 'Cocaine Lab Management', options)
|
||||||
|
end
|
||||||
|
|
||||||
|
ps.boxTarget('cokeLabManagement', vector3(1099.67, -3193.13, -38.99), {length = 1.0, width = 1.0, height = 1.0, rotation = 0.0}, {
|
||||||
|
{
|
||||||
|
label = 'Open Coke Management',
|
||||||
|
action = function()
|
||||||
|
openDrugLabMenu()
|
||||||
|
end,
|
||||||
|
canInteract = function()
|
||||||
|
if inside and cocaineLab and ps.getIdentifier() == labData.owner then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
if labData and labData.allowedIn and ps.tableContains(labData.allowedIn, ps.getIdentifier()) then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
RegisterNetEvent('md-drugs:client:EnterCokeLab', function(data)
|
||||||
|
inside = true
|
||||||
|
cocaineLab = true
|
||||||
|
labData = data
|
||||||
|
labData.coords = json.decode(labData.coords)
|
||||||
|
labData.allowedIn = json.decode(labData.allowedIn) or {}
|
||||||
|
labData.employees = json.decode(labData.employees) or {}
|
||||||
|
for k, v in pairs (labData.employees) do
|
||||||
|
if v.type == 'packer' then
|
||||||
|
BagCoke(vector3(1093.16, -3195.78, -39.19), vector3(4.515137, 2.542969, -0.814194), vector3(0,0,180.0))
|
||||||
|
end
|
||||||
|
if v.type == 'mixer' then
|
||||||
|
CutCoke(vector3(1095.61, -3195.62, -39.13), vector3(-1.782227, 0.445068, -0.502701), vector3(0,0,0))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
@@ -1,14 +1,13 @@
|
|||||||
if not Config.Drugs['consumables'] then return end
|
|
||||||
|
|
||||||
Bridge.Callback.Register('md-drugs:client:consumedrugs', function(time, effect, anim, progresstext, status, item)
|
|
||||||
Bridge.Anim.RequestDict(anim.dict)
|
ps.registerCallback('md-drugs:client:consumedrugs', function(time, effect, anim, progresstext, status, item)
|
||||||
if not progressbar(progresstext .. Bridge.Inventory.GetItemInfo(item).label.. "!", time, anim ) then return end
|
if not progressbar(progresstext .. ps.getLabel(item).. "!", time, anim ) then return end
|
||||||
for k, v in pairs (status) do
|
for k, v in pairs (status) do
|
||||||
if k == 'health' then
|
if k == 'health' then
|
||||||
local cur = GetEntityHealth(PlayerPedId())
|
local cur = GetEntityHealth(PlayerPedId())
|
||||||
SetEntityHealth(PlayerPedId(), cur + v)
|
SetEntityHealth(PlayerPedId(), cur + v)
|
||||||
elseif k == 'thirst' or k == 'stress' or k == 'hunger' then
|
elseif k == 'thirst' or k == 'stress' or k == 'hunger' then
|
||||||
TriggerServerEvent('md-drugs:server:updatestatus', k, v)
|
TriggerServerEvent('md-drugs:server:updatestatus', k, v)
|
||||||
elseif k == "armor" then
|
elseif k == "armor" then
|
||||||
TriggerServerEvent('hospital:server:SetArmor', v)
|
TriggerServerEvent('hospital:server:SetArmor', v)
|
||||||
TriggerServerEvent('consumables:server:useArmor')
|
TriggerServerEvent('consumables:server:useArmor')
|
||||||
@@ -34,113 +33,28 @@ RegisterNetEvent('md-drugs:client:recievebuff', function(type, amount)
|
|||||||
until count == amount
|
until count == amount
|
||||||
SetRunSprintMultiplierForPlayer(PlayerPedId(), 1.00)
|
SetRunSprintMultiplierForPlayer(PlayerPedId(), 1.00)
|
||||||
end
|
end
|
||||||
if type == 'strength' then
|
if type == 'strength' then
|
||||||
local strength = 0
|
local strength = 0
|
||||||
SetCurrentPedWeapon(PlayerPedId(), 'weapon_unarmed', true)
|
SetCurrentPedWeapon(PlayerPedId(), 'weapon_unarmed', true)
|
||||||
SetWeaponDamageModifier(GetHashKey("WEAPON_UNARMED"), 50.0)
|
SetWeaponDamageModifier(GetHashKey("WEAPON_UNARMED"), 50.0)
|
||||||
repeat
|
repeat
|
||||||
strength = strength + 1
|
strength = strength + 1
|
||||||
Wait(1000)
|
Wait(1000)
|
||||||
until strength == amount
|
until strength == amount
|
||||||
SetWeaponDamageModifier(GetHashKey("WEAPON_UNARMED"), 1.0)
|
SetWeaponDamageModifier(GetHashKey("WEAPON_UNARMED"), 1.0)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local function EcstasyEffect()
|
|
||||||
local startStamina = 50
|
|
||||||
SetFlash(0, 0, 500, 20000, 500)
|
|
||||||
while startStamina > 0 do
|
|
||||||
Wait(1000)
|
|
||||||
startStamina = startStamina - 1
|
|
||||||
RestorePlayerStamina(PlayerId(), 1.0)
|
|
||||||
if math.random(1, 100) < 51 then
|
|
||||||
SetFlash(0, 0, 500, 7000, 500)
|
|
||||||
ShakeGameplayCam('SMALL_EXPLOSION_SHAKE', 0.08)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if IsPedRunning(PlayerPedId()) then
|
|
||||||
SetPedToRagdoll(PlayerPedId(), math.random(1000, 3000), math.random(1000, 3000), 3, 0, 0, 0)
|
|
||||||
end
|
|
||||||
startStamina = 0
|
|
||||||
end
|
|
||||||
|
|
||||||
local function TrevorEffect()
|
|
||||||
StartScreenEffect("DrugsTrevorClownsFightIn", 3.0, 0)
|
|
||||||
Wait(3000)
|
|
||||||
StartScreenEffect("DrugsTrevorClownsFight", 3.0, 0)
|
|
||||||
Wait(3000)
|
|
||||||
StartScreenEffect("DrugsTrevorClownsFightOut", 3.0, 0)
|
|
||||||
StopScreenEffect("DrugsTrevorClownsFight")
|
|
||||||
StopScreenEffect("DrugsTrevorClownsFightIn")
|
|
||||||
StopScreenEffect("DrugsTrevorClownsFightOut")
|
|
||||||
end
|
|
||||||
|
|
||||||
local function MethBagEffect()
|
|
||||||
local startStamina = 30
|
|
||||||
TrevorEffect()
|
|
||||||
SetRunSprintMultiplierForPlayer(PlayerId(), 1.49)
|
|
||||||
while startStamina > 0 do
|
|
||||||
Wait(1000)
|
|
||||||
if math.random(5, 100) < 10 then
|
|
||||||
RestorePlayerStamina(PlayerId(), 1.0)
|
|
||||||
end
|
|
||||||
startStamina = startStamina - 1
|
|
||||||
if math.random(5, 100) < 51 then
|
|
||||||
TrevorEffect()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
startStamina = 0
|
|
||||||
SetRunSprintMultiplierForPlayer(PlayerId(), 1.0)
|
|
||||||
end
|
|
||||||
|
|
||||||
local function AlienEffect()
|
|
||||||
StartScreenEffect("DrugsMichaelAliensFightIn", 3.0, 0)
|
|
||||||
Wait(math.random(5000, 8000))
|
|
||||||
StartScreenEffect("DrugsMichaelAliensFight", 3.0, 0)
|
|
||||||
Wait(math.random(5000, 8000))
|
|
||||||
StartScreenEffect("DrugsMichaelAliensFightOut", 3.0, 0)
|
|
||||||
StopScreenEffect("DrugsMichaelAliensFightIn")
|
|
||||||
StopScreenEffect("DrugsMichaelAliensFight")
|
|
||||||
StopScreenEffect("DrugsMichaelAliensFightOut")
|
|
||||||
end
|
|
||||||
|
|
||||||
local function CokeBaggyEffect()
|
|
||||||
local startStamina = 20
|
|
||||||
local ped = PlayerPedId()
|
|
||||||
AlienEffect()
|
|
||||||
SetRunSprintMultiplierForPlayer(PlayerId(), 1.1)
|
|
||||||
while startStamina > 0 do
|
|
||||||
Wait(1000)
|
|
||||||
if math.random(1, 100) < 20 then
|
|
||||||
RestorePlayerStamina(PlayerId(), 1.0)
|
|
||||||
end
|
|
||||||
startStamina = startStamina - 1
|
|
||||||
if math.random(1, 100) < 10 and IsPedRunning(ped) then
|
|
||||||
SetPedToRagdoll(ped, math.random(1000, 3000), math.random(1000, 3000), 3, 0, 0, 0)
|
|
||||||
end
|
|
||||||
if math.random(1, 300) < 10 then
|
|
||||||
AlienEffect()
|
|
||||||
Wait(math.random(3000, 6000))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if IsPedRunning(ped) then
|
|
||||||
SetPedToRagdoll(ped, math.random(1000, 3000), math.random(1000, 3000), 3, 0, 0, 0)
|
|
||||||
end
|
|
||||||
|
|
||||||
startStamina = 0
|
|
||||||
SetRunSprintMultiplierForPlayer(PlayerId(), 1.0)
|
|
||||||
end
|
|
||||||
|
|
||||||
RegisterNetEvent('md-drugs:client:applyFeeling', function(effect)
|
RegisterNetEvent('md-drugs:client:applyFeeling', function(effect)
|
||||||
if effect == "alien" then
|
if effect == "alien" then
|
||||||
AlienEffect()
|
AlienEffect()
|
||||||
elseif effect == "ecstacy" then
|
elseif effect == "ecstacy" then
|
||||||
EcstasyEffect()
|
EcstasyEffect()
|
||||||
elseif effect == "meth" then
|
elseif effect == "meth" then
|
||||||
MethBagEffect()
|
MethBagEffect()
|
||||||
elseif effect == "coke" then
|
elseif effect == "coke" then
|
||||||
CokeBaggyEffect()
|
CokeBaggyEffect()
|
||||||
elseif effect == "trevor" then
|
elseif effect == "trevor" then
|
||||||
TrevorEffect()
|
TrevorEffect()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
@@ -9,62 +9,31 @@ end
|
|||||||
|
|
||||||
local function sellDrug(item, amount, price, targ)
|
local function sellDrug(item, amount, price, targ)
|
||||||
PoliceCall(20)
|
PoliceCall(20)
|
||||||
if IsPedInAnyVehicle(PlayerPedId(), true) then
|
if ps.vehicleData() then
|
||||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('Cornerselling.inVeh'), 'error')
|
ps.notify(ps.lang('Cornerselling.inVeh'), 'error')
|
||||||
walkAway(targ)
|
walkAway(targ)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if not progressbar(Bridge.Language.Locale('Cornerselling.selling', Bridge.Inventory.GetItemInfo(item).label, price)) then
|
if not ps.progressbar(string.format(ps.lang('Cornerselling.selling', ps.getLabel(item), price)), 4000, 'uncuff') then walkAway(targ) return end
|
||||||
walkAway(targ)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
buyers[targ] = 'sold'
|
buyers[targ] = 'sold'
|
||||||
TriggerServerEvent('md-drugs:server:sellCornerDrugs', item, amount, price, NetworkGetNetworkIdFromEntity(targ))
|
TriggerServerEvent('md-drugs:server:sellCornerDrugs', item, amount, price)
|
||||||
walkAway(targ)
|
walkAway(targ)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function deny(targ)
|
local function deny(targ)
|
||||||
PoliceCall(20)
|
PoliceCall(20)
|
||||||
buyers[targ] = 'sold'
|
buyers[targ] = 'sold'
|
||||||
if not progressbar(Bridge.Language.Locale('Cornerselling.deny'), 4000, {
|
if not ps.progressbar(ps.lang('Cornerselling.deny'), 4000, 'argue5') then return end
|
||||||
dict = 'anim@amb@casino@brawl@fights@argue@',
|
|
||||||
clip = 'arguement_loop_mp_m_brawler_01',
|
|
||||||
flag = 49
|
|
||||||
}) then return end
|
|
||||||
walkAway(targ)
|
walkAway(targ)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function getClosestPed()
|
|
||||||
local coords = GetEntityCoords(PlayerPedId())
|
|
||||||
local distance = 10.0
|
|
||||||
local pedList = GetGamePool('CPed')
|
|
||||||
local closestDistance = 1000.0
|
|
||||||
local PED = nil
|
|
||||||
for i = 1, #pedList do
|
|
||||||
local ped = pedList[i]
|
|
||||||
if ped ~= PlayerPedId() then
|
|
||||||
local pedCoords = GetEntityCoords(ped)
|
|
||||||
local dist = #(coords - pedCoords)
|
|
||||||
if dist < closestDistance then
|
|
||||||
PED = ped
|
|
||||||
closestDistance = dist
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if PED and closestDistance < distance then
|
|
||||||
return PED, closestDistance
|
|
||||||
else
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local function findPed()
|
local function findPed()
|
||||||
local targ = nil
|
local targ = nil
|
||||||
|
|
||||||
repeat
|
repeat
|
||||||
Wait(100)
|
Wait(100)
|
||||||
targ = getClosestPed()
|
targ = ps.getNearestPed(GetEntityCoords(PlayerPedId()), 8)
|
||||||
|
|
||||||
if IsPedInAnyVehicle(targ, false) or GetEntityHealth(targ) == 0 or not IsPedHuman(targ) then
|
if IsPedInAnyVehicle(targ, false) or GetEntityHealth(targ) == 0 or not IsPedHuman(targ) then
|
||||||
targ = nil
|
targ = nil
|
||||||
end
|
end
|
||||||
@@ -74,22 +43,19 @@ local function findPed()
|
|||||||
if inZone then
|
if inZone then
|
||||||
targ = nil
|
targ = nil
|
||||||
end
|
end
|
||||||
until targ ~= nil or sell == false
|
until targ ~= nil
|
||||||
|
|
||||||
if not sell then return end
|
|
||||||
buyers[targ] = true
|
buyers[targ] = true
|
||||||
|
|
||||||
Bridge.HelpText.ShowHelpText(Bridge.Language.Locale('Cornerselling.wait'))
|
ps.drawText(ps.lang('Cornerselling.wait'))
|
||||||
|
|
||||||
repeat
|
repeat
|
||||||
Wait(1000)
|
Wait(1000)
|
||||||
TaskGoToCoordAnyMeans(targ, GetEntityCoords(PlayerPedId()), 1.0, 0, 0, 0, 0)
|
TaskGoToCoordAnyMeans(targ, GetEntityCoords(PlayerPedId()), 1.0, 0, 0, 0, 0)
|
||||||
until #(GetEntityCoords(PlayerPedId()) - GetEntityCoords(targ)) < 2.0 or sell == false or inZone
|
until #(GetEntityCoords(PlayerPedId()) - GetEntityCoords(targ)) < 2.0
|
||||||
|
|
||||||
if not sell then return end
|
|
||||||
|
|
||||||
TaskTurnPedToFaceEntity(targ, PlayerPedId(), -1)
|
TaskTurnPedToFaceEntity(targ, PlayerPedId(), -1)
|
||||||
Bridge.HelpText.HideHelpText()
|
ps.hideText()
|
||||||
CreateThread(function()
|
CreateThread(function()
|
||||||
Wait(45000)
|
Wait(45000)
|
||||||
walkAway(targ)
|
walkAway(targ)
|
||||||
@@ -99,17 +65,14 @@ local function findPed()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function checkItems()
|
local function checkItems()
|
||||||
local has = false
|
local count = 0
|
||||||
for k, v in pairs (GlobalState.DrugNames) do
|
for k, v in pairs (GlobalState.DrugNames) do
|
||||||
if Bridge.Inventory.HasItem(v) then
|
if ps.hasItem(v) then
|
||||||
has = true
|
count = count + 1
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if not has then
|
if count == 0 then ps.notify(ps.lang('Cornerselling.nodrugs', 'error')) return false end
|
||||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('Cornerselling.nodrugs', 'error'))
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -126,10 +89,10 @@ local function Cornersell()
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
Bridge.HelpText.ShowHelpText(Bridge.Language.Locale('Cornerselling.searching'))
|
ps.drawText(ps.lang('Cornerselling.searching'))
|
||||||
|
|
||||||
local targ = findPed()
|
local targ = findPed()
|
||||||
local data = Bridge.Callback.Trigger('md-drugs:server:cornerselling:getAvailableDrugs', NetworkGetNetworkIdFromEntity(targ))
|
local data = ps.callback('md-drugs:server:cornerselling:getAvailableDrugs', targ)
|
||||||
if data == false then
|
if data == false then
|
||||||
sell = false
|
sell = false
|
||||||
return
|
return
|
||||||
@@ -139,13 +102,13 @@ local function Cornersell()
|
|||||||
TaskGoStraightToCoord(targ, -1858.232910, -1242.395630, 8.60510, 100.0, -1, 0.0, 0.0)
|
TaskGoStraightToCoord(targ, -1858.232910, -1242.395630, 8.60510, 100.0, -1, 0.0, 0.0)
|
||||||
SetPedMoveRateOverride(targ, 10.0)
|
SetPedMoveRateOverride(targ, 10.0)
|
||||||
local got = false
|
local got = false
|
||||||
Bridge.Target.AddLocalEntity(targ, {
|
ps.entityTarget(targ, {
|
||||||
{
|
{
|
||||||
label = Bridge.Language.Locale('Cornerselling.targetTakeBack'),
|
label = ps.lang('Cornerselling.targetTakeBack'),
|
||||||
icon = Bridge.Language.Locale("Cornerselling.targetTakeBackIcon"),
|
icon ="fa-solid fa-money-bill",
|
||||||
action = function()
|
action = function()
|
||||||
got = true
|
got = true
|
||||||
TriggerServerEvent('md-drugs:server:getBackRobbed', NetworkGetNetworkIdFromEntity(targ))
|
TriggerServerEvent('md-drugs:server:getBackRobbed')
|
||||||
Cornersell()
|
Cornersell()
|
||||||
end,
|
end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
@@ -153,17 +116,15 @@ local function Cornersell()
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
}
|
}}, nil)
|
||||||
})
|
|
||||||
targets[#targets+1] = targ
|
|
||||||
else
|
else
|
||||||
Bridge.Anim.RequestDict("rcmme_tracey1")
|
ps.requestAnim("rcmme_tracey1")
|
||||||
TaskStartScenarioInPlace(targ, "WORLD_HUMAN_STAND_IMPATIENT_UPRIGHT", 0, false)
|
TaskStartScenarioInPlace(targ, "WORLD_HUMAN_STAND_IMPATIENT_UPRIGHT", 0, false)
|
||||||
FreezeEntityPosition(targ, true)
|
FreezeEntityPosition(targ, true)
|
||||||
Bridge.Target.AddLocalEntity(targ, {
|
ps.entityTarget(targ, {
|
||||||
{
|
{
|
||||||
label = Bridge.Language.Locale('Cornerselling.targetSell', data.amount, Bridge.Inventory.GetItemInfo(data.item).label, data.price),
|
label = string.format(ps.lang('Cornerselling.targetSell'), data.amount, ps.getLabel(data.item), data.price),
|
||||||
icon = Bridge.Language.Locale("Cornerselling.targetSellIcon"),
|
icon ="fa-solid fa-money-bill",
|
||||||
action = function()
|
action = function()
|
||||||
sellDrug(data.item, data.amount, data.price, targ)
|
sellDrug(data.item, data.amount, data.price, targ)
|
||||||
Cornersell()
|
Cornersell()
|
||||||
@@ -175,8 +136,8 @@ local function Cornersell()
|
|||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label = Bridge.Language.Locale('Cornerselling.targetDeny'),
|
label = ps.lang('Cornerselling.targetDeny'),
|
||||||
icon = Bridge.Language.Locale("Cornerselling.targetDenyIcon"),
|
icon = "fa-solid fa-person-harassing",
|
||||||
action = function()
|
action = function()
|
||||||
deny(targ)
|
deny(targ)
|
||||||
walkAway(targ)
|
walkAway(targ)
|
||||||
@@ -189,39 +150,24 @@ local function Cornersell()
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = targ
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
RegisterNetEvent('md-drugs:client:cornerselling', function()
|
RegisterNetEvent('md-drugs:client:cornerselling', function()
|
||||||
if inZone then
|
|
||||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('Cornerselling.inNoSellZone'), 'error')
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if sell then
|
if sell then
|
||||||
sell = false
|
sell = false
|
||||||
Bridge.HelpText.HideHelpText()
|
ps.hideText()
|
||||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('Cornerselling.stopped'), 'error')
|
ps.notify(ps.lang('Cornerselling.stopped'), 'error')
|
||||||
else
|
else
|
||||||
sell = true
|
sell = true
|
||||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('Cornerselling.start'), 'success')
|
ps.notify(ps.lang('Cornerselling.start'), 'success')
|
||||||
Cornersell()
|
Cornersell()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
CreateThread(function()
|
CreateThread(function()
|
||||||
for k, v in pairs (Config.Cornerselling.noSellZones) do
|
for k, v in pairs (QBConfig.NoSellZones) do
|
||||||
Bridge.Point.Register(
|
local box = ps.zones.box({ coords = v.loc, size = vec3(v.width, v.length, v.height), rotation = 180.0, debug = false,
|
||||||
'MDDRUGNOSELLZONE'..k,
|
onEnter = function() inZone = true end, onExit = function() inZone = false end})
|
||||||
v.loc,
|
|
||||||
((v.width or 10.0) + (v.length or 10.0)) / 2,
|
|
||||||
nil,
|
|
||||||
function()
|
|
||||||
inZone = true
|
|
||||||
end,
|
|
||||||
function(point, data)
|
|
||||||
inZone = false
|
|
||||||
end
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
@@ -1,17 +1,20 @@
|
|||||||
local locations = Config.Crack.Locations
|
local locations = ps.callback('md-drugs:server:GetCrackLocations')
|
||||||
|
|
||||||
for k, v in pairs (locations.makecrack) do
|
for k, v in pairs (locations.makecrack) do
|
||||||
Bridge.Target.AddBoxZone('makeCrack'..k, v.loc, v.size, v.loc.w or 180.0, {
|
ps.boxTarget('makeCrack'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
|
||||||
{
|
{
|
||||||
label = Bridge.Language.Locale('crack.targetMake'),
|
label = ps.lang('crack.targetMake'),
|
||||||
icon = Bridge.Language.Locale('crack.makeIcon'),
|
icon = 'fa-solid fa-temperature-high',
|
||||||
action = function()
|
action = function()
|
||||||
if not itemCheck('bakingsoda') then return end
|
if not ps.hasItem('bakingsoda') then
|
||||||
|
ps.notify(ps.lang('Catches.itemMissings', ps.getLabel('bakingsoda')), 'error')
|
||||||
|
return
|
||||||
|
end
|
||||||
if not minigame() then
|
if not minigame() then
|
||||||
TriggerServerEvent("md-drugs:server:failcrackone", k)
|
TriggerServerEvent("md-drugs:server:failcrackone", k)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if not progressbar(Bridge.Language.Locale('crack.cook')) then return end
|
if not ps.progressbar(ps.lang('crack.cook'), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent('md-drugs:server:makecrackone', k)
|
TriggerServerEvent('md-drugs:server:makecrackone', k)
|
||||||
end,
|
end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
@@ -20,17 +23,19 @@ for k, v in pairs (locations.makecrack) do
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = 'makeCrack'..k
|
|
||||||
end
|
end
|
||||||
|
|
||||||
for k, v in pairs (locations.bagcrack) do
|
for k, v in pairs (locations.bagcrack) do
|
||||||
Bridge.Target.AddBoxZone('bagCrack'..k, v.loc, v.size, v.loc.w or 180.0, {
|
ps.boxTarget('bagCrack'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
|
||||||
{
|
{
|
||||||
label = Bridge.Language.Locale('crack.targetBag'),
|
label = ps.lang('crack.targetBag'),
|
||||||
icon = Bridge.Language.Locale('crack.bagIcon'),
|
icon = 'fa-solid fa-weight-scale',
|
||||||
action = function()
|
action = function()
|
||||||
if not itemCheck('empty_weed_bag') then return end
|
if not ps.hasItem('empty_weed_bag') then
|
||||||
if not progressbar(Bridge.Language.Locale('crack.bag')) then return end
|
ps.notify(ps.lang('Catches.itemMissings', ps.getLabel('empty_weed_bag')), 'error')
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if not ps.progressbar(ps.lang('crack.bag'), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:bagcrack", k)
|
TriggerServerEvent("md-drugs:server:bagcrack", k)
|
||||||
end,
|
end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
@@ -39,5 +44,4 @@ for k, v in pairs (locations.bagcrack) do
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = 'bagCrack'..k
|
|
||||||
end
|
end
|
||||||
@@ -1,83 +1,79 @@
|
|||||||
if not Config.Drugs['deliveries'] then return end
|
local isActive = false
|
||||||
local dealer = {}
|
local dealer = {}
|
||||||
local buyer = nil
|
|
||||||
|
|
||||||
repeat Wait(100) until GlobalState.MDDrugDealers ~= nil
|
|
||||||
|
|
||||||
local function SpawnDealer()
|
local function SpawnDealer()
|
||||||
if #dealer >= 1 then
|
local getDealers = ps.callback('md-drugs:server:getDealers')
|
||||||
for k,v in pairs (dealer) do
|
for k,v in pairs(getDealers) do
|
||||||
DeletePed(v)
|
local Ped = "g_m_y_famdnf_01"
|
||||||
end
|
ps.requestModel(Ped, Config.RequestModelTime)
|
||||||
dealer = {}
|
local loc = json.decode(v.coords)
|
||||||
end
|
dealer[k] = CreatePed(0, Ped,loc.x,loc.y, loc.z-1, loc.h, false, false)
|
||||||
for k,v in pairs(GlobalState.MDDrugDealers) do
|
Freeze(dealer[k], true, loc.h)
|
||||||
requestModel(v.model)
|
ps.entityTarget(dealer[k], {
|
||||||
dealer[k] = CreatePed(0, v.model, v.coords.x, v.coords.y, v.coords.z-1, v.coords.w, false, false)
|
|
||||||
Freeze(dealer[k], true, v.coords.w)
|
|
||||||
Bridge.Target.AddLocalEntity(dealer[k], {
|
|
||||||
{
|
{
|
||||||
icon = Bridge.Language.Locale('Deliveries.targetGetDelIcon'),
|
icon = 'fas fa-user-secret',
|
||||||
label = Bridge.Language.Locale('Deliveries.targetGetDel'),
|
label = ps.lang('Deliveries.targetGetDel'),
|
||||||
action = function()
|
action = function()
|
||||||
TriggerServerEvent('md-drugs:server:requestDelivery', k)
|
local bool, item, amount, coords = ps.callback('md-drugs:server:GetDeliveryItem', false, k)
|
||||||
|
if bool then
|
||||||
|
TriggerEvent('md-drugs:client:setLocation', {bool = bool, item = item, amount = amount, coords = coords})
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon = Bridge.Language.Locale('Deliveries.targetOpenShopIcon'),
|
icon = "fa-solid fa-store",
|
||||||
label = Bridge.Language.Locale('Deliveries.targetOpenShop'),
|
label = ps.lang('Deliveries.targetOpenShop'),
|
||||||
action = function()
|
action = function()
|
||||||
local rep = GetRep()
|
local rep = GetRep()
|
||||||
|
local items = ps.callback('md-drugs:server:dealerList')
|
||||||
local options = {}
|
local options = {}
|
||||||
for m, d in pairs (Config.Deliveries.Recipes) do
|
for m, d in pairs (items) do
|
||||||
if rep.dealerrep >= d.minrep then
|
if rep.dealerrep >= d.minrep then
|
||||||
options[#options+1] = {
|
options[#options+1] = {
|
||||||
title = Bridge.Inventory.GetItemInfo(d.name).label,
|
title = ps.getLabel(d.name),
|
||||||
description = '$' .. d.price,
|
description = '$' .. d.price,
|
||||||
icon = Bridge.Inventory.GetItemInfo(d.name).image,
|
icon = ps.getImage(d.name),
|
||||||
onSelect = function()
|
action = function()
|
||||||
TriggerServerEvent('md-drugs:server:buyItemDealer', m, k)
|
TriggerServerEvent('md-drugs:server:buyItemDealer', m)
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Bridge.Menu.Open({
|
ps.menu(ps.lang('Deliveries.shopHeader'), ps.lang('Deliveries.shopHeader'), options)
|
||||||
id = 'DealerMenu',
|
|
||||||
title = Bridge.Language.Locale('Deliveries.shopHeader'),
|
|
||||||
description = Bridge.Language.Locale('Deliveries.shopHeader'),
|
|
||||||
options = options
|
|
||||||
})
|
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
SpawnDealer()
|
|
||||||
|
|
||||||
RegisterNetEvent('md-drugs:client:RefreshDealers', function()
|
RegisterNetEvent('md-drugs:client:RefreshDealers', function()
|
||||||
SpawnDealer()
|
SpawnDealer()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
CreateThread(function()
|
||||||
|
SpawnDealer()
|
||||||
|
end)
|
||||||
|
|
||||||
RegisterNetEvent('md-drugs:client:setLocation', function(data)
|
RegisterNetEvent('md-drugs:client:setLocation', function(data)
|
||||||
if buyer then
|
local coord = json.decode(data.coords)
|
||||||
DeletePed(buyer)
|
|
||||||
end
|
|
||||||
local coord = data.coords
|
|
||||||
SetNewWaypoint(coord.x, coord.y)
|
SetNewWaypoint(coord.x, coord.y)
|
||||||
requestModel("g_m_y_famdnf_01")
|
if isActive then return end
|
||||||
buyer = CreatePed(0, "g_m_y_famdnf_01",coord.x, coord.y, coord.z-1, coord.w, false, false)
|
isActive = true
|
||||||
Freeze(buyer, true, coord.w)
|
local Buyer = CreatePed(0, "g_m_y_famdnf_01",coord.x, coord.y, coord.z-1, coord.w, false, false)
|
||||||
Bridge.Target.AddLocalEntity(buyer , {
|
Freeze(Buyer, true, coord.w)
|
||||||
{
|
ps.entityTarget(Buyer, {
|
||||||
icon = Bridge.Language.Locale('Deliveries.targetHandOffIcon'),
|
icon = 'fas fa-user-secret',
|
||||||
label = Bridge.Language.Locale('Deliveries.targetHandOff'),
|
label = ps.lang('Deliveries.targetHandOff'),
|
||||||
action = function()
|
action = function()
|
||||||
if not progressbar(Bridge.Language.Locale('Deliveries.delivering')) then return end
|
if not progressbar(ps.lang('Deliveries.delivering'), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent('md-drugs:server:giveDeliveryItems')
|
isActive = false
|
||||||
Wait(400)
|
DeletePed(Buyer)
|
||||||
DeletePed(buyer)
|
TriggerServerEvent('md-drugs:server:giveDeliveryItems', data.item, data.amount)
|
||||||
end,
|
end,
|
||||||
}
|
canInteract = function()
|
||||||
})
|
if isActive then
|
||||||
end)
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
}, nil)
|
||||||
|
end)
|
||||||
@@ -1,18 +1,16 @@
|
|||||||
|
|
||||||
local minigametype = Config.minigametype
|
local minigametype = Config.minigametype
|
||||||
|
local dispatch = Config.Dispatch
|
||||||
|
|
||||||
function requestModel(ped, timeout)
|
|
||||||
timeout = timeout or 15000
|
function loadParticle(dict)
|
||||||
local startTime = GetGameTimer()
|
if not HasNamedPtfxAssetLoaded(dict) then
|
||||||
RequestModel(ped)
|
RequestNamedPtfxAsset(dict)
|
||||||
while not HasModelLoaded(ped) do
|
|
||||||
Wait(0)
|
|
||||||
if GetGameTimer() - startTime > timeout then
|
|
||||||
Bridge.Prints.Debug('requestModel timed out', ped, GetGameTimer() - startTime)
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
return true
|
while not HasNamedPtfxAssetLoaded(dict) do
|
||||||
|
Wait(0)
|
||||||
|
end
|
||||||
|
SetPtfxAssetNextCall(dict)
|
||||||
end
|
end
|
||||||
|
|
||||||
function minigame()
|
function minigame()
|
||||||
@@ -88,34 +86,59 @@ function minigame()
|
|||||||
Wait(1000)
|
Wait(1000)
|
||||||
time = time + 1
|
time = time + 1
|
||||||
until successes or time == 100
|
until successes or time == 100
|
||||||
elseif minigametype == 'none' then
|
elseif minigametype == 'none' then
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
print"^1 SCRIPT ERROR: Md-Drugs set your minigame with one of the options!"
|
print"^1 SCRIPT ERROR: Md-Drugs set your minigame with one of the options!"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function GetRep()
|
function GetRep()
|
||||||
local rep = Bridge.Callback.Trigger('md-drugs:server:GetRep')
|
local rep = ps.callback('md-drugs:server:GetRep')
|
||||||
return rep
|
return rep
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function sorter(sorting, value)
|
||||||
|
table.sort(sorting, function(a, b) return a[value] < b[value] end)
|
||||||
|
end
|
||||||
|
|
||||||
function PoliceCall(chance)
|
function PoliceCall(chance)
|
||||||
local math = math.random(1,100)
|
local math = math.random(1,100)
|
||||||
if math <= chance then
|
if math <= chance then
|
||||||
Bridge.Dispatch.SendAlert({
|
if dispatch == 'ps' then
|
||||||
message = Bridge.Language.Locale('Dispatch.header'),
|
exports['ps-dispatch']:DrugSale()
|
||||||
code = Bridge.Language.Locale('Dispatch.code'),
|
elseif dispatch == 'cd' then
|
||||||
coords = GetEntityCoords(PlayerPedId()),
|
local data = exports['cd_dispatch']:GetPlayerInfo()
|
||||||
jobs = {"police"},
|
TriggerServerEvent('cd_dispatch:AddNotification', {
|
||||||
blipData = {
|
job_table = {'police', },
|
||||||
sprite = 161,
|
coords = data.coords,
|
||||||
color = 1,
|
title = '420-69 Drug Sale',
|
||||||
scale = 1.0
|
message = 'A '..data.sex..' robbing a store at '..data.street,
|
||||||
},
|
flash = 0,
|
||||||
time = 300000,
|
unique_id = data.unique_id,
|
||||||
icon = Bridge.Language.Locale('Dispatch.icon')
|
sound = 1,
|
||||||
})
|
blip = { sprite = 431, scale = 1.2, colour = 3, flashes = false, text = '420-69 Drug Sale', time = 5, radius = 0,}
|
||||||
|
})
|
||||||
|
elseif dispatch == 'core' then
|
||||||
|
exports['core_dispatch']:addCall("420-69", "Drugs Are Being Sold", {
|
||||||
|
{icon="fa-ruler", info="4.5 MILES"},
|
||||||
|
}, {GetEntityCoords(PlayerPedId())}, "police", 3000, 11, 5 )
|
||||||
|
elseif dispatch == 'aty' then
|
||||||
|
exports["aty_dispatch"]:SendDispatch('Drug Sale', '420-69', 40, {'police'})
|
||||||
|
elseif dispatch == 'qs' then
|
||||||
|
exports['qs-dispatch']:DrugSale()
|
||||||
|
elseif dispatch == 'codem' then
|
||||||
|
local Data = {
|
||||||
|
type = 'Drug Sale',
|
||||||
|
header = 'Someone Selling Drugs',
|
||||||
|
text = 'Hurry up and save the community',
|
||||||
|
code = '420-69',
|
||||||
|
}
|
||||||
|
exports['codem-dispatch']:CustomDispatch(Data)
|
||||||
|
else
|
||||||
|
print('Congrats, You Choose 0 of the options :)')
|
||||||
|
end
|
||||||
else
|
else
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@@ -123,10 +146,11 @@ end
|
|||||||
|
|
||||||
function GetCops(number)
|
function GetCops(number)
|
||||||
if number == 0 then return true end
|
if number == 0 then return true end
|
||||||
local amount = Bridge.Callback.Trigger('md-drugs:server:GetCoppers')
|
local amount = ps.callback('md-drugs:server:GetCoppers')
|
||||||
if amount >= number then return true else Bridge.Notify.SendNotify(string.format(Bridge.Language.Locale('Catches.YouNeedMoreCops'), number - amount), 'error') end
|
if amount >= number then return true else ps.notify('You Need '.. number - amount .. ' More Cops To Do This', 'error') end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function Freeze(entity, toggle, head)
|
function Freeze(entity, toggle, head)
|
||||||
SetEntityInvincible(entity, toggle)
|
SetEntityInvincible(entity, toggle)
|
||||||
SetEntityAsMissionEntity(entity, toggle, toggle)
|
SetEntityAsMissionEntity(entity, toggle, toggle)
|
||||||
@@ -135,55 +159,18 @@ function Freeze(entity, toggle, head)
|
|||||||
SetBlockingOfNonTemporaryEvents(entity, toggle)
|
SetBlockingOfNonTemporaryEvents(entity, toggle)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function RotationToDirection(rotation)
|
|
||||||
local adjustedRotation = {
|
|
||||||
x = (math.pi / 180) * rotation.x,
|
|
||||||
y = (math.pi / 180) * rotation.y,
|
|
||||||
z = (math.pi / 180) * rotation.z
|
|
||||||
}
|
|
||||||
local direction = {
|
|
||||||
x = -math.sin(adjustedRotation.z) * math.abs(math.cos(adjustedRotation.x)),
|
|
||||||
y = math.cos(adjustedRotation.z) * math.abs(math.cos(adjustedRotation.x)),
|
|
||||||
z = math.sin(adjustedRotation.x)
|
|
||||||
}
|
|
||||||
return direction
|
|
||||||
end
|
|
||||||
|
|
||||||
local function RayCastGamePlayCamera(distance)
|
|
||||||
local currentRenderingCam = false
|
|
||||||
if not IsGameplayCamRendering() then
|
|
||||||
currentRenderingCam = GetRenderingCam()
|
|
||||||
end
|
|
||||||
|
|
||||||
local cameraRotation = not currentRenderingCam and GetGameplayCamRot() or GetCamRot(currentRenderingCam, 2)
|
|
||||||
local cameraCoord = not currentRenderingCam and GetGameplayCamCoord() or GetCamCoord(currentRenderingCam)
|
|
||||||
local direction = RotationToDirection(cameraRotation)
|
|
||||||
local destination = {
|
|
||||||
x = cameraCoord.x + direction.x * distance,
|
|
||||||
y = cameraCoord.y + direction.y * distance,
|
|
||||||
z = cameraCoord.z + direction.z * distance
|
|
||||||
}
|
|
||||||
local _, hit, endCoords, surfaceNormal, entityHit = GetShapeTestResult(StartShapeTestRay(cameraCoord.x, cameraCoord.y, cameraCoord.z, destination.x, destination.y, destination.z, -1, PlayerPedId(), 0))
|
|
||||||
return _, hit, endCoords, surfaceNormal, entityHit
|
|
||||||
end
|
|
||||||
|
|
||||||
local function ray()
|
|
||||||
local _, hit, endCoords, surfaceNormal, entityHit = RayCastGamePlayCamera(1000.0)
|
|
||||||
return hit, endCoords, surfaceNormal, entityHit
|
|
||||||
end
|
|
||||||
|
|
||||||
local created = false
|
local created = false
|
||||||
local heading = 180.0
|
local heading = 180.0
|
||||||
function StartRay()
|
function StartRay()
|
||||||
local run = true
|
local run = true
|
||||||
local pedcoord = GetEntityCoords(PlayerPedId())
|
local pedcoord = GetEntityCoords(PlayerPedId())
|
||||||
requestModel('v_ret_ml_tablea', 30000)
|
ps.requestModel('v_ret_ml_tablea', 30000)
|
||||||
local table = CreateObject('v_ret_ml_tablea', pedcoord.x, pedcoord.y, pedcoord.z+1, heading, false, false)
|
local table = CreateObject('v_ret_ml_tablea', pedcoord.x, pedcoord.y, pedcoord.z+1, heading, false, false)
|
||||||
repeat
|
repeat
|
||||||
local hit, endCoords, surfaceNormal, entityHit = ray()
|
local hit, endCoords, surfaceNormal, entityHit = ps.raycast()
|
||||||
if not created then
|
if not created then
|
||||||
created = true
|
created = true
|
||||||
Bridge.HelpText.ShowHelpText([[[E] To Place
|
ps.drawText([[[E] To Place
|
||||||
[DEL] To Cancel
|
[DEL] To Cancel
|
||||||
[<-] To Move Left
|
[<-] To Move Left
|
||||||
[->] To Move Right]])
|
[->] To Move Right]])
|
||||||
@@ -200,7 +187,7 @@ function StartRay()
|
|||||||
heading = heading + 2
|
heading = heading + 2
|
||||||
end
|
end
|
||||||
if IsControlPressed(0, 38) then
|
if IsControlPressed(0, 38) then
|
||||||
Bridge.HelpText.HideHelpText()
|
ps.hideText()
|
||||||
run = false
|
run = false
|
||||||
DeleteObject(table)
|
DeleteObject(table)
|
||||||
created = false
|
created = false
|
||||||
@@ -208,7 +195,7 @@ function StartRay()
|
|||||||
end
|
end
|
||||||
|
|
||||||
if IsControlPressed(0, 178) then
|
if IsControlPressed(0, 178) then
|
||||||
Bridge.HelpText.HideHelpText()
|
ps.hideText()
|
||||||
run = false
|
run = false
|
||||||
created = false
|
created = false
|
||||||
DeleteObject(table)
|
DeleteObject(table)
|
||||||
@@ -221,13 +208,13 @@ end
|
|||||||
function StartRay2()
|
function StartRay2()
|
||||||
local run = true
|
local run = true
|
||||||
local pedcoord = GetEntityCoords(PlayerPedId())
|
local pedcoord = GetEntityCoords(PlayerPedId())
|
||||||
requestModel('bkr_prop_coke_press_01aa', 30000)
|
ps.requestModel('bkr_prop_coke_press_01aa', 30000)
|
||||||
local table = CreateObject('bkr_prop_coke_press_01aa', pedcoord.x, pedcoord.y, pedcoord.z+1, heading, false, false)
|
local table = CreateObject('bkr_prop_coke_press_01aa', pedcoord.x, pedcoord.y, pedcoord.z+1, heading, false, false)
|
||||||
repeat
|
repeat
|
||||||
local hit, endCoords, surfaceNormal, entityHit = ray()
|
local hit, endCoords, surfaceNormal, entityHit = ps.raycast()
|
||||||
if not created then
|
if not created then
|
||||||
created = true
|
created = true
|
||||||
Bridge.HelpText.ShowHelpText([[[E] To Place
|
ps.drawText([[[E] To Place
|
||||||
[DEL] To Cancel
|
[DEL] To Cancel
|
||||||
[<-] To Move Left
|
[<-] To Move Left
|
||||||
[->] To Move Right]])
|
[->] To Move Right]])
|
||||||
@@ -244,7 +231,7 @@ function StartRay2()
|
|||||||
heading = heading + 2
|
heading = heading + 2
|
||||||
end
|
end
|
||||||
if IsControlPressed(0, 38) then
|
if IsControlPressed(0, 38) then
|
||||||
Bridge.HelpText.HideHelpText()
|
ps.hideText()
|
||||||
run = false
|
run = false
|
||||||
DeleteObject(table)
|
DeleteObject(table)
|
||||||
created = false
|
created = false
|
||||||
@@ -252,7 +239,7 @@ function StartRay2()
|
|||||||
end
|
end
|
||||||
|
|
||||||
if IsControlPressed(0, 178) then
|
if IsControlPressed(0, 178) then
|
||||||
Bridge.HelpText.HideHelpText()
|
ps.hideText()
|
||||||
run = false
|
run = false
|
||||||
created = false
|
created = false
|
||||||
DeleteObject(table)
|
DeleteObject(table)
|
||||||
@@ -262,121 +249,27 @@ function StartRay2()
|
|||||||
until run == false
|
until run == false
|
||||||
end
|
end
|
||||||
|
|
||||||
Bridge.Callback.Register('md-drugs:client:uncuff', function(data)
|
|
||||||
if not progressbar(data) then return end
|
|
||||||
|
ps.registerCallback('md-drugs:client:uncuff', function(data)
|
||||||
|
if not progressbar(data, 4000, 'uncuff') then return end
|
||||||
return true
|
return true
|
||||||
end)
|
end)
|
||||||
|
|
||||||
RegisterCommand('DrugRep', function()
|
RegisterCommand('DrugRep', function()
|
||||||
if not Config.TierSystem then return end
|
if not Config.TierSystem then return end
|
||||||
local rep = GetRep()
|
local rep = ps.callback('md-drugs:server:GetRep', false)
|
||||||
Bridge.Menu.Open({
|
ps.menu('Drug Rep', 'Drug Rep', {
|
||||||
id = 'drugrep',
|
{icon = "fa-solid fa-face-flushed", title = 'Cocaine: '..rep.coke},
|
||||||
title = Bridge.Language.Locale('DrugRep.header'),
|
{icon = "fa-solid fa-syringe", title = 'Heroin: '..rep.heroin},
|
||||||
description = Bridge.Language.Locale('DrugRep.increased'),
|
{icon = "fa-solid fa-vial", title = 'LSD: '..rep.lsd},
|
||||||
options = {
|
{icon = "fa-solid fa-plug", title = 'Dealer: '..rep.dealerrep},
|
||||||
{icon = Bridge.Language.Locale('DrugRep.coke.icon'), title = Bridge.Language.Locale('DrugRep.coke.title', rep.coke)},
|
{icon = "fa-solid fa-money-bill", title = 'Corner Selling: ' .. rep.cornerselling.rep, description = 'Rank: ' .. rep.cornerselling.label }
|
||||||
{icon = Bridge.Language.Locale('DrugRep.heroin.icon'), title = Bridge.Language.Locale('DrugRep.heroin.title', rep.heroin)},
|
|
||||||
{icon = Bridge.Language.Locale('DrugRep.lsd.icon'), title = Bridge.Language.Locale('DrugRep.lsd.title', rep.lsd)},
|
|
||||||
{icon = Bridge.Language.Locale('DrugRep.dealerrep.icon'), title = Bridge.Language.Locale('DrugRep.dealerrep.title', rep.dealerrep)},
|
|
||||||
{icon = Bridge.Language.Locale('DrugRep.cornerselling.icon'), title = Bridge.Language.Locale('DrugRep.cornerselling.title', rep.cornerselling.rep), description = Bridge.Language.Locale('DrugRep.cornerselling.description', rep.cornerselling.label) }
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
end, false)
|
end, false)
|
||||||
|
|
||||||
if Bridge.Framework.GetResourceName() == 'es_extended' then
|
function handleGang(gang)
|
||||||
function handleGang(gang)
|
if gang == nil or gang == '' or gang == "" then return true end
|
||||||
return true
|
if ps.getGangName() == gang or gang == 1 then return true end
|
||||||
end
|
return false
|
||||||
else
|
end
|
||||||
function handleGang(gang)
|
|
||||||
if not gang then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
if #gang == 0 then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
local data = Bridge.Framework.GetPlayerData()
|
|
||||||
if not data.gang then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
return data.gang.name == gang
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if Config.Emotes == 'scully' then
|
|
||||||
function playEmote(emote)
|
|
||||||
exports.scully_emotemenu:playEmoteByCommand(emote, 0)
|
|
||||||
end
|
|
||||||
function stopEmote()
|
|
||||||
exports.scully_emotemenu:cancelEmote()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if Config.Emotes == 'dpemotes' then
|
|
||||||
function playEmote(emote)
|
|
||||||
TriggerEvent('animations:client:EmoteCommandStart', {emote})
|
|
||||||
end
|
|
||||||
function stopEmote()
|
|
||||||
TriggerEvent('animations:client:EmoteCommandStart', {"c"})
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if Config.Emotes == 'rpemotes' then
|
|
||||||
function playEmote(emote)
|
|
||||||
exports["rpemotes"]:EmoteCommandStart(emote, 0)
|
|
||||||
end
|
|
||||||
function stopEmote()
|
|
||||||
exports["rpemotes"]:EmoteCancel()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local animation = nil
|
|
||||||
|
|
||||||
function progressbar(text, time, emote, cancel)
|
|
||||||
local animData
|
|
||||||
if type(emote) == 'string' then
|
|
||||||
playEmote(emote)
|
|
||||||
animation = emote
|
|
||||||
elseif type(emote) == 'table' then
|
|
||||||
animData = emote
|
|
||||||
if emote.prop and not emote.prop.model then
|
|
||||||
emote.prop = nil
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local success = Bridge.ProgressBar.Open({
|
|
||||||
duration = time or 5000,
|
|
||||||
label = text or 'LAZY AF DEVS',
|
|
||||||
canCancel = true,
|
|
||||||
disable = cancel or Config.ProgressBar.Disables,
|
|
||||||
anim = animData or Config.DefaultAnimation,
|
|
||||||
prop = animData and animData.prop or nil
|
|
||||||
})
|
|
||||||
if animation then
|
|
||||||
animation = nil
|
|
||||||
stopEmote()
|
|
||||||
end
|
|
||||||
return success
|
|
||||||
end
|
|
||||||
|
|
||||||
function itemCheck(item)
|
|
||||||
if not Bridge.Inventory.HasItem(item) then
|
|
||||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('Catches.itemMissings', Bridge.Inventory.GetItemInfo(item).label), 'error')
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
AddEventHandler('onResourceStop', function(resourceName)
|
|
||||||
if GetCurrentResourceName() ~= resourceName then return end
|
|
||||||
for k, v in pairs (targets) do
|
|
||||||
if type(v) == 'number' then
|
|
||||||
Bridge.Target.RemoveLocalEntity(v)
|
|
||||||
if DoesEntityExist(v) then
|
|
||||||
DeleteEntity(v)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
Bridge.Target.RemoveZone(v)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
@@ -1,30 +1,32 @@
|
|||||||
if not Config.Drugs['heroin'] then return end
|
|
||||||
local herointable = false
|
local herointable = false
|
||||||
local dirty = false
|
local dirty = false
|
||||||
|
local locations = ps.callback('md-drugs:server:GetHeroinLocations')
|
||||||
local locations = Config.Heroin.Locations
|
|
||||||
|
|
||||||
local function createLabKit(coord, head)
|
local function createLabKit(coord, head)
|
||||||
local heroinlabkit = CreateObject("v_ret_ml_tablea", coord.x, coord.y, coord.z - 1, true, false,false)
|
local heroinlabkit = CreateObject("v_ret_ml_tablea", coord.x, coord.y, coord.z - 1, true, false,false)
|
||||||
SetEntityHeading(heroinlabkit, head)
|
SetEntityHeading(heroinlabkit, head)
|
||||||
PlaceObjectOnGroundProperly(heroinlabkit)
|
PlaceObjectOnGroundProperly(heroinlabkit)
|
||||||
Bridge.Target.AddLocalEntity(heroinlabkit, {
|
ps.entityTarget(heroinlabkit, {
|
||||||
{
|
{
|
||||||
icon = Bridge.Language.Locale('heroin.cookIcon'),
|
icon = "fa-solid fa-temperature-high",
|
||||||
label = Bridge.Language.Locale('heroin.targetCook'),
|
label = ps.lang('heroin.targetCook'),
|
||||||
action = function()
|
action = function()
|
||||||
if not itemCheck('emptyvial') then return end
|
if not ps.hasItem('emptyvial') then
|
||||||
|
ps.notify(ps.lang('Catches.itemMissings', ps.getLabel('emptyvial')), 'error')
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
if not minigame() then
|
if not minigame() then
|
||||||
dirty = true
|
dirty = true
|
||||||
TriggerServerEvent("md-drugs:server:failheatingheroin")
|
TriggerServerEvent("md-drugs:server:failheatingheroin")
|
||||||
local coords = GetEntityCoords(heroinlabkit)
|
ps.requestPTFX("core")
|
||||||
AddExplosion(coords.x, coords.y, coords.z-1.0, 34, 0.0, true, false, true)
|
local heroinkit = StartParticleFxLoopedOnEntity("exp_air_molotov", heroinlabkit, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.5, false, false, false)
|
||||||
SetParticleFxLoopedAlpha(heroinkit, 3.0)
|
SetParticleFxLoopedAlpha(heroinkit, 3.0)
|
||||||
SetPedToRagdoll(PlayerPedId(), 1300, 1300, 0, 0, 0, 0)
|
SetPedToRagdoll(PlayerPedId(), 1300, 1300, 0, 0, 0, 0)
|
||||||
return
|
return end
|
||||||
end
|
|
||||||
if not progressbar(Bridge.Language.Locale('heroin.pbCook')) then return end
|
if not ps.progressbar(ps.lang('heroin.pbCook'), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:heatliquidheroin")
|
TriggerServerEvent("md-drugs:server:heatliquidheroin")
|
||||||
end,
|
end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
@@ -32,10 +34,10 @@ local function createLabKit(coord, head)
|
|||||||
end
|
end
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon = Bridge.Language.Locale('heroin.targetPickupIcon'),
|
icon = "fas fa-box-circle-check",
|
||||||
label = Bridge.Language.Locale('heroin.targetPickup'),
|
label = ps.lang('heroin.targetPickup'),
|
||||||
action = function()
|
action = function()
|
||||||
if not progressbar(Bridge.Language.Locale('heroin.pbPickup')) then return end
|
if not ps.progressbar(ps.lang('heroin.pbPickup'), 4000, 'uncuff') then return end
|
||||||
herointable = false
|
herointable = false
|
||||||
DeleteObject(heroinlabkit)
|
DeleteObject(heroinlabkit)
|
||||||
TriggerServerEvent("md-drugs:server:getheroinlabkitback")
|
TriggerServerEvent("md-drugs:server:getheroinlabkitback")
|
||||||
@@ -46,12 +48,15 @@ local function createLabKit(coord, head)
|
|||||||
end
|
end
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon = Bridge.Language.Locale('heroin.targetCleanIcon'),
|
icon = "fa-solid fa-hand-sparkles",
|
||||||
label = Bridge.Language.Locale('heroin.targetClean'),
|
label = ps.lang('heroin.targetClean'),
|
||||||
action = function()
|
action = function()
|
||||||
if not itemCheck('cleaningkit') then return end
|
if not ps.hasItem('cleaningkit') then
|
||||||
if not progressbar(Bridge.Language.Locale('heroin.pbClean'), 4000, 'clean') then return end
|
ps.notify(ps.lang('Catches.itemMissings', ps.getLabel('cleaningkit')), 'error')
|
||||||
local done = Bridge.Callback.Trigger('md-drugs:server:removeCleaningKitHeroin', false)
|
return
|
||||||
|
end
|
||||||
|
if not ps.progressbar(ps.lang('heroin.pbClean'), 4000, 'clean') then return end
|
||||||
|
local done = ps.callback('removeCleaningkit', false)
|
||||||
if done then dirty = false end
|
if done then dirty = false end
|
||||||
end,
|
end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
@@ -59,16 +64,15 @@ local function createLabKit(coord, head)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
}})
|
}})
|
||||||
targets[#targets+1] = heroinlabkit
|
|
||||||
end
|
end
|
||||||
|
|
||||||
for k, v in pairs (locations.dryplant) do
|
for k, v in pairs (locations.dryplant) do
|
||||||
Bridge.Target.AddBoxZone('dryHeroin'..k, v.loc, v.size, v.loc.w or 180.0, {
|
ps.boxTarget('dryHeroin'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
|
||||||
{
|
{
|
||||||
label = Bridge.Language.Locale('heroin.targetDry'),
|
label = ps.lang('heroin.targetDry'),
|
||||||
icon = Bridge.Language.Locale('heroin.dryIcon'),
|
icon = 'fa-solid fa-temperature-high',
|
||||||
action = function()
|
action = function()
|
||||||
if not progressbar(Bridge.Language.Locale('heroin.pbDry')) then return end
|
if not ps.progressbar(ps.lang('heroin.pbDry'), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:dryplant", k)
|
TriggerServerEvent("md-drugs:server:dryplant", k)
|
||||||
end,
|
end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
@@ -76,17 +80,16 @@ for k, v in pairs (locations.dryplant) do
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = 'dryHeroin'..k
|
|
||||||
end
|
end
|
||||||
|
|
||||||
for k, v in pairs (locations.cutheroinone) do
|
for k, v in pairs (locations.cutheroinone) do
|
||||||
Bridge.Target.AddBoxZone('cutHeroin'..k, v.loc, v.size, v.loc.w or 180.0, {
|
ps.boxTarget('cutHeroin'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
|
||||||
{
|
{
|
||||||
label = Bridge.Language.Locale('heroin.targetCutHeroin'),
|
label = ps.lang('heroin.targetCutHeroin'),
|
||||||
icon = Bridge.Language.Locale('heroin.cutIcon'),
|
icon = 'fa-solid fa-seedling',
|
||||||
action = function()
|
action = function()
|
||||||
if not itemCheck('bakingsoda') then return end
|
if not ps.hasItem('bakingsoda') then return end
|
||||||
if not progressbar(Bridge.Language.Locale('heroin.pbCutHeroin')) then return end
|
if not ps.progressbar(ps.lang('heroin.pbCutHeroin'), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:cutheroin", k)
|
TriggerServerEvent("md-drugs:server:cutheroin", k)
|
||||||
end,
|
end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
@@ -94,22 +97,20 @@ for k, v in pairs (locations.cutheroinone) do
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = 'cutHeroin'..k
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local peds = {}
|
local peds = {}
|
||||||
for k, v in pairs (locations.buyKit) do
|
for k, v in pairs (locations.buyKit) do
|
||||||
requestModel(v.ped, 1000)
|
ps.requestModel(v.ped, 1000)
|
||||||
peds[k] = CreatePed(4, v.ped, v.loc.x, v.loc.y, v.loc.z, v.loc.w, false, false)
|
peds[k] = CreatePed(4, v.ped, v.loc.x, v.loc.y, v.loc.z, v.loc.w, false, false)
|
||||||
Freeze(peds[k], true, v.loc.w)
|
Freeze(peds[k], true, v.loc.w)
|
||||||
SetBlockingOfNonTemporaryEvents(peds[k], true)
|
SetBlockingOfNonTemporaryEvents(peds[k], true)
|
||||||
SetEntityInvincible(peds[k], true)
|
SetEntityInvincible(peds[k], true)
|
||||||
Bridge.Target.AddLocalEntity(peds[k], {
|
ps.entityTarget(peds[k], {
|
||||||
{
|
{
|
||||||
label = Bridge.Language.Locale('heroin.targetBuyKit'),
|
label = ps.lang('heroin.targetBuyKit'),
|
||||||
icon = Bridge.Language.Locale('heroin.buyIcon'),
|
icon = 'fa-solid fa-box-open',
|
||||||
action = function()
|
action = function()
|
||||||
if not progressbar(Bridge.Language.Locale('heroin.pbBuyKit')) then return end
|
if not ps.progressbar(ps.lang('heroin.pbBuyKit'), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:getheroinlabkit", k)
|
TriggerServerEvent("md-drugs:server:getheroinlabkit", k)
|
||||||
end,
|
end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
@@ -118,32 +119,31 @@ for k, v in pairs (locations.buyKit) do
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = peds[k]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
Bridge.Callback.Register("md-drugs:client:setheroinlabkit", function()
|
ps.registerCallback("md-drugs:client:setheroinlabkit", function()
|
||||||
if herointable then
|
if herointable then
|
||||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('heroin.tableout'), 'error')
|
ps.notify(ps.lang('heroin.tableout'), 'error')
|
||||||
return false
|
return false
|
||||||
else
|
else
|
||||||
herointable = true
|
herointable = true
|
||||||
local location, head = StartRay()
|
local location, head = StartRay()
|
||||||
if not location then herointable = false return end
|
if not location then herointable = false return end
|
||||||
if not progressbar(Bridge.Language.Locale('heroin.placing')) then return end
|
if not ps.progressbar(ps.lang('heroin.placing'), 4000, 'uncuff') then return end
|
||||||
createLabKit(location, head)
|
createLabKit(location, head)
|
||||||
return true, location
|
return true, location
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
for k, v in pairs (locations.fillneedle) do
|
for k, v in pairs (locations.fillneedle) do
|
||||||
Bridge.Target.AddBoxZone('fillNeedle'..k, v.loc, v.size, v.loc.w or 180.0, {
|
ps.boxTarget('fillNeedle'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
|
||||||
{
|
{
|
||||||
label = Bridge.Language.Locale('heroin.targetFill'),
|
label = ps.lang('heroin.targetFill'),
|
||||||
icon = Bridge.Language.Locale('heroin.fillNeedleIcon'),
|
icon = 'fa-solid fa-syringe',
|
||||||
action = function()
|
action = function()
|
||||||
if not minigame() then TriggerServerEvent("md-drugs:server:failheroin", k) return end
|
if not minigame() then TriggerServerEvent("md-drugs:server:failheroin", k) return end
|
||||||
if not progressbar(Bridge.Language.Locale('heroin.pbFill')) then return end
|
if not ps.progressbar(ps.lang('heroin.pbFill'), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:fillneedle", k)
|
TriggerServerEvent("md-drugs:server:fillneedle", k)
|
||||||
end,
|
end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
@@ -151,5 +151,4 @@ for k, v in pairs (locations.fillneedle) do
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = 'fillNeedle'..k
|
|
||||||
end
|
end
|
||||||
@@ -1,68 +1,61 @@
|
|||||||
if not Config.Drugs['lean'] then return end
|
|
||||||
local started = false
|
local started = false
|
||||||
local leanCar = nil
|
local hit = 0
|
||||||
|
local location = ps.callback('md-drugs:server:GetLeanLocs')
|
||||||
|
|
||||||
local location = Config.Lean.Locations
|
local function SpawnCarPedChase()
|
||||||
|
|
||||||
local function SpawnCarPedChase(loc)
|
|
||||||
local stoploc = vector3(-1157.63, -3056.71, 13.94)
|
local stoploc = vector3(-1157.63, -3056.71, 13.94)
|
||||||
local start = location.StartLoc[math.random(1,#location.StartLoc)]
|
local start = location.StartLoc[math.random(1,#location.StartLoc)]
|
||||||
|
|
||||||
if started then Bridge.Notify.SendNotify(Bridge.Language.Locale('lean.alreadyChasing'), 'error') return end
|
if started then ps.notify(ps.lang('lean.alreadyChasing'), 'error') return end
|
||||||
started = true
|
started = true
|
||||||
|
|
||||||
requestModel("pounder", 30000)
|
ps.callback('md-drugs:server:RegisterLean')
|
||||||
requestModel("ig_priest", 30000)
|
ps.requestModel("pounder", Config.RequestModelTime)
|
||||||
requestModel("cargobob3", 30000)
|
ps.requestModel("ig_priest", Config.RequestModelTime)
|
||||||
|
ps.requestModel("cargobob3", Config.RequestModelTime)
|
||||||
|
|
||||||
leanCar = CreateVehicle("pounder", start.x+3, start.y-2, start.z-1, 52.0, true, false)
|
local leancar = CreateVehicle("pounder", start.x+3, start.y-2, start.z-1, 52.0, true, false)
|
||||||
local driver = CreatePed(26, "ig_priest", start.x, start.y, start.z, 268.9422, false, false)
|
local driver = CreatePed(26, "ig_priest", start.x, start.y, start.z, 268.9422, false, false)
|
||||||
local pilot2 = CreatePed(26, "ig_priest", stoploc.x-3, stoploc.y-3, stoploc.z-1, 268.9422, false, false)
|
local pilot2 = CreatePed(26, "ig_priest", stoploc.x-3, stoploc.y-3, stoploc.z-1, 268.9422, false, false)
|
||||||
local can = Bridge.Callback.Trigger('md-drugs:server:registerLean', loc, NetworkGetNetworkIdFromEntity(leanCar))
|
|
||||||
|
|
||||||
if not can then
|
|
||||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('lean.cantStart'), 'error')
|
|
||||||
DeleteVehicle(leanCar)
|
|
||||||
DeleteEntity(driver)
|
|
||||||
DeleteEntity(pilot2)
|
|
||||||
started = false
|
|
||||||
return
|
|
||||||
end
|
|
||||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('lean.chaseStarted'), 'success')
|
|
||||||
SetPedIntoVehicle(pilot2, leanCar, 1)
|
|
||||||
FreezeEntityPosition(driver, true)
|
|
||||||
FreezeEntityPosition(pilot2, true)
|
FreezeEntityPosition(pilot2, true)
|
||||||
SetEntityInvincible(pilot2, true)
|
SetEntityInvincible(pilot2, true)
|
||||||
SetEntityAsMissionEntity(leanCar)
|
SetEntityAsMissionEntity(leancar)
|
||||||
AddBlipForEntity(leanCar)
|
AddBlipForEntity(leancar)
|
||||||
SetPedIntoVehicle(driver, leanCar, -1)
|
SetPedIntoVehicle(driver, leancar, -1)
|
||||||
SetPedFleeAttributes(driver,false)
|
SetPedFleeAttributes(driver,false)
|
||||||
TaskVehicleDriveToCoordLongrange(driver, leanCar, stoploc.x, stoploc.y, stoploc.z-1, 50.0, 524288, 25.0)
|
TaskVehicleDriveToCoordLongrange(driver, leancar, stoploc.x, stoploc.y, stoploc.z-1, 50.0, 524288, 25.0)
|
||||||
SetPedKeepTask(driver, true)
|
SetPedKeepTask(driver, true)
|
||||||
|
|
||||||
repeat
|
repeat
|
||||||
Wait(1000)
|
Wait(1000)
|
||||||
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
|
||||||
Bridge.Target.AddLocalEntity(leanCar, {
|
ps.entityTarget(leancar, {
|
||||||
{
|
{
|
||||||
name = 'leancar',
|
name = 'leancar',
|
||||||
icon = Bridge.Language.Locale('lean.carIcon'),
|
icon = 'fa-solid fa-car',
|
||||||
label = Bridge.Language.Locale('lean.stealFromTruck'),
|
label = ps.lang('lean.stealFromTruck'),
|
||||||
action = function()
|
action = function()
|
||||||
|
hit = hit + 1
|
||||||
if not minigame() then return end
|
if not minigame() then return end
|
||||||
TriggerServerEvent('md-drugs:server:givelean')
|
TriggerServerEvent('md-drugs:server:givelean')
|
||||||
started = false
|
started = false
|
||||||
|
if math.random(1,100) <= 30 or hit == 4 then
|
||||||
|
hit = 0
|
||||||
|
DeleteVehicle(leancar)
|
||||||
DeleteEntity(driver)
|
DeleteEntity(driver)
|
||||||
DeleteEntity(pilot2)
|
DeleteEntity(pilot2)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = leanCar
|
|
||||||
else
|
else
|
||||||
|
DeleteVehicle(leancar)
|
||||||
DeleteEntity(driver)
|
DeleteEntity(driver)
|
||||||
DeleteEntity(pilot2)
|
DeleteEntity(pilot2)
|
||||||
end
|
end
|
||||||
@@ -70,15 +63,15 @@ end
|
|||||||
|
|
||||||
local leanPeds = {}
|
local leanPeds = {}
|
||||||
for k, v in pairs (location.SyrupVendor) do
|
for k, v in pairs (location.SyrupVendor) do
|
||||||
requestModel(v.ped)
|
ps.requestModel(v.ped)
|
||||||
leanPeds[k] = CreatePed(0, v.ped, v.loc.x, v.loc.y, v.loc.z, false, false)
|
leanPeds[k] = CreatePed(0, v.ped, v.loc.x, v.loc.y, v.loc.z, false, false)
|
||||||
Freeze(leanPeds[k], true, v.loc.w)
|
Freeze(leanPeds[k], true, v.loc.w)
|
||||||
Bridge.Target.AddLocalEntity(leanPeds[k], {
|
ps.entityTarget(leanPeds[k], {
|
||||||
{
|
{
|
||||||
icon = Bridge.Language.Locale('lean.startMissionIcon'),
|
icon = "fa-solid fa-hand-holding-medical",
|
||||||
label = Bridge.Language.Locale('lean.startMission'),
|
label = ps.lang('lean.startMission'),
|
||||||
action = function()
|
action = function()
|
||||||
SpawnCarPedChase(k)
|
SpawnCarPedChase()
|
||||||
end,
|
end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
if not handleGang(v.gang) then return false end
|
if not handleGang(v.gang) then return false end
|
||||||
@@ -86,45 +79,4 @@ for k, v in pairs (location.SyrupVendor) do
|
|||||||
end
|
end
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
targets[#targets+1] = leanPeds[k]
|
end
|
||||||
end
|
|
||||||
|
|
||||||
local function concat(tbl)
|
|
||||||
local str = ""
|
|
||||||
for k, v in pairs (tbl) do
|
|
||||||
str = str .. v.item .. " X " .. v.amount .. " \n "
|
|
||||||
end
|
|
||||||
return str
|
|
||||||
end
|
|
||||||
|
|
||||||
local function getDisabled(recipe)
|
|
||||||
for k, v in pairs (recipe.ingredients) do
|
|
||||||
local count = Bridge.Inventory.GetItemCount(v.item)
|
|
||||||
if count < v.amount then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
RegisterNetEvent("md-drugs:client:makeLean", function()
|
|
||||||
local menu = {}
|
|
||||||
for k, v in pairs (Config.Lean.Recipes) do
|
|
||||||
menu[#menu+1] = {
|
|
||||||
title = Bridge.Inventory.GetItemInfo(v.item).label,
|
|
||||||
description = concat(v.ingredients),
|
|
||||||
icon = Bridge.Inventory.GetItemInfo(v.item).image,
|
|
||||||
disabled = getDisabled(v),
|
|
||||||
onSelect = function()
|
|
||||||
if not progressbar(Bridge.Language.Locale('lean.makingLean')) then return end
|
|
||||||
TriggerServerEvent('md-drugs:server:makeLean', k)
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
end
|
|
||||||
Bridge.Menu.Open({
|
|
||||||
id = 'makeLeanMenu',
|
|
||||||
title = Bridge.Language.Locale('lean.makeLeanMenuTitle'),
|
|
||||||
description = Bridge.Language.Locale('lean.makeLeanMenuDesc'),
|
|
||||||
options = menu
|
|
||||||
})
|
|
||||||
end)
|
|
||||||
@@ -1,10 +1,8 @@
|
|||||||
if not Config.Drugs['lsd'] then return end
|
|
||||||
local tableout = false
|
local tableout = false
|
||||||
local dirtylsd = false
|
local dirtylsd = false
|
||||||
local locations = Config.LSD.Locations
|
local locations = ps.callback('md-drugs:server:GetLSDLocations')
|
||||||
|
|
||||||
local function createLabKit(coord, head)
|
local function createLabKit(coord, head)
|
||||||
requestModel("v_ret_ml_tablea")
|
|
||||||
local labkit = CreateObject("v_ret_ml_tablea", coord.x, coord.y, coord.z - 1, true, false)
|
local labkit = CreateObject("v_ret_ml_tablea", coord.x, coord.y, coord.z - 1, true, false)
|
||||||
SetEntityHeading(labkit, head)
|
SetEntityHeading(labkit, head)
|
||||||
PlaceObjectOnGroundProperly(labkit)
|
PlaceObjectOnGroundProperly(labkit)
|
||||||
@@ -12,17 +10,18 @@ local function createLabKit(coord, head)
|
|||||||
tableout = true
|
tableout = true
|
||||||
local options = {
|
local options = {
|
||||||
{
|
{
|
||||||
icon = Bridge.Language.Locale('lsd.targetHeatIcon'),
|
icon = "fa-solid fa-temperature-high",
|
||||||
label = Bridge.Language.Locale('lsd.targetHeat'),
|
label = ps.lang('lsd.targetHeat'),
|
||||||
action = function()
|
action = function()
|
||||||
|
local dict = "scr_ie_svm_technical2"
|
||||||
if not minigame() then
|
if not minigame() then
|
||||||
local coords = GetEntityCoords(labkit)
|
|
||||||
AddExplosion(coords.x, coords.y, coords.z-1.0, 34, 0.0, true, false, true)
|
|
||||||
dirtylsd = true
|
dirtylsd = true
|
||||||
TriggerServerEvent("md-drugs:server:failheating")
|
loadParticle(dict)
|
||||||
|
local exitPtfx = StartParticleFxLoopedOnEntity("scr_dst_cocaine", labkit, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.5, false, false, false)
|
||||||
|
SetParticleFxLoopedAlpha(exitPtfx, 3.0)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if not progressbar(Bridge.Language.Locale('lsd.heating'), 7000) then return end
|
if not ps.progressbar(ps.lang('lsd.heating'), 7000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:heatliquid")
|
TriggerServerEvent("md-drugs:server:heatliquid")
|
||||||
end,
|
end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
@@ -30,12 +29,15 @@ local function createLabKit(coord, head)
|
|||||||
end
|
end
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon = Bridge.Language.Locale('lsd.targetRefineIcon'),
|
icon = "fa-solid fa-temperature-high",
|
||||||
label = Bridge.Language.Locale('lsd.targetRefine'),
|
label = ps.lang('lsd.targetRefine'),
|
||||||
action = function()
|
action = function()
|
||||||
if not itemCheck('lsd_one_vial') then return end
|
if not ps.hasItem('lsd_one_vial') then
|
||||||
|
ps.notify(ps.lang('Catches.itemNeeded', ps.getLabel('lsd_one_vial')), 'error')
|
||||||
|
return
|
||||||
|
end
|
||||||
if not minigame() then TriggerServerEvent("md-drugs:server:failrefinequality") return end
|
if not minigame() then TriggerServerEvent("md-drugs:server:failrefinequality") return end
|
||||||
if not progressbar(Bridge.Language.Locale('lsd.refining')) then return end
|
if not ps.progressbar(ps.lang('lsd.refining'), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:refinequalityacid")
|
TriggerServerEvent("md-drugs:server:refinequalityacid")
|
||||||
end,
|
end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
@@ -43,12 +45,15 @@ local function createLabKit(coord, head)
|
|||||||
end
|
end
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon = Bridge.Language.Locale('lsd.targetDippingIcon'),
|
icon = "fa-regular fa-note-sticky",
|
||||||
label = Bridge.Language.Locale('lsd.targetDipping'),
|
label = ps.lang('lsd.targetDipping'),
|
||||||
action = function()
|
action = function()
|
||||||
if not itemCheck('tab_paper') then return end
|
if not ps.hasItem('tab_paper') then
|
||||||
|
ps.notify(ps.lang('Catches.itemNeeded', ps.getLabel('tab_paper')), 'error')
|
||||||
|
return
|
||||||
|
end
|
||||||
if not minigame() then TriggerServerEvent("md-drugs:server:failtabs") return end
|
if not minigame() then TriggerServerEvent("md-drugs:server:failtabs") return end
|
||||||
if not progressbar(Bridge.Language.Locale('lsd.dipping')) then return end
|
if not ps.progressbar(ps.lang('lsd.dipping'), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:maketabpaper")
|
TriggerServerEvent("md-drugs:server:maketabpaper")
|
||||||
end,
|
end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
@@ -56,10 +61,11 @@ local function createLabKit(coord, head)
|
|||||||
end
|
end
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon = Bridge.Language.Locale('lsd.targetPickupIcon'),
|
event = "md-drugs:client:getlabkitback",
|
||||||
label = Bridge.Language.Locale('lsd.targetPickup'),
|
icon = "fas fa-box-circle-check",
|
||||||
|
label = ps.lang('lsd.targetPickup'),
|
||||||
action = function()
|
action = function()
|
||||||
if not progressbar(Bridge.Language.Locale('lsd.packup')) then return end
|
if not ps.progressbar(ps.lang('lsd.packup'), 4000, 'uncuff') then return end
|
||||||
DeleteObject(labkit)
|
DeleteObject(labkit)
|
||||||
TriggerServerEvent('md-drugs:server:getlabkitback')
|
TriggerServerEvent('md-drugs:server:getlabkitback')
|
||||||
tableout = false
|
tableout = false
|
||||||
@@ -69,12 +75,15 @@ local function createLabKit(coord, head)
|
|||||||
end
|
end
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon = Bridge.Language.Locale('lsd.targetCleanIcon'),
|
icon = "fa-solid fa-hand-sparkles",
|
||||||
label = Bridge.Language.Locale('lsd.targetClean'),
|
label = ps.lang('lsd.targetClean'),
|
||||||
action = function()
|
action = function()
|
||||||
if not itemCheck('cleaningkit') then return end
|
if not ps.hasItem('cleaningkit') then
|
||||||
if not progressbar(Bridge.Language.Locale('lsd.cleaning'), 4000, 'clean') then return end
|
ps.notify(ps.lang('Catches.itemNeeded', ps.getLabel('cleaningkit')), 'error')
|
||||||
local check = Bridge.Callback.Trigger('md-drugs:server:removecleaningkit')
|
return
|
||||||
|
end
|
||||||
|
if not ps.progressbar(ps.lang('lsd.cleaning'), 4000, 'clean') then return end
|
||||||
|
local check = ps.callback('md-drugs:server:removecleaningkit')
|
||||||
if check then
|
if check then
|
||||||
dirtylsd = false
|
dirtylsd = false
|
||||||
end
|
end
|
||||||
@@ -82,18 +91,17 @@ local function createLabKit(coord, head)
|
|||||||
canInteract = function() if dirtylsd then return true end end
|
canInteract = function() if dirtylsd then return true end end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Bridge.Target.AddLocalEntity(labkit, options)
|
ps.entityTarget(labkit, options)
|
||||||
targets[#targets+1] = labkit
|
|
||||||
end
|
end
|
||||||
|
|
||||||
for k, v in pairs (locations.lysergicacid) do
|
for k, v in pairs (locations.lysergicacid) do
|
||||||
Bridge.Target.AddBoxZone('lysergicacid'..k,v.loc, v.size, v.loc.w or 180.0, {
|
ps.boxTarget('lysergicacid'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
|
||||||
{
|
{
|
||||||
label = Bridge.Language.Locale('lsd.targetLys'),
|
label = ps.lang('lsd.targetLys'),
|
||||||
icon = Bridge.Language.Locale('lsd.targetLysIcon'),
|
icon = 'fa-solid fa-temperature-high',
|
||||||
action = function()
|
action = function()
|
||||||
if not minigame() then TriggerServerEvent("md-drugs:server:faillysergic") return end
|
if not minigame() then TriggerServerEvent("md-drugs:server:faillysergic") return end
|
||||||
if not progressbar(Bridge.Language.Locale('lsd.stealLys')) then return end
|
if not ps.progressbar(ps.lang('lsd.stealLys'), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:getlysergic", k)
|
TriggerServerEvent("md-drugs:server:getlysergic", k)
|
||||||
end,
|
end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
@@ -102,17 +110,16 @@ for k, v in pairs (locations.lysergicacid) do
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = 'lysergicacid'..k
|
|
||||||
end
|
end
|
||||||
|
|
||||||
for k, v in pairs (locations.diethylamide) do
|
for k, v in pairs (locations.diethylamide) do
|
||||||
Bridge.Target.AddBoxZone('diethylamide'..k, v.loc, v.size, v.loc.w or 180.0, {
|
ps.boxTarget('diethylamide'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
|
||||||
{
|
{
|
||||||
label = Bridge.Language.Locale('lsd.targetDie'),
|
label = ps.lang('lsd.targetDie'),
|
||||||
icon = Bridge.Language.Locale('lsd.targetDieIcon'),
|
icon = 'fa-solid fa-temperature-high',
|
||||||
action = function()
|
action = function()
|
||||||
if not minigame() then TriggerServerEvent("md-drugs:server:faildiethylamide") return end
|
if not minigame() then TriggerServerEvent("md-drugs:server:faildiethylamide") return end
|
||||||
if not progressbar(Bridge.Language.Locale('lsd.stealDie')) then return end
|
if not ps.progressbar(ps.lang('lsd.stealDie'), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:getdiethylamide", k)
|
TriggerServerEvent("md-drugs:server:getdiethylamide", k)
|
||||||
end,
|
end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
@@ -121,14 +128,13 @@ for k, v in pairs (locations.diethylamide) do
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = 'diethylamide'..k
|
|
||||||
end
|
end
|
||||||
|
|
||||||
for k, v in pairs (locations.gettabs) do
|
for k, v in pairs (locations.gettabs) do
|
||||||
Bridge.Target.AddBoxZone('gettabs'..k, v.loc, v.size, v.loc.w or 180.0, {
|
ps.boxTarget('gettabs'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
|
||||||
{
|
{
|
||||||
label = Bridge.Language.Locale('lsd.targetBuyTab'),
|
label = ps.lang('lsd.targetBuyTab'),
|
||||||
icon = Bridge.Language.Locale('lsd.targetBuyTabIcon'),
|
icon = 'fa-solid fa-hand-holding-dollar',
|
||||||
action = function()
|
action = function()
|
||||||
TriggerServerEvent("md-drugs:server:gettabpaper", k)
|
TriggerServerEvent("md-drugs:server:gettabpaper", k)
|
||||||
end,
|
end,
|
||||||
@@ -138,24 +144,22 @@ for k, v in pairs (locations.gettabs) do
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = 'gettabs'..k
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local seller = {}
|
local seller = {}
|
||||||
for k, v in pairs (locations.buyLSDkit) do
|
for k, v in pairs (locations.buyLSDkit) do
|
||||||
requestModel(v.ped, 1000)
|
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)
|
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)
|
Freeze(seller[k], true, v.loc.w)
|
||||||
Bridge.Target.AddLocalEntity(seller[k], {
|
ps.entityTarget(seller[k], {
|
||||||
{
|
{
|
||||||
label = Bridge.Language.Locale('lsd.targetBuyKit'),
|
label = ps.lang('lsd.targetBuyKit'),
|
||||||
icon = Bridge.Language.Locale('lsd.targetBuyKitIcon'),
|
icon = 'fa-solid fa-hand-holding-dollar',
|
||||||
action = function()
|
action = function()
|
||||||
if Bridge.Inventory.HasItem('lsdlabkit') then
|
if ps.hasItem('lsdlabkit') then
|
||||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('lsd.alreadyOwn'), 'error')
|
ps.notify(ps.lang('lsd.alreadyOwn'), 'error')
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if not progressbar(Bridge.Language.Locale('lsd.buyingKit')) then return end
|
if not ps.progressbar(ps.lang('lsd.buyingKit'), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent('md-drugs:server:getlabkit', k)
|
TriggerServerEvent('md-drugs:server:getlabkit', k)
|
||||||
end,
|
end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
@@ -164,18 +168,17 @@ for k, v in pairs (locations.buyLSDkit) do
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = seller[k]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Bridge.Callback.Register("md-drugs:client:setlsdlabkit", function()
|
ps.registerCallback("md-drugs:client:setlsdlabkit", function()
|
||||||
if tableout then
|
if tableout then
|
||||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('lsd.tableout'), 'error')
|
ps.notify(ps.lang('lsd.tableout'), 'error')
|
||||||
return false
|
return false
|
||||||
else
|
else
|
||||||
tableout = true
|
tableout = true
|
||||||
local loc, head = StartRay()
|
local loc, head = StartRay()
|
||||||
if not loc then tableout = false return end
|
if not loc then tableout = false return end
|
||||||
if not progressbar(Bridge.Language.Locale('lsd.placing')) then return end
|
if not ps.progressbar(ps.lang('lsd.placing'), 4000, 'uncuff') then return end
|
||||||
createLabKit(loc, head)
|
createLabKit(loc, head)
|
||||||
return true, loc
|
return true, loc
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,27 +1,15 @@
|
|||||||
if not Config.Drugs['mescaline'] then return end
|
local locations = ps.callback('md-drugs:server:GetMescalineLocs')
|
||||||
local badTrip = 100
|
|
||||||
local locations = Config.Mescaline.Locations
|
|
||||||
local function AlienEffect()
|
|
||||||
CreateThread(function()
|
|
||||||
StartScreenEffect("DrugsMichaelAliensFightIn", 3.0, 0)
|
|
||||||
StartScreenEffect("DrugsMichaelAliensFight", 3.0, 0)
|
|
||||||
Wait(math.random(25000, 35000))
|
|
||||||
StartScreenEffect("DrugsMichaelAliensFightOut", 3.0, 0)
|
|
||||||
StopScreenEffect("DrugsMichaelAliensFightIn")
|
|
||||||
StopScreenEffect("DrugsMichaelAliensFight")
|
|
||||||
StopScreenEffect("DrugsMichaelAliensFightOut")
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
for k, v in pairs (locations.DryOutMescaline) do
|
for k, v in pairs (locations.DryOutMescaline) do
|
||||||
Bridge.Target.AddBoxZone('dryoutMesc'..k, v.loc, v.size, v.loc.w or 180.0,{
|
ps.boxTarget('dryoutMesc'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
|
||||||
{
|
{
|
||||||
label = Bridge.Language.Locale('mesc.targetDry'),
|
label = ps.lang('mesc.targetDry'),
|
||||||
icon = 'fa-solid fa-temperature-high',
|
icon = 'fa-solid fa-temperature-high',
|
||||||
action = function()
|
action = function()
|
||||||
if not itemCheck('cactusbulb') then return end
|
if not ps.hasItem('cactusbulb') then
|
||||||
if not progressbar(Bridge.Language.Locale('mesc.dry')) then return end
|
ps.notify(ps.lang('Catches.itemNeeded', ps.getLabel('cactusbulb')), 'error')
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if not ps.progressbar(ps.lang('mescaline.dry'), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:drymescaline", k)
|
TriggerServerEvent("md-drugs:server:drymescaline", k)
|
||||||
end,
|
end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
@@ -30,18 +18,16 @@ for k, v in pairs (locations.DryOutMescaline) do
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = 'dryoutMesc'..k
|
|
||||||
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(Bridge.Language.Locale('mesc.eat')) then return end
|
if not ps.progressbar(ps.lang('mescaline.eat'), 4000, 'uncuff') then return end
|
||||||
if chance <= badTrip then
|
if chance <= Config.Badtrip then
|
||||||
AlienEffect()
|
AlienEffect()
|
||||||
Wait(math.random(3000,6000))
|
local clone = ClonePed(PlayerPedId(), false, false, true)
|
||||||
local clone = ClonePed(PlayerPedId(), true, true, true)
|
|
||||||
SetEntityAsMissionEntity(clone)
|
SetEntityAsMissionEntity(clone)
|
||||||
SetPedFleeAttributes(clone, false)
|
SetPedFleeAttributes(clone, false)
|
||||||
GiveWeaponToPed(clone, weapon, 1, false, true)
|
GiveWeaponToPed(clone, weapon, 1, false, true)
|
||||||
|
|||||||
@@ -1,37 +1,36 @@
|
|||||||
if not Config.Drugs['meth'] then return end
|
local amonia = false
|
||||||
local amonia, tray, heated, active, trays, startedmeth, methVan = false, false, false, false, nil, false, nil
|
local tray = false
|
||||||
local locations = Config.Meth.Locations
|
local heated = false
|
||||||
|
local active = false
|
||||||
|
local trays = nil
|
||||||
|
local locations = ps.callback('md-drugs:server:GetMethLocs')
|
||||||
--- meth heist
|
--- meth heist
|
||||||
|
local startedmeth = false
|
||||||
|
|
||||||
|
local function SpawnMethCarPedChase()
|
||||||
local function SpawnMethCarPedChase(loc)
|
|
||||||
local stoploc = vector3(-1157.63, -3056.71, 13.94)
|
local stoploc = vector3(-1157.63, -3056.71, 13.94)
|
||||||
local start = locations.StartLoc[math.random(1,#locations.StartLoc)]
|
local start = locations.StartLoc[math.random(1,#locations.StartLoc)]
|
||||||
if startedmeth then
|
if startedmeth then
|
||||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('meth.alreadyChasing'),'error')
|
ps.notify(ps.lang('meth.alreadyChasing'),'error')
|
||||||
else
|
else
|
||||||
startedmeth = true
|
startedmeth = true
|
||||||
requestModel("journey", 30000)
|
ps.callback('md-drugs:server:registerMeth')
|
||||||
requestModel("a_m_m_hillbilly_02", 30000)
|
|
||||||
requestModel("cargobob3", 30000)
|
ps.requestModel("journey", Config.RequestModelTime)
|
||||||
methVan = CreateVehicle("journey", start.x+3, start.y-2, start.z-1, 52.0, true, false)
|
ps.requestModel("a_m_m_hillbilly_02", Config.RequestModelTime)
|
||||||
|
ps.requestModel("cargobob3", Config.RequestModelTime)
|
||||||
|
|
||||||
|
local methcar = CreateVehicle("journey", start.x+3, start.y-2, start.z-1, 52.0, true, false)
|
||||||
local methdriver = CreatePed(26, "a_m_m_hillbilly_02", start.x, start.y, start.z, 268.9422, false, false)
|
local methdriver = CreatePed(26, "a_m_m_hillbilly_02", start.x, start.y, start.z, 268.9422, false, false)
|
||||||
local methpilot = CreatePed(26, "a_m_m_hillbilly_02", stoploc.x-3, stoploc.y-3, stoploc.z-1, 268.9422, false, false)
|
local methpilot = CreatePed(26, "a_m_m_hillbilly_02", stoploc.x-3, stoploc.y-3, stoploc.z-1, 268.9422, false, false)
|
||||||
local can = Bridge.Callback.Trigger('md-drugs:server:registerMeth', loc, NetworkGetNetworkIdFromEntity(methVan))
|
|
||||||
if not can then
|
|
||||||
startedmeth = false
|
|
||||||
DeleteVehicle(methVan)
|
|
||||||
DeleteEntity(methdriver)
|
|
||||||
DeleteEntity(methpilot)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
FreezeEntityPosition(methpilot, true)
|
FreezeEntityPosition(methpilot, true)
|
||||||
SetEntityInvincible(methpilot, true)
|
SetEntityInvincible(methpilot, true)
|
||||||
SetEntityAsMissionEntity(methVan)
|
SetEntityAsMissionEntity(methcar)
|
||||||
AddBlipForEntity(methVan)
|
AddBlipForEntity(methcar)
|
||||||
SetPedIntoVehicle(methdriver, methVan, -1)
|
SetPedIntoVehicle(methdriver, methcar, -1)
|
||||||
SetPedFleeAttributes(methdriver,false)
|
SetPedFleeAttributes(methdriver,false)
|
||||||
TaskVehicleDriveToCoordLongrange(methdriver, methVan, stoploc.x, stoploc.y, stoploc.z-1, 50.0, 524288, 25.0)
|
TaskVehicleDriveToCoordLongrange(methdriver, methcar, stoploc.x, stoploc.y, stoploc.z-1, 50.0, 524288, 25.0)
|
||||||
SetPedKeepTask(methdriver, true)
|
SetPedKeepTask(methdriver, true)
|
||||||
|
|
||||||
repeat
|
repeat
|
||||||
@@ -39,22 +38,25 @@ local function SpawnMethCarPedChase(loc)
|
|||||||
until #(GetEntityCoords(methdriver) - stoploc) < 20.0 or GetEntityHealth(methdriver) == 0
|
until #(GetEntityCoords(methdriver) - stoploc) < 20.0 or GetEntityHealth(methdriver) == 0
|
||||||
|
|
||||||
if GetEntityHealth(methdriver) == 0 then
|
if GetEntityHealth(methdriver) == 0 then
|
||||||
Bridge.Target.AddLocalEntity(methVan, {
|
ps.entityTarget(methcar, {
|
||||||
{
|
{
|
||||||
name = 'methcar',
|
name = 'methcar',
|
||||||
icon = Bridge.Language.Locale('meth.targetStealFromCarIcon'),
|
icon = 'fa-solid fa-car',
|
||||||
label = Bridge.Language.Locale('meth.targetStealFromCar'),
|
label = ps.lang('meth.targetStealFromCar'),
|
||||||
action = function()
|
action = function()
|
||||||
if not minigame() then return end
|
if not minigame() then return end
|
||||||
TriggerServerEvent('md-drugs:server:givemethingridients', NetworkGetNetworkIdFromEntity(methVan))
|
TriggerServerEvent('md-drugs:server:givemethingridients')
|
||||||
startedmeth = false
|
startedmeth = false
|
||||||
DeleteEntity(methdriver)
|
if math.random(1,100) <= 30 then
|
||||||
DeleteEntity(methpilot)
|
DeleteVehicle(methcar)
|
||||||
|
DeleteEntity(methdriver)
|
||||||
|
DeleteEntity(methpilot)
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
else
|
else
|
||||||
DeleteVehicle(methVan)
|
DeleteVehicle(methcar)
|
||||||
DeleteEntity(methdriver)
|
DeleteEntity(methdriver)
|
||||||
DeleteEntity(methpilot)
|
DeleteEntity(methpilot)
|
||||||
end
|
end
|
||||||
@@ -65,23 +67,20 @@ local peds = {}
|
|||||||
for k, v in pairs (locations.MethHeist) do
|
for k, v in pairs (locations.MethHeist) do
|
||||||
peds[k] = CreatePed(4, GetHashKey(v.ped), v.loc.x, v.loc.y, v.loc.z, v.loc.w, false, true)
|
peds[k] = CreatePed(4, GetHashKey(v.ped), v.loc.x, v.loc.y, v.loc.z, v.loc.w, false, true)
|
||||||
Freeze(peds[k], true, v.loc.w)
|
Freeze(peds[k], true, v.loc.w)
|
||||||
Bridge.Target.AddLocalEntity(peds[k], {
|
ps.entityTarget(peds[k], {
|
||||||
{
|
{
|
||||||
icon = Bridge.Language.Locale('meth.targetHeistIcon'),
|
name = 'methheist'..k,
|
||||||
label = Bridge.Language.Locale('meth.targetHeist'),
|
icon = 'fa-solid fa-user-secret',
|
||||||
|
label = ps.lang('meth.targetHeist'),
|
||||||
action = function()
|
action = function()
|
||||||
if startedmeth then
|
if startedmeth then ps.notify(ps.lang('meth.alreadyChasing'),'error') return end
|
||||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('meth.alreadyChasing'),'error')
|
SpawnMethCarPedChase()
|
||||||
return
|
|
||||||
end
|
|
||||||
SpawnMethCarPedChase(k)
|
|
||||||
end,
|
end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
return handleGang(v.gang)
|
return handleGang(v.gang)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = peds[k]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
---- start animation shit
|
---- start animation shit
|
||||||
@@ -95,22 +94,9 @@ local function loadParticle(dict)
|
|||||||
SetPtfxAssetNextCall(dict)
|
SetPtfxAssetNextCall(dict)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function dialSuccess(coords)
|
|
||||||
requestModel('hei_prop_heist_thermite', 2000)
|
|
||||||
loadParticle('scr_ornate_heist')
|
|
||||||
local thermite = CreateObject('hei_prop_heist_thermite', coords.x - 0.5, coords.y - 0.5, coords.z -0.5, true, false, false)
|
|
||||||
FreezeEntityPosition(thermite, true)
|
|
||||||
SetEntityVisible(thermite, false)
|
|
||||||
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)
|
|
||||||
DeleteObject(thermite)
|
|
||||||
end
|
|
||||||
|
|
||||||
local function MethCooking(coords, offset, rotation)
|
local function MethCooking(coords, offset, rotation)
|
||||||
local animDict, animName = "anim@amb@business@meth@meth_monitoring_cooking@cooking@", "chemical_pour_short_cooker"
|
local animDict, animName = "anim@amb@business@meth@meth_monitoring_cooking@cooking@", "chemical_pour_short_cooker"
|
||||||
Bridge.Anim.RequestDict(animDict)
|
ps.requestAnim(animDict, 500)
|
||||||
SetEntityCoords(PlayerPedId(), coords)
|
SetEntityCoords(PlayerPedId(), coords)
|
||||||
local targetPosition = GetEntityCoords(PlayerPedId())
|
local targetPosition = GetEntityCoords(PlayerPedId())
|
||||||
local animDuration = GetAnimDuration(animDict, animName) * 800
|
local animDuration = GetAnimDuration(animDict, animName) * 800
|
||||||
@@ -127,13 +113,22 @@ local function MethCooking(coords, offset, rotation)
|
|||||||
NetworkStopSynchronisedScene(netScene)
|
NetworkStopSynchronisedScene(netScene)
|
||||||
DeleteObject(sacid) DeleteObject(ammonia)
|
DeleteObject(sacid) DeleteObject(ammonia)
|
||||||
FreezeEntityPosition(PlayerPedId(), false)
|
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
|
end
|
||||||
|
|
||||||
|
|
||||||
local function SmashMeth(coords, offset, rotation)
|
local function SmashMeth(coords, offset, rotation)
|
||||||
local ver = ""
|
local ver = ""
|
||||||
local animDict, animName = "anim@amb@business@meth@meth_smash_weight_check@", "break_weigh_"..ver.."char02"
|
local animDict, animName = "anim@amb@business@meth@meth_smash_weight_check@", "break_weigh_"..ver.."char02"
|
||||||
Bridge.Anim.RequestDict(animDict, 500)
|
ps.requestAnim(animDict, 500)
|
||||||
local ped = PlayerPedId()
|
local ped = PlayerPedId()
|
||||||
local targetPosition = coords
|
local targetPosition = coords
|
||||||
SetEntityCoords(ped, targetPosition)
|
SetEntityCoords(ped, targetPosition)
|
||||||
@@ -168,7 +163,7 @@ end
|
|||||||
local function BagMeth(coords, offset, rotation)
|
local function BagMeth(coords, offset, rotation)
|
||||||
local ver = ""
|
local ver = ""
|
||||||
local animDict, animName = "anim@amb@business@meth@meth_smash_weight_check@", "break_weigh_"..ver.."char01"
|
local animDict, animName = "anim@amb@business@meth@meth_smash_weight_check@", "break_weigh_"..ver.."char01"
|
||||||
Bridge.Anim.RequestDict(animDict, 500)
|
ps.requestAnim(animDict, 500)
|
||||||
local animDuration = GetAnimDuration(animDict, animName) * 1000
|
local animDuration = GetAnimDuration(animDict, animName) * 1000
|
||||||
local ped = PlayerPedId()
|
local ped = PlayerPedId()
|
||||||
SetEntityCoords(ped, coords)
|
SetEntityCoords(ped, coords)
|
||||||
@@ -237,44 +232,44 @@ end
|
|||||||
|
|
||||||
local function startcook(num, coords, offset, rotation)
|
local function startcook(num, coords, offset, rotation)
|
||||||
if not amonia then
|
if not amonia then
|
||||||
local adding = Bridge.Callback.Trigger('md-drugs:server:startcook', num)
|
local adding = ps.callback('md-drugs:server:startcook', num)
|
||||||
if not adding then return end
|
if not adding then return end
|
||||||
active = true
|
active = true
|
||||||
|
amonia = true
|
||||||
MethCooking(coords, offset, rotation)
|
MethCooking(coords, offset, rotation)
|
||||||
amonia = true
|
amonia = true
|
||||||
else
|
else
|
||||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('meth.started'), "error")
|
ps.notify(ps.lang('meth.started'), "error")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local function dials(coords)
|
local function dials(coords)
|
||||||
if amonia then
|
if amonia == true then
|
||||||
if not minigame() then
|
if not ps.minigame('ps-circle', {amount = 2, speed = 8}) then
|
||||||
AddExplosion(coords.x, coords.y,coords.z, 49, 10, true, false, true)
|
AddExplosion(coords.x, coords.y,coords.z, 49, 10, true, false, true)
|
||||||
amonia = false
|
amonia = false
|
||||||
active = false
|
active = false
|
||||||
return
|
return end
|
||||||
end
|
ps.notify(ps.lang('meth.increaseHeat'), "success")
|
||||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('meth.increaseHeat'), "success")
|
|
||||||
dialSuccess(coords)
|
|
||||||
heated = true
|
heated = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function smash(coords, offset, rotation, buckets, k)
|
local function smash(coords, offset, rotation, buckets, k)
|
||||||
if active and tray and amonia and heated then
|
if tray then
|
||||||
DeleteObject(trays)
|
|
||||||
tray = false
|
tray = false
|
||||||
|
DeleteObject(trays)
|
||||||
local bucket = CreateObject("bkr_prop_meth_bigbag_03a", buckets.x, buckets.y, buckets.z, true, true, true)
|
local bucket = CreateObject("bkr_prop_meth_bigbag_03a", buckets.x, buckets.y, buckets.z, true, true, true)
|
||||||
Freeze(bucket, true, buckets.w)
|
Freeze(bucket, true, buckets.w)
|
||||||
SmashMeth(coords, offset, rotation)
|
ps.entityTarget(bucket, {
|
||||||
Wait(100)
|
|
||||||
Bridge.Target.AddLocalEntity(bucket, {
|
|
||||||
{
|
{
|
||||||
name = 'bucket',
|
name = 'bucket',
|
||||||
icon = Bridge.Language.Locale('meth.targetBagIcon'),
|
icon = "fa-solid fa-sack-xmark",
|
||||||
label = Bridge.Language.Locale('meth.targetBag'),
|
label = ps.lang('meth.targetBag'),
|
||||||
|
canInteract = function()
|
||||||
|
if active == false then return false end
|
||||||
|
end,
|
||||||
action = function()
|
action = function()
|
||||||
DeleteObject(bucket)
|
DeleteObject(bucket)
|
||||||
active = false
|
active = false
|
||||||
@@ -284,48 +279,52 @@ local function smash(coords, offset, rotation, buckets, k)
|
|||||||
BagMeth(locations.BagMeth[k].loc, locations.BagMeth[k].offset, locations.BagMeth[k].rotation)
|
BagMeth(locations.BagMeth[k].loc, locations.BagMeth[k].offset, locations.BagMeth[k].rotation)
|
||||||
TriggerServerEvent('md-drugs:server:getmeth', k)
|
TriggerServerEvent('md-drugs:server:getmeth', k)
|
||||||
end,
|
end,
|
||||||
canInteract = function()
|
|
||||||
if not active then return false end
|
|
||||||
return true
|
|
||||||
end,
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = bucket
|
SmashMeth(coords, offset, rotation)
|
||||||
|
Wait(100)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function trayscarry()
|
local function trayscarry()
|
||||||
if amonia and heated then
|
if amonia then
|
||||||
local pos = GetEntityCoords(PlayerPedId(), true)
|
local pos = GetEntityCoords(PlayerPedId(), true)
|
||||||
Bridge.Anim.RequestDict('anim@heists@box_carry@')
|
ps.requestAnim('anim@heists@box_carry@')
|
||||||
TaskPlayAnim(PlayerPedId(), 'anim@heists@box_carry@', 'idle', 5.0, -1, -1, 50, 0, false, false, false)
|
TaskPlayAnim(PlayerPedId(), 'anim@heists@box_carry@', 'idle', 5.0, -1, -1, 50, 0, false, false, false)
|
||||||
requestModel('bkr_prop_meth_tray_02a')
|
ps.requestModel('bkr_prop_meth_tray_02a')
|
||||||
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,-0.2, 20.0, 0.0, 0.0, true, true, false, true, 1, 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)
|
||||||
tray = true
|
tray = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
CreateThread(function()
|
||||||
|
BikerMethLab = exports['bob74_ipl']:GetBikerMethLabObject()
|
||||||
|
BikerMethLab.Style.Set(BikerMethLab.Style.upgrade)
|
||||||
|
BikerMethLab.Security.Set(BikerMethLab.Security.upgrade)
|
||||||
|
BikerMethLab.Details.Enable(BikerMethLab.Details.production, true)
|
||||||
|
RefreshInterior(BikerMethLab.interiorId)
|
||||||
|
end)
|
||||||
|
|
||||||
for k, v in pairs (locations.CookMeth) do
|
for k, v in pairs (locations.CookMeth) do
|
||||||
Bridge.Target.AddBoxZone('cookMeth'..k, v.loc, v.size, v.loc.w or 180.0, {
|
ps.boxTarget('cookMeth'..k, v.loc, {length = v.l, width = v.w, rotation = v.rot, height = 1.0},{
|
||||||
{
|
{
|
||||||
label = Bridge.Language.Locale('meth.targetCook'),
|
label = ps.lang('meth.targetCook'),
|
||||||
icon = Bridge.Language.Locale('meth.targetCookIcon'),
|
icon = 'fa-solid fa-temperature-high',
|
||||||
action = function()
|
action = function()
|
||||||
startcook(k, v.loc, v.offset or vec3(0,0,0), v.rotation or vector3(0,0,180.0))
|
startcook(k, v.loc, v.offset or vec3(0,0,0), v.rotation or vector3(0,0,180.0))
|
||||||
end,
|
end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
if not handleGang(v.gang) then return false end
|
if not handleGang(v.gang) then return false end
|
||||||
if not amonia and not active then
|
if not amonia and not active then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon = Bridge.Language.Locale('meth.targetGrabTrayIcon'),
|
icon = "fas fa-sign-in-alt",
|
||||||
label = Bridge.Language.Locale('meth.targetGrabTray'),
|
label = ps.lang('meth.targetGrabTray'),
|
||||||
action = function() trayscarry() end,
|
action = function() trayscarry() end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
if not handleGang(v.gang) then return false end
|
if not handleGang(v.gang) then return false end
|
||||||
@@ -335,15 +334,14 @@ for k, v in pairs (locations.CookMeth) do
|
|||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
targets[#targets+1] = 'cookMeth'..k
|
|
||||||
end
|
end
|
||||||
|
|
||||||
for k, v in pairs (locations.MethDials) do
|
for k, v in pairs (locations.MethDials) do
|
||||||
Bridge.Target.AddBoxZone('adjustMethDials'..k, v.loc, v.size, v.loc.w or 180.0, {
|
ps.boxTarget('adjustMethDials'..k, v.loc, {length = v.l, width = v.w, rotation = v.rot, height = 1.0},{
|
||||||
{
|
{
|
||||||
name = 'adjustdials',
|
name = 'adjustdials',
|
||||||
icon = Bridge.Language.Locale('meth.targetHeatIcon'),
|
icon = "fa-solid fa-temperature-three-quarters",
|
||||||
label = Bridge.Language.Locale('meth.targetHeat'),
|
label = ps.lang('meth.targetHeat'),
|
||||||
action = function()
|
action = function()
|
||||||
dials(locations.CookMeth[k].loc)
|
dials(locations.CookMeth[k].loc)
|
||||||
end,
|
end,
|
||||||
@@ -353,15 +351,14 @@ for k, v in pairs (locations.MethDials) do
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = 'adjustMethDials'..k
|
|
||||||
end
|
end
|
||||||
|
|
||||||
for k, v in pairs (locations.MethSmash) do
|
for k, v in pairs (locations.MethSmash) do
|
||||||
Bridge.Target.AddBoxZone('smashMeth'..k, v.loc, v.size, v.loc.w or 180.0, {
|
ps.boxTarget('smashMeth'..k, v.loc, {length = v.l, width = v.w, rotation = v.rot, height = 1.0},{
|
||||||
{
|
{
|
||||||
name = 'smash',
|
name = 'smash',
|
||||||
icon = Bridge.Language.Locale('meth.targetSmashIcon'),
|
icon = "fa-solid fa-weight-scale",
|
||||||
label = Bridge.Language.Locale('meth.targetSmash'),
|
label = ps.lang('meth.targetSmash'),
|
||||||
action = function()
|
action = function()
|
||||||
smash(v.loc, v.offset, v.rotation, v.bucket,k)
|
smash(v.loc, v.offset, v.rotation, v.bucket,k)
|
||||||
end,
|
end,
|
||||||
@@ -371,14 +368,13 @@ for k, v in pairs (locations.MethSmash) do
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = 'smashMeth'..k
|
|
||||||
end
|
end
|
||||||
|
|
||||||
for k, v in pairs (locations.MethTele) do
|
for k, v in pairs (locations.MethTele) do
|
||||||
Bridge.Target.AddBoxZone('meth_tele'..k, v.inside, v.size, v.rot, {
|
ps.boxTarget('meth_tele'..k, v.inside, {length = v.l, width = v.w, heading = v.rot}, {
|
||||||
{
|
{
|
||||||
icon = Bridge.Language.Locale('meth.teleOutIcon'),
|
icon = 'fa-solid fa-door-open',
|
||||||
label = Bridge.Language.Locale('meth.teleOut'),
|
label = ps.lang('coke.teleOut'),
|
||||||
action = function()
|
action = function()
|
||||||
SetEntityCoords(PlayerPedId(), v.outside)
|
SetEntityCoords(PlayerPedId(), v.outside)
|
||||||
end,
|
end,
|
||||||
@@ -387,10 +383,10 @@ for k, v in pairs (locations.MethTele) do
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
Bridge.Target.AddBoxZone('meth_teleout'..k, v.outside, v.size, v.rot, {
|
ps.boxTarget('meth_teleout'..k, v.outside, {length = v.l, width = v.w, heading = v.rot}, {
|
||||||
{
|
{
|
||||||
icon = Bridge.Language.Locale('meth.teleInIcon'),
|
icon = 'fa-solid fa-door-closed',
|
||||||
label = Bridge.Language.Locale('meth.teleIn'),
|
label = ps.lang('coke.teleIn'),
|
||||||
action = function()
|
action = function()
|
||||||
SetEntityCoords(PlayerPedId(), v.inside)
|
SetEntityCoords(PlayerPedId(), v.inside)
|
||||||
end,
|
end,
|
||||||
@@ -399,8 +395,6 @@ for k, v in pairs (locations.MethTele) do
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = 'meth_tele'..k
|
|
||||||
targets[#targets+1] = 'meth_teleout'..k
|
|
||||||
end
|
end
|
||||||
|
|
||||||
RegisterCommand('offset', function()
|
RegisterCommand('offset', function()
|
||||||
@@ -411,12 +405,12 @@ RegisterCommand('offset', function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
for k, v in pairs (locations.MethEph) do
|
for k, v in pairs (locations.MethEph) do
|
||||||
Bridge.Target.AddBoxZone('stealMethEph'..k, v.loc, v.size, v.loc.w or 180.0, {
|
ps.boxTarget('stealMethEph'..k, v.loc, {length = v.l, width = v.w, rotation = v.rot, height = 1.0},{
|
||||||
{
|
{
|
||||||
label = Bridge.Language.Locale('meth.targetStealEPH'),
|
label = ps.lang('meth.targetStealEPH'),
|
||||||
icon = Bridge.Language.Locale('meth.targetStealEPHIcon'),
|
icon = 'fa-solid fa-bucket',
|
||||||
action = function()
|
action = function()
|
||||||
if not progressbar(Bridge.Language.Locale('meth.stealingEPH')) then return end
|
if not ps.progressbar(ps.lang('meth.stealingEPH'), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:geteph", k)
|
TriggerServerEvent("md-drugs:server:geteph", k)
|
||||||
end,
|
end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
@@ -424,15 +418,14 @@ for k, v in pairs (locations.MethEph) do
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = 'stealMethEph'..k
|
|
||||||
end
|
end
|
||||||
for k, v in pairs (locations.MethAce) do
|
for k, v in pairs (locations.MethAce) do
|
||||||
Bridge.Target.AddBoxZone('stealMethAce'..k, v.loc, v.size, v.loc.w or 180.0, {
|
ps.boxTarget('stealMethAce'..k, v.loc, {length = v.l, width = v.w, rotation = v.rot, height = 1.0},{
|
||||||
{
|
{
|
||||||
label = Bridge.Language.Locale('meth.targetStealACE'),
|
label = ps.lang('meth.targetStealACE'),
|
||||||
icon = Bridge.Language.Locale('meth.targetStealACEIcon'),
|
icon = 'fa-solid fa-bucket',
|
||||||
action = function()
|
action = function()
|
||||||
if not progressbar(Bridge.Language.Locale('meth.stealingACE')) then return end
|
if not ps.progressbar(ps.lang('meth.stealingACE'), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:getace", k)
|
TriggerServerEvent("md-drugs:server:getace", k)
|
||||||
end,
|
end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
@@ -440,13 +433,6 @@ for k, v in pairs (locations.MethAce) do
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = 'stealMethAce'..k
|
|
||||||
end
|
end
|
||||||
|
|
||||||
CreateThread(function()
|
|
||||||
BikerMethLab = exports['bob74_ipl']:GetBikerMethLabObject()
|
|
||||||
BikerMethLab.Style.Set(BikerMethLab.Style.upgrade)
|
|
||||||
BikerMethLab.Security.Set(BikerMethLab.Security.upgrade)
|
|
||||||
BikerMethLab.Details.Enable(BikerMethLab.Details.production, true)
|
|
||||||
RefreshInterior(BikerMethLab.interiorId)
|
|
||||||
end)
|
|
||||||
@@ -0,0 +1,173 @@
|
|||||||
|
local inside = false
|
||||||
|
---- 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 MethCooking(coords, offset, rotation)
|
||||||
|
CreateThread(function()
|
||||||
|
local animDict, animName = "anim@amb@business@meth@meth_monitoring_cooking@cooking@", "chemical_pour_short_cooker"
|
||||||
|
ps.requestModel('ig_priest', 500)
|
||||||
|
local worker1 = CreatePed(4, 'ig_priest', coords.x + 1.0, coords.y + 1.0, coords.z - 1.0, 0.0, true, true)
|
||||||
|
ps.requestAnim(animDict, 500)
|
||||||
|
SetEntityCoords(worker1, coords)
|
||||||
|
local targetPosition = GetEntityCoords(worker1)
|
||||||
|
local animDuration = GetAnimDuration(animDict, animName) * 800
|
||||||
|
FreezeEntityPosition(worker1, 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(worker1, 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(worker1, false)
|
||||||
|
if inside then
|
||||||
|
MethCooking(coords, offset, rotation)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
local function SmashMeth(coords, offset, rotation)
|
||||||
|
CreateThread(function()
|
||||||
|
local ver = ""
|
||||||
|
local animDict, animName = "anim@amb@business@meth@meth_smash_weight_check@", "break_weigh_"..ver.."char02"
|
||||||
|
ps.requestAnim(animDict, 500)
|
||||||
|
local ped = CreatePed(4, 'ig_priest', coords.x + 1.0, coords.y + 1.0, coords.z - 1.0, 0.0, true, true)
|
||||||
|
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)
|
||||||
|
if inside then
|
||||||
|
SmashMeth(coords, offset, rotation)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function BagMeth(coords, offset, rotation)
|
||||||
|
CreateThread(function()
|
||||||
|
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 = CreatePed(4, 'ig_priest', coords.x + 1.0, coords.y + 1.0, coords.z - 1.0, 0.0, true, true)
|
||||||
|
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)
|
||||||
|
if inside then
|
||||||
|
BagMeth(coords, offset, rotation)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
RegisterCommand('TestMethLab', function()
|
||||||
|
TriggerServerEvent('TestMethLab')
|
||||||
|
Wait(2000)
|
||||||
|
SetEntityCoords(PlayerPedId(), vector3(1004.66, -3199.98, -38.99)) -- Example coordinates
|
||||||
|
end)
|
||||||
|
|
||||||
|
RegisterCommand('RestoreMethLab', function()
|
||||||
|
TriggerServerEvent('RestoreMethLab')
|
||||||
|
end)
|
||||||
|
|
||||||
|
RegisterCommand('methcook', function()
|
||||||
|
local coords = vector3(1006.09, -3200.59, -38.52)
|
||||||
|
local offset = vector3(4.79, 2.13, -0.41)
|
||||||
|
local rotation = vector3(0.0, 0.0, 0.0)
|
||||||
|
inside = true
|
||||||
|
MethCooking(coords, offset, rotation)
|
||||||
|
SmashMeth(vector3(1012.04, -3194.96, -38.99), vector3(-3.143311, -1.666748, -1.010128), vector3(0,0,0.0))
|
||||||
|
BagMeth(vector3(1014.25, -3194.93, -38.99), vector3(-4.9, -1.70, -1.01), vector3(0,0,0.0))
|
||||||
|
end)
|
||||||
@@ -1,20 +1,17 @@
|
|||||||
if not Config.Drugs['oxyruns'] then return end
|
|
||||||
local carryPackage = nil
|
local carryPackage = nil
|
||||||
local onMission = false
|
local onMission = false
|
||||||
local locations = Config.Oxy.Locations
|
local locations = ps.callback('md-drugs:server:GetOxyLocs')
|
||||||
local pdAlert = 90
|
|
||||||
local vehicle = nil
|
|
||||||
|
|
||||||
local function getRoute()
|
local function getRoute()
|
||||||
local Route = Bridge.Callback.Trigger('md-drugs:server:getRoute')
|
local Route = ps.callback('md-drugs:server:getRoute')
|
||||||
if not Route then
|
if not Route then
|
||||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('oxy.ditchCar'), "error")
|
ps.notify(ps.lang('oxy.ditchCar'), "error")
|
||||||
onMission = false
|
onMission = false
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
local Route = locations.oxylocations[Route]
|
|
||||||
SetNewWaypoint(Route.x, Route.y)
|
SetNewWaypoint(Route.x, Route.y)
|
||||||
requestModel('g_m_y_famdnf_01', 30000)
|
ps.requestModel('g_m_y_famdnf_01', Config.RequestModelTime)
|
||||||
local oxybuyer = CreatePed(0, 'g_m_y_famdnf_01',Route.x,Route.y,Route.z-1, Route.w, false, false)
|
local oxybuyer = CreatePed(0, 'g_m_y_famdnf_01',Route.x,Route.y,Route.z-1, Route.w, false, false)
|
||||||
Freeze(oxybuyer, true, Route.w)
|
Freeze(oxybuyer, true, Route.w)
|
||||||
local timeOut = 300
|
local timeOut = 300
|
||||||
@@ -24,14 +21,14 @@ local function getRoute()
|
|||||||
timeOut = timeOut - 1
|
timeOut = timeOut - 1
|
||||||
until #(GetEntityCoords(PlayerPedId()) - vector3(Route.x,Route.y,Route.z)) < 5.0 or timeOut == 0
|
until #(GetEntityCoords(PlayerPedId()) - vector3(Route.x,Route.y,Route.z)) < 5.0 or timeOut == 0
|
||||||
|
|
||||||
PoliceCall(pdAlert)
|
PoliceCall(Config.PoliceAlertOxy)
|
||||||
Bridge.Target.AddLocalEntity(oxybuyer,{
|
ps.entityTarget(oxybuyer,{
|
||||||
{
|
{
|
||||||
label = Bridge.Language.Locale('oxy.targetHandoff'),
|
label = ps.lang('oxy.targetHandoff'),
|
||||||
icon = Bridge.Language.Locale('oxy.targetHandOffIcon'),
|
icon = "fa-solid fa-dollar-sign",
|
||||||
action = function()
|
action = function()
|
||||||
if carryPackage then
|
if carryPackage then
|
||||||
if not progressbar(Bridge.Language.Locale('oxy.handingoff')) then return end
|
if not ps.progressbar(ps.lang('oxy.handingoff'), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:giveoxybox")
|
TriggerServerEvent("md-drugs:server:giveoxybox")
|
||||||
DeleteEntity(oxybuyer)
|
DeleteEntity(oxybuyer)
|
||||||
DetachEntity(carryPackage, true, true)
|
DetachEntity(carryPackage, true, true)
|
||||||
@@ -39,44 +36,47 @@ local function getRoute()
|
|||||||
carryPackage = nil
|
carryPackage = nil
|
||||||
getRoute()
|
getRoute()
|
||||||
else
|
else
|
||||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('oxy.emptyHands'), "error")
|
ps.notify(ps.lang('oxy.emptyHands'), "error")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = oxybuyer
|
|
||||||
end
|
end
|
||||||
|
|
||||||
for k, v in pairs(locations.OxyPayForTruck) do
|
for k, v in pairs(locations.OxyPayForTruck) do
|
||||||
Bridge.Target.AddBoxZone('oxyTruckPur' ..k , v.loc, v.size, v.loc.w or 180.0, {
|
ps.boxTarget('oxyTruckPur' ..k , v.loc, {length = v.l, width = v.w, heading = v.rot}, {
|
||||||
{
|
{
|
||||||
icon = Bridge.Language.Locale('oxy.targetPayIcon'),
|
icon = 'fa-solid fa-truck-fast',
|
||||||
label = Bridge.Language.Locale('oxy.targetPay'),
|
label = ps.lang('oxy.targetPay'),
|
||||||
action = function()
|
action = function()
|
||||||
requestModel("burrito3", 30000)
|
ps.requestModel("burrito3", Config.RequestModelTime)
|
||||||
|
|
||||||
local paid = Bridge.Callback.Trigger('md-drugs:server:payfortruck', k)
|
local paid = ps.callback('md-drugs:server:payfortruck', false)
|
||||||
if not paid then return end
|
if not paid then return end
|
||||||
vehicle = CreateVehicle("burrito3",v.truckSpawn.x, v.truckSpawn.y, v.truckSpawn.z, v.truckSpawn.w, true, false)
|
local oxycar = CreateVehicle("burrito3",v.truckSpawn.x, v.truckSpawn.y, v.truckSpawn.z, v.truckSpawn.w, true, false)
|
||||||
SetVehicleFuelLevel(vehicle, 100.0)
|
|
||||||
local plate = GetVehicleNumberPlateText(vehicle)
|
if Config.Fuel == "ox_fuel" then
|
||||||
Bridge.VehicleKey.GiveKeys(vehicle, plate)
|
Entity(oxycar).state.fuel = 100.0
|
||||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('oxy.keys'), 'success')
|
else
|
||||||
|
exports[Config.Fuel]:SetFuel(oxycar, 100.0)
|
||||||
|
end
|
||||||
|
TriggerEvent("vehiclekeys:client:SetOwner", GetVehicleNumberPlateText(oxycar))
|
||||||
|
ps.notify(ps.lang('oxy.keys'), 'success')
|
||||||
onMission = true
|
onMission = true
|
||||||
TriggerServerEvent('md-drugs:server:startOxyRun', NetworkGetNetworkIdFromEntity(vehicle))
|
getRoute()
|
||||||
|
|
||||||
Bridge.Target.AddLocalEntity(vehicle, {
|
ps.entityTarget(oxycar, {
|
||||||
{
|
{
|
||||||
icon = Bridge.Language.Locale('oxy.targetGetPackageIcon'),
|
icon = "fa-solid fa-box",
|
||||||
label = Bridge.Language.Locale('oxy.targetGetPackage'),
|
label = ps.lang('oxy.targetGetPackage'),
|
||||||
action = function()
|
action = function()
|
||||||
if carryPackage then
|
if carryPackage then
|
||||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('oxy.alreadyCarrying'), "error")
|
ps.notify(ps.lang('oxy.alreadyCarrying'), "error")
|
||||||
else
|
else
|
||||||
local pos = GetEntityCoords(PlayerPedId(), true)
|
local pos = GetEntityCoords(PlayerPedId(), true)
|
||||||
Bridge.Anim.RequestDict('anim@heists@box_carry@')
|
ps.requestAnim('anim@heists@box_carry@')
|
||||||
TaskPlayAnim(PlayerPedId(), 'anim@heists@box_carry@', 'idle', 5.0, -1, -1, 50, 0, false, false, false)
|
TaskPlayAnim(PlayerPedId(), 'anim@heists@box_carry@', 'idle', 5.0, -1, -1, 50, 0, false, false, false)
|
||||||
requestModel("hei_prop_drug_statue_box_big")
|
ps.requestModel("hei_prop_drug_statue_box_big")
|
||||||
carryPackage = CreateObject("hei_prop_drug_statue_box_big", pos.x, pos.y, pos.z, true, true, true)
|
carryPackage = CreateObject("hei_prop_drug_statue_box_big", pos.x, pos.y, pos.z, true, true, true)
|
||||||
AttachEntityToEntity(carryPackage, PlayerPedId(), GetPedBoneIndex(PlayerPedId(), 57005), 0.05, 0.1, -0.3, 300.0, 250.0, 20.0, true, true, false, true, 1, true)
|
AttachEntityToEntity(carryPackage, PlayerPedId(), GetPedBoneIndex(PlayerPedId(), 57005), 0.05, 0.1, -0.3, 300.0, 250.0, 20.0, true, true, false, true, 1, true)
|
||||||
end
|
end
|
||||||
@@ -86,8 +86,6 @@ for k, v in pairs(locations.OxyPayForTruck) do
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
Wait(1000)
|
|
||||||
getRoute()
|
|
||||||
end,
|
end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
if onMission then
|
if onMission then
|
||||||
@@ -97,5 +95,5 @@ for k, v in pairs(locations.OxyPayForTruck) do
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = 'oxyTruckPur' ..k
|
|
||||||
end
|
end
|
||||||
@@ -1,45 +1,29 @@
|
|||||||
|
local locations = ps.callback('md-drugs:server:GetPharmaLocs')
|
||||||
|
|
||||||
if not Config.Drugs['pharma'] then return end
|
ps.registerCallback("md-drugs:client:prescriptionpad", function(data, op)
|
||||||
local locations = Config.Pharma.Locations
|
if ps.getJobType() ~= 'ems' then return end
|
||||||
|
local input = ps.input(ps.lang('pharma.input.header'), {
|
||||||
Bridge.Callback.Register("md-drugs:client:prescriptionpad", function( data, op)
|
{type = 'select', title = ps.lang('pharma.input.title1'), options = data},
|
||||||
local job = Bridge.Framework.GetPlayerJob()
|
{type = 'select', title = ps.lang('pharma.input.title2'), options = op}
|
||||||
if job ~= 'ambulance' then
|
|
||||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('pharma.notPharma'), 'error')
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local input = Bridge.Input.Open(Bridge.Language.Locale('pharma.input.header'), {
|
|
||||||
{type = 'select', title = Bridge.Language.Locale('pharma.input.title1'), options = data},
|
|
||||||
{type = 'select', title = Bridge.Language.Locale('pharma.input.title2'), options = op}
|
|
||||||
})
|
})
|
||||||
if not input[1] then return end
|
if not input[1] then return end
|
||||||
if not progressbar(Bridge.Language.Locale('pharma.write'), 4000, {
|
if not ps.progressbar(ps.lang('pharma.write'), 4000, 'notepad') then return end
|
||||||
dict = 'missheistdockssetup1clipboard@base',
|
|
||||||
clip = 'base',
|
|
||||||
flag = 49,
|
|
||||||
prop = {
|
|
||||||
model = 'prop_notepad_01',
|
|
||||||
bone = 18905,
|
|
||||||
pos = {0.1, 0.02, 0.03},
|
|
||||||
rot = { -90.0, 0.0, 0.0}
|
|
||||||
}
|
|
||||||
}) then return end
|
|
||||||
return {who = input[1], what = input[2]}
|
return {who = input[1], what = input[2]}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
Bridge.Callback.Register("md-drugs:client:unbottle", function()
|
ps.registerCallback("md-drugs:client:unbottle", function()
|
||||||
if not progressbar(Bridge.Language.Locale('pharma.opening')) then return end
|
if not ps.progressbar(ps.lang('pharma.opening'), 4000, 'uncuff') then return end
|
||||||
return true
|
return true
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
for k, v in pairs (locations.FillPrescription) do
|
for k, v in pairs (locations.FillPrescription) do
|
||||||
Bridge.Target.AddBoxZone('pharma' ..k , v.loc,v.size, v.loc.w or 180, {
|
ps.boxTarget('pharma' ..k , v.loc, {length = v.l, width = v.w, heading = v.rot}, {
|
||||||
{
|
{
|
||||||
icon = Bridge.Language.Locale('pharma.fillIcon'),
|
icon = 'fa-solid fa-capsules',
|
||||||
label = Bridge.Language.Locale('pharma.targetFill'),
|
label = ps.lang('pharma.targetFill'),
|
||||||
action = function()
|
action = function()
|
||||||
if not progressbar(Bridge.Language.Locale('pharma.fill')) then return end
|
if not ps.progressbar(ps.lang('pharma.fill'), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:fillprescription", k)
|
TriggerServerEvent("md-drugs:server:fillprescription", k)
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,50 +1,45 @@
|
|||||||
|
|
||||||
local DrugPlants = {
|
local DrugPlants = {
|
||||||
{model = 'prop_plant_01a', label = 'coke', langs = Bridge.Language.Locale('coke.targetPick'), tbl = GlobalState.CocaPlant, plantTbl = {},
|
{model = 'prop_plant_01a', label = 'coke', langs = ps.lang('coke.targetPick'), tbl = GlobalState.CocaPlant, plantTbl = {},
|
||||||
pick = function(loc)
|
pick = function(loc)
|
||||||
if not progressbar(Bridge.Language.Locale('coke.picking')) then return end
|
if not ps.progressbar(ps.lang('coke.picking'), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("coke:pickupCane", loc)
|
TriggerServerEvent("coke:pickupCane", loc)
|
||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
allow = Config.Drugs.cocaine,
|
allow = Config.Drugs.cocaine,
|
||||||
icon = Bridge.Language.Locale('coke.pickIcon'),
|
|
||||||
},
|
},
|
||||||
{model = 'prop_plant_01b', label = 'heroin',langs = Bridge.Language.Locale('heroin.targetPick'), tbl = GlobalState.PoppyPlants, plantTbl = {},
|
{model = 'prop_plant_01b', label = 'heroin',langs = ps.lang('heroin.targetPick'), tbl = GlobalState.PoppyPlants, plantTbl = {},
|
||||||
pick = function(loc)
|
pick = function(loc)
|
||||||
if not progressbar(Bridge.Language.Locale('heroin.picking')) then return end
|
if not ps.progressbar(ps.lang('heroin.picking'), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("heroin:pickupCane", loc)
|
TriggerServerEvent("heroin:pickupCane", loc)
|
||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
allow = Config.Drugs.heroin,
|
allow = Config.Drugs.heroin,
|
||||||
icon = Bridge.Language.Locale('heroin.pickIcon'),
|
|
||||||
},
|
},
|
||||||
{model = 'prop_cactus_03', label = 'Mescaline', langs = Bridge.Language.Locale('mesc.targetPick'), tbl = GlobalState.Mescaline, plantTbl = {},
|
{model = 'prop_cactus_03', label = 'Mescaline', langs = ps.lang('mesc.targetPick'), tbl = GlobalState.Mescaline, plantTbl = {},
|
||||||
pick = function(loc)
|
pick = function(loc)
|
||||||
if not progressbar(Bridge.Language.Locale('mesc.picking')) then return end
|
if not ps.progressbar(ps.lang('mesc.picking'), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("Mescaline:pickupCane", loc)
|
TriggerServerEvent("Mescaline:pickupCane", loc)
|
||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
allow = Config.Drugs.mescaline,
|
allow = Config.Drugs.mescaline,
|
||||||
icon = Bridge.Language.Locale('mesc.pickIcon'),
|
|
||||||
|
|
||||||
},
|
},
|
||||||
{model = 'prop_weed_01', label = 'weed', langs = Bridge.Language.Locale('weed.targetPick'), tbl = GlobalState.WeedPlant, plantTbl = {},
|
{model = 'prop_weed_01', label = 'weed', langs = ps.lang('weed.targetPick'), tbl = GlobalState.WeedPlant, plantTbl = {},
|
||||||
pick = function(loc)
|
pick = function(loc)
|
||||||
if not progressbar(Bridge.Language.Locale('weed.picking')) then return end
|
if not ps.progressbar(ps.lang('weed.picking'), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("weed:pickupCane", loc)
|
TriggerServerEvent("weed:pickupCane", loc)
|
||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
allow = Config.Drugs.weed,
|
allow = Config.Drugs.weed,
|
||||||
icon = Bridge.Language.Locale('weed.pickIcon'),
|
|
||||||
},
|
},
|
||||||
{model = 'mushroom', label = 'shrooms', langs = Bridge.Language.Locale('shrooms.targetPick'), tbl = GlobalState.shrooms, plantTbl = {},
|
{model = 'mushroom', label = 'shrooms', langs = ps.lang('shrooms.targetPick'), tbl = GlobalState.shrooms, plantTbl = {},
|
||||||
pick = function(loc)
|
pick = function(loc)
|
||||||
if not progressbar(Bridge.Language.Locale('shrooms.picking')) then return end
|
if not ps.progressbar(ps.lang('shrooms.picking'), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("shrooms:pickupCane", loc)
|
TriggerServerEvent("shrooms:pickupCane", loc)
|
||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
allow = Config.Drugs.shrooms,
|
allow = Config.Drugs.shrooms,
|
||||||
icon = Bridge.Language.Locale('shrooms.pickIcon'),
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,10 +49,10 @@ for k, v in pairs (DrugPlants) do
|
|||||||
local plant = v.tbl[loc]
|
local plant = v.tbl[loc]
|
||||||
local hash = GetHashKey(plant.model)
|
local hash = GetHashKey(plant.model)
|
||||||
if not v.plantTbl[loc] then
|
if not v.plantTbl[loc] then
|
||||||
requestModel(hash)
|
ps.requestModel(hash)
|
||||||
v.plantTbl[loc] = CreateObject(hash, plant.location, false, true, true)
|
v.plantTbl[loc] = CreateObject(hash, plant.location, false, true, true)
|
||||||
Freeze(v.plantTbl[loc], true, plant.heading)
|
Freeze(v.plantTbl[loc], true, plant.heading)
|
||||||
Bridge.Target.AddLocalEntity(v.plantTbl[loc], {
|
ps.entityTarget(v.plantTbl[loc], {
|
||||||
{
|
{
|
||||||
icon = v.icon,
|
icon = v.icon,
|
||||||
label = v.langs,
|
label = v.langs,
|
||||||
@@ -66,7 +61,6 @@ for k, v in pairs (DrugPlants) do
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = v.plantTbl[loc]
|
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@@ -82,7 +76,7 @@ for k, v in pairs (DrugPlants) do
|
|||||||
if not value.taken then
|
if not value.taken then
|
||||||
v.plantTbl[key] = CreateObject(hash, value.location.x, value.location.y, value.location.z, false, true, true)
|
v.plantTbl[key] = CreateObject(hash, value.location.x, value.location.y, value.location.z, false, true, true)
|
||||||
Freeze(v.plantTbl[key], true, v.heading)
|
Freeze(v.plantTbl[key], true, v.heading)
|
||||||
Bridge.Target.AddLocalEntity(v.plantTbl[key], {
|
ps.entityTarget(v.plantTbl[key], {
|
||||||
{
|
{
|
||||||
icon = v.icon,
|
icon = v.icon,
|
||||||
label = v.langs,
|
label = v.langs,
|
||||||
@@ -91,10 +85,22 @@ for k, v in pairs (DrugPlants) do
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = v.plantTbl[key]
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
TriggerEvent(v.label ..":init")
|
TriggerEvent(v.label ..":init")
|
||||||
::continue::
|
::continue::
|
||||||
end
|
|
||||||
|
end
|
||||||
|
|
||||||
|
AddEventHandler('onResourceStop', function(resourceName)
|
||||||
|
if GetCurrentResourceName() == resourceName then
|
||||||
|
SetModelAsNoLongerNeeded(GetHashKey('prop_plant_01a'))
|
||||||
|
for k, v in pairs(DrugPlants) do
|
||||||
|
for key, plant in pairs(v.plantTbl) do
|
||||||
|
if DoesEntityExist(plant) then DeleteEntity(plant) end
|
||||||
|
v.plantTbl[key] = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
@@ -1,29 +1,6 @@
|
|||||||
if not Config.Drugs['shrooms'] then return end
|
|
||||||
|
|
||||||
local function EcstasyEffect()
|
ps.registerCallback("md-drugs:client:shrooms", function()
|
||||||
local startStamina = 50
|
if not ps.progressbar(ps.lang('shrooms.eat'), 5000, 'eat') then return end
|
||||||
SetFlash(0, 0, 500, 20000, 500)
|
|
||||||
while startStamina > 0 do
|
|
||||||
Wait(1000)
|
|
||||||
startStamina = startStamina - 1
|
|
||||||
RestorePlayerStamina(PlayerId(), 1.0)
|
|
||||||
if math.random(1, 100) < 51 then
|
|
||||||
SetFlash(0, 0, 500, 7000, 500)
|
|
||||||
ShakeGameplayCam('SMALL_EXPLOSION_SHAKE', 0.08)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if IsPedRunning(PlayerPedId()) then
|
|
||||||
SetPedToRagdoll(PlayerPedId(), math.random(1000, 3000), math.random(1000, 3000), 3, 0, 0, 0)
|
|
||||||
end
|
|
||||||
startStamina = 0
|
|
||||||
end
|
|
||||||
|
|
||||||
Bridge.Callback.Register("md-drugs:client:shrooms", function()
|
|
||||||
if not progressbar(Bridge.Language.Locale('shrooms.eat'), 5000, {
|
|
||||||
dict = 'mp_player_inteat@burger',
|
|
||||||
clip = 'mp_player_int_eat_burger',
|
|
||||||
flags = 49
|
|
||||||
}) then return end
|
|
||||||
CreateThread(function()
|
CreateThread(function()
|
||||||
EcstasyEffect()
|
EcstasyEffect()
|
||||||
end)
|
end)
|
||||||
|
|||||||
@@ -1,63 +1,56 @@
|
|||||||
if not Config.Drugs['weed'] then return end
|
|
||||||
local exploded, drying = false, false
|
local exploded, drying = false, false
|
||||||
local locations, recipes = Config.Weed.Locations, Config.Weed.Recipes
|
local locations = ps.callback('md-drugs:server:GetWeedLocs')
|
||||||
for k, v in pairs (locations.WeedDry) do
|
for k, v in pairs (locations.WeedDry) do
|
||||||
Bridge.Target.AddBoxZone('weed_dry'..k, v.loc, v.size, v.loc.w or 180.0, {
|
ps.boxTarget('weed_dry'..k, v.loc, {length = v.l, width = v.w, heading = v.rot}, {
|
||||||
{
|
{
|
||||||
icon = Bridge.Language.Locale('weed.targetDryIcon'),
|
icon = 'fa-solid fa-cannabis',
|
||||||
label = Bridge.Language.Locale('weed.targetDry'),
|
label = ps.lang('weed.targetDry'),
|
||||||
action = function()
|
action = function()
|
||||||
if not itemCheck("wetcannabis") then return end
|
if not ps.hasItem('wetcannabis', 1) then
|
||||||
|
ps.notify(ps.lang('weed.nodry'), "error")
|
||||||
|
return
|
||||||
|
end
|
||||||
if drying then return end
|
if drying then return end
|
||||||
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)
|
||||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('weed.wait'), "success")
|
ps.notify(ps.lang('weed.wait'), "success")
|
||||||
Wait(math.random(1000,5000))
|
Wait(math.random(1000,5000))
|
||||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('weed.take'), "success")
|
ps.notify(ps.lang('weed.take'), "success")
|
||||||
Bridge.Target.AddLocalEntity(weedplant, {
|
ps.entityTarget(weedplant, {
|
||||||
{
|
icon = "fa-solid fa-cannabis",
|
||||||
icon = Bridge.Language.Locale('weed.targetDryIcon'),
|
label = ps.lang('weed.targetDryed'),
|
||||||
label = Bridge.Language.Locale('weed.targetDryed'),
|
action = function()
|
||||||
action = function()
|
DeleteEntity(weedplant)
|
||||||
DeleteEntity(weedplant)
|
drying = false
|
||||||
drying = false
|
TriggerServerEvent('md-drugs:server:dryoutweed')
|
||||||
TriggerServerEvent('md-drugs:server:dryoutweed', k)
|
end,
|
||||||
end,
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
end,
|
|
||||||
canInteract = function()
|
|
||||||
if drying then return false end
|
|
||||||
return true
|
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = 'weed_dry'..k
|
|
||||||
end
|
end
|
||||||
|
|
||||||
for k, v in pairs (locations.WeedTele) do
|
for k, v in pairs (locations.WeedTele) do
|
||||||
Bridge.Target.AddBoxZone('weed_tele'..k, v.inside, v.size, v.rot or 180.0, {
|
ps.boxTarget('weed_tele'..k, v.inside, {length = v.l, width = v.w, heading = v.rot}, {
|
||||||
{
|
{
|
||||||
icon = Bridge.Language.Locale('weed.teleportOutIcon'),
|
icon = 'fa-solid fa-door-open',
|
||||||
label = Bridge.Language.Locale('weed.teleportOut'),
|
label = ps.lang('weed.teleportOut'),
|
||||||
action = function()
|
action = function()
|
||||||
SetEntityCoords(PlayerPedId(), v.outside)
|
SetEntityCoords(PlayerPedId(), v.outside)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = 'weed_tele'..k
|
ps.boxTarget('weed_teleout'..k, v.outside, {length = v.l, width = v.w, heading = v.rot}, {
|
||||||
Bridge.Target.AddBoxZone('weed_teleout'..k, v.outside, v.size, v.rot or 180.0, {
|
|
||||||
{
|
{
|
||||||
icon = Bridge.Language.Locale('weed.teleportInIcon'),
|
icon = 'fa-solid fa-door-closed',
|
||||||
label = Bridge.Language.Locale('weed.teleportIn'),
|
label = ps.lang('weed.teleportIn'),
|
||||||
action = function()
|
action = function()
|
||||||
SetEntityCoords(PlayerPedId(), v.inside)
|
SetEntityCoords(PlayerPedId(), v.inside)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = 'weed_teleout'..k
|
|
||||||
end
|
end
|
||||||
|
|
||||||
CreateThread(function()
|
CreateThread(function()
|
||||||
@@ -72,168 +65,73 @@ CreateThread(function()
|
|||||||
RefreshInterior(BikerWeedFarm.interiorId)
|
RefreshInterior(BikerWeedFarm.interiorId)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local function AlienEffect()
|
|
||||||
StartScreenEffect("DrugsMichaelAliensFightIn", 3.0, 0)
|
|
||||||
Wait(math.random(5000, 8000))
|
|
||||||
StartScreenEffect("DrugsMichaelAliensFight", 3.0, 0)
|
|
||||||
Wait(math.random(5000, 8000))
|
|
||||||
StartScreenEffect("DrugsMichaelAliensFightOut", 3.0, 0)
|
|
||||||
StopScreenEffect("DrugsMichaelAliensFightIn")
|
|
||||||
StopScreenEffect("DrugsMichaelAliensFight")
|
|
||||||
StopScreenEffect("DrugsMichaelAliensFightOut")
|
|
||||||
end
|
|
||||||
|
|
||||||
RegisterNetEvent("md-drugs:client:dodabs", function()
|
RegisterNetEvent("md-drugs:client:dodabs", function()
|
||||||
if not progressbar(Bridge.Language.Locale('weed.dabs'), 4000, 'bong2') then AlienEffect() return end
|
if not ps.progressbar(ps.lang('weed.dabs'), 4000, 'bong2') then AlienEffect() return end
|
||||||
|
AlienEffect()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local function createBluntOptions(contextId, contextTitle, eventLabelPrefix, tableName)
|
local function createBluntOptions(contextId, contextTitle, eventLabelPrefix, tableName)
|
||||||
local options = {}
|
local options = {}
|
||||||
|
local items = ps.callback('md-drugs:server:GetWeedRecipe', 'weed', tableName)
|
||||||
for k, v in pairs(recipes[tableName]) do
|
for k, v in pairs(items) do
|
||||||
local label = {}
|
local label = {}
|
||||||
local item = ''
|
local item = ''
|
||||||
for m, d in pairs(v.take) do table.insert(label, Bridge.Inventory.GetItemInfo(m).label .. ' X ' .. d .. ' \n ') end
|
for m, d in pairs(v.take) do table.insert(label, ps.getLabel(m) .. ' X ' .. d) end
|
||||||
for m, d in pairs(v.give) do item = m end
|
for m, d in pairs(v.give) do item = m end
|
||||||
local itemData = Bridge.Inventory.GetItemInfo(item)
|
|
||||||
options[#options + 1] = {
|
options[#options + 1] = {
|
||||||
icon = itemData.image,
|
icon = ps.getImage(item),
|
||||||
description = table.concat(label, " "),
|
description = table.concat(label, ", "),
|
||||||
title = itemData.label,
|
title = ps.getLabel(item),
|
||||||
onSelect = function()
|
action = function()
|
||||||
if not minigame() then return end
|
if not minigame() then return end
|
||||||
if not progressbar( Bridge.Language.Locale(eventLabelPrefix, itemData.label)) then return end
|
if not ps.progressbar(eventLabelPrefix .. ps.getLabel(item), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent('md-drugs:server:RollBlunt', tableName, item)
|
TriggerServerEvent('md-drugs:server:MakeWeedItems', {item = item, recipe = 'weed', num = k, table = tableName})
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
Bridge.Menu.Open({
|
sorter(options, 'title')
|
||||||
id = contextId,
|
ps.menu(contextTitle, contextTitle, options)
|
||||||
title = contextTitle,
|
|
||||||
options = options,
|
|
||||||
})
|
|
||||||
end
|
end
|
||||||
|
|
||||||
RegisterNetEvent('md-drugs:client:makeBluntWrap', function(data)
|
RegisterNetEvent('md-drugs:client:makeBluntWrap', function(data)
|
||||||
createBluntOptions('mddrugsbluntwraps', "Dipping Syrup", 'weed.bluntWrap', 'bluntwrap')
|
createBluntOptions('mddrugsbluntwraps', "Dipping Syrup", ps.lang('weed.bluntWrap'), 'bluntwrap')
|
||||||
end)
|
end)
|
||||||
|
|
||||||
RegisterNetEvent('md-drugs:client:rollBlunt', function(data)
|
RegisterNetEvent('md-drugs:client:rollBlunt', function(data)
|
||||||
createBluntOptions('mddrugsblunts', "Roll Blunts", 'weed.rolling', 'blunts')
|
createBluntOptions('mddrugsblunts', "Roll Blunts", ps.lang('weed.blunts'), 'blunts')
|
||||||
end)
|
end)
|
||||||
|
|
||||||
for k, v in pairs (locations.WeedSalesman) do
|
for k, v in pairs (locations.WeedSalesman) do
|
||||||
requestModel(v.ped)
|
ps.requestModel(v.ped)
|
||||||
local ped = CreatePed(4, v.ped, v.loc.x, v.loc.y, v.loc.z - 1.0, v.loc.w, false, true)
|
local ped = CreatePed(4, v.ped, v.loc.x, v.loc.y, v.loc.z - 1.0, v.loc.w, false, true)
|
||||||
FreezeEntityPosition(ped, true)
|
FreezeEntityPosition(ped, true)
|
||||||
SetEntityInvincible(ped, true)
|
SetEntityInvincible(ped, true)
|
||||||
SetBlockingOfNonTemporaryEvents(ped, true)
|
SetBlockingOfNonTemporaryEvents(ped, true)
|
||||||
Bridge.Target.AddLocalEntity(ped, {
|
ps.entityTarget(ped, {
|
||||||
{
|
{
|
||||||
icon = Bridge.Language.Locale('weed.salesIcon'),
|
icon = "fa-solid fa-cannabis",
|
||||||
label = Bridge.Language.Locale('weed.targetSales'),
|
label = ps.lang('weed.targetSales'),
|
||||||
action = function()
|
action = function()
|
||||||
|
local itemList = ps.callback('md-drugs:server:getWeedItems')
|
||||||
local options = {}
|
local options = {}
|
||||||
for m, d in pairs (recipes.weedStore) do
|
for m, d in pairs (itemList) do
|
||||||
local itemInfo = Bridge.Inventory.GetItemInfo(m)
|
|
||||||
options[#options + 1] = {
|
options[#options + 1] = {
|
||||||
icon = itemInfo.image,
|
icon = ps.getImage(m),
|
||||||
title = itemInfo.label,
|
title = ps.getLabel(m),
|
||||||
description = '$' .. d,
|
description = '$' .. d,
|
||||||
onSelect = function()
|
action = function()
|
||||||
local input = Bridge.Input.Open(Bridge.Language.Locale('weed.salesHeader'),{
|
local input = ps.input('Amount To Buy',{
|
||||||
{type = 'number', title = Bridge.Language.Locale('weed.salesDesc'), min = 1, max = 1000}
|
{type = 'number', title = 'How Many To Buy', min = 1, max = 1000}
|
||||||
})
|
})
|
||||||
if not input and input[1] then return end
|
if not input and input[1] then return end
|
||||||
if not progressbar(Bridge.Language.Locale('weed.buying', Bridge.Inventory.GetItemInfo(m).label)) then return end
|
if not ps.progressbar(ps.lang('weed.buying', ps.getLabel(m)), 2000, 'uncuff') then return end
|
||||||
TriggerServerEvent('md-drugs:server:buyWeedItem', k, m, input[1])
|
TriggerServerEvent('md-drugs:server:buyWeedItem', k, m, input[1])
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
Bridge.Menu.Open({
|
ps.menu('Weed Shop', 'Weed Shop', options)
|
||||||
id = 'weedDude',
|
|
||||||
title = Bridge.Language.Locale('weed.salessHeader'),
|
|
||||||
options = options,
|
|
||||||
})
|
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = ped
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local props = {}
|
|
||||||
|
|
||||||
for locationKey, locationData in pairs (locations.MakeButter) do
|
|
||||||
if locationData.prop then
|
|
||||||
requestModel(locationData.prop)
|
|
||||||
props[#props+1] = CreateObject(locationData.prop, locationData.loc.x, locationData.loc.y, locationData.loc.z - 1.0, false, false, false)
|
|
||||||
FreezeEntityPosition(props[#props], true)
|
|
||||||
SetEntityHeading(props[#props], locationData.loc.w)
|
|
||||||
Bridge.Target.AddLocalEntity(props[#props], {
|
|
||||||
{
|
|
||||||
icon = Bridge.Language.Locale('weed.cannabisIcon'),
|
|
||||||
label = Bridge.Language.Locale('weed.targetMakeButter'),
|
|
||||||
action = function()
|
|
||||||
local options = {}
|
|
||||||
for k, v in pairs (recipes.makeButter) do
|
|
||||||
local itemInfo = Bridge.Inventory.GetItemInfo(k)
|
|
||||||
local label = {}
|
|
||||||
for m, d in pairs(v.recipe) do table.insert(label, Bridge.Inventory.GetItemInfo(m).label .. ' X ' .. d .. ' \n ') end
|
|
||||||
options[#options + 1] = {
|
|
||||||
icon = itemInfo.image,
|
|
||||||
title = itemInfo.label,
|
|
||||||
description = table.concat(label, " "),
|
|
||||||
onSelect = function()
|
|
||||||
if not progressbar(Bridge.Language.Locale('weed.making', itemInfo.label)) then return end
|
|
||||||
TriggerServerEvent('md-drugs:server:MakeWeedItems', 'makeButter', k, locationKey)
|
|
||||||
end
|
|
||||||
}
|
|
||||||
end
|
|
||||||
Bridge.Menu.Open({
|
|
||||||
id = 'weedMakeButter',
|
|
||||||
title = Bridge.Language.Locale('weed.makeButter'),
|
|
||||||
options = options,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
}
|
|
||||||
})
|
|
||||||
targets[#targets+1] = props[#props]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
for locationKey, locationData in pairs (locations.MakeOil) do
|
|
||||||
if locationData.prop then
|
|
||||||
requestModel(locationData.prop)
|
|
||||||
props[#props+1] = CreateObject(locationData.prop, locationData.loc.x, locationData.loc.y, locationData.loc.z - 1.0, false, false, false)
|
|
||||||
FreezeEntityPosition(props[#props], true)
|
|
||||||
SetEntityHeading(props[#props], locationData.loc.w)
|
|
||||||
Bridge.Target.AddLocalEntity(props[#props], {
|
|
||||||
{
|
|
||||||
icon = Bridge.Language.Locale('weed.cannabisIcon'),
|
|
||||||
label = Bridge.Language.Locale('weed.targetMakeOil'),
|
|
||||||
action = function()
|
|
||||||
local options = {}
|
|
||||||
for k, v in pairs (recipes.makeOil) do
|
|
||||||
local itemInfo = Bridge.Inventory.GetItemInfo(k)
|
|
||||||
local label = {}
|
|
||||||
for m, d in pairs(v.recipe) do table.insert(label, Bridge.Inventory.GetItemInfo(m).label .. ' X ' .. d .. ' \n ') end
|
|
||||||
options[#options + 1] = {
|
|
||||||
icon = itemInfo.image,
|
|
||||||
title = itemInfo.label,
|
|
||||||
description = table.concat(label, " "),
|
|
||||||
onSelect = function()
|
|
||||||
if not progressbar(Bridge.Language.Locale('weed.making', itemInfo.label)) then return end
|
|
||||||
TriggerServerEvent('md-drugs:server:MakeWeedItems', 'makeOil', k, locationKey)
|
|
||||||
end
|
|
||||||
}
|
|
||||||
end
|
|
||||||
Bridge.Menu.Open({
|
|
||||||
id = 'weedMakeOil',
|
|
||||||
title = Bridge.Language.Locale('weed.makeOil'),
|
|
||||||
options = options,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
}
|
|
||||||
})
|
|
||||||
targets[#targets+1] = props[#props]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
if not Config.Drugs['whippit'] then return end
|
|
||||||
local prop = nil
|
|
||||||
|
|
||||||
local function animation(color)
|
|
||||||
local coords = GetEntityCoords(PlayerPedId())
|
|
||||||
Bridge.Anim.RequestDict('mp_player_intdrink')
|
|
||||||
requestModel(color)
|
|
||||||
prop = CreateObject(GetHashKey(color), coords.x, coords.y, coords.z, true, true, true)
|
|
||||||
AttachEntityToEntity(prop, PlayerPedId(), GetPedBoneIndex(PlayerPedId(), 18905), 0.087000, -0.130001, 0.138999, 63.630001, 3.299881, -21.000000, true, true, false, true, 1, true)
|
|
||||||
TaskPlayAnim(PlayerPedId(), 'mp_player_intdrink', 'loop_bottle', 8.0, -8.0, -1, 49, 0, false, false, false)
|
|
||||||
if progressbar('Inhaling Nitrous', 5000, false) then
|
|
||||||
ClearPedTasks(PlayerPedId())
|
|
||||||
DetachEntity(prop, true, true)
|
|
||||||
DeleteEntity(prop)
|
|
||||||
prop = nil
|
|
||||||
return true
|
|
||||||
else
|
|
||||||
ClearPedTasks(PlayerPedId())
|
|
||||||
DetachEntity(prop, true, true)
|
|
||||||
DeleteEntity(prop)
|
|
||||||
prop = nil
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local function blur(duration)
|
|
||||||
CreateThread(function()
|
|
||||||
TriggerScreenblurFadeIn(1000)
|
|
||||||
Wait(duration)
|
|
||||||
TriggerScreenblurFadeOut(1000)
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
Bridge.Callback.Register('md-drugs:client:useWhippit', function(color)
|
|
||||||
if animation(color) then
|
|
||||||
blur(30000)
|
|
||||||
return true
|
|
||||||
else
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
local function spawnShops()
|
|
||||||
|
|
||||||
for k, v in pairs(Config.Whippit.Locations.Whippit) do
|
|
||||||
requestModel(v.ped)
|
|
||||||
local ped = CreatePed(5, GetHashKey(v.ped), v.loc.x, v.loc.y, v.loc.z, v.loc.w, true, true)
|
|
||||||
FreezeEntityPosition(ped, true)
|
|
||||||
SetEntityInvincible(ped, true)
|
|
||||||
SetBlockingOfNonTemporaryEvents(ped, true)
|
|
||||||
Bridge.Target.AddLocalEntity(ped, {
|
|
||||||
{
|
|
||||||
label = Bridge.Language.Locale('Whippit.targetShop'),
|
|
||||||
icon = Bridge.Language.Locale('Whippit.whippitIcon'),
|
|
||||||
action = function()
|
|
||||||
local menu = {}
|
|
||||||
for item, price in pairs (Config.Whippit.Recipes.shop) do
|
|
||||||
local itemInfo = Bridge.Inventory.GetItemInfo(item)
|
|
||||||
menu[#menu + 1] = {
|
|
||||||
title = itemInfo.label,
|
|
||||||
icon = itemInfo.image,
|
|
||||||
description = '$' .. price,
|
|
||||||
onSelect = function()
|
|
||||||
local amount = Bridge.Input.Open(itemInfo.label, {
|
|
||||||
{type = 'number', label = 'Amount', name = 'amount', min = 1, max = 100, default = 1}
|
|
||||||
})
|
|
||||||
if amount and amount[1] then
|
|
||||||
TriggerServerEvent('md-drugs:server:buyWhippitItem', k, item, amount[1])
|
|
||||||
end
|
|
||||||
end
|
|
||||||
}
|
|
||||||
end
|
|
||||||
Bridge.Menu.Open({
|
|
||||||
id = 'whippitShop',
|
|
||||||
title = Bridge.Language.Locale('Whippit.shopHeader'),
|
|
||||||
options = menu
|
|
||||||
})
|
|
||||||
end
|
|
||||||
},
|
|
||||||
})
|
|
||||||
targets[#targets+1] = ped
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
spawnShops()
|
|
||||||
@@ -1,95 +1,67 @@
|
|||||||
if not Config.Drugs['wholesale'] then return end
|
local miss = false
|
||||||
local active, ped, peds = false, nil, {}
|
local function SetUpPeds()
|
||||||
|
AddRelationshipGroup('setups')
|
||||||
local function loop(wholesaleData)
|
local ped = GetEntityCoords(PlayerPedId())
|
||||||
local timeout = 600 -- 10 minutes
|
local peds = {
|
||||||
while active do
|
{x = ped.x+3, y = ped.y-5, z = ped.z-1, },
|
||||||
Wait(1000)
|
{x = ped.x+6, y = ped.y-10, z = ped.z-1,},
|
||||||
local dist = #(GetEntityCoords(PlayerPedId()) - vector3(wholesaleData.location.x, wholesaleData.location.y, wholesaleData.location.z))
|
{x = ped.x+-2,y = ped.y+5, z = ped.z-1,},
|
||||||
if dist < 100.0 then
|
{x = ped.x+8, y = ped.y-12, z = ped.z-1,},
|
||||||
if IsEntityDead(PlayerPedId()) then
|
{x = ped.x+5, y = ped.y-2, z = ped.z-1, },
|
||||||
active = false
|
{x = ped.x+2, y = ped.y-20, z = ped.z-1,},
|
||||||
Bridge.Point.Remove('md-drugs:wholesaleZone'..Bridge.Framework.GetPlayerIdentifier())
|
{x = ped.x+1, y = ped.y-10, z = ped.z-1,},
|
||||||
TriggerServerEvent('md-drugs:server:getkilledFuckingNoob')
|
}
|
||||||
for k, v in pairs (peds) do
|
for i = 1, #peds do
|
||||||
DeleteEntity(v)
|
local k = peds[i]
|
||||||
|
i = CreatePed(0, "g_m_y_famdnf_01", k.x, k.y, k.z, 90.0, true, true)
|
||||||
|
SetPedRelationshipGroupHash(i, 'setups')
|
||||||
|
GiveWeaponToPed(i, "weapon_pistol", 1, false, true)
|
||||||
|
TaskCombatPed(i, PlayerPedId(), 0, 16)
|
||||||
|
SetPedCombatAttributes(i, 46, true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
RegisterNetEvent("md-drugs:client:GetLocation", function(drug)
|
||||||
|
if not GetCops(Config.PoliceCount) then return end
|
||||||
|
if miss then
|
||||||
|
ps.notify(ps.lang('wholesale.alreadyWholesale'), 'error')
|
||||||
|
else
|
||||||
|
local loc = drug.location
|
||||||
|
local timer = 0
|
||||||
|
miss = true
|
||||||
|
SetNewWaypoint(loc.x, loc.y)
|
||||||
|
ps.requestModel("g_m_y_famdnf_01", Config.RequestModelTime)
|
||||||
|
local drugdealer = CreatePed(0, "g_m_y_famdnf_01",loc.x,loc.y,loc.z-1, 90.0, false, false)
|
||||||
|
FreezeEntityPosition(drugdealer, true)
|
||||||
|
SetEntityInvincible(drugdealer, true)
|
||||||
|
ps.entityTarget(drugdealer, {{
|
||||||
|
label = ps.lang('wholesale.targetBuyer'),
|
||||||
|
icon = "fas fa-eye",
|
||||||
|
action = function()
|
||||||
|
local luck = math.random(1,100)
|
||||||
|
if luck <= Config.SuccessfulChance then
|
||||||
|
if not ps.progressbar(ps.lang('wholesale.wholesaling'), 4000, 'uncuff') then return end
|
||||||
|
TriggerServerEvent("md-drugs:server:SuccessSale", drug)
|
||||||
|
else
|
||||||
|
ps.notify(ps.lang('wholesale.uhoh'), 'error')
|
||||||
|
SetUpPeds()
|
||||||
end
|
end
|
||||||
peds = {}
|
Wait(3000)
|
||||||
break
|
DeleteEntity(drugdealer)
|
||||||
|
miss = false
|
||||||
end
|
end
|
||||||
end
|
}},drugdealer )
|
||||||
timeout = timeout - 1
|
repeat
|
||||||
if timeout <= 0 then
|
Wait(1000)
|
||||||
break
|
timer = timer + 1
|
||||||
end
|
until #(GetEntityCoords(PlayerPedId()) - vector3(loc.x, loc.y, loc.z) ) < 4.0 or timer == Config.WholesaleTimeout + 1
|
||||||
|
PoliceCall(Config.AlertPoliceWholesale)
|
||||||
|
if timer <= Config.WholesaleTimeout or #(GetEntityCoords(PlayerPedId()) - vector3(loc.x, loc.y, loc.z) ) < 4.0 then
|
||||||
|
timer = 0
|
||||||
|
else
|
||||||
|
ps.notify(ps.lang('wholesale.tooLong'), 'error')
|
||||||
|
DeleteEntity(drugdealer)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
function SetUpPeds(attackerCount, location)
|
|
||||||
local models = {"g_m_y_ballasout_01", "g_m_y_famdnf_01", "g_m_y_famca_01", "g_m_y_mexgoon_01", "g_m_y_salvagoon_01"}
|
|
||||||
for i = 1, attackerCount do
|
|
||||||
local angle = (360 / attackerCount) * i
|
|
||||||
local x = location.x + math.cos(math.rad(angle)) * 15
|
|
||||||
local y = location.y + math.sin(math.rad(angle)) * 15
|
|
||||||
local z = location.z
|
|
||||||
local modelHash = GetHashKey(models[math.random(1, #models)])
|
|
||||||
requestModel(modelHash)
|
|
||||||
peds[#peds+1] = CreatePed(4, modelHash, x, y, z, 0.0, true, true)
|
|
||||||
local weapon = math.random(1, 2) == 1 and "WEAPON_PISTOL" or "WEAPON_BAT"
|
|
||||||
SetPedRelationshipGroupHash(peds[#peds], GetHashKey("HATES_PLAYER"))
|
|
||||||
SetPedCombatAttributes(peds[#peds], 46, true)
|
|
||||||
SetPedCombatAttributes(peds[#peds], 0, true)
|
|
||||||
SetPedCombatAttributes(peds[#peds], 5, true)
|
|
||||||
SetPedCombatAttributes(peds[#peds], 2, true)
|
|
||||||
GiveWeaponToPed(peds[#peds], GetHashKey(weapon), 500, false, true)
|
|
||||||
TaskCombatPed(peds[#peds], PlayerPedId(), 0, 16)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
RegisterNetEvent("md-drugs:client:GetLocation", function(wholesaleData)
|
|
||||||
if active then return end
|
|
||||||
if not wholesaleData then return end
|
|
||||||
active = true
|
|
||||||
SetNewWaypoint(wholesaleData.location.x, wholesaleData.location.y)
|
|
||||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('wholesale.go_location'), 'success')
|
|
||||||
Bridge.Point.Register(
|
|
||||||
'md-drugs:wholesaleZone'..Bridge.Framework.GetPlayerIdentifier(),
|
|
||||||
vector3(wholesaleData.location.x, wholesaleData.location.y, wholesaleData.location.z),
|
|
||||||
50.0,
|
|
||||||
nil,
|
|
||||||
function(point, data)
|
|
||||||
if wholesaleData.ambush then
|
|
||||||
SetUpPeds(wholesaleData.attackerCount, wholesaleData.location)
|
|
||||||
loop(wholesaleData)
|
|
||||||
end
|
|
||||||
requestModel(GetHashKey("s_m_m_ammucountry"))
|
|
||||||
ped = CreatePed(4, GetHashKey("s_m_m_ammucountry"), wholesaleData.location.x, wholesaleData.location.y, wholesaleData.location.z, wholesaleData.location.w, false, true)
|
|
||||||
FreezeEntityPosition(ped, true)
|
|
||||||
TaskStartScenarioInPlace(ped, "WORLD_HUMAN_STAND_IMPATIENT", 0, true)
|
|
||||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('wholesale.meet_dealer'), 'info')
|
|
||||||
Bridge.Target.AddLocalEntity(ped, {
|
|
||||||
{
|
|
||||||
label = Bridge.Language.Locale('wholesale.sell_drugs'),
|
|
||||||
icon = Bridge.Language.Locale('wholesale.sell_drugs_icon'),
|
|
||||||
action = function()
|
|
||||||
if not progressbar(Bridge.Language.Locale('wholesale.selling_drugs'), 15000) then return end
|
|
||||||
TriggerServerEvent('md-drugs:server:SuccessSale')
|
|
||||||
DeleteEntity(ped)
|
|
||||||
active = false
|
|
||||||
Bridge.Point.Remove('md-drugs:wholesaleZone'.. Bridge.Framework.GetPlayerIdentifier())
|
|
||||||
end
|
|
||||||
}
|
|
||||||
})
|
|
||||||
targets[#targets+1] = ped
|
|
||||||
end,
|
|
||||||
function(point, data)
|
|
||||||
Bridge.Point.Remove('md-drugs:wholesaleZone'.. Bridge.Framework.GetPlayerIdentifier())
|
|
||||||
return data
|
|
||||||
end)
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
RegisterNetEvent('md-drugs:client:MarkLocation', function(data)
|
|
||||||
SetNewWaypoint(data.x, data.y)
|
|
||||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('wholesale.go_location'), 'success')
|
|
||||||
end)
|
|
||||||
@@ -1,67 +1,55 @@
|
|||||||
if not Config.Drugs['xtc'] then return end
|
|
||||||
local xtcpress = false
|
local xtcpress = false
|
||||||
local locations = Config.XTC.Locations
|
local locations = ps.callback('md-drugs:server:GetXtcLocs')
|
||||||
|
|
||||||
local function getRecipeList(tbl, type)
|
local function getRecipeList(tbl)
|
||||||
local rec
|
local rec = {}
|
||||||
if type == 'presses' then
|
for m, d in pairs(tbl) do table.insert(rec, ps.getLabel(m) .. ' X ' .. d) end
|
||||||
rec = {'XTC FROM THE PREVIOUS TIER REQUIRED TO UPGRADE \n '}
|
return table.concat(rec, ', ')
|
||||||
else
|
|
||||||
rec = {'REQUIRED INGREDIENTS: \n '}
|
|
||||||
end
|
|
||||||
|
|
||||||
for m, d in pairs(tbl) do table.insert(rec, Bridge.Inventory.GetItemInfo(m).label .. ' X ' .. d .. ' \n ') end
|
|
||||||
return table.concat(rec, ' ')
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Bridge.Callback.Register('md-drugs:client:setpress', function(xtcData)
|
ps.registerCallback('md-drugs:client:setpress', function(xtcData)
|
||||||
if xtcpress then
|
if xtcpress then
|
||||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('xtc.alreadyOut'), 'error')
|
ps.notify(ps.lang('xtc.alreadyOut'), 'error')
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local coords, head = StartRay2()
|
local coords, head = StartRay2()
|
||||||
xtcpress = true
|
xtcpress = true
|
||||||
if not progressbar(Bridge.Language.Locale('xtc.settingDown')) then return end
|
if not ps.progressbar(ps.lang('xtc.settingDown'), 4000, 'uncuff') then return end
|
||||||
local press = CreateObject("bkr_prop_coke_press_01aa", coords.x, coords.y, coords.z, true, false, false)
|
local press = CreateObject("bkr_prop_coke_press_01aa", coords.x, coords.y, coords.z, true, false, false)
|
||||||
PlaceObjectOnGroundProperly(press)
|
PlaceObjectOnGroundProperly(press)
|
||||||
Freeze(press, true, head)
|
Freeze(press, true, head)
|
||||||
local options = {
|
local options = {
|
||||||
{
|
{
|
||||||
icon = Bridge.Language.Locale('xtc.pressIcon'),
|
icon = "fas fa-eye",
|
||||||
label = Bridge.Language.Locale('xtc.targetMake'),
|
label = ps.lang('xtc.targetMake'),
|
||||||
distance = 2.0,
|
distance = 2.0,
|
||||||
action = function()
|
action = function()
|
||||||
local options = {}
|
local options = {}
|
||||||
for k, v in pairs(xtcData.recipes) do
|
for k, v in pairs(xtcData.recipes) do
|
||||||
local descript = getRecipeList(v.take)
|
local descript = getRecipeList(v.take)
|
||||||
local itemInfo = Bridge.Inventory.GetItemInfo(k)
|
|
||||||
options[#options + 1] = {
|
options[#options + 1] = {
|
||||||
icon = itemInfo.image,
|
icon = ps.getImage(k),
|
||||||
title = Bridge.Language.Locale(k),
|
title = ps.getLabel(k),
|
||||||
description = descript,
|
description = descript,
|
||||||
onSelect = function()
|
action = function()
|
||||||
if not minigame() then return end
|
if not minigame() then ps.notify(ps.lang('xtc.fail'), "error") return end
|
||||||
if not progressbar(Bridge.Language.Locale('xtc.making', Bridge.Language.Locale(k))) then return end
|
if not ps.progressbar(ps.lang('xtc.making', ps.getLabel(k)), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:makextc", k)
|
TriggerServerEvent("md-drugs:server:makextc", k)
|
||||||
end,
|
end,
|
||||||
distance = 2.0
|
distance = 2.0
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
Bridge.Menu.Open({
|
ps.menu('XTC Recipes', 'XTC Recipes', options)
|
||||||
id = 'XTC Recipes',
|
|
||||||
title = 'XTC Recipes',
|
|
||||||
options = options
|
|
||||||
})
|
|
||||||
end,
|
end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
if xtcpress then return true end
|
if xtcpress then return true end
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon = Bridge.Language.Locale('xtc.pressIcon'),
|
icon = "fas fa-eye",
|
||||||
label = Bridge.Language.Locale('xtc.targetPickup'),
|
label = ps.lang('xtc.targetPickup'),
|
||||||
action = function()
|
action = function()
|
||||||
if not progressbar(Bridge.Language.Locale('xtc.picking')) then return end
|
if not ps.progressbar(ps.lang('xtc.picking'), 5000, 'uncuff') then return end
|
||||||
DeleteObject(press)
|
DeleteObject(press)
|
||||||
xtcpress = false
|
xtcpress = false
|
||||||
TriggerServerEvent("md-drugs:server:getpressback")
|
TriggerServerEvent("md-drugs:server:getpressback")
|
||||||
@@ -71,19 +59,18 @@ Bridge.Callback.Register('md-drugs:client:setpress', function(xtcData)
|
|||||||
end
|
end
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
Bridge.Target.AddLocalEntity(press, options)
|
ps.entityTarget(press, options)
|
||||||
targets[#targets+1] = press
|
return true
|
||||||
return coords
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
for k, v in pairs(locations.mdp2p) do
|
for k, v in pairs(locations.mdp2p) do
|
||||||
Bridge.Target.AddBoxZone('mdp2p'..k, v.loc, v.size, v.rot or 180.0, {
|
ps.boxTarget('mdp2p'..k, v.loc, {length = v.l, width = v.w, heading = v.rot}, {
|
||||||
{
|
{
|
||||||
icon = Bridge.Language.Locale('xtc.mdp2pIcon'),
|
icon = 'fa-solid fa-flask',
|
||||||
label = Bridge.Language.Locale('xtc.targetStealMDP2P'),
|
label = ps.lang('xtc.targetStealMDP2P'),
|
||||||
action = function()
|
action = function()
|
||||||
if not minigame() then return end
|
if not minigame() then ps.notify(ps.lang('xtc.fail'), "error") return end
|
||||||
if not progressbar(Bridge.Language.Locale('xtc.stealingMDP2P')) then return end
|
if not ps.progressbar(ps.lang('xtc.stealingMDP2P'), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:stealmdp2p", k)
|
TriggerServerEvent("md-drugs:server:stealmdp2p", k)
|
||||||
end,
|
end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
@@ -91,16 +78,15 @@ for k, v in pairs(locations.mdp2p) do
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = 'mdp2p'..k
|
|
||||||
end
|
end
|
||||||
for k, v in pairs(locations.isosafrole) do
|
for k, v in pairs(locations.isosafrole) do
|
||||||
Bridge.Target.AddBoxZone('isosafrole'..k, v.loc, v.size, v.rot or 180.0, {
|
ps.boxTarget('isosafrole'..k, v.loc, {length = v.l, width = v.w, heading = v.rot}, {
|
||||||
{
|
{
|
||||||
icon = Bridge.Language.Locale('xtc.isosafroleIcon'),
|
icon = 'fa-solid fa-flask',
|
||||||
label = Bridge.Language.Locale('xtc.targetStealIsosafrole'),
|
label = ps.lang('xtc.targetStealIsosafrole'),
|
||||||
action = function()
|
action = function()
|
||||||
if not minigame() then return end
|
if not minigame() then ps.notify(ps.lang('xtc.fail'), "error") return end
|
||||||
if not progressbar(Bridge.Language.Locale('xtc.stealingIsosafrole')) then return end
|
if not ps.progressbar(ps.lang('xtc.stealingIsosafrole'), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:stealisosafrole", k)
|
TriggerServerEvent("md-drugs:server:stealisosafrole", k)
|
||||||
end,
|
end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
@@ -108,17 +94,16 @@ for k, v in pairs(locations.isosafrole) do
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = 'isosafrole'..k
|
|
||||||
end
|
end
|
||||||
|
|
||||||
for k, v in pairs(locations.rawxtcloc) do
|
for k, v in pairs(locations.rawxtcloc) do
|
||||||
Bridge.Target.AddBoxZone('xtcraw'..k, v.loc, v.size, v.rot or 180.0, {
|
ps.boxTarget('xtcraw'..k, v.loc, {length = v.l, width = v.w, heading = v.rot}, {
|
||||||
{
|
{
|
||||||
icon = Bridge.Language.Locale('xtc.rawIcon'),
|
icon = 'fa-solid fa-flask',
|
||||||
label = Bridge.Language.Locale('xtc.targetRaw'),
|
label = ps.lang('xtc.targetRaw'),
|
||||||
action = function()
|
action = function()
|
||||||
if not minigame() then return end
|
if not minigame() then ps.notify(ps.lang('xtc.fail'), "error") return end
|
||||||
if not progressbar(Bridge.Language.Locale('xtc.makingRaw')) then return end
|
if not ps.progressbar(ps.lang('xtc.makingRaw'), 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:makingrawxtc", k)
|
TriggerServerEvent("md-drugs:server:makingrawxtc", k)
|
||||||
end,
|
end,
|
||||||
canInteract = function()
|
canInteract = function()
|
||||||
@@ -126,96 +111,80 @@ for k, v in pairs(locations.rawxtcloc) do
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = 'xtcraw'..k
|
|
||||||
end
|
end
|
||||||
|
|
||||||
for k, v in pairs(locations.xtcpress) do
|
for k, v in pairs(locations.xtcpress) do
|
||||||
requestModel(v.ped)
|
ps.requestModel(v.ped)
|
||||||
local ped = CreatePed(0, v.ped, v.loc, false, false)
|
local ped = CreatePed(0, v.ped, v.loc, false, false)
|
||||||
Freeze(ped, true, v.loc.w)
|
Freeze(ped, true, v.loc.w)
|
||||||
Bridge.Target.AddLocalEntity(ped, {
|
ps.entityTarget(ped, {
|
||||||
{
|
{
|
||||||
icon = Bridge.Language.Locale('xtc.pressIcon'),
|
icon = 'fa-solid fa-flask',
|
||||||
label = Bridge.Language.Locale('xtc.getPress'),
|
label = ps.lang('xtc.getPress'),
|
||||||
onSelect = function()
|
action = function()
|
||||||
local options = {}
|
local options = {}
|
||||||
local recipeList = Config.XTC.Recipes.presses
|
local recipeList = ps.callback('md-drugs:server:getpressrecipes')
|
||||||
for m, d in pairs(recipeList) do
|
for m, d in pairs(recipeList) do
|
||||||
if m == 'singlepress' then
|
if m == 'singlepress' then
|
||||||
local itemInfo = Bridge.Inventory.GetItemInfo(m)
|
|
||||||
options[#options + 1] = {
|
options[#options + 1] = {
|
||||||
icon = itemInfo.image,
|
icon = ps.getImage(m),
|
||||||
title = itemInfo.label,
|
title = ps.getLabel(m),
|
||||||
description = Bridge.Language.Locale('xtc.buySingle', d.cash),
|
description = ps.lang('xtc.buySingle', d.cash),
|
||||||
type = d.type,
|
action = function()
|
||||||
onSelect = function()
|
if not ps.progressbar(ps.lang('xtc.buyp'), 4000, 'uncuff') then return end
|
||||||
if not progressbar(Bridge.Language.Locale('xtc.buyp')) then return end
|
|
||||||
TriggerServerEvent('md-drugs:server:buypress',k, m)
|
TriggerServerEvent('md-drugs:server:buypress',k, m)
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
local itemInfo = Bridge.Inventory.GetItemInfo(m)
|
local descript = getRecipeList(d.take)
|
||||||
local descript = getRecipeList(d.take, 'presses')
|
|
||||||
options[#options + 1] = {
|
options[#options + 1] = {
|
||||||
icon = itemInfo.image,
|
icon = ps.getImage(m),
|
||||||
title = itemInfo.label,
|
title = ps.getLabel(m),
|
||||||
description = descript,
|
description = descript,
|
||||||
type = d.type,
|
action = function()
|
||||||
onSelect = function()
|
if not ps.progressbar(ps.lang('xtc.buyp'), 4000, 'uncuff') then return end
|
||||||
if not progressbar(Bridge.Language.Locale('xtc.buyp')) then return end
|
|
||||||
TriggerServerEvent("md-drugs:server:upgradepress", k, m)
|
TriggerServerEvent("md-drugs:server:upgradepress", k, m)
|
||||||
end,
|
end,
|
||||||
distance = 2.0
|
distance = 2.0
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
table.sort(options, function(a, b) return a.type < b.type end)
|
ps.menu('XTC Presses', 'XTC Presses', options)
|
||||||
Bridge.Menu.Open({
|
|
||||||
id = 'XTC Presses',
|
|
||||||
title = 'XTC Presses',
|
|
||||||
options = options
|
|
||||||
})
|
|
||||||
end,
|
end,
|
||||||
canInteract = function() return handleGang(v.gang) end
|
canInteract = function() return handleGang(v.gang) end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = ped
|
|
||||||
end
|
end
|
||||||
|
|
||||||
for k, v in pairs (locations.stamp) do
|
for k, v in pairs (locations.stamp) do
|
||||||
Bridge.Target.AddBoxZone('xtcstamp'..k, v.loc, v.size, v.rot or 180.0, {
|
ps.boxTarget('xtcstamp'..k, v.loc, {length = v.l, width = v.w, heading = v.rot}, {
|
||||||
{
|
{
|
||||||
icon = Bridge.Language.Locale('xtc.stampIcon'),
|
icon = 'fa-solid fa-flask',
|
||||||
label = Bridge.Language.Locale('xtc.targetStamp'),
|
label = ps.lang('xtc.targetStamp'),
|
||||||
onSelect = function()
|
action = function()
|
||||||
local item = {
|
local item = {
|
||||||
{item = 'white_xtc', label = Bridge.Inventory.GetItemInfo('white_xtc').label, color = 'white'},
|
{item = 'white_xtc', label = ps.getLabel('white_xtc'), color = 'white'},
|
||||||
{item = 'red_xtc', label = Bridge.Inventory.GetItemInfo('red_xtc').label, color = 'red'},
|
{item = 'red_xtc', label = ps.getLabel('red_xtc'), color = 'red'},
|
||||||
{item = 'orange_xtc', label = Bridge.Inventory.GetItemInfo('orange_xtc').label, color = 'orange'},
|
{item = 'orange_xtc', label = ps.getLabel('orange_xtc'), color = 'orange'},
|
||||||
{item = 'blue_xtc', label = Bridge.Inventory.GetItemInfo('blue_xtc').label, color = 'blue'},
|
{item = 'blue_xtc', label = ps.getLabel('blue_xtc'), color = 'blue'},
|
||||||
}
|
}
|
||||||
local options = {}
|
local options = {}
|
||||||
for m, d in pairs (item) do
|
for m, d in pairs (item) do
|
||||||
options[#options + 1] = {
|
options[#options + 1] = {
|
||||||
icon = Bridge.Inventory.GetItemInfo(d.item).image,
|
icon = ps.getImage(d.item),
|
||||||
title = d.label,
|
title = d.label,
|
||||||
description = Bridge.Language.Locale('xtc.stamp_desc', d.color),
|
description = ps.lang('xtc.stamp_desc', d.color),
|
||||||
action = function()
|
action = function()
|
||||||
if not minigame() then return end
|
if not minigame() then ps.notify(ps.lang('xtc.fail'), "error") return end
|
||||||
if not progressbar(Bridge.Language.Locale('xtc.stamping', d.label)) then return end
|
if not ps.progressbar(ps.lang('xtc.stamping'), d.label, 4000, 'uncuff') then return end
|
||||||
TriggerServerEvent("md-drugs:server:stamp", k, d.color)
|
TriggerServerEvent("md-drugs:server:stamp", k, d.color)
|
||||||
end,
|
end,
|
||||||
distance = 2.0
|
distance = 2.0
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
Bridge.Menu.Open({
|
ps.menu('Stamp Pills', 'Stamp Pills', options)
|
||||||
id = 'XTC Stamp',
|
|
||||||
title = 'XTC Stamp',
|
|
||||||
options = options
|
|
||||||
})
|
|
||||||
end,
|
end,
|
||||||
canInteract = function() return handleGang(v.gang) end
|
canInteract = function() return handleGang(v.gang) end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
targets[#targets+1] = 'xtcstamp'..k
|
|
||||||
end
|
end
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
function loadFile(filePath)
|
||||||
|
local resourceName = 'md-drugs'
|
||||||
|
local fullScript = LoadResourceFile(resourceName, filePath)
|
||||||
|
if not fullScript then
|
||||||
|
ps.error("Error: Failed to load module '" .. filePath .. "' from resource '" .. resourceName .. "'.")
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
local chunk, err = load(fullScript, filePath, "t")
|
||||||
|
if not chunk then
|
||||||
|
ps.error("Error loading Lua chunk from '" .. filePath .. "': " .. tostring(err))
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
local success, execErr = pcall(chunk)
|
||||||
|
if not success then
|
||||||
|
ps.error("Error executing Lua chunk from '" .. filePath .. "': " .. tostring(execErr))
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
for scriptName, toggle in pairs(Config.Drugs) do
|
||||||
|
if not toggle then goto continue end
|
||||||
|
loadFile('client/' .. scriptName .. '.lua')
|
||||||
|
::continue::
|
||||||
|
end
|
||||||
@@ -3,22 +3,24 @@ author "mustache_dom"
|
|||||||
description "drugs by mustache dom"
|
description "drugs by mustache dom"
|
||||||
fx_version "cerulean"
|
fx_version "cerulean"
|
||||||
game "gta5"
|
game "gta5"
|
||||||
version '4.0.8'
|
version '3.9.0'
|
||||||
|
|
||||||
client_scripts {
|
client_scripts {
|
||||||
'client/functions.lua',
|
'client/functions.lua',
|
||||||
'client/**.lua',
|
'client/animationsandfunctions.lua',
|
||||||
|
'client/plantSpawns.lua',
|
||||||
|
'clientRun.lua',
|
||||||
}
|
}
|
||||||
|
|
||||||
server_scripts {
|
server_scripts {
|
||||||
'@oxmysql/lib/MySQL.lua',
|
'@oxmysql/lib/MySQL.lua',
|
||||||
'server/functions.lua',
|
'server/functions.lua',
|
||||||
'server/**.lua',
|
'server/plantSpawns.lua',
|
||||||
|
'serverRun.lua',
|
||||||
}
|
}
|
||||||
|
|
||||||
shared_scripts {
|
shared_scripts {
|
||||||
'@ox_lib/init.lua',
|
'shared/**.lua',
|
||||||
'shared/config.lua',
|
|
||||||
'shared/DrugData/*.lua',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lua54 'yes'
|
lua54 'yes'
|
||||||
@@ -26,5 +28,5 @@ lua54 'yes'
|
|||||||
files {
|
files {
|
||||||
'client/**.lua',
|
'client/**.lua',
|
||||||
'server/**.lua',
|
'server/**.lua',
|
||||||
'locales/**.json'
|
'locales/**.lua'
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 47 KiB |
|
Before Width: | Height: | Size: 7.9 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 8.2 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 31 KiB |