remove blips| switch to waypoint. function spawning tables, code condense
This commit is contained in:
1 parent
1224133815
commit
83f2749101
13 files changed
+77
-199
No files matched your search
+4
-5
@@ -88,17 +88,16 @@ RegisterNetEvent("md-drugs:client:bagcoke", function()
|
||||
end
|
||||
TriggerServerEvent("md-drugs:server:bagcoke")
|
||||
baggingcoke = nil
|
||||
|
||||
end)
|
||||
|
||||
CreateThread(function()
|
||||
if Config.FancyCokeAnims == false then
|
||||
AddBoxZoneMulti('cuttcoke', Config.CuttingCoke, { type = "client", event = "md-drugs:client:cutcokeone", icon = "fas fa-sign-in-alt", label = Lang.targets.coke.cut})
|
||||
AddBoxZoneMulti('baggcoke', Config.BaggingCoke, { type = "client", event = "md-drugs:client:bagcoke", icon = "fas fa-sign-in-alt", label = Lang.targets.coke.bag})
|
||||
AddBoxZoneMulti('cuttcoke', Config.CuttingCoke, { type = "client", event = "md-drugs:client:cutcokeone", icon = "fa-solid fa-mortar-pestle", label = Lang.targets.coke.cut})
|
||||
AddBoxZoneMulti('baggcoke', Config.BaggingCoke, { type = "client", event = "md-drugs:client:bagcoke", icon = "fa-solid fa-sack-xmark", label = Lang.targets.coke.bag})
|
||||
else
|
||||
AddBoxZoneSingle('cutcoke', vector3(1093.17, -3195.74, -39.19),
|
||||
{ type = "client", event = "md-drugs:client:cutcokeone", icon = "fas fa-sign-in-alt", label = Lang.targets.coke.cut, canInteract = function()if cuttingcoke == nil and baggingcoke == nil then return true end end })
|
||||
{ type = "client", event = "md-drugs:client:cutcokeone", icon = "fa-solid fa-mortar-pestle", label = Lang.targets.coke.cut, canInteract = function()if cuttingcoke == nil and baggingcoke == nil then return true end end })
|
||||
AddBoxZoneSingle('bagcokepowder', vector3(1090.29, -3195.66, -39.13),
|
||||
{ type = "client", event = "md-drugs:client:bagcoke", icon = "fas fa-sign-in-alt", label = Lang.targets.coke.bag, canInteract = function() if baggingcoke == nil and cuttingcoke == nil then return true end end })
|
||||
{ type = "client", event = "md-drugs:client:bagcoke", icon = "fa-solid fa-sack-xmark", label = Lang.targets.coke.bag, canInteract = function() if baggingcoke == nil and cuttingcoke == nil then return true end end })
|
||||
end
|
||||
end)
|
||||
+17
-28
@@ -3,21 +3,7 @@ local sell = false
|
||||
local sold = false
|
||||
local targbusy = false
|
||||
|
||||
local function sellDrug(item, amount, price, targ)
|
||||
PoliceCall(20)
|
||||
targbusy = true
|
||||
if IsPedInAnyVehicle(PlayerPedId(), true) then
|
||||
Notify(Lang.Cornerselling.inveh, 'error')
|
||||
FreezeEntityPosition(targ, false)
|
||||
ClearPedTasks(targ)
|
||||
Wait(10000)
|
||||
DeletePed(targ)
|
||||
targbusy = false
|
||||
sold = true
|
||||
sell = false
|
||||
return end
|
||||
if not progressbar(string.format(Lang.Cornerselling.selling, GetLabel(item), price), 4000, 'uncuff') then return end
|
||||
TriggerServerEvent('md-drugs:server:sellCornerDrugs', item, amount, price)
|
||||
local function reset(targ)
|
||||
FreezeEntityPosition(targ, false)
|
||||
ClearPedTasks(targ)
|
||||
Wait(10000)
|
||||
@@ -26,16 +12,23 @@ local function sellDrug(item, amount, price, targ)
|
||||
sold = true
|
||||
end
|
||||
|
||||
local function sellDrug(item, amount, price, targ)
|
||||
PoliceCall(20)
|
||||
targbusy = true
|
||||
if IsPedInAnyVehicle(PlayerPedId(), true) then
|
||||
Notify(Lang.Cornerselling.inveh, 'error')
|
||||
reset(targ)
|
||||
return end
|
||||
if not progressbar(string.format(Lang.Cornerselling.selling, GetLabel(item), price), 4000, 'uncuff') then return end
|
||||
TriggerServerEvent('md-drugs:server:sellCornerDrugs', item, amount, price)
|
||||
reset(targ)
|
||||
end
|
||||
|
||||
local function deny(targ)
|
||||
PoliceCall(20)
|
||||
targbusy = true
|
||||
if not progressbar(Lang.Cornerselling.deny, 4000, 'argue5') then return end
|
||||
FreezeEntityPosition(targ, false)
|
||||
ClearPedTasks(targ)
|
||||
Wait(10000)
|
||||
DeletePed(targ)
|
||||
targbusy = false
|
||||
sold = true
|
||||
reset(targ)
|
||||
end
|
||||
|
||||
function Cornersell()
|
||||
@@ -48,19 +41,16 @@ function Cornersell()
|
||||
until #(GetEntityCoords(PlayerPedId()) - GetEntityCoords(targ)) < 2.0
|
||||
lib.requestAnimDict("rcmme_tracey1")
|
||||
TaskStartScenarioInPlace(targ, "WORLD_HUMAN_STAND_IMPATIENT_UPRIGHT", 0, false) FreezeEntityPosition(targ, true)
|
||||
|
||||
local item, amount, price = lib.callback.await('md-drugs:server:cornerselling:getAvailableDrugs', false)
|
||||
if item == 'nothing' then Notify(Lang.Cornerselling.nodrugs, 'error') sell = false FreezeEntityPosition(targ, false) ClearPedTasks(targ) return false end
|
||||
local options = {
|
||||
{ label = string.format(Lang.Targets.CornerSell.sell, amount, GetLabel(item), price), icon = "fas fa-eye",
|
||||
{ label = string.format(Lang.Targets.CornerSell.sell, amount, GetLabel(item), price), icon ="fa-solid fa-money-bill",
|
||||
action = function() sellDrug(item, amount, price, targ) end,
|
||||
onSelect = function() sellDrug(item, amount, price, targ) end,
|
||||
canInteract = function()
|
||||
if not targbusy then return true end end,
|
||||
},
|
||||
{ label = Lang.targets.CornerSell.deny, icon = "fas fa-eye",
|
||||
{ label = Lang.targets.CornerSell.deny, icon = "fa-solid fa-person-harassing",
|
||||
action = function() deny(targ) end,
|
||||
onSelect = function() deny(targ) end,
|
||||
canInteract = function()
|
||||
if not targbusy then return true end end,
|
||||
},
|
||||
@@ -85,10 +75,9 @@ RegisterNetEvent('md-drugs:client:cornerselling', function()
|
||||
repeat
|
||||
Wait(1000)
|
||||
if not Cornersell() then end
|
||||
until sell == false
|
||||
until not sell
|
||||
end
|
||||
else
|
||||
Notify(Lang.Cornerselling.nodrugs, 'error')
|
||||
end
|
||||
end)
|
||||
|
||||
+3
-25
@@ -17,9 +17,7 @@ CreateThread(function()
|
||||
dealer[k] = CreatePed(0, Ped,loc.x,loc.y, loc.z-1, loc.h, false, false)
|
||||
Freeze(dealer[k], true, loc.h)
|
||||
local options = {
|
||||
{
|
||||
icon = 'fas fa-user-secret',
|
||||
label = string.format(Lang.targets.Delivery.Deliver, v.name),
|
||||
{ icon = 'fas fa-user-secret', label = string.format(Lang.targets.Delivery.Deliver, v.name),
|
||||
action = function()
|
||||
local bool, item, amount, coords = lib.callback.await('md-drugs:server:GetDeliveryItem', false, k)
|
||||
if bool then
|
||||
@@ -27,19 +25,9 @@ CreateThread(function()
|
||||
TriggerEvent('md-drugs:client:setLocation', {bool = bool, item = item, amount = amount, coords = coords})
|
||||
end
|
||||
end,
|
||||
onSelect = function()
|
||||
local bool, item, amount, coords = lib.callback.await('md-drugs:server:GetDeliveryItem', false, k)
|
||||
if item then
|
||||
TriggerEvent('md-drugs:client:setLocation', {bool = bool, item = item, amount = amount, coords = coords})
|
||||
Email(Lang.Delivery.emailn, Lang.Delivery.emailsub, string.format(Lang.Delivery.emailcon, amount, GetLabel(item)))
|
||||
end
|
||||
end
|
||||
},
|
||||
{
|
||||
icon = 'fas fa-user-secret',
|
||||
label = string.format(Lang.targets.Delivery.open, v.name),
|
||||
{ icon = 'fas fa-user-secret', label = string.format(Lang.targets.Delivery.open, v.name),
|
||||
action = function() TriggerEvent('md-drugs:client:opendealermenu') end,
|
||||
onSelect = function() TriggerEvent('md-drugs:client:opendealermenu') end
|
||||
}
|
||||
}
|
||||
AddMultiModel(dealer[k], options)
|
||||
@@ -48,16 +36,7 @@ end)
|
||||
|
||||
RegisterNetEvent('md-drugs:client:setLocation', function(data)
|
||||
local coord = json.decode(data.coords)
|
||||
local deliveryBlip = AddBlipForCoord(coord.x, coord.y, coord.z)
|
||||
SetBlipSprite(deliveryBlip, 1)
|
||||
SetBlipDisplay(deliveryBlip, 2)
|
||||
SetBlipScale(deliveryBlip, 1.0)
|
||||
SetBlipAsShortRange(deliveryBlip, false)
|
||||
SetBlipColour(deliveryBlip, 27)
|
||||
BeginTextCommandSetBlipName("STRING")
|
||||
AddTextComponentSubstringPlayerName('Drug Delivery')
|
||||
EndTextCommandSetBlipName(deliveryBlip)
|
||||
SetBlipRoute(deliveryBlip, true)
|
||||
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, 180.0, false, false)
|
||||
@@ -69,7 +48,6 @@ RegisterNetEvent('md-drugs:client:setLocation', function(data)
|
||||
if not progressbar(Lang.Delivery.pack, 4000, 'uncuff') then return end
|
||||
isActive = false
|
||||
DeletePed(Buyer)
|
||||
RemoveBlip(deliveryBlip)
|
||||
TriggerServerEvent('md-drugs:server:giveDeliveryItems', data.item, data.amount)
|
||||
end,
|
||||
canInteract = function()
|
||||
|
||||
+8
-16
@@ -368,22 +368,6 @@ function tele(coords)
|
||||
DoScreenFadeIn(500)
|
||||
end
|
||||
|
||||
function Blip(entity, text)
|
||||
local deliveryBlip = AddBlipForCoord(entity)
|
||||
SetBlipSprite(deliveryBlip, 1)
|
||||
SetBlipDisplay(deliveryBlip, 2)
|
||||
SetBlipScale(deliveryBlip, 1.0)
|
||||
SetBlipAsShortRange(deliveryBlip, false)
|
||||
SetBlipColour(deliveryBlip, 27)
|
||||
BeginTextCommandSetBlipName("STRING")
|
||||
AddTextComponentSubstringPlayerName(text)
|
||||
EndTextCommandSetBlipName(deliveryBlip)
|
||||
SetBlipRoute(deliveryBlip, true)
|
||||
end
|
||||
|
||||
function RemoveBlips()
|
||||
RemoveBlip(deliveryBlip)
|
||||
end
|
||||
|
||||
function AddBoxZoneSingle(name, loc, data)
|
||||
if Config.Target == 'qb' then
|
||||
@@ -476,6 +460,14 @@ function AddSingleModel(model, data, num)
|
||||
end
|
||||
|
||||
function AddMultiModel(model, data, num)
|
||||
local data = {}
|
||||
for k, v in pairs (data) do
|
||||
table.insert(data,{
|
||||
{ icon = v.icon, label = v.label, event = v.event or nil, action = v.action or nil,
|
||||
onSelect = v.action,data = num,canInteract = v.canInteract or nil,
|
||||
}
|
||||
})
|
||||
end
|
||||
if Config.Target == 'qb' then
|
||||
exports['qb-target']:AddTargetEntity(model, {options = data, distance = 2.5})
|
||||
elseif Config.Target == 'ox' then
|
||||
|
||||
+10
-28
@@ -2,10 +2,16 @@ local QBCore = exports['qb-core']:GetCoreObject()
|
||||
local PoppyPlants = {}
|
||||
local herointable = false
|
||||
|
||||
local function createLabKit(coord, head)
|
||||
local heroinlabkit = CreateObject("v_ret_ml_tablea", coord.x, coord.y, coord.z - 1, true, false)
|
||||
SetEntityHeading(heroinlabkit, head)
|
||||
PlaceObjectOnGroundProperly(heroinlabkit)
|
||||
local options = {
|
||||
{ event = "md-drugs:client:heatliquidheroin", icon = "fas fa-box-circle-check", label = Lang.targets.heroin.cook, data = heroinlabkit},
|
||||
{ event = "md-drugs:client:getheroinkitback", icon = "fas fa-box-circle-check", label = Lang.targets.heroin.up, data = heroinlabkit, canInteract = function() if herointable then return true end end},
|
||||
}
|
||||
AddMultiModel(heroinlabkit, options, heroinlabkit)
|
||||
end
|
||||
|
||||
local function pickher(loc)
|
||||
if not progressbar(Lang.Heroin.pick, 4000, 'uncuff') then return end
|
||||
@@ -21,7 +27,6 @@ local Ped = "g_m_y_famdnf_01"
|
||||
AddSingleModel(heroinkitdealer, { label = Lang.targets.heroin.kit, icon = "fas fa-eye", event = "md-drugs:client:buyheroinlabkit", distance = 2.0}, nil )
|
||||
end)
|
||||
|
||||
---- plant spawns dont edit
|
||||
RegisterNetEvent('heroin:respawnCane', function(loc)
|
||||
local v = GlobalState.PoppyPlants[loc]
|
||||
local hash = GetHashKey(v.model)
|
||||
@@ -32,15 +37,11 @@ RegisterNetEvent('heroin:respawnCane', function(loc)
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
|
||||
RegisterNetEvent('heroin:removeCane', function(loc)
|
||||
if DoesEntityExist(PoppyPlants[loc]) then DeleteEntity(PoppyPlants[loc]) end
|
||||
PoppyPlants[loc] = nil
|
||||
end)
|
||||
|
||||
|
||||
|
||||
RegisterNetEvent("heroin:init", function()
|
||||
for k, v in pairs (GlobalState.PoppyPlants) do
|
||||
local hash = GetHashKey(v.model)
|
||||
@@ -75,11 +76,7 @@ AddEventHandler('onResourceStart', function(resource)
|
||||
end
|
||||
end
|
||||
end
|
||||
DeleteObject(heroinlabkit)
|
||||
DeleteObject(dirtylabkitheroin)
|
||||
end)
|
||||
---- plant stop end
|
||||
|
||||
|
||||
RegisterNetEvent("md-drugs:client:dryplant", function(data)
|
||||
if not progressbar(Lang.Heroin.dryout, 4000, 'uncuff') then return end
|
||||
@@ -97,7 +94,6 @@ RegisterNetEvent("md-drugs:client:buyheroinlabkit", function()
|
||||
TriggerServerEvent("md-drugs:server:getheroinlabkit")
|
||||
end)
|
||||
|
||||
|
||||
RegisterNetEvent("md-drugs:client:setheroinlabkit", function()
|
||||
if herointable then
|
||||
Notify(Lang.Heroin.tableout, 'error')
|
||||
@@ -106,17 +102,12 @@ else
|
||||
local location, head = StartRay()
|
||||
if not location then herointable = false TriggerServerEvent('md-drugs:server:getheroinlabkitback') return end
|
||||
if not progressbar(Lang.Heroin.table, 4000, 'uncuff') then TriggerServerEvent('md-drugs:server:getheroinlabkitback') return end
|
||||
heroinlabkit = CreateObject("v_ret_ml_tablea", location.x, location.y, location.z, true, false)
|
||||
SetEntityHeading(heroinlabkit, head)
|
||||
PlaceObjectOnGroundProperly(heroinlabkit)
|
||||
AddMultiModel(heroinlabkit, options, heroinlabkit)
|
||||
createLabKit(location, head)
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
RegisterNetEvent("md-drugs:client:heatliquidheroin", function(data)
|
||||
local loc = GetEntityCoords(data.data)
|
||||
local head = GetEntityHeading(data.data)
|
||||
local loc, head = GetEntityCoords(data.data), GetEntityHeading(data.data)
|
||||
if not ItemCheck('emptyvial') then return end
|
||||
if not minigame() then
|
||||
TriggerServerEvent("md-drugs:server:failheatingheroin")
|
||||
@@ -142,17 +133,11 @@ RegisterNetEvent("md-drugs:client:cleanheroinlabkit", function(data)
|
||||
end)
|
||||
|
||||
RegisterNetEvent("md-drugs:client:deletedirtyheroin", function(data)
|
||||
local location = GetEntityCoords(data)
|
||||
local head = GetEntityHeading(data)
|
||||
local location,head = GetEntityCoords(data), GetEntityHeading(data)
|
||||
DeleteObject(data)
|
||||
local heroinlabkit = CreateObject("v_ret_ml_tablea", location.x, location.y, location.z-1, true, false)
|
||||
SetEntityHeading(heroinlabkit, head)
|
||||
PlaceObjectOnGroundProperly(heroinlabkit)
|
||||
AddMultiModel(heroinlabkit, options, heroinlabkit)
|
||||
createLabKit(location, head)
|
||||
end)
|
||||
|
||||
|
||||
|
||||
RegisterNetEvent("md-drugs:client:getheroinkitback", function(data)
|
||||
if not progressbar(Lang.Heroin.pickup, 4000, 'uncuff') then return end
|
||||
herointable = false
|
||||
@@ -160,11 +145,8 @@ RegisterNetEvent("md-drugs:client:getheroinkitback", function(data)
|
||||
TriggerServerEvent("md-drugs:server:getheroinlabkitback")
|
||||
end)
|
||||
|
||||
|
||||
RegisterNetEvent("md-drugs:client:fillneedle", function(data)
|
||||
if not minigame() then TriggerServerEvent("md-drugs:server:failheroin", data.data) return end
|
||||
if not progressbar(Lang.Heroin.needles, 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:fillneedle", data.data)
|
||||
end)
|
||||
|
||||
|
||||
+17
-22
@@ -2,7 +2,18 @@ local QBCore = exports['qb-core']:GetCoreObject()
|
||||
local tableout = false
|
||||
|
||||
|
||||
|
||||
local function createLabKit(coord, head)
|
||||
local labkit = CreateObject("v_ret_ml_tablea", coord.x, coord.y, coord.z - 1, true, false)
|
||||
SetEntityHeading(labkit, head)
|
||||
PlaceObjectOnGroundProperly(labkit)
|
||||
local options = {
|
||||
{ event = "md-drugs:client:heatliquid", icon = "fas fa-box-circle-check", label = Lang.targets.lsd.heat, data = labkit },
|
||||
{ event = "md-drugs:client:refinequalityacid", icon = "fas fa-box-circle-check", label = Lang.targets.lsd.refine, data = labkit },
|
||||
{ event = "md-drugs:client:maketabpaper", icon = "fas fa-box-circle-check", label = Lang.targets.lsd.dab, data = labkit },
|
||||
{ event = "md-drugs:client:getlabkitback", icon = "fas fa-box-circle-check", label = Lang.targets.lsd.back, data = labkit, canInteract = function() return tableout end }
|
||||
}
|
||||
AddMultiModel(labkit, options, labkit)
|
||||
end
|
||||
|
||||
CreateThread(function()
|
||||
local Ped = "g_m_y_famdnf_01"
|
||||
@@ -35,16 +46,7 @@ else
|
||||
local loc, head = StartRay()
|
||||
if not loc then tableout = false TriggerServerEvent('md-drugs:server:getlabkitback') return end
|
||||
if not progressbar(Lang.lsd.place, 4000, 'uncuff') then TriggerServerEvent('md-drugs:server:getlabkitback') return end
|
||||
local labkit = CreateObject("v_ret_ml_tablea", loc.x, loc.y, loc.z-1, true, false)
|
||||
SetEntityHeading(labkit, head)
|
||||
PlaceObjectOnGroundProperly(labkit)
|
||||
local options = {
|
||||
{ event = "md-drugs:client:heatliquid", icon = "fas fa-box-circle-check", label = Lang.targets.lsd.heat, data = labkit, },
|
||||
{ event = "md-drugs:client:refinequalityacid", icon = "fas fa-box-circle-check", label = Lang.targets.lsd.refine, data = labkit, },
|
||||
{ event = "md-drugs:client:maketabpaper", icon = "fas fa-box-circle-check", label = Lang.targets.lsd.dab, data = labkit, },
|
||||
{ event = "md-drugs:client:getlabkitback", icon = "fas fa-box-circle-check", label = Lang.targets.lsd.back, data = labkit, canInteract = function() if tableout then return true end end},
|
||||
}
|
||||
AddMultiModel(labkit, options, labkit)
|
||||
createLabKit(loc, head)
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -56,7 +58,7 @@ RegisterNetEvent("md-drugs:client:getlabkitback", function(data)
|
||||
end)
|
||||
|
||||
RegisterNetEvent("md-drugs:client:heatliquid", function(data)
|
||||
local PedCoords = GetEntityCoords(data.data)
|
||||
local PedCoords, head = GetEntityCoords(data.data), GetEntityHeading(data.data)
|
||||
local dict = "scr_ie_svm_technical2"
|
||||
if not ItemCheck('lysergic_acid') then return end
|
||||
if not ItemCheck('diethylamide') then return end
|
||||
@@ -64,6 +66,7 @@ RegisterNetEvent("md-drugs:client:heatliquid", function(data)
|
||||
TriggerServerEvent("md-drugs:server:failheating")
|
||||
DeleteObject(data.data)
|
||||
local dirtylabkit = CreateObject("v_ret_ml_tablea", PedCoords.x, PedCoords.y, PedCoords.z-1, true, false)
|
||||
SetEntityHeading(dirtylabkit, head)
|
||||
loadParticle(dict)
|
||||
exitPtfx = StartParticleFxLoopedOnEntity("scr_dst_cocaine", dirtylabkit, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.5, false, false, false)
|
||||
PlaceObjectOnGroundProperly(dirtylabkit)
|
||||
@@ -80,17 +83,9 @@ RegisterNetEvent("md-drugs:client:cleanlabkit", function(data)
|
||||
if not progressbar(Lang.lsd.clean, 4000, 'clean') then return end
|
||||
local check = lib.callback.await('md-drugs:server:removecleaningkit')
|
||||
if check then
|
||||
local coord = GetEntityCoords(data.data)
|
||||
local coord, head = GetEntityCoords(data.data), GetEntityHeading(data.data)
|
||||
DeleteObject(data.data)
|
||||
local labkit = CreateObject("v_ret_ml_tablea", coord.x, coord.y, coord.z-1, true, false)
|
||||
PlaceObjectOnGroundProperly(labkit)
|
||||
local options = {
|
||||
{ event = "md-drugs:client:heatliquid", icon = "fas fa-box-circle-check", label = Lang.targets.lsd.heat, data = labkit, },
|
||||
{ event = "md-drugs:client:refinequalityacid", icon = "fas fa-box-circle-check", label = Lang.targets.lsd.refine, data = labkit, },
|
||||
{ event = "md-drugs:client:maketabpaper", icon = "fas fa-box-circle-check", label = Lang.targets.lsd.dab, data = labkit, },
|
||||
{ event = "md-drugs:client:getlabkitback", icon = "fas fa-box-circle-check", label = Lang.targets.lsd.back, data = labkit, canInteract = function() if tableout then return true end end},
|
||||
}
|
||||
AddMultiModel(labkit, options, labkit)
|
||||
createLabKit(coord, head)
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
+4
-23
@@ -24,15 +24,11 @@ RegisterNetEvent('Mescaline:respawnCane', function(loc)
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
|
||||
RegisterNetEvent('Mescaline:removeCane', function(loc)
|
||||
if DoesEntityExist(Mescaline[loc]) then DeleteEntity(Mescaline[loc]) end
|
||||
Mescaline[loc] = nil
|
||||
end)
|
||||
|
||||
|
||||
|
||||
RegisterNetEvent("Mescaline:init", function()
|
||||
for k, v in pairs (GlobalState.Mescaline) do
|
||||
local hash = GetHashKey(v.model)
|
||||
@@ -69,42 +65,27 @@ AddEventHandler('onResourceStart', function(resource)
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
|
||||
RegisterNetEvent("md-drugs:client:drymescaline", function()
|
||||
if not ItemCheck('cactusbulb') then return end
|
||||
if not progressbar(Lang.mescaline.dry, 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:drymescaline")
|
||||
end)
|
||||
|
||||
|
||||
RegisterNetEvent("md-drugs:client:takemescaline", function()
|
||||
local chance = math.random(1,100)
|
||||
local chance2 = math.random(1,100)
|
||||
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 progressbar(Lang.mescaline.eat, 4000, 'uncuff') then return end
|
||||
if chance <= Config.Badtrip then
|
||||
AlienEffect()
|
||||
local clone = ClonePed(PlayerPedId(), false, false, true)
|
||||
SetEntityAsMissionEntity(clone)
|
||||
SetEntityVisible(clone, true)
|
||||
SetPedRelationshipGroupHash(clone)
|
||||
SetPedAccuracy(clone)
|
||||
SetPedArmour(clone)
|
||||
SetPedCanSwitchWeapon(clone, true)
|
||||
SetPedFleeAttributes(clone, false)
|
||||
if chance2 <= 99 then
|
||||
GiveWeaponToPed(clone, "weapon_flaregun", 1, false, true)
|
||||
GiveWeaponToPed(clone, weapon, 1, false, true)
|
||||
TaskCombatPed(clone, PlayerPedId(), 0, 16)
|
||||
SetPedCombatAttributes(clone, 46, true)
|
||||
Wait(1000 * 30)
|
||||
DeleteEntity(clone)
|
||||
else
|
||||
GiveWeaponToPed(clone, "weapon_rpg", 1, false, true)
|
||||
TaskCombatPed(clone, PlayerPedId(), 0, 16)
|
||||
SetPedCombatAttributes(clone, 46, true)
|
||||
Wait(1000 * 30)
|
||||
DeleteEntity(clone)
|
||||
end
|
||||
else
|
||||
AlienEffect()
|
||||
end
|
||||
|
||||
+2
-3
@@ -83,18 +83,17 @@ CreateThread(function()
|
||||
end)
|
||||
|
||||
CreateThread(function()
|
||||
|
||||
AddBoxZoneSingle("methTeleOut",Config.MethTeleIn, {name = 'teleout', icon = "fas fa-sign-in-alt", label = Lang.targets.meth.enter, action = function() SetEntityCoords(PlayerPedId(), Config.MethTeleOut) end} )
|
||||
AddBoxZoneSingle("methtelein",Config.MethTeleOut, {name = 'teleout', icon = "fas fa-sign-in-alt", label = Lang.targets.meth.exit, action = function() SetEntityCoords(PlayerPedId(), Config.MethTeleIn) end} )
|
||||
local options = {
|
||||
{ name = 'methcook', icon = "fas fa-sign-in-alt", label = Lang.targets.meth.cook, distance = 2.5, action = function() startcook() end, onSelect = function() startcook() end,
|
||||
{ name = 'methcook', icon = "fas fa-sign-in-alt", label = Lang.targets.meth.cook, distance = 2.5, action = function() startcook() end,
|
||||
canInteract = function()
|
||||
if amonia == nil and active == nil then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
},
|
||||
{ name = 'grabtray', icon = "fas fa-sign-in-alt", label = Lang.targets.meth.tray, distance = 2.5, onSelect = function() trayscarry() end, action = function() trayscarry() end,
|
||||
{ name = 'grabtray', icon = "fas fa-sign-in-alt", label = Lang.targets.meth.tray, distance = 2.5, action = function() trayscarry() end,
|
||||
canInteract = function()
|
||||
if heated and amonia and tray == nil then return true end
|
||||
end,
|
||||
|
||||
+2
-12
@@ -1,5 +1,4 @@
|
||||
local QBCore = exports['qb-core']:GetCoreObject()
|
||||
local deliveryBlip = nil
|
||||
local carryPackage = nil
|
||||
|
||||
RegisterNetEvent("md-drugs:client:GetOxyCar", function()
|
||||
@@ -19,16 +18,7 @@ end)
|
||||
RegisterNetEvent("md-drugs:client:getoxylocationroute", function()
|
||||
local CurrentLocation = Config.oxylocations[math.random(#Config.oxylocations)]
|
||||
if CurrentLocation ~= nil then
|
||||
local deliveryBlip = AddBlipForCoord(CurrentLocation)
|
||||
SetBlipSprite(deliveryBlip, 1)
|
||||
SetBlipDisplay(deliveryBlip, 2)
|
||||
SetBlipScale(deliveryBlip, 1.0)
|
||||
SetBlipAsShortRange(deliveryBlip, false)
|
||||
SetBlipColour(deliveryBlip, 27)
|
||||
BeginTextCommandSetBlipName("STRING")
|
||||
AddTextComponentSubstringPlayerName('Oxy Buyer')
|
||||
EndTextCommandSetBlipName(deliveryBlip)
|
||||
SetBlipRoute(deliveryBlip, true)
|
||||
SetNewWaypoint(CurrentLocation.x, CurrentLocation.y)
|
||||
local current = "g_m_y_famdnf_01"
|
||||
lib.requestModel(current, Config.RequestModelTime)
|
||||
local oxybuyer = CreatePed(0, current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, CurrentLocation.w, false, false)
|
||||
@@ -36,7 +26,7 @@ RegisterNetEvent("md-drugs:client:getoxylocationroute", function()
|
||||
repeat
|
||||
Wait(1000)
|
||||
until #(GetEntityCoords(PlayerPedId()) - vector3(CurrentLocation.x,CurrentLocation.y,CurrentLocation.z)) < 5.0
|
||||
RemoveBlip(deliveryBlip)
|
||||
|
||||
PoliceCall(Config.PoliceAlertOxy)
|
||||
AddSingleModel(oxybuyer, { type = "client", label = Lang.targets.oxy.talk, icon = "fas fa-eye",
|
||||
action = function()
|
||||
|
||||
@@ -19,20 +19,16 @@ else
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
|
||||
RegisterNetEvent("md-drugs:client:writeprescription", function(args)
|
||||
if not progressbar(Lang.Pharma.write, 4000, 'notepad') then return end
|
||||
TriggerServerEvent("md-drugs:server:giveprescription", args.item)
|
||||
end)
|
||||
|
||||
|
||||
RegisterNetEvent("md-drugs:client:fillprescription", function(data)
|
||||
if not progressbar(Lang.Pharma.fill, 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:fillprescription", data.data)
|
||||
end)
|
||||
|
||||
|
||||
RegisterNetEvent("md-drugs:client:unbottle", function(item)
|
||||
if not progressbar(Lang.Pharma.open, 4000, 'uncuff') then return end
|
||||
if item.name == 'vicodinbottle' then item = 'vicodin' end
|
||||
|
||||
+2
-3
@@ -1,7 +1,6 @@
|
||||
local QBCore = exports['qb-core']:GetCoreObject()
|
||||
local shrooms = {}
|
||||
|
||||
|
||||
function LoadModel(hash)
|
||||
hash = GetHashKey(hash)
|
||||
RequestModel(hash)
|
||||
@@ -14,6 +13,7 @@ local function pick(loc)
|
||||
if not progressbar(Lang.Shrooms.pick, 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("shrooms:pickupCane", loc)
|
||||
end
|
||||
|
||||
RegisterNetEvent('shrooms:respawnCane', function(loc)
|
||||
local v = GlobalState.shrooms[loc]
|
||||
local hash = GetHashKey(v.model)
|
||||
@@ -23,6 +23,7 @@ RegisterNetEvent('shrooms:respawnCane', function(loc)
|
||||
AddSingleModel(shrooms[loc],{ icon = "fas fa-hand", label = Lang.targets.shrooms.pick, action = function() pick(loc) end }, loc )
|
||||
end
|
||||
end)
|
||||
|
||||
AddEventHandler('onResourceStart', function(resource)
|
||||
if resource == GetCurrentResourceName() then
|
||||
Wait(3000)
|
||||
@@ -53,7 +54,6 @@ end)
|
||||
TriggerEvent('shrooms:init')
|
||||
end)
|
||||
|
||||
|
||||
RegisterNetEvent("shrooms:init", function()
|
||||
for k, v in pairs (GlobalState.shrooms) do
|
||||
local hash = GetHashKey(v.model)
|
||||
@@ -66,7 +66,6 @@ end)
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
RegisterNetEvent('md-drugs:client:takeshrooms', function()
|
||||
if not progressbar(Lang.Shrooms.eat, 500, 'eat') then return end
|
||||
TriggerEvent("evidence:client:SetStatus", "widepupils", 300)
|
||||
|
||||
+6
-17
@@ -19,7 +19,6 @@ local function hasJob()
|
||||
return true end
|
||||
end
|
||||
|
||||
|
||||
RegisterNetEvent('weed:respawnCane', function(loc)
|
||||
local v = GlobalState.WeedPlant[loc]
|
||||
local hash = GetHashKey(v.model)
|
||||
@@ -28,14 +27,9 @@ RegisterNetEvent('weed:respawnCane', function(loc)
|
||||
WeedPlant[loc] = CreateObject(hash, v.location.x, v.location.y, v.location.z-3.5, false, true, true)
|
||||
Freeze(WeedPlant[loc],true, v.heading)
|
||||
AddSingleModel(WeedPlant[loc],
|
||||
{
|
||||
icon = "fas fa-hand",
|
||||
label = Lang.targets.weed.pick,
|
||||
action = function()
|
||||
if not progressbar(Lang.Weed.pick, 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("weed:pickupCane", loc)
|
||||
end
|
||||
}, loc)
|
||||
{icon = "fas fa-hand",label = Lang.targets.weed.pick,
|
||||
action = function()if not progressbar(Lang.Weed.pick, 4000, 'uncuff') then return end TriggerServerEvent("weed:pickupCane", loc) end},
|
||||
loc)
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -52,14 +46,9 @@ RegisterNetEvent("weed:init", function()
|
||||
WeedPlant[k] = CreateObject(hash, v.location.x, v.location.y, v.location.z-3.5, false, true, true)
|
||||
Freeze(WeedPlant[k],true, v.heading)
|
||||
AddSingleModel(WeedPlant[k],
|
||||
{
|
||||
icon = "fas fa-hand",
|
||||
label = Lang.targets.weed.pick,
|
||||
action = function()
|
||||
if not progressbar(Lang.Weed.pick, 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("weed:pickupCane", k)
|
||||
end
|
||||
}, k)
|
||||
{icon = "fas fa-hand",label = Lang.targets.weed.pick,
|
||||
action = function()if not progressbar(Lang.Weed.pick, 4000, 'uncuff') then return end TriggerServerEvent("weed:pickupCane", k) end},
|
||||
k)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
+2
-13
@@ -1,6 +1,6 @@
|
||||
local QBCore = exports['qb-core']:GetCoreObject()
|
||||
local miss = false
|
||||
local deliveryBlip = nil
|
||||
|
||||
|
||||
RegisterNetEvent("md-drugs:client:GetLocation", function(drug, notify)
|
||||
if not GetCops(Config.PoliceCount) then return end
|
||||
@@ -12,16 +12,7 @@ RegisterNetEvent("md-drugs:client:GetLocation", function(drug, notify)
|
||||
local CurrentLocation = Config.oxylocations[math.random(#Config.oxylocations)]
|
||||
local timer = 0
|
||||
miss = true
|
||||
deliveryBlip = AddBlipForCoord(CurrentLocation)
|
||||
SetBlipSprite(deliveryBlip, 1)
|
||||
SetBlipDisplay(deliveryBlip, 2)
|
||||
SetBlipScale(deliveryBlip, 1.0)
|
||||
SetBlipAsShortRange(deliveryBlip, false)
|
||||
SetBlipColour(deliveryBlip, 27)
|
||||
BeginTextCommandSetBlipName("STRING")
|
||||
AddTextComponentSubstringPlayerName("drug Meet")
|
||||
EndTextCommandSetBlipName(deliveryBlip)
|
||||
SetBlipRoute(deliveryBlip, true)
|
||||
SetNewWaypoint(CurrentLocation.x, CurrentLocation.y)
|
||||
lib.requestModel("g_m_y_famdnf_01", Config.RequestModelTime)
|
||||
local current = "g_m_y_famdnf_01"
|
||||
local drugdealer = CreatePed(0, current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, 90.0, false, false)
|
||||
@@ -50,7 +41,6 @@ RegisterNetEvent("md-drugs:client:GetLocation", function(drug, notify)
|
||||
timer = timer + 1
|
||||
until #(GetEntityCoords(PlayerPedId()) - vector3(CurrentLocation.x, CurrentLocation.y, CurrentLocation.z) ) < 4.0 or timer == Config.WholesaleTimeout + 1
|
||||
PoliceCall(Config.AlertPoliceWholesale)
|
||||
RemoveBlip(deliveryBlip)
|
||||
if timer <= Config.WholesaleTimeout or #(GetEntityCoords(PlayerPedId()) - vector3(CurrentLocation.x, CurrentLocation.y, CurrentLocation.z) ) < 4.0 then
|
||||
timer = 0
|
||||
else
|
||||
@@ -76,7 +66,6 @@ RegisterNetEvent("md-drugs:client:SuccessSale", function(drug)
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
RegisterNetEvent("md-drugs:client:SetUp", function()
|
||||
progressbar("YOU FUCKED NOW", 4000, 'uncuff')
|
||||
SetUpPeds()
|
||||
|
||||
Reference in new issue
Block a user