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