Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0e55a18676 | ||
|
|
28d4244243 | ||
|
|
ff5a86b3f3 | ||
|
|
0f80534168 | ||
|
|
30f12ebbe5 | ||
|
|
fdd4b0cb7b | ||
|
|
32af7ae59a | ||
|
|
c08ff45617 | ||
|
|
97af3833b7 | ||
|
|
4e48857437 | ||
|
|
c3084abc78 | ||
|
|
d97cd43951 | ||
|
|
7ceaa97b5f | ||
|
|
11e7015672 | ||
|
|
c7eca0285b | ||
|
|
fdc28723bc | ||
|
|
1d82b8beba | ||
|
|
5db30458eb | ||
|
|
b5297bd109 | ||
|
|
547ba993d4 | ||
|
|
c380c75149 | ||
|
|
9c0723d4c7 | ||
|
|
c3aaf67421 | ||
|
|
addce12081 | ||
|
|
a975406031 | ||
|
|
c752baffda | ||
|
|
fc8a623067 | ||
|
|
c1c8b8cb86 | ||
|
|
690db7ce55 | ||
|
|
d46e28e8f2 | ||
|
|
fb500dc502 | ||
|
|
df9584711a | ||
|
|
66934fd68a | ||
|
|
ebc47ba5d7 | ||
|
|
d2f70d78ed | ||
|
|
0ed22eb62b | ||
|
|
a02e333688 | ||
|
|
50aca1d946 | ||
|
|
257c0e8d97 | ||
|
|
d250006a03 | ||
|
|
9a1704b08b | ||
|
|
c31f9e4d4e | ||
|
|
3ba3c5bc9d | ||
|
|
ec5e4f0e15 | ||
|
|
0b6b7e178b | ||
|
|
feb1d6e7d5 | ||
|
|
2c1401f9a3 | ||
|
|
d41944d3e3 | ||
|
|
b79c9fba17 | ||
|
|
e93ce41218 | ||
|
|
49a8749ddf | ||
|
|
767914043f | ||
|
|
6198b50400 | ||
|
|
0e94b82a96 | ||
|
|
5032d561ff | ||
|
|
4d51671d7d | ||
|
|
d21e71e00a | ||
|
|
ad3e35c3dc | ||
|
|
52c6eaec91 | ||
|
|
69879dd0df | ||
|
|
cab8646830 | ||
|
|
1a44099624 | ||
|
|
ecd80656af | ||
|
|
b6c9338792 | ||
|
|
861476ad71 | ||
|
|
20da44cf88 | ||
|
|
ab81a09922 | ||
|
|
a37ed02864 | ||
|
|
8909a96033 | ||
|
|
3c206491dd | ||
|
|
532ef823e2 | ||
|
|
76f228c1ac | ||
|
|
8811f7e73c | ||
|
|
e3262e2886 | ||
|
|
291ac27e36 | ||
|
|
2765eef9b3 | ||
|
|
0599c60864 | ||
|
|
880479b435 | ||
|
|
804eba41c9 | ||
|
|
3c05cf79c3 | ||
|
|
3c8b654b28 | ||
|
|
49f43b997b |
No files matched your search
@@ -21,6 +21,7 @@
|
||||
"heroinCooldown",
|
||||
"checkLoc",
|
||||
"getRandW",
|
||||
"shroomsCooldown"
|
||||
"shroomsCooldown",
|
||||
"targets"
|
||||
]
|
||||
}
|
||||
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 22 KiB |
@@ -0,0 +1,25 @@
|
||||
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',
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
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,28 +1,35 @@
|
||||
|
||||
if not Config.Drugs['TravellingMerchant'] then return end
|
||||
local function spawn()
|
||||
local data = ps.callback('md-drugs:server:GetMerchant')
|
||||
local data = Bridge.Callback.Trigger('md-drugs:server:GetMerchant')
|
||||
local model = 's_m_m_trucker_01'
|
||||
ps.requestModel(model)
|
||||
requestModel(model)
|
||||
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)
|
||||
ps.entityTarget(ped, {
|
||||
Bridge.Target.AddLocalEntity(ped, {
|
||||
{
|
||||
label = ps.lang('merchant.targetOpen'),
|
||||
icon = Bridge.Language.Locale('merchant.targetIcon'),
|
||||
label = Bridge.Language.Locale('merchant.targetOpen'),
|
||||
action = function()
|
||||
local options = {}
|
||||
for k, v in pairs (data.items) do
|
||||
local itemInfo = Bridge.Inventory.GetItemInfo(k)
|
||||
options[#options+1] = {
|
||||
title = ps.getLabel(k),
|
||||
title = itemInfo.label,
|
||||
description = '$'..v,
|
||||
icon = ps.getImage(k),
|
||||
action = function()
|
||||
icon = itemInfo.image,
|
||||
onSelect = function()
|
||||
TriggerServerEvent('md-drugs:server:purchaseGoods', k)
|
||||
end
|
||||
}
|
||||
end
|
||||
ps.menu('Travelling Merchant', 'Travelling Merchant', options)
|
||||
Bridge.Menu.Open({
|
||||
id = 'merchant_menu',
|
||||
title = Bridge.Language.Locale('merchant.menuTitle'),
|
||||
options = options
|
||||
})
|
||||
end
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = ped
|
||||
end
|
||||
spawn()
|
||||
@@ -1,88 +0,0 @@
|
||||
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,10 +1,11 @@
|
||||
|
||||
local cuttingcoke = nil
|
||||
local baggingcoke = nil
|
||||
local locations = ps.callback('md-drugs:server:GetCokeLocations')
|
||||
local locations = Config.Cocaine.Locations
|
||||
|
||||
local function CutCoke(coords, offset, rotation)
|
||||
cuttingcoke = true
|
||||
local animDict, animName = "anim@amb@business@coc@coc_unpack_cut_left@", "coke_cut_v5_coccutter"
|
||||
ps.requestAnim(animDict, 500)
|
||||
Bridge.Anim.RequestDict(animDict, 500)
|
||||
local animDuration = GetAnimDuration(animDict, animName) * 1000
|
||||
local ped = PlayerPedId()
|
||||
local scenePos, sceneRot = vector3(coords.x + offset.x, coords.y + offset.y,coords.z + offset.z), rotation
|
||||
@@ -47,15 +48,17 @@ local function CutCoke(coords, offset, rotation)
|
||||
end
|
||||
RemoveAnimDict(animDict)
|
||||
FreezeEntityPosition(ped, false)
|
||||
cuttingcoke = nil
|
||||
end
|
||||
|
||||
local function BagCoke(coords, offset, rotation)
|
||||
baggingcoke = true
|
||||
local ver = ""
|
||||
local animDict, animName = "anim@amb@business@meth@meth_smash_weight_check@", "break_weigh_"..ver.."char01"
|
||||
ps.requestAnim(animDict, 500)
|
||||
Bridge.Anim.RequestDict(animDict, 500)
|
||||
local animDuration = GetAnimDuration(animDict, animName) * 1000
|
||||
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 +0.03), rotation
|
||||
local scenes = {
|
||||
{
|
||||
{ hash = "bkr_prop_coke_cutblock_01", animName = "break_weigh_"..ver.."box01"},
|
||||
@@ -74,7 +77,6 @@ local function BagCoke(coords, offset, rotation)
|
||||
},
|
||||
{
|
||||
{ hash = "bkr_prop_fakeid_clipboard_01a", animName = "break_weigh_"..ver.."clipboard"},
|
||||
|
||||
}
|
||||
}
|
||||
local scenesList, entitiesList = {}, {}
|
||||
@@ -109,19 +111,17 @@ local function BagCoke(coords, offset, rotation)
|
||||
end
|
||||
RemoveAnimDict(animDict)
|
||||
FreezeEntityPosition(ped, false)
|
||||
baggingcoke = nil
|
||||
end
|
||||
|
||||
for k, v in pairs (locations.MakePowder) do
|
||||
ps.boxTarget('cocaplant'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
|
||||
Bridge.Target.AddBoxZone('cocaplant'..k, v.loc, v.size, v.loc.w or 180.0, {
|
||||
{
|
||||
label = ps.lang('coke.targetMakePow'),
|
||||
icon = 'fa-solid fa-seedling',
|
||||
label = Bridge.Language.Locale('coke.targetMakePow'),
|
||||
icon = Bridge.Language.Locale('coke.targetMakePowIcon'),
|
||||
action = function()
|
||||
if not ps.hasItem('coca_leaf') then
|
||||
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
|
||||
if not itemCheck('coca_leaf') then return end
|
||||
if not progressbar(Bridge.Language.Locale('coke.makePow')) then return end
|
||||
TriggerServerEvent("md-drugs:server:makepowder", k)
|
||||
end,
|
||||
canInteract = function()
|
||||
@@ -129,18 +129,16 @@ for k, v in pairs (locations.MakePowder) do
|
||||
end
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = 'cocaplant'..k
|
||||
end
|
||||
|
||||
for k, v in pairs (locations.CuttingCoke) do
|
||||
ps.boxTarget('cutcoke'..k, v.loc, {length = 1.0, width = 1.0, height = 1.0, rotation = 180.0}, {
|
||||
Bridge.Target.AddBoxZone('cutcoke'..k, v.loc, v.size, v.loc.w or 180.0, {
|
||||
{
|
||||
label = ps.lang('coke.targetCutCoke'),
|
||||
icon = 'fa-solid fa-mortar-pestle',
|
||||
label = Bridge.Language.Locale('coke.targetCutCoke'),
|
||||
icon = Bridge.Language.Locale('coke.targetCutCokeIcon'),
|
||||
action = function()
|
||||
if not ps.hasItem('bakingsoda') then
|
||||
ps.notify(ps.lang('Catches.itemMissings', ps.getLabel('bakingsoda')), 'error')
|
||||
return
|
||||
end
|
||||
if not itemCheck('bakingsoda') then return end
|
||||
CutCoke(v.loc, v.offset, v.rotation)
|
||||
TriggerServerEvent("md-drugs:server:cutcokeone", k)
|
||||
end,
|
||||
@@ -151,18 +149,16 @@ for k, v in pairs (locations.CuttingCoke) do
|
||||
end,
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = 'cutcoke'..k
|
||||
end
|
||||
|
||||
for k, v in pairs (locations.BaggingCoke) do
|
||||
ps.boxTarget('bagcoke'..k, v.loc, {length = 1.0, width = 1.0, height = 1.0, rotation = 180.0}, {
|
||||
Bridge.Target.AddBoxZone('bagcoke'..k, v.loc, v.size, v.loc.w or 180.0, {
|
||||
{
|
||||
label = ps.lang('coke.targetBagCoke'),
|
||||
icon = 'fa-solid fa-sack-xmark',
|
||||
label = Bridge.Language.Locale('coke.targetBagCoke'),
|
||||
icon = Bridge.Language.Locale('coke.targetBagCokeIcon'),
|
||||
action = function()
|
||||
if not ps.hasItem('empty_weed_bag') then
|
||||
ps.notify(ps.lang('Catches.itemMissings', ps.getLabel('empty_weed_bag')), 'error')
|
||||
return
|
||||
end
|
||||
if not itemCheck('empty_weed_bag') then return end
|
||||
BagCoke(v.loc, v.offset, v.rotation)
|
||||
TriggerServerEvent("md-drugs:server:bagcoke", k)
|
||||
end,
|
||||
@@ -173,13 +169,14 @@ for k, v in pairs (locations.BaggingCoke) do
|
||||
end
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = 'bagcoke'..k
|
||||
end
|
||||
|
||||
for k, v in pairs (locations.cokeTele) do
|
||||
ps.boxTarget('coke_tele'..k, v.inside, {length = v.l, width = v.w, heading = v.rot}, {
|
||||
Bridge.Target.AddBoxZone('coke_tele'..k, v.inside, v.size, v.inside.w or 180.0,{
|
||||
{
|
||||
icon = 'fa-solid fa-door-open',
|
||||
label = ps.lang('coke.teleOut'),
|
||||
icon = Bridge.Language.Locale('coke.teleOutIcon'),
|
||||
label = Bridge.Language.Locale('coke.teleOut'),
|
||||
action = function()
|
||||
SetEntityCoords(PlayerPedId(), v.outside)
|
||||
end,
|
||||
@@ -188,10 +185,11 @@ for k, v in pairs (locations.cokeTele) do
|
||||
end
|
||||
}
|
||||
})
|
||||
ps.boxTarget('coke_teleout'..k, v.outside, {length = v.l, width = v.w, heading = v.rot}, {
|
||||
targets[#targets+1] = 'coke_tele'..k
|
||||
Bridge.Target.AddBoxZone('coke_teleout'..k, v.outside, v.size, v.outside.w or 180.0,{
|
||||
{
|
||||
icon = 'fa-solid fa-door-closed',
|
||||
label = ps.lang('coke.teleIn'),
|
||||
icon = Bridge.Language.Locale('coke.teleInIcon'),
|
||||
label = Bridge.Language.Locale('coke.teleIn'),
|
||||
action = function()
|
||||
SetEntityCoords(PlayerPedId(), v.inside)
|
||||
end,
|
||||
@@ -200,6 +198,7 @@ for k, v in pairs (locations.cokeTele) do
|
||||
end
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = 'coke_teleout'..k
|
||||
end
|
||||
|
||||
CreateThread(function()
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
if not Config.Drugs['consumables'] then return end
|
||||
|
||||
|
||||
ps.registerCallback('md-drugs:client:consumedrugs', function(time, effect, anim, progresstext, status, item)
|
||||
if not progressbar(progresstext .. ps.getLabel(item).. "!", time, anim ) then return end
|
||||
Bridge.Callback.Register('md-drugs:client:consumedrugs', function(time, effect, anim, progresstext, status, item)
|
||||
Bridge.Anim.RequestDict(anim.dict)
|
||||
if not progressbar(progresstext .. Bridge.Inventory.GetItemInfo(item).label.. "!", time, anim ) then return end
|
||||
for k, v in pairs (status) do
|
||||
if k == 'health' then
|
||||
local cur = GetEntityHealth(PlayerPedId())
|
||||
SetEntityHealth(PlayerPedId(), cur + v)
|
||||
elseif k == 'thirst' or k == 'stress' or k == 'hunger' then
|
||||
TriggerServerEvent('md-drugs:server:updatestatus', k, v)
|
||||
elseif k == 'thirst' or k == 'stress' or k == 'hunger' then
|
||||
TriggerServerEvent('md-drugs:server:updatestatus', k, v)
|
||||
elseif k == "armor" then
|
||||
TriggerServerEvent('hospital:server:SetArmor', v)
|
||||
TriggerServerEvent('consumables:server:useArmor')
|
||||
@@ -33,28 +34,113 @@ RegisterNetEvent('md-drugs:client:recievebuff', function(type, amount)
|
||||
until count == amount
|
||||
SetRunSprintMultiplierForPlayer(PlayerPedId(), 1.00)
|
||||
end
|
||||
if type == 'strength' then
|
||||
if type == 'strength' then
|
||||
local strength = 0
|
||||
SetCurrentPedWeapon(PlayerPedId(), 'weapon_unarmed', true)
|
||||
SetWeaponDamageModifier(GetHashKey("WEAPON_UNARMED"), 50.0)
|
||||
repeat
|
||||
strength = strength + 1
|
||||
Wait(1000)
|
||||
Wait(1000)
|
||||
until strength == amount
|
||||
SetWeaponDamageModifier(GetHashKey("WEAPON_UNARMED"), 1.0)
|
||||
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)
|
||||
if effect == "alien" then
|
||||
AlienEffect()
|
||||
if effect == "alien" then
|
||||
AlienEffect()
|
||||
elseif effect == "ecstacy" then
|
||||
EcstasyEffect()
|
||||
elseif effect == "meth" then
|
||||
MethBagEffect()
|
||||
elseif effect == "coke" then
|
||||
CokeBaggyEffect()
|
||||
elseif effect == "trevor" then
|
||||
TrevorEffect()
|
||||
elseif effect == "meth" then
|
||||
MethBagEffect()
|
||||
elseif effect == "coke" then
|
||||
CokeBaggyEffect()
|
||||
elseif effect == "trevor" then
|
||||
TrevorEffect()
|
||||
end
|
||||
end)
|
||||
@@ -9,31 +9,62 @@ end
|
||||
|
||||
local function sellDrug(item, amount, price, targ)
|
||||
PoliceCall(20)
|
||||
if ps.vehicleData() then
|
||||
ps.notify(ps.lang('Cornerselling.inVeh'), 'error')
|
||||
if IsPedInAnyVehicle(PlayerPedId(), true) then
|
||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('Cornerselling.inVeh'), 'error')
|
||||
walkAway(targ)
|
||||
return
|
||||
end
|
||||
|
||||
if not ps.progressbar(string.format(ps.lang('Cornerselling.selling', ps.getLabel(item), price)), 4000, 'uncuff') then walkAway(targ) return end
|
||||
if not progressbar(Bridge.Language.Locale('Cornerselling.selling', Bridge.Inventory.GetItemInfo(item).label, price)) then
|
||||
walkAway(targ)
|
||||
return
|
||||
end
|
||||
buyers[targ] = 'sold'
|
||||
TriggerServerEvent('md-drugs:server:sellCornerDrugs', item, amount, price)
|
||||
TriggerServerEvent('md-drugs:server:sellCornerDrugs', item, amount, price, NetworkGetNetworkIdFromEntity(targ))
|
||||
walkAway(targ)
|
||||
end
|
||||
|
||||
local function deny(targ)
|
||||
PoliceCall(20)
|
||||
PoliceCall(20)
|
||||
buyers[targ] = 'sold'
|
||||
if not ps.progressbar(ps.lang('Cornerselling.deny'), 4000, 'argue5') then return end
|
||||
if not progressbar(Bridge.Language.Locale('Cornerselling.deny'), 4000, {
|
||||
dict = 'anim@amb@casino@brawl@fights@argue@',
|
||||
clip = 'arguement_loop_mp_m_brawler_01',
|
||||
flag = 49
|
||||
}) then return end
|
||||
walkAway(targ)
|
||||
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 targ = nil
|
||||
|
||||
repeat
|
||||
Wait(100)
|
||||
targ = ps.getNearestPed(GetEntityCoords(PlayerPedId()), 8)
|
||||
|
||||
targ = getClosestPed()
|
||||
if IsPedInAnyVehicle(targ, false) or GetEntityHealth(targ) == 0 or not IsPedHuman(targ) then
|
||||
targ = nil
|
||||
end
|
||||
@@ -43,19 +74,22 @@ local function findPed()
|
||||
if inZone then
|
||||
targ = nil
|
||||
end
|
||||
until targ ~= nil
|
||||
until targ ~= nil or sell == false
|
||||
|
||||
if not sell then return end
|
||||
buyers[targ] = true
|
||||
|
||||
ps.drawText(ps.lang('Cornerselling.wait'))
|
||||
Bridge.HelpText.ShowHelpText(Bridge.Language.Locale('Cornerselling.wait'))
|
||||
|
||||
repeat
|
||||
Wait(1000)
|
||||
TaskGoToCoordAnyMeans(targ, GetEntityCoords(PlayerPedId()), 1.0, 0, 0, 0, 0)
|
||||
until #(GetEntityCoords(PlayerPedId()) - GetEntityCoords(targ)) < 2.0
|
||||
until #(GetEntityCoords(PlayerPedId()) - GetEntityCoords(targ)) < 2.0 or sell == false or inZone
|
||||
|
||||
if not sell then return end
|
||||
|
||||
TaskTurnPedToFaceEntity(targ, PlayerPedId(), -1)
|
||||
ps.hideText()
|
||||
Bridge.HelpText.HideHelpText()
|
||||
CreateThread(function()
|
||||
Wait(45000)
|
||||
walkAway(targ)
|
||||
@@ -65,14 +99,17 @@ local function findPed()
|
||||
end
|
||||
|
||||
local function checkItems()
|
||||
local count = 0
|
||||
local has = false
|
||||
for k, v in pairs (GlobalState.DrugNames) do
|
||||
if ps.hasItem(v) then
|
||||
count = count + 1
|
||||
if Bridge.Inventory.HasItem(v) then
|
||||
has = true
|
||||
break
|
||||
end
|
||||
end
|
||||
if count == 0 then ps.notify(ps.lang('Cornerselling.nodrugs', 'error')) return false end
|
||||
if not has then
|
||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('Cornerselling.nodrugs', 'error'))
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
@@ -89,10 +126,10 @@ local function Cornersell()
|
||||
return
|
||||
end
|
||||
|
||||
ps.drawText(ps.lang('Cornerselling.searching'))
|
||||
|
||||
Bridge.HelpText.ShowHelpText(Bridge.Language.Locale('Cornerselling.searching'))
|
||||
|
||||
local targ = findPed()
|
||||
local data = ps.callback('md-drugs:server:cornerselling:getAvailableDrugs', targ)
|
||||
local data = Bridge.Callback.Trigger('md-drugs:server:cornerselling:getAvailableDrugs', NetworkGetNetworkIdFromEntity(targ))
|
||||
if data == false then
|
||||
sell = false
|
||||
return
|
||||
@@ -102,13 +139,13 @@ local function Cornersell()
|
||||
TaskGoStraightToCoord(targ, -1858.232910, -1242.395630, 8.60510, 100.0, -1, 0.0, 0.0)
|
||||
SetPedMoveRateOverride(targ, 10.0)
|
||||
local got = false
|
||||
ps.entityTarget(targ, {
|
||||
Bridge.Target.AddLocalEntity(targ, {
|
||||
{
|
||||
label = ps.lang('Cornerselling.targetTakeBack'),
|
||||
icon ="fa-solid fa-money-bill",
|
||||
label = Bridge.Language.Locale('Cornerselling.targetTakeBack'),
|
||||
icon = Bridge.Language.Locale("Cornerselling.targetTakeBackIcon"),
|
||||
action = function()
|
||||
got = true
|
||||
TriggerServerEvent('md-drugs:server:getBackRobbed')
|
||||
TriggerServerEvent('md-drugs:server:getBackRobbed', NetworkGetNetworkIdFromEntity(targ))
|
||||
Cornersell()
|
||||
end,
|
||||
canInteract = function()
|
||||
@@ -116,15 +153,17 @@ local function Cornersell()
|
||||
return true
|
||||
end
|
||||
end,
|
||||
}}, nil)
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = targ
|
||||
else
|
||||
ps.requestAnim("rcmme_tracey1")
|
||||
Bridge.Anim.RequestDict("rcmme_tracey1")
|
||||
TaskStartScenarioInPlace(targ, "WORLD_HUMAN_STAND_IMPATIENT_UPRIGHT", 0, false)
|
||||
FreezeEntityPosition(targ, true)
|
||||
ps.entityTarget(targ, {
|
||||
Bridge.Target.AddLocalEntity(targ, {
|
||||
{
|
||||
label = string.format(ps.lang('Cornerselling.targetSell'), data.amount, ps.getLabel(data.item), data.price),
|
||||
icon ="fa-solid fa-money-bill",
|
||||
label = Bridge.Language.Locale('Cornerselling.targetSell', data.amount, Bridge.Inventory.GetItemInfo(data.item).label, data.price),
|
||||
icon = Bridge.Language.Locale("Cornerselling.targetSellIcon"),
|
||||
action = function()
|
||||
sellDrug(data.item, data.amount, data.price, targ)
|
||||
Cornersell()
|
||||
@@ -136,8 +175,8 @@ local function Cornersell()
|
||||
end,
|
||||
},
|
||||
{
|
||||
label = ps.lang('Cornerselling.targetDeny'),
|
||||
icon = "fa-solid fa-person-harassing",
|
||||
label = Bridge.Language.Locale('Cornerselling.targetDeny'),
|
||||
icon = Bridge.Language.Locale("Cornerselling.targetDenyIcon"),
|
||||
action = function()
|
||||
deny(targ)
|
||||
walkAway(targ)
|
||||
@@ -150,24 +189,39 @@ local function Cornersell()
|
||||
end
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = targ
|
||||
end
|
||||
end
|
||||
|
||||
RegisterNetEvent('md-drugs:client:cornerselling', function()
|
||||
if inZone then
|
||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('Cornerselling.inNoSellZone'), 'error')
|
||||
return
|
||||
end
|
||||
if sell then
|
||||
sell = false
|
||||
ps.hideText()
|
||||
ps.notify(ps.lang('Cornerselling.stopped'), 'error')
|
||||
Bridge.HelpText.HideHelpText()
|
||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('Cornerselling.stopped'), 'error')
|
||||
else
|
||||
sell = true
|
||||
ps.notify(ps.lang('Cornerselling.start'), 'success')
|
||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('Cornerselling.start'), 'success')
|
||||
Cornersell()
|
||||
end
|
||||
end)
|
||||
|
||||
CreateThread(function()
|
||||
for k, v in pairs (QBConfig.NoSellZones) do
|
||||
local box = ps.zones.box({ coords = v.loc, size = vec3(v.width, v.length, v.height), rotation = 180.0, debug = false,
|
||||
onEnter = function() inZone = true end, onExit = function() inZone = false end})
|
||||
for k, v in pairs (Config.Cornerselling.noSellZones) do
|
||||
Bridge.Point.Register(
|
||||
'MDDRUGNOSELLZONE'..k,
|
||||
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)
|
||||
@@ -1,20 +1,17 @@
|
||||
local locations = ps.callback('md-drugs:server:GetCrackLocations')
|
||||
local locations = Config.Crack.Locations
|
||||
|
||||
for k, v in pairs (locations.makecrack) do
|
||||
ps.boxTarget('makeCrack'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
|
||||
Bridge.Target.AddBoxZone('makeCrack'..k, v.loc, v.size, v.loc.w or 180.0, {
|
||||
{
|
||||
label = ps.lang('crack.targetMake'),
|
||||
icon = 'fa-solid fa-temperature-high',
|
||||
label = Bridge.Language.Locale('crack.targetMake'),
|
||||
icon = Bridge.Language.Locale('crack.makeIcon'),
|
||||
action = function()
|
||||
if not ps.hasItem('bakingsoda') then
|
||||
ps.notify(ps.lang('Catches.itemMissings', ps.getLabel('bakingsoda')), 'error')
|
||||
return
|
||||
end
|
||||
if not itemCheck('bakingsoda') then return end
|
||||
if not minigame() then
|
||||
TriggerServerEvent("md-drugs:server:failcrackone", k)
|
||||
return
|
||||
end
|
||||
if not ps.progressbar(ps.lang('crack.cook'), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('crack.cook')) then return end
|
||||
TriggerServerEvent('md-drugs:server:makecrackone', k)
|
||||
end,
|
||||
canInteract = function()
|
||||
@@ -23,19 +20,17 @@ for k, v in pairs (locations.makecrack) do
|
||||
end
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = 'makeCrack'..k
|
||||
end
|
||||
|
||||
for k, v in pairs (locations.bagcrack) do
|
||||
ps.boxTarget('bagCrack'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
|
||||
Bridge.Target.AddBoxZone('bagCrack'..k, v.loc, v.size, v.loc.w or 180.0, {
|
||||
{
|
||||
label = ps.lang('crack.targetBag'),
|
||||
icon = 'fa-solid fa-weight-scale',
|
||||
label = Bridge.Language.Locale('crack.targetBag'),
|
||||
icon = Bridge.Language.Locale('crack.bagIcon'),
|
||||
action = function()
|
||||
if not ps.hasItem('empty_weed_bag') then
|
||||
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
|
||||
if not itemCheck('empty_weed_bag') then return end
|
||||
if not progressbar(Bridge.Language.Locale('crack.bag')) then return end
|
||||
TriggerServerEvent("md-drugs:server:bagcrack", k)
|
||||
end,
|
||||
canInteract = function()
|
||||
@@ -44,4 +39,5 @@ for k, v in pairs (locations.bagcrack) do
|
||||
end
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = 'bagCrack'..k
|
||||
end
|
||||
@@ -1,79 +1,83 @@
|
||||
local isActive = false
|
||||
if not Config.Drugs['deliveries'] then return end
|
||||
local dealer = {}
|
||||
local buyer = nil
|
||||
|
||||
repeat Wait(100) until GlobalState.MDDrugDealers ~= nil
|
||||
|
||||
local function SpawnDealer()
|
||||
local getDealers = ps.callback('md-drugs:server:getDealers')
|
||||
for k,v in pairs(getDealers) do
|
||||
local Ped = "g_m_y_famdnf_01"
|
||||
ps.requestModel(Ped, Config.RequestModelTime)
|
||||
local loc = json.decode(v.coords)
|
||||
dealer[k] = CreatePed(0, Ped,loc.x,loc.y, loc.z-1, loc.h, false, false)
|
||||
Freeze(dealer[k], true, loc.h)
|
||||
ps.entityTarget(dealer[k], {
|
||||
if #dealer >= 1 then
|
||||
for k,v in pairs (dealer) do
|
||||
DeletePed(v)
|
||||
end
|
||||
dealer = {}
|
||||
end
|
||||
for k,v in pairs(GlobalState.MDDrugDealers) do
|
||||
requestModel(v.model)
|
||||
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 = 'fas fa-user-secret',
|
||||
label = ps.lang('Deliveries.targetGetDel'),
|
||||
icon = Bridge.Language.Locale('Deliveries.targetGetDelIcon'),
|
||||
label = Bridge.Language.Locale('Deliveries.targetGetDel'),
|
||||
action = function()
|
||||
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
|
||||
TriggerServerEvent('md-drugs:server:requestDelivery', k)
|
||||
end,
|
||||
},
|
||||
{
|
||||
icon = "fa-solid fa-store",
|
||||
label = ps.lang('Deliveries.targetOpenShop'),
|
||||
icon = Bridge.Language.Locale('Deliveries.targetOpenShopIcon'),
|
||||
label = Bridge.Language.Locale('Deliveries.targetOpenShop'),
|
||||
action = function()
|
||||
local rep = GetRep()
|
||||
local items = ps.callback('md-drugs:server:dealerList')
|
||||
local options = {}
|
||||
for m, d in pairs (items) do
|
||||
for m, d in pairs (Config.Deliveries.Recipes) do
|
||||
if rep.dealerrep >= d.minrep then
|
||||
options[#options+1] = {
|
||||
title = ps.getLabel(d.name),
|
||||
title = Bridge.Inventory.GetItemInfo(d.name).label,
|
||||
description = '$' .. d.price,
|
||||
icon = ps.getImage(d.name),
|
||||
action = function()
|
||||
TriggerServerEvent('md-drugs:server:buyItemDealer', m)
|
||||
icon = Bridge.Inventory.GetItemInfo(d.name).image,
|
||||
onSelect = function()
|
||||
TriggerServerEvent('md-drugs:server:buyItemDealer', m, k)
|
||||
end,
|
||||
}
|
||||
end
|
||||
end
|
||||
ps.menu(ps.lang('Deliveries.shopHeader'), ps.lang('Deliveries.shopHeader'), options)
|
||||
Bridge.Menu.Open({
|
||||
id = 'DealerMenu',
|
||||
title = Bridge.Language.Locale('Deliveries.shopHeader'),
|
||||
description = Bridge.Language.Locale('Deliveries.shopHeader'),
|
||||
options = options
|
||||
})
|
||||
end,
|
||||
}
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
SpawnDealer()
|
||||
|
||||
RegisterNetEvent('md-drugs:client:RefreshDealers', function()
|
||||
SpawnDealer()
|
||||
end)
|
||||
|
||||
CreateThread(function()
|
||||
SpawnDealer()
|
||||
end)
|
||||
|
||||
RegisterNetEvent('md-drugs:client:setLocation', function(data)
|
||||
local coord = json.decode(data.coords)
|
||||
if buyer then
|
||||
DeletePed(buyer)
|
||||
end
|
||||
local coord = data.coords
|
||||
SetNewWaypoint(coord.x, coord.y)
|
||||
if isActive then return end
|
||||
isActive = true
|
||||
local Buyer = CreatePed(0, "g_m_y_famdnf_01",coord.x, coord.y, coord.z-1, coord.w, false, false)
|
||||
Freeze(Buyer, true, coord.w)
|
||||
ps.entityTarget(Buyer, {
|
||||
icon = 'fas fa-user-secret',
|
||||
label = ps.lang('Deliveries.targetHandOff'),
|
||||
action = function()
|
||||
if not progressbar(ps.lang('Deliveries.delivering'), 4000, 'uncuff') then return end
|
||||
isActive = false
|
||||
DeletePed(Buyer)
|
||||
TriggerServerEvent('md-drugs:server:giveDeliveryItems', data.item, data.amount)
|
||||
end,
|
||||
canInteract = function()
|
||||
if isActive then
|
||||
return true
|
||||
end
|
||||
end
|
||||
}, nil)
|
||||
end)
|
||||
requestModel("g_m_y_famdnf_01")
|
||||
buyer = CreatePed(0, "g_m_y_famdnf_01",coord.x, coord.y, coord.z-1, coord.w, false, false)
|
||||
Freeze(buyer, true, coord.w)
|
||||
Bridge.Target.AddLocalEntity(buyer , {
|
||||
{
|
||||
icon = Bridge.Language.Locale('Deliveries.targetHandOffIcon'),
|
||||
label = Bridge.Language.Locale('Deliveries.targetHandOff'),
|
||||
action = function()
|
||||
if not progressbar(Bridge.Language.Locale('Deliveries.delivering')) then return end
|
||||
TriggerServerEvent('md-drugs:server:giveDeliveryItems')
|
||||
Wait(400)
|
||||
DeletePed(buyer)
|
||||
end,
|
||||
}
|
||||
})
|
||||
end)
|
||||
@@ -1,16 +1,18 @@
|
||||
|
||||
local minigametype = Config.minigametype
|
||||
local dispatch = Config.Dispatch
|
||||
|
||||
|
||||
function loadParticle(dict)
|
||||
if not HasNamedPtfxAssetLoaded(dict) then
|
||||
RequestNamedPtfxAsset(dict)
|
||||
function requestModel(ped, timeout)
|
||||
timeout = timeout or 15000
|
||||
local startTime = GetGameTimer()
|
||||
RequestModel(ped)
|
||||
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
|
||||
while not HasNamedPtfxAssetLoaded(dict) do
|
||||
Wait(0)
|
||||
end
|
||||
SetPtfxAssetNextCall(dict)
|
||||
return true
|
||||
end
|
||||
|
||||
function minigame()
|
||||
@@ -86,59 +88,34 @@ function minigame()
|
||||
Wait(1000)
|
||||
time = time + 1
|
||||
until successes or time == 100
|
||||
elseif minigametype == 'none' then
|
||||
return true
|
||||
elseif minigametype == 'none' then
|
||||
return true
|
||||
else
|
||||
print"^1 SCRIPT ERROR: Md-Drugs set your minigame with one of the options!"
|
||||
end
|
||||
end
|
||||
|
||||
function GetRep()
|
||||
local rep = ps.callback('md-drugs:server:GetRep')
|
||||
return rep
|
||||
end
|
||||
|
||||
|
||||
function sorter(sorting, value)
|
||||
table.sort(sorting, function(a, b) return a[value] < b[value] end)
|
||||
function GetRep()
|
||||
local rep = Bridge.Callback.Trigger('md-drugs:server:GetRep')
|
||||
return rep
|
||||
end
|
||||
|
||||
function PoliceCall(chance)
|
||||
local math = math.random(1,100)
|
||||
if math <= chance then
|
||||
if dispatch == 'ps' then
|
||||
exports['ps-dispatch']:DrugSale()
|
||||
elseif dispatch == 'cd' then
|
||||
local data = exports['cd_dispatch']:GetPlayerInfo()
|
||||
TriggerServerEvent('cd_dispatch:AddNotification', {
|
||||
job_table = {'police', },
|
||||
coords = data.coords,
|
||||
title = '420-69 Drug Sale',
|
||||
message = 'A '..data.sex..' robbing a store at '..data.street,
|
||||
flash = 0,
|
||||
unique_id = data.unique_id,
|
||||
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
|
||||
Bridge.Dispatch.SendAlert({
|
||||
message = Bridge.Language.Locale('Dispatch.header'),
|
||||
code = Bridge.Language.Locale('Dispatch.code'),
|
||||
coords = GetEntityCoords(PlayerPedId()),
|
||||
jobs = {"police"},
|
||||
blipData = {
|
||||
sprite = 161,
|
||||
color = 1,
|
||||
scale = 1.0
|
||||
},
|
||||
time = 300000,
|
||||
icon = Bridge.Language.Locale('Dispatch.icon')
|
||||
})
|
||||
else
|
||||
return
|
||||
end
|
||||
@@ -146,11 +123,10 @@ end
|
||||
|
||||
function GetCops(number)
|
||||
if number == 0 then return true end
|
||||
local amount = ps.callback('md-drugs:server:GetCoppers')
|
||||
if amount >= number then return true else ps.notify('You Need '.. number - amount .. ' More Cops To Do This', 'error') end
|
||||
local amount = Bridge.Callback.Trigger('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
|
||||
end
|
||||
|
||||
|
||||
function Freeze(entity, toggle, head)
|
||||
SetEntityInvincible(entity, toggle)
|
||||
SetEntityAsMissionEntity(entity, toggle, toggle)
|
||||
@@ -159,18 +135,55 @@ function Freeze(entity, toggle, head)
|
||||
SetBlockingOfNonTemporaryEvents(entity, toggle)
|
||||
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 heading = 180.0
|
||||
function StartRay()
|
||||
local run = true
|
||||
local pedcoord = GetEntityCoords(PlayerPedId())
|
||||
ps.requestModel('v_ret_ml_tablea', 30000)
|
||||
requestModel('v_ret_ml_tablea', 30000)
|
||||
local table = CreateObject('v_ret_ml_tablea', pedcoord.x, pedcoord.y, pedcoord.z+1, heading, false, false)
|
||||
repeat
|
||||
local hit, endCoords, surfaceNormal, entityHit = ps.raycast()
|
||||
local hit, endCoords, surfaceNormal, entityHit = ray()
|
||||
if not created then
|
||||
created = true
|
||||
ps.drawText([[[E] To Place
|
||||
Bridge.HelpText.ShowHelpText([[[E] To Place
|
||||
[DEL] To Cancel
|
||||
[<-] To Move Left
|
||||
[->] To Move Right]])
|
||||
@@ -187,7 +200,7 @@ function StartRay()
|
||||
heading = heading + 2
|
||||
end
|
||||
if IsControlPressed(0, 38) then
|
||||
ps.hideText()
|
||||
Bridge.HelpText.HideHelpText()
|
||||
run = false
|
||||
DeleteObject(table)
|
||||
created = false
|
||||
@@ -195,7 +208,7 @@ function StartRay()
|
||||
end
|
||||
|
||||
if IsControlPressed(0, 178) then
|
||||
ps.hideText()
|
||||
Bridge.HelpText.HideHelpText()
|
||||
run = false
|
||||
created = false
|
||||
DeleteObject(table)
|
||||
@@ -208,13 +221,13 @@ end
|
||||
function StartRay2()
|
||||
local run = true
|
||||
local pedcoord = GetEntityCoords(PlayerPedId())
|
||||
ps.requestModel('bkr_prop_coke_press_01aa', 30000)
|
||||
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)
|
||||
repeat
|
||||
local hit, endCoords, surfaceNormal, entityHit = ps.raycast()
|
||||
local hit, endCoords, surfaceNormal, entityHit = ray()
|
||||
if not created then
|
||||
created = true
|
||||
ps.drawText([[[E] To Place
|
||||
Bridge.HelpText.ShowHelpText([[[E] To Place
|
||||
[DEL] To Cancel
|
||||
[<-] To Move Left
|
||||
[->] To Move Right]])
|
||||
@@ -231,7 +244,7 @@ function StartRay2()
|
||||
heading = heading + 2
|
||||
end
|
||||
if IsControlPressed(0, 38) then
|
||||
ps.hideText()
|
||||
Bridge.HelpText.HideHelpText()
|
||||
run = false
|
||||
DeleteObject(table)
|
||||
created = false
|
||||
@@ -239,7 +252,7 @@ function StartRay2()
|
||||
end
|
||||
|
||||
if IsControlPressed(0, 178) then
|
||||
ps.hideText()
|
||||
Bridge.HelpText.HideHelpText()
|
||||
run = false
|
||||
created = false
|
||||
DeleteObject(table)
|
||||
@@ -249,27 +262,121 @@ function StartRay2()
|
||||
until run == false
|
||||
end
|
||||
|
||||
|
||||
|
||||
ps.registerCallback('md-drugs:client:uncuff', function(data)
|
||||
if not progressbar(data, 4000, 'uncuff') then return end
|
||||
Bridge.Callback.Register('md-drugs:client:uncuff', function(data)
|
||||
if not progressbar(data) then return end
|
||||
return true
|
||||
end)
|
||||
|
||||
RegisterCommand('DrugRep', function()
|
||||
if not Config.TierSystem then return end
|
||||
local rep = ps.callback('md-drugs:server:GetRep', false)
|
||||
ps.menu('Drug Rep', 'Drug Rep', {
|
||||
{icon = "fa-solid fa-face-flushed", title = 'Cocaine: '..rep.coke},
|
||||
{icon = "fa-solid fa-syringe", title = 'Heroin: '..rep.heroin},
|
||||
{icon = "fa-solid fa-vial", title = 'LSD: '..rep.lsd},
|
||||
{icon = "fa-solid fa-plug", title = 'Dealer: '..rep.dealerrep},
|
||||
{icon = "fa-solid fa-money-bill", title = 'Corner Selling: ' .. rep.cornerselling.rep, description = 'Rank: ' .. rep.cornerselling.label }
|
||||
local rep = GetRep()
|
||||
Bridge.Menu.Open({
|
||||
id = 'drugrep',
|
||||
title = Bridge.Language.Locale('DrugRep.header'),
|
||||
description = Bridge.Language.Locale('DrugRep.increased'),
|
||||
options = {
|
||||
{icon = Bridge.Language.Locale('DrugRep.coke.icon'), title = Bridge.Language.Locale('DrugRep.coke.title', rep.coke)},
|
||||
{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)
|
||||
|
||||
function handleGang(gang)
|
||||
if gang == nil or gang == '' or gang == "" then return true end
|
||||
if ps.getGangName() == gang or gang == 1 then return true end
|
||||
return false
|
||||
end
|
||||
if Bridge.Framework.GetResourceName() == 'es_extended' then
|
||||
function handleGang(gang)
|
||||
return true
|
||||
end
|
||||
else
|
||||
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,32 +1,30 @@
|
||||
|
||||
if not Config.Drugs['heroin'] then return end
|
||||
local herointable = false
|
||||
local dirty = false
|
||||
local locations = ps.callback('md-drugs:server:GetHeroinLocations')
|
||||
|
||||
local locations = Config.Heroin.Locations
|
||||
|
||||
local function createLabKit(coord, head)
|
||||
local heroinlabkit = CreateObject("v_ret_ml_tablea", coord.x, coord.y, coord.z - 1, true, false,false)
|
||||
SetEntityHeading(heroinlabkit, head)
|
||||
PlaceObjectOnGroundProperly(heroinlabkit)
|
||||
ps.entityTarget(heroinlabkit, {
|
||||
Bridge.Target.AddLocalEntity(heroinlabkit, {
|
||||
{
|
||||
icon = "fa-solid fa-temperature-high",
|
||||
label = ps.lang('heroin.targetCook'),
|
||||
icon = Bridge.Language.Locale('heroin.cookIcon'),
|
||||
label = Bridge.Language.Locale('heroin.targetCook'),
|
||||
action = function()
|
||||
if not ps.hasItem('emptyvial') then
|
||||
ps.notify(ps.lang('Catches.itemMissings', ps.getLabel('emptyvial')), 'error')
|
||||
return
|
||||
end
|
||||
if not itemCheck('emptyvial') then return end
|
||||
|
||||
if not minigame() then
|
||||
dirty = true
|
||||
TriggerServerEvent("md-drugs:server:failheatingheroin")
|
||||
ps.requestPTFX("core")
|
||||
local heroinkit = StartParticleFxLoopedOnEntity("exp_air_molotov", heroinlabkit, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.5, false, false, false)
|
||||
local coords = GetEntityCoords(heroinlabkit)
|
||||
AddExplosion(coords.x, coords.y, coords.z-1.0, 34, 0.0, true, false, true)
|
||||
SetParticleFxLoopedAlpha(heroinkit, 3.0)
|
||||
SetPedToRagdoll(PlayerPedId(), 1300, 1300, 0, 0, 0, 0)
|
||||
return end
|
||||
|
||||
if not ps.progressbar(ps.lang('heroin.pbCook'), 4000, 'uncuff') then return end
|
||||
return
|
||||
end
|
||||
if not progressbar(Bridge.Language.Locale('heroin.pbCook')) then return end
|
||||
TriggerServerEvent("md-drugs:server:heatliquidheroin")
|
||||
end,
|
||||
canInteract = function()
|
||||
@@ -34,10 +32,10 @@ local function createLabKit(coord, head)
|
||||
end
|
||||
},
|
||||
{
|
||||
icon = "fas fa-box-circle-check",
|
||||
label = ps.lang('heroin.targetPickup'),
|
||||
icon = Bridge.Language.Locale('heroin.targetPickupIcon'),
|
||||
label = Bridge.Language.Locale('heroin.targetPickup'),
|
||||
action = function()
|
||||
if not ps.progressbar(ps.lang('heroin.pbPickup'), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('heroin.pbPickup')) then return end
|
||||
herointable = false
|
||||
DeleteObject(heroinlabkit)
|
||||
TriggerServerEvent("md-drugs:server:getheroinlabkitback")
|
||||
@@ -48,15 +46,12 @@ local function createLabKit(coord, head)
|
||||
end
|
||||
},
|
||||
{
|
||||
icon = "fa-solid fa-hand-sparkles",
|
||||
label = ps.lang('heroin.targetClean'),
|
||||
icon = Bridge.Language.Locale('heroin.targetCleanIcon'),
|
||||
label = Bridge.Language.Locale('heroin.targetClean'),
|
||||
action = function()
|
||||
if not ps.hasItem('cleaningkit') then
|
||||
ps.notify(ps.lang('Catches.itemMissings', ps.getLabel('cleaningkit')), 'error')
|
||||
return
|
||||
end
|
||||
if not ps.progressbar(ps.lang('heroin.pbClean'), 4000, 'clean') then return end
|
||||
local done = ps.callback('removeCleaningkit', false)
|
||||
if not itemCheck('cleaningkit') then return end
|
||||
if not progressbar(Bridge.Language.Locale('heroin.pbClean'), 4000, 'clean') then return end
|
||||
local done = Bridge.Callback.Trigger('md-drugs:server:removeCleaningKitHeroin', false)
|
||||
if done then dirty = false end
|
||||
end,
|
||||
canInteract = function()
|
||||
@@ -64,15 +59,16 @@ local function createLabKit(coord, head)
|
||||
return false
|
||||
end
|
||||
}})
|
||||
targets[#targets+1] = heroinlabkit
|
||||
end
|
||||
|
||||
for k, v in pairs (locations.dryplant) do
|
||||
ps.boxTarget('dryHeroin'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
|
||||
Bridge.Target.AddBoxZone('dryHeroin'..k, v.loc, v.size, v.loc.w or 180.0, {
|
||||
{
|
||||
label = ps.lang('heroin.targetDry'),
|
||||
icon = 'fa-solid fa-temperature-high',
|
||||
label = Bridge.Language.Locale('heroin.targetDry'),
|
||||
icon = Bridge.Language.Locale('heroin.dryIcon'),
|
||||
action = function()
|
||||
if not ps.progressbar(ps.lang('heroin.pbDry'), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('heroin.pbDry')) then return end
|
||||
TriggerServerEvent("md-drugs:server:dryplant", k)
|
||||
end,
|
||||
canInteract = function()
|
||||
@@ -80,16 +76,17 @@ for k, v in pairs (locations.dryplant) do
|
||||
end
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = 'dryHeroin'..k
|
||||
end
|
||||
|
||||
for k, v in pairs (locations.cutheroinone) do
|
||||
ps.boxTarget('cutHeroin'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
|
||||
Bridge.Target.AddBoxZone('cutHeroin'..k, v.loc, v.size, v.loc.w or 180.0, {
|
||||
{
|
||||
label = ps.lang('heroin.targetCutHeroin'),
|
||||
icon = 'fa-solid fa-seedling',
|
||||
label = Bridge.Language.Locale('heroin.targetCutHeroin'),
|
||||
icon = Bridge.Language.Locale('heroin.cutIcon'),
|
||||
action = function()
|
||||
if not ps.hasItem('bakingsoda') then return end
|
||||
if not ps.progressbar(ps.lang('heroin.pbCutHeroin'), 4000, 'uncuff') then return end
|
||||
if not itemCheck('bakingsoda') then return end
|
||||
if not progressbar(Bridge.Language.Locale('heroin.pbCutHeroin')) then return end
|
||||
TriggerServerEvent("md-drugs:server:cutheroin", k)
|
||||
end,
|
||||
canInteract = function()
|
||||
@@ -97,20 +94,22 @@ for k, v in pairs (locations.cutheroinone) do
|
||||
end
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = 'cutHeroin'..k
|
||||
end
|
||||
|
||||
local peds = {}
|
||||
for k, v in pairs (locations.buyKit) do
|
||||
ps.requestModel(v.ped, 1000)
|
||||
requestModel(v.ped, 1000)
|
||||
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)
|
||||
SetBlockingOfNonTemporaryEvents(peds[k], true)
|
||||
SetEntityInvincible(peds[k], true)
|
||||
ps.entityTarget(peds[k], {
|
||||
Bridge.Target.AddLocalEntity(peds[k], {
|
||||
{
|
||||
label = ps.lang('heroin.targetBuyKit'),
|
||||
icon = 'fa-solid fa-box-open',
|
||||
label = Bridge.Language.Locale('heroin.targetBuyKit'),
|
||||
icon = Bridge.Language.Locale('heroin.buyIcon'),
|
||||
action = function()
|
||||
if not ps.progressbar(ps.lang('heroin.pbBuyKit'), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('heroin.pbBuyKit')) then return end
|
||||
TriggerServerEvent("md-drugs:server:getheroinlabkit", k)
|
||||
end,
|
||||
canInteract = function()
|
||||
@@ -119,31 +118,32 @@ for k, v in pairs (locations.buyKit) do
|
||||
end
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = peds[k]
|
||||
end
|
||||
|
||||
|
||||
ps.registerCallback("md-drugs:client:setheroinlabkit", function()
|
||||
Bridge.Callback.Register("md-drugs:client:setheroinlabkit", function()
|
||||
if herointable then
|
||||
ps.notify(ps.lang('heroin.tableout'), 'error')
|
||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('heroin.tableout'), 'error')
|
||||
return false
|
||||
else
|
||||
herointable = true
|
||||
local location, head = StartRay()
|
||||
if not location then herointable = false return end
|
||||
if not ps.progressbar(ps.lang('heroin.placing'), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('heroin.placing')) then return end
|
||||
createLabKit(location, head)
|
||||
return true, location
|
||||
end
|
||||
end)
|
||||
|
||||
for k, v in pairs (locations.fillneedle) do
|
||||
ps.boxTarget('fillNeedle'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
|
||||
Bridge.Target.AddBoxZone('fillNeedle'..k, v.loc, v.size, v.loc.w or 180.0, {
|
||||
{
|
||||
label = ps.lang('heroin.targetFill'),
|
||||
icon = 'fa-solid fa-syringe',
|
||||
label = Bridge.Language.Locale('heroin.targetFill'),
|
||||
icon = Bridge.Language.Locale('heroin.fillNeedleIcon'),
|
||||
action = function()
|
||||
if not minigame() then TriggerServerEvent("md-drugs:server:failheroin", k) return end
|
||||
if not ps.progressbar(ps.lang('heroin.pbFill'), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('heroin.pbFill')) then return end
|
||||
TriggerServerEvent("md-drugs:server:fillneedle", k)
|
||||
end,
|
||||
canInteract = function()
|
||||
@@ -151,4 +151,5 @@ for k, v in pairs (locations.fillneedle) do
|
||||
end
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = 'fillNeedle'..k
|
||||
end
|
||||
@@ -1,61 +1,68 @@
|
||||
|
||||
if not Config.Drugs['lean'] then return end
|
||||
local started = false
|
||||
local hit = 0
|
||||
local location = ps.callback('md-drugs:server:GetLeanLocs')
|
||||
local leanCar = nil
|
||||
|
||||
local function SpawnCarPedChase()
|
||||
local location = Config.Lean.Locations
|
||||
|
||||
local function SpawnCarPedChase(loc)
|
||||
local stoploc = vector3(-1157.63, -3056.71, 13.94)
|
||||
local start = location.StartLoc[math.random(1,#location.StartLoc)]
|
||||
|
||||
if started then ps.notify(ps.lang('lean.alreadyChasing'), 'error') return end
|
||||
if started then Bridge.Notify.SendNotify(Bridge.Language.Locale('lean.alreadyChasing'), 'error') return end
|
||||
started = true
|
||||
|
||||
ps.callback('md-drugs:server:RegisterLean')
|
||||
ps.requestModel("pounder", Config.RequestModelTime)
|
||||
ps.requestModel("ig_priest", Config.RequestModelTime)
|
||||
ps.requestModel("cargobob3", Config.RequestModelTime)
|
||||
requestModel("pounder", 30000)
|
||||
requestModel("ig_priest", 30000)
|
||||
requestModel("cargobob3", 30000)
|
||||
|
||||
local leancar = CreateVehicle("pounder", start.x+3, start.y-2, start.z-1, 52.0, true, false)
|
||||
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 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)
|
||||
SetEntityInvincible(pilot2, true)
|
||||
SetEntityAsMissionEntity(leancar)
|
||||
AddBlipForEntity(leancar)
|
||||
SetPedIntoVehicle(driver, leancar, -1)
|
||||
SetEntityAsMissionEntity(leanCar)
|
||||
AddBlipForEntity(leanCar)
|
||||
SetPedIntoVehicle(driver, leanCar, -1)
|
||||
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)
|
||||
|
||||
repeat
|
||||
Wait(1000)
|
||||
until #(GetEntityCoords(driver) - stoploc) < 20.0 or GetEntityHealth(driver) == 0
|
||||
|
||||
RemoveBlip(leancar)
|
||||
RemoveBlip(leanCar)
|
||||
|
||||
if GetEntityHealth(driver) == 0 then
|
||||
ps.entityTarget(leancar, {
|
||||
Bridge.Target.AddLocalEntity(leanCar, {
|
||||
{
|
||||
name = 'leancar',
|
||||
icon = 'fa-solid fa-car',
|
||||
label = ps.lang('lean.stealFromTruck'),
|
||||
icon = Bridge.Language.Locale('lean.carIcon'),
|
||||
label = Bridge.Language.Locale('lean.stealFromTruck'),
|
||||
action = function()
|
||||
hit = hit + 1
|
||||
if not minigame() then return end
|
||||
TriggerServerEvent('md-drugs:server:givelean')
|
||||
started = false
|
||||
if math.random(1,100) <= 30 or hit == 4 then
|
||||
hit = 0
|
||||
DeleteVehicle(leancar)
|
||||
DeleteEntity(driver)
|
||||
DeleteEntity(pilot2)
|
||||
end
|
||||
end
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = leanCar
|
||||
else
|
||||
DeleteVehicle(leancar)
|
||||
DeleteEntity(driver)
|
||||
DeleteEntity(pilot2)
|
||||
end
|
||||
@@ -63,15 +70,15 @@ end
|
||||
|
||||
local leanPeds = {}
|
||||
for k, v in pairs (location.SyrupVendor) do
|
||||
ps.requestModel(v.ped)
|
||||
requestModel(v.ped)
|
||||
leanPeds[k] = CreatePed(0, v.ped, v.loc.x, v.loc.y, v.loc.z, false, false)
|
||||
Freeze(leanPeds[k], true, v.loc.w)
|
||||
ps.entityTarget(leanPeds[k], {
|
||||
Bridge.Target.AddLocalEntity(leanPeds[k], {
|
||||
{
|
||||
icon = "fa-solid fa-hand-holding-medical",
|
||||
label = ps.lang('lean.startMission'),
|
||||
icon = Bridge.Language.Locale('lean.startMissionIcon'),
|
||||
label = Bridge.Language.Locale('lean.startMission'),
|
||||
action = function()
|
||||
SpawnCarPedChase()
|
||||
SpawnCarPedChase(k)
|
||||
end,
|
||||
canInteract = function()
|
||||
if not handleGang(v.gang) then return false end
|
||||
@@ -79,4 +86,45 @@ for k, v in pairs (location.SyrupVendor) do
|
||||
end
|
||||
},
|
||||
})
|
||||
end
|
||||
targets[#targets+1] = leanPeds[k]
|
||||
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,8 +1,10 @@
|
||||
if not Config.Drugs['lsd'] then return end
|
||||
local tableout = false
|
||||
local dirtylsd = false
|
||||
local locations = ps.callback('md-drugs:server:GetLSDLocations')
|
||||
local locations = Config.LSD.Locations
|
||||
|
||||
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)
|
||||
SetEntityHeading(labkit, head)
|
||||
PlaceObjectOnGroundProperly(labkit)
|
||||
@@ -10,18 +12,17 @@ local function createLabKit(coord, head)
|
||||
tableout = true
|
||||
local options = {
|
||||
{
|
||||
icon = "fa-solid fa-temperature-high",
|
||||
label = ps.lang('lsd.targetHeat'),
|
||||
icon = Bridge.Language.Locale('lsd.targetHeatIcon'),
|
||||
label = Bridge.Language.Locale('lsd.targetHeat'),
|
||||
action = function()
|
||||
local dict = "scr_ie_svm_technical2"
|
||||
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
|
||||
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)
|
||||
TriggerServerEvent("md-drugs:server:failheating")
|
||||
return
|
||||
end
|
||||
if not ps.progressbar(ps.lang('lsd.heating'), 7000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('lsd.heating'), 7000) then return end
|
||||
TriggerServerEvent("md-drugs:server:heatliquid")
|
||||
end,
|
||||
canInteract = function()
|
||||
@@ -29,15 +30,12 @@ local function createLabKit(coord, head)
|
||||
end
|
||||
},
|
||||
{
|
||||
icon = "fa-solid fa-temperature-high",
|
||||
label = ps.lang('lsd.targetRefine'),
|
||||
icon = Bridge.Language.Locale('lsd.targetRefineIcon'),
|
||||
label = Bridge.Language.Locale('lsd.targetRefine'),
|
||||
action = function()
|
||||
if not ps.hasItem('lsd_one_vial') then
|
||||
ps.notify(ps.lang('Catches.itemNeeded', ps.getLabel('lsd_one_vial')), 'error')
|
||||
return
|
||||
end
|
||||
if not itemCheck('lsd_one_vial') then return end
|
||||
if not minigame() then TriggerServerEvent("md-drugs:server:failrefinequality") return end
|
||||
if not ps.progressbar(ps.lang('lsd.refining'), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('lsd.refining')) then return end
|
||||
TriggerServerEvent("md-drugs:server:refinequalityacid")
|
||||
end,
|
||||
canInteract = function()
|
||||
@@ -45,15 +43,12 @@ local function createLabKit(coord, head)
|
||||
end
|
||||
},
|
||||
{
|
||||
icon = "fa-regular fa-note-sticky",
|
||||
label = ps.lang('lsd.targetDipping'),
|
||||
icon = Bridge.Language.Locale('lsd.targetDippingIcon'),
|
||||
label = Bridge.Language.Locale('lsd.targetDipping'),
|
||||
action = function()
|
||||
if not ps.hasItem('tab_paper') then
|
||||
ps.notify(ps.lang('Catches.itemNeeded', ps.getLabel('tab_paper')), 'error')
|
||||
return
|
||||
end
|
||||
if not itemCheck('tab_paper') then return end
|
||||
if not minigame() then TriggerServerEvent("md-drugs:server:failtabs") return end
|
||||
if not ps.progressbar(ps.lang('lsd.dipping'), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('lsd.dipping')) then return end
|
||||
TriggerServerEvent("md-drugs:server:maketabpaper")
|
||||
end,
|
||||
canInteract = function()
|
||||
@@ -61,11 +56,10 @@ local function createLabKit(coord, head)
|
||||
end
|
||||
},
|
||||
{
|
||||
event = "md-drugs:client:getlabkitback",
|
||||
icon = "fas fa-box-circle-check",
|
||||
label = ps.lang('lsd.targetPickup'),
|
||||
icon = Bridge.Language.Locale('lsd.targetPickupIcon'),
|
||||
label = Bridge.Language.Locale('lsd.targetPickup'),
|
||||
action = function()
|
||||
if not ps.progressbar(ps.lang('lsd.packup'), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('lsd.packup')) then return end
|
||||
DeleteObject(labkit)
|
||||
TriggerServerEvent('md-drugs:server:getlabkitback')
|
||||
tableout = false
|
||||
@@ -75,15 +69,12 @@ local function createLabKit(coord, head)
|
||||
end
|
||||
},
|
||||
{
|
||||
icon = "fa-solid fa-hand-sparkles",
|
||||
label = ps.lang('lsd.targetClean'),
|
||||
icon = Bridge.Language.Locale('lsd.targetCleanIcon'),
|
||||
label = Bridge.Language.Locale('lsd.targetClean'),
|
||||
action = function()
|
||||
if not ps.hasItem('cleaningkit') then
|
||||
ps.notify(ps.lang('Catches.itemNeeded', ps.getLabel('cleaningkit')), 'error')
|
||||
return
|
||||
end
|
||||
if not ps.progressbar(ps.lang('lsd.cleaning'), 4000, 'clean') then return end
|
||||
local check = ps.callback('md-drugs:server:removecleaningkit')
|
||||
if not itemCheck('cleaningkit') then return end
|
||||
if not progressbar(Bridge.Language.Locale('lsd.cleaning'), 4000, 'clean') then return end
|
||||
local check = Bridge.Callback.Trigger('md-drugs:server:removecleaningkit')
|
||||
if check then
|
||||
dirtylsd = false
|
||||
end
|
||||
@@ -91,17 +82,18 @@ local function createLabKit(coord, head)
|
||||
canInteract = function() if dirtylsd then return true end end
|
||||
}
|
||||
}
|
||||
ps.entityTarget(labkit, options)
|
||||
Bridge.Target.AddLocalEntity(labkit, options)
|
||||
targets[#targets+1] = labkit
|
||||
end
|
||||
|
||||
for k, v in pairs (locations.lysergicacid) do
|
||||
ps.boxTarget('lysergicacid'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
|
||||
Bridge.Target.AddBoxZone('lysergicacid'..k,v.loc, v.size, v.loc.w or 180.0, {
|
||||
{
|
||||
label = ps.lang('lsd.targetLys'),
|
||||
icon = 'fa-solid fa-temperature-high',
|
||||
label = Bridge.Language.Locale('lsd.targetLys'),
|
||||
icon = Bridge.Language.Locale('lsd.targetLysIcon'),
|
||||
action = function()
|
||||
if not minigame() then TriggerServerEvent("md-drugs:server:faillysergic") return end
|
||||
if not ps.progressbar(ps.lang('lsd.stealLys'), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('lsd.stealLys')) then return end
|
||||
TriggerServerEvent("md-drugs:server:getlysergic", k)
|
||||
end,
|
||||
canInteract = function()
|
||||
@@ -110,16 +102,17 @@ for k, v in pairs (locations.lysergicacid) do
|
||||
end
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = 'lysergicacid'..k
|
||||
end
|
||||
|
||||
for k, v in pairs (locations.diethylamide) do
|
||||
ps.boxTarget('diethylamide'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
|
||||
Bridge.Target.AddBoxZone('diethylamide'..k, v.loc, v.size, v.loc.w or 180.0, {
|
||||
{
|
||||
label = ps.lang('lsd.targetDie'),
|
||||
icon = 'fa-solid fa-temperature-high',
|
||||
label = Bridge.Language.Locale('lsd.targetDie'),
|
||||
icon = Bridge.Language.Locale('lsd.targetDieIcon'),
|
||||
action = function()
|
||||
if not minigame() then TriggerServerEvent("md-drugs:server:faildiethylamide") return end
|
||||
if not ps.progressbar(ps.lang('lsd.stealDie'), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('lsd.stealDie')) then return end
|
||||
TriggerServerEvent("md-drugs:server:getdiethylamide", k)
|
||||
end,
|
||||
canInteract = function()
|
||||
@@ -128,13 +121,14 @@ for k, v in pairs (locations.diethylamide) do
|
||||
end
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = 'diethylamide'..k
|
||||
end
|
||||
|
||||
for k, v in pairs (locations.gettabs) do
|
||||
ps.boxTarget('gettabs'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
|
||||
Bridge.Target.AddBoxZone('gettabs'..k, v.loc, v.size, v.loc.w or 180.0, {
|
||||
{
|
||||
label = ps.lang('lsd.targetBuyTab'),
|
||||
icon = 'fa-solid fa-hand-holding-dollar',
|
||||
label = Bridge.Language.Locale('lsd.targetBuyTab'),
|
||||
icon = Bridge.Language.Locale('lsd.targetBuyTabIcon'),
|
||||
action = function()
|
||||
TriggerServerEvent("md-drugs:server:gettabpaper", k)
|
||||
end,
|
||||
@@ -144,22 +138,24 @@ for k, v in pairs (locations.gettabs) do
|
||||
end
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = 'gettabs'..k
|
||||
end
|
||||
|
||||
local seller = {}
|
||||
for k, v in pairs (locations.buyLSDkit) do
|
||||
ps.requestModel(v.ped, 1000)
|
||||
requestModel(v.ped, 1000)
|
||||
seller[k] = CreatePed(4, v.ped, v.loc.x, v.loc.y, v.loc.z, v.loc.w, false, false)
|
||||
Freeze(seller[k], true, v.loc.w)
|
||||
ps.entityTarget(seller[k], {
|
||||
Bridge.Target.AddLocalEntity(seller[k], {
|
||||
{
|
||||
label = ps.lang('lsd.targetBuyKit'),
|
||||
icon = 'fa-solid fa-hand-holding-dollar',
|
||||
label = Bridge.Language.Locale('lsd.targetBuyKit'),
|
||||
icon = Bridge.Language.Locale('lsd.targetBuyKitIcon'),
|
||||
action = function()
|
||||
if ps.hasItem('lsdlabkit') then
|
||||
ps.notify(ps.lang('lsd.alreadyOwn'), 'error')
|
||||
if Bridge.Inventory.HasItem('lsdlabkit') then
|
||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('lsd.alreadyOwn'), 'error')
|
||||
return
|
||||
end
|
||||
if not ps.progressbar(ps.lang('lsd.buyingKit'), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('lsd.buyingKit')) then return end
|
||||
TriggerServerEvent('md-drugs:server:getlabkit', k)
|
||||
end,
|
||||
canInteract = function()
|
||||
@@ -168,17 +164,18 @@ for k, v in pairs (locations.buyLSDkit) do
|
||||
end
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = seller[k]
|
||||
end
|
||||
|
||||
ps.registerCallback("md-drugs:client:setlsdlabkit", function()
|
||||
Bridge.Callback.Register("md-drugs:client:setlsdlabkit", function()
|
||||
if tableout then
|
||||
ps.notify(ps.lang('lsd.tableout'), 'error')
|
||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('lsd.tableout'), 'error')
|
||||
return false
|
||||
else
|
||||
tableout = true
|
||||
local loc, head = StartRay()
|
||||
if not loc then tableout = false return end
|
||||
if not ps.progressbar(ps.lang('lsd.placing'), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('lsd.placing')) then return end
|
||||
createLabKit(loc, head)
|
||||
return true, loc
|
||||
end
|
||||
|
||||
@@ -1,15 +1,27 @@
|
||||
local locations = ps.callback('md-drugs:server:GetMescalineLocs')
|
||||
if not Config.Drugs['mescaline'] then return end
|
||||
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
|
||||
ps.boxTarget('dryoutMesc'..k, v.loc, {length = v.l, width = v.w, height = 1.0, rotation = v.rot}, {
|
||||
Bridge.Target.AddBoxZone('dryoutMesc'..k, v.loc, v.size, v.loc.w or 180.0,{
|
||||
{
|
||||
label = ps.lang('mesc.targetDry'),
|
||||
label = Bridge.Language.Locale('mesc.targetDry'),
|
||||
icon = 'fa-solid fa-temperature-high',
|
||||
action = function()
|
||||
if not ps.hasItem('cactusbulb') then
|
||||
ps.notify(ps.lang('Catches.itemNeeded', ps.getLabel('cactusbulb')), 'error')
|
||||
return
|
||||
end
|
||||
if not ps.progressbar(ps.lang('mescaline.dry'), 4000, 'uncuff') then return end
|
||||
if not itemCheck('cactusbulb') then return end
|
||||
if not progressbar(Bridge.Language.Locale('mesc.dry')) then return end
|
||||
TriggerServerEvent("md-drugs:server:drymescaline", k)
|
||||
end,
|
||||
canInteract = function()
|
||||
@@ -18,16 +30,18 @@ for k, v in pairs (locations.DryOutMescaline) do
|
||||
end
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = 'dryoutMesc'..k
|
||||
end
|
||||
|
||||
RegisterNetEvent("md-drugs:client:takemescaline", function()
|
||||
local chance, chance2 = math.random(1,100), math.random(1,100)
|
||||
local weapon = ''
|
||||
if chance2 == 100 then weapon = 'weapon_rpg' else weapon = 'weapon_flaregun' end
|
||||
if not ps.progressbar(ps.lang('mescaline.eat'), 4000, 'uncuff') then return end
|
||||
if chance <= Config.Badtrip then
|
||||
if not progressbar(Bridge.Language.Locale('mesc.eat')) then return end
|
||||
if chance <= badTrip then
|
||||
AlienEffect()
|
||||
local clone = ClonePed(PlayerPedId(), false, false, true)
|
||||
Wait(math.random(3000,6000))
|
||||
local clone = ClonePed(PlayerPedId(), true, true, true)
|
||||
SetEntityAsMissionEntity(clone)
|
||||
SetPedFleeAttributes(clone, false)
|
||||
GiveWeaponToPed(clone, weapon, 1, false, true)
|
||||
|
||||
@@ -1,36 +1,37 @@
|
||||
local amonia = false
|
||||
local tray = false
|
||||
local heated = false
|
||||
local active = false
|
||||
local trays = nil
|
||||
local locations = ps.callback('md-drugs:server:GetMethLocs')
|
||||
if not Config.Drugs['meth'] then return end
|
||||
local amonia, tray, heated, active, trays, startedmeth, methVan = false, false, false, false, nil, false, nil
|
||||
local locations = Config.Meth.Locations
|
||||
--- meth heist
|
||||
local startedmeth = false
|
||||
|
||||
local function SpawnMethCarPedChase()
|
||||
|
||||
local function SpawnMethCarPedChase(loc)
|
||||
local stoploc = vector3(-1157.63, -3056.71, 13.94)
|
||||
local start = locations.StartLoc[math.random(1,#locations.StartLoc)]
|
||||
if startedmeth then
|
||||
ps.notify(ps.lang('meth.alreadyChasing'),'error')
|
||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('meth.alreadyChasing'),'error')
|
||||
else
|
||||
startedmeth = true
|
||||
ps.callback('md-drugs:server:registerMeth')
|
||||
|
||||
ps.requestModel("journey", Config.RequestModelTime)
|
||||
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)
|
||||
requestModel("journey", 30000)
|
||||
requestModel("a_m_m_hillbilly_02", 30000)
|
||||
requestModel("cargobob3", 30000)
|
||||
methVan = 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 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)
|
||||
SetEntityInvincible(methpilot, true)
|
||||
SetEntityAsMissionEntity(methcar)
|
||||
AddBlipForEntity(methcar)
|
||||
SetPedIntoVehicle(methdriver, methcar, -1)
|
||||
SetEntityAsMissionEntity(methVan)
|
||||
AddBlipForEntity(methVan)
|
||||
SetPedIntoVehicle(methdriver, methVan, -1)
|
||||
SetPedFleeAttributes(methdriver,false)
|
||||
TaskVehicleDriveToCoordLongrange(methdriver, methcar, stoploc.x, stoploc.y, stoploc.z-1, 50.0, 524288, 25.0)
|
||||
TaskVehicleDriveToCoordLongrange(methdriver, methVan, stoploc.x, stoploc.y, stoploc.z-1, 50.0, 524288, 25.0)
|
||||
SetPedKeepTask(methdriver, true)
|
||||
|
||||
repeat
|
||||
@@ -38,25 +39,22 @@ local function SpawnMethCarPedChase()
|
||||
until #(GetEntityCoords(methdriver) - stoploc) < 20.0 or GetEntityHealth(methdriver) == 0
|
||||
|
||||
if GetEntityHealth(methdriver) == 0 then
|
||||
ps.entityTarget(methcar, {
|
||||
Bridge.Target.AddLocalEntity(methVan, {
|
||||
{
|
||||
name = 'methcar',
|
||||
icon = 'fa-solid fa-car',
|
||||
label = ps.lang('meth.targetStealFromCar'),
|
||||
icon = Bridge.Language.Locale('meth.targetStealFromCarIcon'),
|
||||
label = Bridge.Language.Locale('meth.targetStealFromCar'),
|
||||
action = function()
|
||||
if not minigame() then return end
|
||||
TriggerServerEvent('md-drugs:server:givemethingridients')
|
||||
TriggerServerEvent('md-drugs:server:givemethingridients', NetworkGetNetworkIdFromEntity(methVan))
|
||||
startedmeth = false
|
||||
if math.random(1,100) <= 30 then
|
||||
DeleteVehicle(methcar)
|
||||
DeleteEntity(methdriver)
|
||||
DeleteEntity(methpilot)
|
||||
end
|
||||
DeleteEntity(methdriver)
|
||||
DeleteEntity(methpilot)
|
||||
end,
|
||||
}
|
||||
})
|
||||
else
|
||||
DeleteVehicle(methcar)
|
||||
DeleteVehicle(methVan)
|
||||
DeleteEntity(methdriver)
|
||||
DeleteEntity(methpilot)
|
||||
end
|
||||
@@ -67,20 +65,23 @@ local peds = {}
|
||||
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)
|
||||
Freeze(peds[k], true, v.loc.w)
|
||||
ps.entityTarget(peds[k], {
|
||||
Bridge.Target.AddLocalEntity(peds[k], {
|
||||
{
|
||||
name = 'methheist'..k,
|
||||
icon = 'fa-solid fa-user-secret',
|
||||
label = ps.lang('meth.targetHeist'),
|
||||
icon = Bridge.Language.Locale('meth.targetHeistIcon'),
|
||||
label = Bridge.Language.Locale('meth.targetHeist'),
|
||||
action = function()
|
||||
if startedmeth then ps.notify(ps.lang('meth.alreadyChasing'),'error') return end
|
||||
SpawnMethCarPedChase()
|
||||
if startedmeth then
|
||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('meth.alreadyChasing'),'error')
|
||||
return
|
||||
end
|
||||
SpawnMethCarPedChase(k)
|
||||
end,
|
||||
canInteract = function()
|
||||
return handleGang(v.gang)
|
||||
end
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = peds[k]
|
||||
end
|
||||
|
||||
---- start animation shit
|
||||
@@ -94,9 +95,22 @@ local function loadParticle(dict)
|
||||
SetPtfxAssetNextCall(dict)
|
||||
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 animDict, animName = "anim@amb@business@meth@meth_monitoring_cooking@cooking@", "chemical_pour_short_cooker"
|
||||
ps.requestAnim(animDict, 500)
|
||||
Bridge.Anim.RequestDict(animDict)
|
||||
SetEntityCoords(PlayerPedId(), coords)
|
||||
local targetPosition = GetEntityCoords(PlayerPedId())
|
||||
local animDuration = GetAnimDuration(animDict, animName) * 800
|
||||
@@ -113,22 +127,13 @@ local function MethCooking(coords, offset, rotation)
|
||||
NetworkStopSynchronisedScene(netScene)
|
||||
DeleteObject(sacid) DeleteObject(ammonia)
|
||||
FreezeEntityPosition(PlayerPedId(), false)
|
||||
ps.requestModel('hei_prop_heist_thermite', 2000)
|
||||
loadParticle('scr_ornate_heist')
|
||||
local thermite = CreateObject('hei_prop_heist_thermite', vector3(1005.76, -3201.3, -39.25), true, false, false)
|
||||
FreezeEntityPosition(thermite, true)
|
||||
SetEntityRotation(thermite, 190.0, 90.0, 140.0, 3, true )
|
||||
Wait(1000)
|
||||
local therm = StartParticleFxLoopedOnEntity('scr_heist_ornate_thermal_burn', thermite, 0.0, 1.4, 0.0, 0.0, 0.0, 0.0, 1.5, false, false, false)
|
||||
Wait(math.random(10000, 20000))
|
||||
StopParticleFxLooped(therm, true)
|
||||
end
|
||||
|
||||
|
||||
local function SmashMeth(coords, offset, rotation)
|
||||
local ver = ""
|
||||
local animDict, animName = "anim@amb@business@meth@meth_smash_weight_check@", "break_weigh_"..ver.."char02"
|
||||
ps.requestAnim(animDict, 500)
|
||||
Bridge.Anim.RequestDict(animDict, 500)
|
||||
local ped = PlayerPedId()
|
||||
local targetPosition = coords
|
||||
SetEntityCoords(ped, targetPosition)
|
||||
@@ -163,7 +168,7 @@ end
|
||||
local function BagMeth(coords, offset, rotation)
|
||||
local ver = ""
|
||||
local animDict, animName = "anim@amb@business@meth@meth_smash_weight_check@", "break_weigh_"..ver.."char01"
|
||||
ps.requestAnim(animDict, 500)
|
||||
Bridge.Anim.RequestDict(animDict, 500)
|
||||
local animDuration = GetAnimDuration(animDict, animName) * 1000
|
||||
local ped = PlayerPedId()
|
||||
SetEntityCoords(ped, coords)
|
||||
@@ -232,44 +237,44 @@ end
|
||||
|
||||
local function startcook(num, coords, offset, rotation)
|
||||
if not amonia then
|
||||
local adding = ps.callback('md-drugs:server:startcook', num)
|
||||
local adding = Bridge.Callback.Trigger('md-drugs:server:startcook', num)
|
||||
if not adding then return end
|
||||
active = true
|
||||
amonia = true
|
||||
MethCooking(coords, offset, rotation)
|
||||
amonia = true
|
||||
else
|
||||
ps.notify(ps.lang('meth.started'), "error")
|
||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('meth.started'), "error")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local function dials(coords)
|
||||
if amonia == true then
|
||||
if not ps.minigame('ps-circle', {amount = 2, speed = 8}) then
|
||||
if amonia then
|
||||
if not minigame() then
|
||||
AddExplosion(coords.x, coords.y,coords.z, 49, 10, true, false, true)
|
||||
amonia = false
|
||||
active = false
|
||||
return end
|
||||
ps.notify(ps.lang('meth.increaseHeat'), "success")
|
||||
return
|
||||
end
|
||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('meth.increaseHeat'), "success")
|
||||
dialSuccess(coords)
|
||||
heated = true
|
||||
end
|
||||
end
|
||||
|
||||
local function smash(coords, offset, rotation, buckets, k)
|
||||
if tray then
|
||||
tray = false
|
||||
if active and tray and amonia and heated then
|
||||
DeleteObject(trays)
|
||||
tray = false
|
||||
local bucket = CreateObject("bkr_prop_meth_bigbag_03a", buckets.x, buckets.y, buckets.z, true, true, true)
|
||||
Freeze(bucket, true, buckets.w)
|
||||
ps.entityTarget(bucket, {
|
||||
SmashMeth(coords, offset, rotation)
|
||||
Wait(100)
|
||||
Bridge.Target.AddLocalEntity(bucket, {
|
||||
{
|
||||
name = 'bucket',
|
||||
icon = "fa-solid fa-sack-xmark",
|
||||
label = ps.lang('meth.targetBag'),
|
||||
canInteract = function()
|
||||
if active == false then return false end
|
||||
end,
|
||||
icon = Bridge.Language.Locale('meth.targetBagIcon'),
|
||||
label = Bridge.Language.Locale('meth.targetBag'),
|
||||
action = function()
|
||||
DeleteObject(bucket)
|
||||
active = false
|
||||
@@ -279,52 +284,48 @@ local function smash(coords, offset, rotation, buckets, k)
|
||||
BagMeth(locations.BagMeth[k].loc, locations.BagMeth[k].offset, locations.BagMeth[k].rotation)
|
||||
TriggerServerEvent('md-drugs:server:getmeth', k)
|
||||
end,
|
||||
canInteract = function()
|
||||
if not active then return false end
|
||||
return true
|
||||
end,
|
||||
}
|
||||
})
|
||||
SmashMeth(coords, offset, rotation)
|
||||
Wait(100)
|
||||
targets[#targets+1] = bucket
|
||||
end
|
||||
end
|
||||
|
||||
local function trayscarry()
|
||||
if amonia then
|
||||
if amonia and heated then
|
||||
local pos = GetEntityCoords(PlayerPedId(), true)
|
||||
ps.requestAnim('anim@heists@box_carry@')
|
||||
Bridge.Anim.RequestDict('anim@heists@box_carry@')
|
||||
TaskPlayAnim(PlayerPedId(), 'anim@heists@box_carry@', 'idle', 5.0, -1, -1, 50, 0, false, false, false)
|
||||
ps.requestModel('bkr_prop_meth_tray_02a')
|
||||
requestModel('bkr_prop_meth_tray_02a')
|
||||
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)
|
||||
tray = true
|
||||
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
|
||||
ps.boxTarget('cookMeth'..k, v.loc, {length = v.l, width = v.w, rotation = v.rot, height = 1.0},{
|
||||
Bridge.Target.AddBoxZone('cookMeth'..k, v.loc, v.size, v.loc.w or 180.0, {
|
||||
{
|
||||
label = ps.lang('meth.targetCook'),
|
||||
icon = 'fa-solid fa-temperature-high',
|
||||
label = Bridge.Language.Locale('meth.targetCook'),
|
||||
icon = Bridge.Language.Locale('meth.targetCookIcon'),
|
||||
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,
|
||||
canInteract = function()
|
||||
if not handleGang(v.gang) then return false end
|
||||
if not amonia and not active then
|
||||
return true
|
||||
end
|
||||
|
||||
end,
|
||||
},
|
||||
{
|
||||
icon = "fas fa-sign-in-alt",
|
||||
label = ps.lang('meth.targetGrabTray'),
|
||||
icon = Bridge.Language.Locale('meth.targetGrabTrayIcon'),
|
||||
label = Bridge.Language.Locale('meth.targetGrabTray'),
|
||||
action = function() trayscarry() end,
|
||||
canInteract = function()
|
||||
if not handleGang(v.gang) then return false end
|
||||
@@ -334,14 +335,15 @@ for k, v in pairs (locations.CookMeth) do
|
||||
end,
|
||||
},
|
||||
})
|
||||
targets[#targets+1] = 'cookMeth'..k
|
||||
end
|
||||
|
||||
for k, v in pairs (locations.MethDials) do
|
||||
ps.boxTarget('adjustMethDials'..k, v.loc, {length = v.l, width = v.w, rotation = v.rot, height = 1.0},{
|
||||
Bridge.Target.AddBoxZone('adjustMethDials'..k, v.loc, v.size, v.loc.w or 180.0, {
|
||||
{
|
||||
name = 'adjustdials',
|
||||
icon = "fa-solid fa-temperature-three-quarters",
|
||||
label = ps.lang('meth.targetHeat'),
|
||||
icon = Bridge.Language.Locale('meth.targetHeatIcon'),
|
||||
label = Bridge.Language.Locale('meth.targetHeat'),
|
||||
action = function()
|
||||
dials(locations.CookMeth[k].loc)
|
||||
end,
|
||||
@@ -351,14 +353,15 @@ for k, v in pairs (locations.MethDials) do
|
||||
end
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = 'adjustMethDials'..k
|
||||
end
|
||||
|
||||
for k, v in pairs (locations.MethSmash) do
|
||||
ps.boxTarget('smashMeth'..k, v.loc, {length = v.l, width = v.w, rotation = v.rot, height = 1.0},{
|
||||
Bridge.Target.AddBoxZone('smashMeth'..k, v.loc, v.size, v.loc.w or 180.0, {
|
||||
{
|
||||
name = 'smash',
|
||||
icon = "fa-solid fa-weight-scale",
|
||||
label = ps.lang('meth.targetSmash'),
|
||||
icon = Bridge.Language.Locale('meth.targetSmashIcon'),
|
||||
label = Bridge.Language.Locale('meth.targetSmash'),
|
||||
action = function()
|
||||
smash(v.loc, v.offset, v.rotation, v.bucket,k)
|
||||
end,
|
||||
@@ -368,13 +371,14 @@ for k, v in pairs (locations.MethSmash) do
|
||||
end
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = 'smashMeth'..k
|
||||
end
|
||||
|
||||
for k, v in pairs (locations.MethTele) do
|
||||
ps.boxTarget('meth_tele'..k, v.inside, {length = v.l, width = v.w, heading = v.rot}, {
|
||||
Bridge.Target.AddBoxZone('meth_tele'..k, v.inside, v.size, v.rot, {
|
||||
{
|
||||
icon = 'fa-solid fa-door-open',
|
||||
label = ps.lang('coke.teleOut'),
|
||||
icon = Bridge.Language.Locale('meth.teleOutIcon'),
|
||||
label = Bridge.Language.Locale('meth.teleOut'),
|
||||
action = function()
|
||||
SetEntityCoords(PlayerPedId(), v.outside)
|
||||
end,
|
||||
@@ -383,10 +387,10 @@ for k, v in pairs (locations.MethTele) do
|
||||
end
|
||||
}
|
||||
})
|
||||
ps.boxTarget('meth_teleout'..k, v.outside, {length = v.l, width = v.w, heading = v.rot}, {
|
||||
Bridge.Target.AddBoxZone('meth_teleout'..k, v.outside, v.size, v.rot, {
|
||||
{
|
||||
icon = 'fa-solid fa-door-closed',
|
||||
label = ps.lang('coke.teleIn'),
|
||||
icon = Bridge.Language.Locale('meth.teleInIcon'),
|
||||
label = Bridge.Language.Locale('meth.teleIn'),
|
||||
action = function()
|
||||
SetEntityCoords(PlayerPedId(), v.inside)
|
||||
end,
|
||||
@@ -395,6 +399,8 @@ for k, v in pairs (locations.MethTele) do
|
||||
end
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = 'meth_tele'..k
|
||||
targets[#targets+1] = 'meth_teleout'..k
|
||||
end
|
||||
|
||||
RegisterCommand('offset', function()
|
||||
@@ -405,12 +411,12 @@ RegisterCommand('offset', function()
|
||||
end)
|
||||
|
||||
for k, v in pairs (locations.MethEph) do
|
||||
ps.boxTarget('stealMethEph'..k, v.loc, {length = v.l, width = v.w, rotation = v.rot, height = 1.0},{
|
||||
Bridge.Target.AddBoxZone('stealMethEph'..k, v.loc, v.size, v.loc.w or 180.0, {
|
||||
{
|
||||
label = ps.lang('meth.targetStealEPH'),
|
||||
icon = 'fa-solid fa-bucket',
|
||||
label = Bridge.Language.Locale('meth.targetStealEPH'),
|
||||
icon = Bridge.Language.Locale('meth.targetStealEPHIcon'),
|
||||
action = function()
|
||||
if not ps.progressbar(ps.lang('meth.stealingEPH'), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('meth.stealingEPH')) then return end
|
||||
TriggerServerEvent("md-drugs:server:geteph", k)
|
||||
end,
|
||||
canInteract = function()
|
||||
@@ -418,14 +424,15 @@ for k, v in pairs (locations.MethEph) do
|
||||
end
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = 'stealMethEph'..k
|
||||
end
|
||||
for k, v in pairs (locations.MethAce) do
|
||||
ps.boxTarget('stealMethAce'..k, v.loc, {length = v.l, width = v.w, rotation = v.rot, height = 1.0},{
|
||||
Bridge.Target.AddBoxZone('stealMethAce'..k, v.loc, v.size, v.loc.w or 180.0, {
|
||||
{
|
||||
label = ps.lang('meth.targetStealACE'),
|
||||
icon = 'fa-solid fa-bucket',
|
||||
label = Bridge.Language.Locale('meth.targetStealACE'),
|
||||
icon = Bridge.Language.Locale('meth.targetStealACEIcon'),
|
||||
action = function()
|
||||
if not ps.progressbar(ps.lang('meth.stealingACE'), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('meth.stealingACE')) then return end
|
||||
TriggerServerEvent("md-drugs:server:getace", k)
|
||||
end,
|
||||
canInteract = function()
|
||||
@@ -433,6 +440,13 @@ for k, v in pairs (locations.MethAce) do
|
||||
end
|
||||
}
|
||||
})
|
||||
|
||||
targets[#targets+1] = 'stealMethAce'..k
|
||||
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)
|
||||
@@ -1,17 +1,20 @@
|
||||
if not Config.Drugs['oxyruns'] then return end
|
||||
local carryPackage = nil
|
||||
local onMission = false
|
||||
local locations = ps.callback('md-drugs:server:GetOxyLocs')
|
||||
local locations = Config.Oxy.Locations
|
||||
local pdAlert = 90
|
||||
local vehicle = nil
|
||||
|
||||
local function getRoute()
|
||||
local Route = ps.callback('md-drugs:server:getRoute')
|
||||
local Route = Bridge.Callback.Trigger('md-drugs:server:getRoute')
|
||||
if not Route then
|
||||
ps.notify(ps.lang('oxy.ditchCar'), "error")
|
||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('oxy.ditchCar'), "error")
|
||||
onMission = false
|
||||
return false
|
||||
end
|
||||
|
||||
local Route = locations.oxylocations[Route]
|
||||
SetNewWaypoint(Route.x, Route.y)
|
||||
ps.requestModel('g_m_y_famdnf_01', Config.RequestModelTime)
|
||||
requestModel('g_m_y_famdnf_01', 30000)
|
||||
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)
|
||||
local timeOut = 300
|
||||
@@ -21,14 +24,14 @@ local function getRoute()
|
||||
timeOut = timeOut - 1
|
||||
until #(GetEntityCoords(PlayerPedId()) - vector3(Route.x,Route.y,Route.z)) < 5.0 or timeOut == 0
|
||||
|
||||
PoliceCall(Config.PoliceAlertOxy)
|
||||
ps.entityTarget(oxybuyer,{
|
||||
PoliceCall(pdAlert)
|
||||
Bridge.Target.AddLocalEntity(oxybuyer,{
|
||||
{
|
||||
label = ps.lang('oxy.targetHandoff'),
|
||||
icon = "fa-solid fa-dollar-sign",
|
||||
label = Bridge.Language.Locale('oxy.targetHandoff'),
|
||||
icon = Bridge.Language.Locale('oxy.targetHandOffIcon'),
|
||||
action = function()
|
||||
if carryPackage then
|
||||
if not ps.progressbar(ps.lang('oxy.handingoff'), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('oxy.handingoff')) then return end
|
||||
TriggerServerEvent("md-drugs:server:giveoxybox")
|
||||
DeleteEntity(oxybuyer)
|
||||
DetachEntity(carryPackage, true, true)
|
||||
@@ -36,47 +39,44 @@ local function getRoute()
|
||||
carryPackage = nil
|
||||
getRoute()
|
||||
else
|
||||
ps.notify(ps.lang('oxy.emptyHands'), "error")
|
||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('oxy.emptyHands'), "error")
|
||||
end
|
||||
end
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = oxybuyer
|
||||
end
|
||||
|
||||
for k, v in pairs(locations.OxyPayForTruck) do
|
||||
ps.boxTarget('oxyTruckPur' ..k , v.loc, {length = v.l, width = v.w, heading = v.rot}, {
|
||||
Bridge.Target.AddBoxZone('oxyTruckPur' ..k , v.loc, v.size, v.loc.w or 180.0, {
|
||||
{
|
||||
icon = 'fa-solid fa-truck-fast',
|
||||
label = ps.lang('oxy.targetPay'),
|
||||
icon = Bridge.Language.Locale('oxy.targetPayIcon'),
|
||||
label = Bridge.Language.Locale('oxy.targetPay'),
|
||||
action = function()
|
||||
ps.requestModel("burrito3", Config.RequestModelTime)
|
||||
requestModel("burrito3", 30000)
|
||||
|
||||
local paid = ps.callback('md-drugs:server:payfortruck', false)
|
||||
local paid = Bridge.Callback.Trigger('md-drugs:server:payfortruck', k)
|
||||
if not paid then return end
|
||||
local oxycar = CreateVehicle("burrito3",v.truckSpawn.x, v.truckSpawn.y, v.truckSpawn.z, v.truckSpawn.w, true, false)
|
||||
|
||||
if Config.Fuel == "ox_fuel" then
|
||||
Entity(oxycar).state.fuel = 100.0
|
||||
else
|
||||
exports[Config.Fuel]:SetFuel(oxycar, 100.0)
|
||||
end
|
||||
TriggerEvent("vehiclekeys:client:SetOwner", GetVehicleNumberPlateText(oxycar))
|
||||
ps.notify(ps.lang('oxy.keys'), 'success')
|
||||
vehicle = CreateVehicle("burrito3",v.truckSpawn.x, v.truckSpawn.y, v.truckSpawn.z, v.truckSpawn.w, true, false)
|
||||
SetVehicleFuelLevel(vehicle, 100.0)
|
||||
local plate = GetVehicleNumberPlateText(vehicle)
|
||||
Bridge.VehicleKey.GiveKeys(vehicle, plate)
|
||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('oxy.keys'), 'success')
|
||||
onMission = true
|
||||
getRoute()
|
||||
|
||||
ps.entityTarget(oxycar, {
|
||||
TriggerServerEvent('md-drugs:server:startOxyRun', NetworkGetNetworkIdFromEntity(vehicle))
|
||||
|
||||
Bridge.Target.AddLocalEntity(vehicle, {
|
||||
{
|
||||
icon = "fa-solid fa-box",
|
||||
label = ps.lang('oxy.targetGetPackage'),
|
||||
icon = Bridge.Language.Locale('oxy.targetGetPackageIcon'),
|
||||
label = Bridge.Language.Locale('oxy.targetGetPackage'),
|
||||
action = function()
|
||||
if carryPackage then
|
||||
ps.notify(ps.lang('oxy.alreadyCarrying'), "error")
|
||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('oxy.alreadyCarrying'), "error")
|
||||
else
|
||||
local pos = GetEntityCoords(PlayerPedId(), true)
|
||||
ps.requestAnim('anim@heists@box_carry@')
|
||||
Bridge.Anim.RequestDict('anim@heists@box_carry@')
|
||||
TaskPlayAnim(PlayerPedId(), 'anim@heists@box_carry@', 'idle', 5.0, -1, -1, 50, 0, false, false, false)
|
||||
ps.requestModel("hei_prop_drug_statue_box_big")
|
||||
requestModel("hei_prop_drug_statue_box_big")
|
||||
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)
|
||||
end
|
||||
@@ -86,6 +86,8 @@ for k, v in pairs(locations.OxyPayForTruck) do
|
||||
end
|
||||
}
|
||||
})
|
||||
Wait(1000)
|
||||
getRoute()
|
||||
end,
|
||||
canInteract = function()
|
||||
if onMission then
|
||||
@@ -95,5 +97,5 @@ for k, v in pairs(locations.OxyPayForTruck) do
|
||||
end
|
||||
}
|
||||
})
|
||||
|
||||
targets[#targets+1] = 'oxyTruckPur' ..k
|
||||
end
|
||||
@@ -1,29 +1,45 @@
|
||||
local locations = ps.callback('md-drugs:server:GetPharmaLocs')
|
||||
|
||||
ps.registerCallback("md-drugs:client:prescriptionpad", function(data, op)
|
||||
if ps.getJobType() ~= 'ems' then return end
|
||||
local input = ps.input(ps.lang('pharma.input.header'), {
|
||||
{type = 'select', title = ps.lang('pharma.input.title1'), options = data},
|
||||
{type = 'select', title = ps.lang('pharma.input.title2'), options = op}
|
||||
if not Config.Drugs['pharma'] then return end
|
||||
local locations = Config.Pharma.Locations
|
||||
|
||||
Bridge.Callback.Register("md-drugs:client:prescriptionpad", function( data, op)
|
||||
local job = Bridge.Framework.GetPlayerJob()
|
||||
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 ps.progressbar(ps.lang('pharma.write'), 4000, 'notepad') then return end
|
||||
if not progressbar(Bridge.Language.Locale('pharma.write'), 4000, {
|
||||
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]}
|
||||
end)
|
||||
|
||||
ps.registerCallback("md-drugs:client:unbottle", function()
|
||||
if not ps.progressbar(ps.lang('pharma.opening'), 4000, 'uncuff') then return end
|
||||
Bridge.Callback.Register("md-drugs:client:unbottle", function()
|
||||
if not progressbar(Bridge.Language.Locale('pharma.opening')) then return end
|
||||
return true
|
||||
end)
|
||||
|
||||
|
||||
for k, v in pairs (locations.FillPrescription) do
|
||||
ps.boxTarget('pharma' ..k , v.loc, {length = v.l, width = v.w, heading = v.rot}, {
|
||||
Bridge.Target.AddBoxZone('pharma' ..k , v.loc,v.size, v.loc.w or 180, {
|
||||
{
|
||||
icon = 'fa-solid fa-capsules',
|
||||
label = ps.lang('pharma.targetFill'),
|
||||
icon = Bridge.Language.Locale('pharma.fillIcon'),
|
||||
label = Bridge.Language.Locale('pharma.targetFill'),
|
||||
action = function()
|
||||
if not ps.progressbar(ps.lang('pharma.fill'), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('pharma.fill')) then return end
|
||||
TriggerServerEvent("md-drugs:server:fillprescription", k)
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -1,45 +1,50 @@
|
||||
|
||||
local DrugPlants = {
|
||||
{model = 'prop_plant_01a', label = 'coke', langs = ps.lang('coke.targetPick'), tbl = GlobalState.CocaPlant, plantTbl = {},
|
||||
{model = 'prop_plant_01a', label = 'coke', langs = Bridge.Language.Locale('coke.targetPick'), tbl = GlobalState.CocaPlant, plantTbl = {},
|
||||
pick = function(loc)
|
||||
if not ps.progressbar(ps.lang('coke.picking'), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('coke.picking')) then return end
|
||||
TriggerServerEvent("coke:pickupCane", loc)
|
||||
return true
|
||||
end,
|
||||
allow = Config.Drugs.cocaine,
|
||||
icon = Bridge.Language.Locale('coke.pickIcon'),
|
||||
},
|
||||
{model = 'prop_plant_01b', label = 'heroin',langs = ps.lang('heroin.targetPick'), tbl = GlobalState.PoppyPlants, plantTbl = {},
|
||||
{model = 'prop_plant_01b', label = 'heroin',langs = Bridge.Language.Locale('heroin.targetPick'), tbl = GlobalState.PoppyPlants, plantTbl = {},
|
||||
pick = function(loc)
|
||||
if not ps.progressbar(ps.lang('heroin.picking'), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('heroin.picking')) then return end
|
||||
TriggerServerEvent("heroin:pickupCane", loc)
|
||||
return true
|
||||
end,
|
||||
allow = Config.Drugs.heroin,
|
||||
icon = Bridge.Language.Locale('heroin.pickIcon'),
|
||||
},
|
||||
{model = 'prop_cactus_03', label = 'Mescaline', langs = ps.lang('mesc.targetPick'), tbl = GlobalState.Mescaline, plantTbl = {},
|
||||
{model = 'prop_cactus_03', label = 'Mescaline', langs = Bridge.Language.Locale('mesc.targetPick'), tbl = GlobalState.Mescaline, plantTbl = {},
|
||||
pick = function(loc)
|
||||
if not ps.progressbar(ps.lang('mesc.picking'), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('mesc.picking')) then return end
|
||||
TriggerServerEvent("Mescaline:pickupCane", loc)
|
||||
return true
|
||||
end,
|
||||
allow = Config.Drugs.mescaline,
|
||||
icon = Bridge.Language.Locale('mesc.pickIcon'),
|
||||
|
||||
},
|
||||
{model = 'prop_weed_01', label = 'weed', langs = ps.lang('weed.targetPick'), tbl = GlobalState.WeedPlant, plantTbl = {},
|
||||
{model = 'prop_weed_01', label = 'weed', langs = Bridge.Language.Locale('weed.targetPick'), tbl = GlobalState.WeedPlant, plantTbl = {},
|
||||
pick = function(loc)
|
||||
if not ps.progressbar(ps.lang('weed.picking'), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('weed.picking')) then return end
|
||||
TriggerServerEvent("weed:pickupCane", loc)
|
||||
return true
|
||||
end,
|
||||
allow = Config.Drugs.weed,
|
||||
icon = Bridge.Language.Locale('weed.pickIcon'),
|
||||
},
|
||||
{model = 'mushroom', label = 'shrooms', langs = ps.lang('shrooms.targetPick'), tbl = GlobalState.shrooms, plantTbl = {},
|
||||
{model = 'mushroom', label = 'shrooms', langs = Bridge.Language.Locale('shrooms.targetPick'), tbl = GlobalState.shrooms, plantTbl = {},
|
||||
pick = function(loc)
|
||||
if not ps.progressbar(ps.lang('shrooms.picking'), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('shrooms.picking')) then return end
|
||||
TriggerServerEvent("shrooms:pickupCane", loc)
|
||||
return true
|
||||
end,
|
||||
allow = Config.Drugs.shrooms,
|
||||
icon = Bridge.Language.Locale('shrooms.pickIcon'),
|
||||
},
|
||||
}
|
||||
|
||||
@@ -49,10 +54,10 @@ for k, v in pairs (DrugPlants) do
|
||||
local plant = v.tbl[loc]
|
||||
local hash = GetHashKey(plant.model)
|
||||
if not v.plantTbl[loc] then
|
||||
ps.requestModel(hash)
|
||||
requestModel(hash)
|
||||
v.plantTbl[loc] = CreateObject(hash, plant.location, false, true, true)
|
||||
Freeze(v.plantTbl[loc], true, plant.heading)
|
||||
ps.entityTarget(v.plantTbl[loc], {
|
||||
Bridge.Target.AddLocalEntity(v.plantTbl[loc], {
|
||||
{
|
||||
icon = v.icon,
|
||||
label = v.langs,
|
||||
@@ -61,6 +66,7 @@ for k, v in pairs (DrugPlants) do
|
||||
end
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = v.plantTbl[loc]
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -76,7 +82,7 @@ for k, v in pairs (DrugPlants) do
|
||||
if not value.taken then
|
||||
v.plantTbl[key] = CreateObject(hash, value.location.x, value.location.y, value.location.z, false, true, true)
|
||||
Freeze(v.plantTbl[key], true, v.heading)
|
||||
ps.entityTarget(v.plantTbl[key], {
|
||||
Bridge.Target.AddLocalEntity(v.plantTbl[key], {
|
||||
{
|
||||
icon = v.icon,
|
||||
label = v.langs,
|
||||
@@ -85,22 +91,10 @@ for k, v in pairs (DrugPlants) do
|
||||
end
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = v.plantTbl[key]
|
||||
end
|
||||
end
|
||||
end)
|
||||
TriggerEvent(v.label ..":init")
|
||||
::continue::
|
||||
|
||||
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)
|
||||
end
|
||||
@@ -1,6 +1,29 @@
|
||||
if not Config.Drugs['shrooms'] then return end
|
||||
|
||||
ps.registerCallback("md-drugs:client:shrooms", function()
|
||||
if not ps.progressbar(ps.lang('shrooms.eat'), 5000, 'eat') then return 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
|
||||
|
||||
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()
|
||||
EcstasyEffect()
|
||||
end)
|
||||
|
||||
@@ -1,56 +1,63 @@
|
||||
if not Config.Drugs['weed'] then return end
|
||||
local exploded, drying = false, false
|
||||
local locations = ps.callback('md-drugs:server:GetWeedLocs')
|
||||
local locations, recipes = Config.Weed.Locations, Config.Weed.Recipes
|
||||
for k, v in pairs (locations.WeedDry) do
|
||||
ps.boxTarget('weed_dry'..k, v.loc, {length = v.l, width = v.w, heading = v.rot}, {
|
||||
Bridge.Target.AddBoxZone('weed_dry'..k, v.loc, v.size, v.loc.w or 180.0, {
|
||||
{
|
||||
icon = 'fa-solid fa-cannabis',
|
||||
label = ps.lang('weed.targetDry'),
|
||||
icon = Bridge.Language.Locale('weed.targetDryIcon'),
|
||||
label = Bridge.Language.Locale('weed.targetDry'),
|
||||
action = function()
|
||||
if not ps.hasItem('wetcannabis', 1) then
|
||||
ps.notify(ps.lang('weed.nodry'), "error")
|
||||
return
|
||||
end
|
||||
if not itemCheck("wetcannabis") then return end
|
||||
if drying then return end
|
||||
local loc = GetEntityCoords(PlayerPedId())
|
||||
local weedplant = CreateObject("bkr_prop_weed_drying_01a", loc.x, loc.y+.2, loc.z, true, false)
|
||||
drying = true
|
||||
FreezeEntityPosition(weedplant, true)
|
||||
ps.notify(ps.lang('weed.wait'), "success")
|
||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('weed.wait'), "success")
|
||||
Wait(math.random(1000,5000))
|
||||
ps.notify(ps.lang('weed.take'), "success")
|
||||
ps.entityTarget(weedplant, {
|
||||
icon = "fa-solid fa-cannabis",
|
||||
label = ps.lang('weed.targetDryed'),
|
||||
action = function()
|
||||
DeleteEntity(weedplant)
|
||||
drying = false
|
||||
TriggerServerEvent('md-drugs:server:dryoutweed')
|
||||
end,
|
||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('weed.take'), "success")
|
||||
Bridge.Target.AddLocalEntity(weedplant, {
|
||||
{
|
||||
icon = Bridge.Language.Locale('weed.targetDryIcon'),
|
||||
label = Bridge.Language.Locale('weed.targetDryed'),
|
||||
action = function()
|
||||
DeleteEntity(weedplant)
|
||||
drying = false
|
||||
TriggerServerEvent('md-drugs:server:dryoutweed', k)
|
||||
end,
|
||||
}
|
||||
})
|
||||
end,
|
||||
canInteract = function()
|
||||
if drying then return false end
|
||||
return true
|
||||
end
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = 'weed_dry'..k
|
||||
end
|
||||
|
||||
for k, v in pairs (locations.WeedTele) do
|
||||
ps.boxTarget('weed_tele'..k, v.inside, {length = v.l, width = v.w, heading = v.rot}, {
|
||||
Bridge.Target.AddBoxZone('weed_tele'..k, v.inside, v.size, v.rot or 180.0, {
|
||||
{
|
||||
icon = 'fa-solid fa-door-open',
|
||||
label = ps.lang('weed.teleportOut'),
|
||||
icon = Bridge.Language.Locale('weed.teleportOutIcon'),
|
||||
label = Bridge.Language.Locale('weed.teleportOut'),
|
||||
action = function()
|
||||
SetEntityCoords(PlayerPedId(), v.outside)
|
||||
end
|
||||
}
|
||||
})
|
||||
ps.boxTarget('weed_teleout'..k, v.outside, {length = v.l, width = v.w, heading = v.rot}, {
|
||||
targets[#targets+1] = 'weed_tele'..k
|
||||
Bridge.Target.AddBoxZone('weed_teleout'..k, v.outside, v.size, v.rot or 180.0, {
|
||||
{
|
||||
icon = 'fa-solid fa-door-closed',
|
||||
label = ps.lang('weed.teleportIn'),
|
||||
icon = Bridge.Language.Locale('weed.teleportInIcon'),
|
||||
label = Bridge.Language.Locale('weed.teleportIn'),
|
||||
action = function()
|
||||
SetEntityCoords(PlayerPedId(), v.inside)
|
||||
end
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = 'weed_teleout'..k
|
||||
end
|
||||
|
||||
CreateThread(function()
|
||||
@@ -65,73 +72,168 @@ CreateThread(function()
|
||||
RefreshInterior(BikerWeedFarm.interiorId)
|
||||
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()
|
||||
if not ps.progressbar(ps.lang('weed.dabs'), 4000, 'bong2') then AlienEffect() return end
|
||||
AlienEffect()
|
||||
if not progressbar(Bridge.Language.Locale('weed.dabs'), 4000, 'bong2') then AlienEffect() return end
|
||||
end)
|
||||
|
||||
local function createBluntOptions(contextId, contextTitle, eventLabelPrefix, tableName)
|
||||
local options = {}
|
||||
local items = ps.callback('md-drugs:server:GetWeedRecipe', 'weed', tableName)
|
||||
for k, v in pairs(items) do
|
||||
|
||||
for k, v in pairs(recipes[tableName]) do
|
||||
local label = {}
|
||||
local item = ''
|
||||
for m, d in pairs(v.take) do table.insert(label, ps.getLabel(m) .. ' X ' .. d) end
|
||||
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.give) do item = m end
|
||||
local itemData = Bridge.Inventory.GetItemInfo(item)
|
||||
options[#options + 1] = {
|
||||
icon = ps.getImage(item),
|
||||
description = table.concat(label, ", "),
|
||||
title = ps.getLabel(item),
|
||||
action = function()
|
||||
icon = itemData.image,
|
||||
description = table.concat(label, " "),
|
||||
title = itemData.label,
|
||||
onSelect = function()
|
||||
if not minigame() then return end
|
||||
if not ps.progressbar(eventLabelPrefix .. ps.getLabel(item), 4000, 'uncuff') then return end
|
||||
TriggerServerEvent('md-drugs:server:MakeWeedItems', {item = item, recipe = 'weed', num = k, table = tableName})
|
||||
if not progressbar( Bridge.Language.Locale(eventLabelPrefix, itemData.label)) then return end
|
||||
TriggerServerEvent('md-drugs:server:RollBlunt', tableName, item)
|
||||
end
|
||||
}
|
||||
end
|
||||
sorter(options, 'title')
|
||||
ps.menu(contextTitle, contextTitle, options)
|
||||
Bridge.Menu.Open({
|
||||
id = contextId,
|
||||
title = contextTitle,
|
||||
options = options,
|
||||
})
|
||||
end
|
||||
|
||||
RegisterNetEvent('md-drugs:client:makeBluntWrap', function(data)
|
||||
createBluntOptions('mddrugsbluntwraps', "Dipping Syrup", ps.lang('weed.bluntWrap'), 'bluntwrap')
|
||||
createBluntOptions('mddrugsbluntwraps', "Dipping Syrup", 'weed.bluntWrap', 'bluntwrap')
|
||||
end)
|
||||
|
||||
RegisterNetEvent('md-drugs:client:rollBlunt', function(data)
|
||||
createBluntOptions('mddrugsblunts', "Roll Blunts", ps.lang('weed.blunts'), 'blunts')
|
||||
createBluntOptions('mddrugsblunts', "Roll Blunts", 'weed.rolling', 'blunts')
|
||||
end)
|
||||
|
||||
for k, v in pairs (locations.WeedSalesman) do
|
||||
ps.requestModel(v.ped)
|
||||
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)
|
||||
FreezeEntityPosition(ped, true)
|
||||
SetEntityInvincible(ped, true)
|
||||
SetBlockingOfNonTemporaryEvents(ped, true)
|
||||
ps.entityTarget(ped, {
|
||||
Bridge.Target.AddLocalEntity(ped, {
|
||||
{
|
||||
icon = "fa-solid fa-cannabis",
|
||||
label = ps.lang('weed.targetSales'),
|
||||
icon = Bridge.Language.Locale('weed.salesIcon'),
|
||||
label = Bridge.Language.Locale('weed.targetSales'),
|
||||
action = function()
|
||||
local itemList = ps.callback('md-drugs:server:getWeedItems')
|
||||
local options = {}
|
||||
for m, d in pairs (itemList) do
|
||||
for m, d in pairs (recipes.weedStore) do
|
||||
local itemInfo = Bridge.Inventory.GetItemInfo(m)
|
||||
options[#options + 1] = {
|
||||
icon = ps.getImage(m),
|
||||
title = ps.getLabel(m),
|
||||
icon = itemInfo.image,
|
||||
title = itemInfo.label,
|
||||
description = '$' .. d,
|
||||
action = function()
|
||||
local input = ps.input('Amount To Buy',{
|
||||
{type = 'number', title = 'How Many To Buy', min = 1, max = 1000}
|
||||
onSelect = function()
|
||||
local input = Bridge.Input.Open(Bridge.Language.Locale('weed.salesHeader'),{
|
||||
{type = 'number', title = Bridge.Language.Locale('weed.salesDesc'), min = 1, max = 1000}
|
||||
})
|
||||
if not input and input[1] then return end
|
||||
if not ps.progressbar(ps.lang('weed.buying', ps.getLabel(m)), 2000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('weed.buying', Bridge.Inventory.GetItemInfo(m).label)) then return end
|
||||
TriggerServerEvent('md-drugs:server:buyWeedItem', k, m, input[1])
|
||||
end
|
||||
}
|
||||
end
|
||||
ps.menu('Weed Shop', 'Weed Shop', options)
|
||||
Bridge.Menu.Open({
|
||||
id = 'weedDude',
|
||||
title = Bridge.Language.Locale('weed.salessHeader'),
|
||||
options = options,
|
||||
})
|
||||
end
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = ped
|
||||
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
|
||||
@@ -0,0 +1,84 @@
|
||||
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,67 +1,95 @@
|
||||
local miss = false
|
||||
local function SetUpPeds()
|
||||
AddRelationshipGroup('setups')
|
||||
local ped = GetEntityCoords(PlayerPedId())
|
||||
local peds = {
|
||||
{x = ped.x+3, y = ped.y-5, z = ped.z-1, },
|
||||
{x = ped.x+6, y = ped.y-10, z = ped.z-1,},
|
||||
{x = ped.x+-2,y = ped.y+5, z = ped.z-1,},
|
||||
{x = ped.x+8, y = ped.y-12, z = ped.z-1,},
|
||||
{x = ped.x+5, y = ped.y-2, z = ped.z-1, },
|
||||
{x = ped.x+2, y = ped.y-20, z = ped.z-1,},
|
||||
{x = ped.x+1, y = ped.y-10, z = ped.z-1,},
|
||||
}
|
||||
for i = 1, #peds do
|
||||
local k = peds[i]
|
||||
i = CreatePed(0, "g_m_y_famdnf_01", k.x, k.y, k.z, 90.0, true, true)
|
||||
SetPedRelationshipGroupHash(i, 'setups')
|
||||
GiveWeaponToPed(i, "weapon_pistol", 1, false, true)
|
||||
TaskCombatPed(i, PlayerPedId(), 0, 16)
|
||||
SetPedCombatAttributes(i, 46, true)
|
||||
end
|
||||
end
|
||||
RegisterNetEvent("md-drugs:client:GetLocation", function(drug)
|
||||
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()
|
||||
if not Config.Drugs['wholesale'] then return end
|
||||
local active, ped, peds = false, nil, {}
|
||||
|
||||
local function loop(wholesaleData)
|
||||
local timeout = 600 -- 10 minutes
|
||||
while active do
|
||||
Wait(1000)
|
||||
local dist = #(GetEntityCoords(PlayerPedId()) - vector3(wholesaleData.location.x, wholesaleData.location.y, wholesaleData.location.z))
|
||||
if dist < 100.0 then
|
||||
if IsEntityDead(PlayerPedId()) then
|
||||
active = false
|
||||
Bridge.Point.Remove('md-drugs:wholesaleZone'..Bridge.Framework.GetPlayerIdentifier())
|
||||
TriggerServerEvent('md-drugs:server:getkilledFuckingNoob')
|
||||
for k, v in pairs (peds) do
|
||||
DeleteEntity(v)
|
||||
end
|
||||
Wait(3000)
|
||||
DeleteEntity(drugdealer)
|
||||
miss = false
|
||||
peds = {}
|
||||
break
|
||||
end
|
||||
}},drugdealer )
|
||||
repeat
|
||||
Wait(1000)
|
||||
timer = timer + 1
|
||||
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
|
||||
timeout = timeout - 1
|
||||
if timeout <= 0 then
|
||||
break
|
||||
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)
|
||||
|
||||
|
||||
RegisterNetEvent('md-drugs:client:MarkLocation', function(data)
|
||||
SetNewWaypoint(data.x, data.y)
|
||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('wholesale.go_location'), 'success')
|
||||
end)
|
||||
@@ -1,55 +1,67 @@
|
||||
if not Config.Drugs['xtc'] then return end
|
||||
local xtcpress = false
|
||||
local locations = ps.callback('md-drugs:server:GetXtcLocs')
|
||||
local locations = Config.XTC.Locations
|
||||
|
||||
local function getRecipeList(tbl)
|
||||
local rec = {}
|
||||
for m, d in pairs(tbl) do table.insert(rec, ps.getLabel(m) .. ' X ' .. d) end
|
||||
return table.concat(rec, ', ')
|
||||
local function getRecipeList(tbl, type)
|
||||
local rec
|
||||
if type == 'presses' then
|
||||
rec = {'XTC FROM THE PREVIOUS TIER REQUIRED TO UPGRADE \n '}
|
||||
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
|
||||
|
||||
ps.registerCallback('md-drugs:client:setpress', function(xtcData)
|
||||
Bridge.Callback.Register('md-drugs:client:setpress', function(xtcData)
|
||||
if xtcpress then
|
||||
ps.notify(ps.lang('xtc.alreadyOut'), 'error')
|
||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('xtc.alreadyOut'), 'error')
|
||||
return
|
||||
end
|
||||
local coords, head = StartRay2()
|
||||
xtcpress = true
|
||||
if not ps.progressbar(ps.lang('xtc.settingDown'), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('xtc.settingDown')) then return end
|
||||
local press = CreateObject("bkr_prop_coke_press_01aa", coords.x, coords.y, coords.z, true, false, false)
|
||||
PlaceObjectOnGroundProperly(press)
|
||||
Freeze(press, true, head)
|
||||
local options = {
|
||||
{
|
||||
icon = "fas fa-eye",
|
||||
label = ps.lang('xtc.targetMake'),
|
||||
icon = Bridge.Language.Locale('xtc.pressIcon'),
|
||||
label = Bridge.Language.Locale('xtc.targetMake'),
|
||||
distance = 2.0,
|
||||
action = function()
|
||||
local options = {}
|
||||
for k, v in pairs(xtcData.recipes) do
|
||||
local descript = getRecipeList(v.take)
|
||||
local itemInfo = Bridge.Inventory.GetItemInfo(k)
|
||||
options[#options + 1] = {
|
||||
icon = ps.getImage(k),
|
||||
title = ps.getLabel(k),
|
||||
icon = itemInfo.image,
|
||||
title = Bridge.Language.Locale(k),
|
||||
description = descript,
|
||||
action = function()
|
||||
if not minigame() then ps.notify(ps.lang('xtc.fail'), "error") return end
|
||||
if not ps.progressbar(ps.lang('xtc.making', ps.getLabel(k)), 4000, 'uncuff') then return end
|
||||
onSelect = function()
|
||||
if not minigame() then return end
|
||||
if not progressbar(Bridge.Language.Locale('xtc.making', Bridge.Language.Locale(k))) then return end
|
||||
TriggerServerEvent("md-drugs:server:makextc", k)
|
||||
end,
|
||||
distance = 2.0
|
||||
}
|
||||
end
|
||||
ps.menu('XTC Recipes', 'XTC Recipes', options)
|
||||
Bridge.Menu.Open({
|
||||
id = 'XTC Recipes',
|
||||
title = 'XTC Recipes',
|
||||
options = options
|
||||
})
|
||||
end,
|
||||
canInteract = function()
|
||||
if xtcpress then return true end
|
||||
end
|
||||
},
|
||||
{
|
||||
icon = "fas fa-eye",
|
||||
label = ps.lang('xtc.targetPickup'),
|
||||
icon = Bridge.Language.Locale('xtc.pressIcon'),
|
||||
label = Bridge.Language.Locale('xtc.targetPickup'),
|
||||
action = function()
|
||||
if not ps.progressbar(ps.lang('xtc.picking'), 5000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('xtc.picking')) then return end
|
||||
DeleteObject(press)
|
||||
xtcpress = false
|
||||
TriggerServerEvent("md-drugs:server:getpressback")
|
||||
@@ -59,18 +71,19 @@ ps.registerCallback('md-drugs:client:setpress', function(xtcData)
|
||||
end
|
||||
},
|
||||
}
|
||||
ps.entityTarget(press, options)
|
||||
return true
|
||||
Bridge.Target.AddLocalEntity(press, options)
|
||||
targets[#targets+1] = press
|
||||
return coords
|
||||
end)
|
||||
|
||||
for k, v in pairs(locations.mdp2p) do
|
||||
ps.boxTarget('mdp2p'..k, v.loc, {length = v.l, width = v.w, heading = v.rot}, {
|
||||
Bridge.Target.AddBoxZone('mdp2p'..k, v.loc, v.size, v.rot or 180.0, {
|
||||
{
|
||||
icon = 'fa-solid fa-flask',
|
||||
label = ps.lang('xtc.targetStealMDP2P'),
|
||||
icon = Bridge.Language.Locale('xtc.mdp2pIcon'),
|
||||
label = Bridge.Language.Locale('xtc.targetStealMDP2P'),
|
||||
action = function()
|
||||
if not minigame() then ps.notify(ps.lang('xtc.fail'), "error") return end
|
||||
if not ps.progressbar(ps.lang('xtc.stealingMDP2P'), 4000, 'uncuff') then return end
|
||||
if not minigame() then return end
|
||||
if not progressbar(Bridge.Language.Locale('xtc.stealingMDP2P')) then return end
|
||||
TriggerServerEvent("md-drugs:server:stealmdp2p", k)
|
||||
end,
|
||||
canInteract = function()
|
||||
@@ -78,15 +91,16 @@ for k, v in pairs(locations.mdp2p) do
|
||||
end
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = 'mdp2p'..k
|
||||
end
|
||||
for k, v in pairs(locations.isosafrole) do
|
||||
ps.boxTarget('isosafrole'..k, v.loc, {length = v.l, width = v.w, heading = v.rot}, {
|
||||
Bridge.Target.AddBoxZone('isosafrole'..k, v.loc, v.size, v.rot or 180.0, {
|
||||
{
|
||||
icon = 'fa-solid fa-flask',
|
||||
label = ps.lang('xtc.targetStealIsosafrole'),
|
||||
icon = Bridge.Language.Locale('xtc.isosafroleIcon'),
|
||||
label = Bridge.Language.Locale('xtc.targetStealIsosafrole'),
|
||||
action = function()
|
||||
if not minigame() then ps.notify(ps.lang('xtc.fail'), "error") return end
|
||||
if not ps.progressbar(ps.lang('xtc.stealingIsosafrole'), 4000, 'uncuff') then return end
|
||||
if not minigame() then return end
|
||||
if not progressbar(Bridge.Language.Locale('xtc.stealingIsosafrole')) then return end
|
||||
TriggerServerEvent("md-drugs:server:stealisosafrole", k)
|
||||
end,
|
||||
canInteract = function()
|
||||
@@ -94,16 +108,17 @@ for k, v in pairs(locations.isosafrole) do
|
||||
end
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = 'isosafrole'..k
|
||||
end
|
||||
|
||||
for k, v in pairs(locations.rawxtcloc) do
|
||||
ps.boxTarget('xtcraw'..k, v.loc, {length = v.l, width = v.w, heading = v.rot}, {
|
||||
Bridge.Target.AddBoxZone('xtcraw'..k, v.loc, v.size, v.rot or 180.0, {
|
||||
{
|
||||
icon = 'fa-solid fa-flask',
|
||||
label = ps.lang('xtc.targetRaw'),
|
||||
icon = Bridge.Language.Locale('xtc.rawIcon'),
|
||||
label = Bridge.Language.Locale('xtc.targetRaw'),
|
||||
action = function()
|
||||
if not minigame() then ps.notify(ps.lang('xtc.fail'), "error") return end
|
||||
if not ps.progressbar(ps.lang('xtc.makingRaw'), 4000, 'uncuff') then return end
|
||||
if not minigame() then return end
|
||||
if not progressbar(Bridge.Language.Locale('xtc.makingRaw')) then return end
|
||||
TriggerServerEvent("md-drugs:server:makingrawxtc", k)
|
||||
end,
|
||||
canInteract = function()
|
||||
@@ -111,80 +126,96 @@ for k, v in pairs(locations.rawxtcloc) do
|
||||
end
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = 'xtcraw'..k
|
||||
end
|
||||
|
||||
for k, v in pairs(locations.xtcpress) do
|
||||
ps.requestModel(v.ped)
|
||||
requestModel(v.ped)
|
||||
local ped = CreatePed(0, v.ped, v.loc, false, false)
|
||||
Freeze(ped, true, v.loc.w)
|
||||
ps.entityTarget(ped, {
|
||||
Bridge.Target.AddLocalEntity(ped, {
|
||||
{
|
||||
icon = 'fa-solid fa-flask',
|
||||
label = ps.lang('xtc.getPress'),
|
||||
action = function()
|
||||
icon = Bridge.Language.Locale('xtc.pressIcon'),
|
||||
label = Bridge.Language.Locale('xtc.getPress'),
|
||||
onSelect = function()
|
||||
local options = {}
|
||||
local recipeList = ps.callback('md-drugs:server:getpressrecipes')
|
||||
local recipeList = Config.XTC.Recipes.presses
|
||||
for m, d in pairs(recipeList) do
|
||||
if m == 'singlepress' then
|
||||
local itemInfo = Bridge.Inventory.GetItemInfo(m)
|
||||
options[#options + 1] = {
|
||||
icon = ps.getImage(m),
|
||||
title = ps.getLabel(m),
|
||||
description = ps.lang('xtc.buySingle', d.cash),
|
||||
action = function()
|
||||
if not ps.progressbar(ps.lang('xtc.buyp'), 4000, 'uncuff') then return end
|
||||
icon = itemInfo.image,
|
||||
title = itemInfo.label,
|
||||
description = Bridge.Language.Locale('xtc.buySingle', d.cash),
|
||||
type = d.type,
|
||||
onSelect = function()
|
||||
if not progressbar(Bridge.Language.Locale('xtc.buyp')) then return end
|
||||
TriggerServerEvent('md-drugs:server:buypress',k, m)
|
||||
end,
|
||||
}
|
||||
else
|
||||
local descript = getRecipeList(d.take)
|
||||
local itemInfo = Bridge.Inventory.GetItemInfo(m)
|
||||
local descript = getRecipeList(d.take, 'presses')
|
||||
options[#options + 1] = {
|
||||
icon = ps.getImage(m),
|
||||
title = ps.getLabel(m),
|
||||
icon = itemInfo.image,
|
||||
title = itemInfo.label,
|
||||
description = descript,
|
||||
action = function()
|
||||
if not ps.progressbar(ps.lang('xtc.buyp'), 4000, 'uncuff') then return end
|
||||
type = d.type,
|
||||
onSelect = function()
|
||||
if not progressbar(Bridge.Language.Locale('xtc.buyp')) then return end
|
||||
TriggerServerEvent("md-drugs:server:upgradepress", k, m)
|
||||
end,
|
||||
distance = 2.0
|
||||
}
|
||||
end
|
||||
end
|
||||
ps.menu('XTC Presses', 'XTC Presses', options)
|
||||
table.sort(options, function(a, b) return a.type < b.type end)
|
||||
Bridge.Menu.Open({
|
||||
id = 'XTC Presses',
|
||||
title = 'XTC Presses',
|
||||
options = options
|
||||
})
|
||||
end,
|
||||
canInteract = function() return handleGang(v.gang) end
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = ped
|
||||
end
|
||||
|
||||
for k, v in pairs (locations.stamp) do
|
||||
ps.boxTarget('xtcstamp'..k, v.loc, {length = v.l, width = v.w, heading = v.rot}, {
|
||||
Bridge.Target.AddBoxZone('xtcstamp'..k, v.loc, v.size, v.rot or 180.0, {
|
||||
{
|
||||
icon = 'fa-solid fa-flask',
|
||||
label = ps.lang('xtc.targetStamp'),
|
||||
action = function()
|
||||
icon = Bridge.Language.Locale('xtc.stampIcon'),
|
||||
label = Bridge.Language.Locale('xtc.targetStamp'),
|
||||
onSelect = function()
|
||||
local item = {
|
||||
{item = 'white_xtc', label = ps.getLabel('white_xtc'), color = 'white'},
|
||||
{item = 'red_xtc', label = ps.getLabel('red_xtc'), color = 'red'},
|
||||
{item = 'orange_xtc', label = ps.getLabel('orange_xtc'), color = 'orange'},
|
||||
{item = 'blue_xtc', label = ps.getLabel('blue_xtc'), color = 'blue'},
|
||||
{item = 'white_xtc', label = Bridge.Inventory.GetItemInfo('white_xtc').label, color = 'white'},
|
||||
{item = 'red_xtc', label = Bridge.Inventory.GetItemInfo('red_xtc').label, color = 'red'},
|
||||
{item = 'orange_xtc', label = Bridge.Inventory.GetItemInfo('orange_xtc').label, color = 'orange'},
|
||||
{item = 'blue_xtc', label = Bridge.Inventory.GetItemInfo('blue_xtc').label, color = 'blue'},
|
||||
}
|
||||
local options = {}
|
||||
for m, d in pairs (item) do
|
||||
options[#options + 1] = {
|
||||
icon = ps.getImage(d.item),
|
||||
icon = Bridge.Inventory.GetItemInfo(d.item).image,
|
||||
title = d.label,
|
||||
description = ps.lang('xtc.stamp_desc', d.color),
|
||||
description = Bridge.Language.Locale('xtc.stamp_desc', d.color),
|
||||
action = function()
|
||||
if not minigame() then ps.notify(ps.lang('xtc.fail'), "error") return end
|
||||
if not ps.progressbar(ps.lang('xtc.stamping'), d.label, 4000, 'uncuff') then return end
|
||||
if not minigame() then return end
|
||||
if not progressbar(Bridge.Language.Locale('xtc.stamping', d.label)) then return end
|
||||
TriggerServerEvent("md-drugs:server:stamp", k, d.color)
|
||||
end,
|
||||
distance = 2.0
|
||||
}
|
||||
end
|
||||
ps.menu('Stamp Pills', 'Stamp Pills', options)
|
||||
Bridge.Menu.Open({
|
||||
id = 'XTC Stamp',
|
||||
title = 'XTC Stamp',
|
||||
options = options
|
||||
})
|
||||
end,
|
||||
canInteract = function() return handleGang(v.gang) end
|
||||
}
|
||||
})
|
||||
targets[#targets+1] = 'xtcstamp'..k
|
||||
end
|
||||
@@ -1,27 +0,0 @@
|
||||
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,33 +3,28 @@ author "mustache_dom"
|
||||
description "drugs by mustache dom"
|
||||
fx_version "cerulean"
|
||||
game "gta5"
|
||||
version '3.9.0'
|
||||
version '4.0.8'
|
||||
client_scripts {
|
||||
'client/functions.lua',
|
||||
'client/animationsandfunctions.lua',
|
||||
'client/plantSpawns.lua',
|
||||
'clientRun.lua',
|
||||
'client/**.lua',
|
||||
}
|
||||
|
||||
server_scripts {
|
||||
'server/functions.lua',
|
||||
'server/plantSpawns.lua',
|
||||
'serverRun.lua',
|
||||
'@oxmysql/lib/MySQL.lua',
|
||||
'server/functions.lua',
|
||||
'server/**.lua',
|
||||
}
|
||||
|
||||
shared_scripts {
|
||||
'shared/**.lua',
|
||||
'@ox_lib/init.lua',
|
||||
'shared/config.lua',
|
||||
'shared/DrugData/*.lua',
|
||||
}
|
||||
|
||||
lua54 'yes'
|
||||
|
||||
files {
|
||||
'stream/mushroom.ytyp',
|
||||
'stream/mushroom.ydr',
|
||||
'client/**.lua',
|
||||
'server/**.lua',
|
||||
'locales/**.lua'
|
||||
'locales/**.json'
|
||||
}
|
||||
|
||||
data_file 'DLC_ITYP_REQUEST' 'stream/mushroom.ytyp'
|
||||
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 7.9 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 8.2 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 6.7 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 23 KiB |