- 80%
This commit is contained in:
1 parent
ebc47ba5d7
commit
66934fd68a
16 files changed
+169
-124
No files matched your search
@@ -1,26 +1,31 @@
|
||||
|
||||
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 = 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),
|
||||
icon = itemInfo.image,
|
||||
action = 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
|
||||
}
|
||||
})
|
||||
|
||||
@@ -141,7 +141,7 @@ 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()
|
||||
@@ -185,7 +185,7 @@ 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()
|
||||
@@ -227,7 +227,7 @@ function StartRay2()
|
||||
end
|
||||
|
||||
ps.registerCallback('md-drugs:client:uncuff', function(data)
|
||||
if not ps.progressbar(data, 4000, 'uncuff') then return end
|
||||
if not progressbar(data, 4000, 'uncuff') then return end
|
||||
return true
|
||||
end)
|
||||
|
||||
|
||||
+6
-6
@@ -11,9 +11,9 @@ local function SpawnCarPedChase()
|
||||
started = true
|
||||
|
||||
ps.callback('md-drugs:server:RegisterLean')
|
||||
ps.requestModel("pounder", 30000)
|
||||
ps.requestModel("ig_priest", 30000)
|
||||
ps.requestModel("cargobob3", 30000)
|
||||
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)
|
||||
local driver = CreatePed(26, "ig_priest", start.x, start.y, start.z, 268.9422, false, false)
|
||||
@@ -35,7 +35,7 @@ local function SpawnCarPedChase()
|
||||
RemoveBlip(leancar)
|
||||
|
||||
if GetEntityHealth(driver) == 0 then
|
||||
ps.entityTarget(leancar, {
|
||||
Bridge.Target.AddLocalEntity(leancar, {
|
||||
{
|
||||
name = 'leancar',
|
||||
icon = 'fa-solid fa-car',
|
||||
@@ -63,10 +63,10 @@ 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 = Bridge.Language.Locale('lean.startMission'),
|
||||
|
||||
+21
-22
@@ -1,18 +1,19 @@
|
||||
local carryPackage = nil
|
||||
local onMission = false
|
||||
local locations = ps.callback('md-drugs:server:GetOxyLocs')
|
||||
local locations = GlobalState.MDDrugsLocations.Oxy
|
||||
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
|
||||
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', 30000)
|
||||
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
|
||||
@@ -23,13 +24,13 @@ local function getRoute()
|
||||
until #(GetEntityCoords(PlayerPedId()) - vector3(Route.x,Route.y,Route.z)) < 5.0 or timeOut == 0
|
||||
|
||||
PoliceCall(pdAlert)
|
||||
ps.entityTarget(oxybuyer,{
|
||||
Bridge.Target.AddLocalEntity(oxybuyer,{
|
||||
{
|
||||
label = Bridge.Language.Locale('oxy.targetHandoff'),
|
||||
icon = "fa-solid fa-dollar-sign",
|
||||
action = function()
|
||||
if carryPackage then
|
||||
if not ps.progressbar(Bridge.Language.Locale('oxy.handingoff'), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('oxy.handingoff'), 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:giveoxybox")
|
||||
DeleteEntity(oxybuyer)
|
||||
DetachEntity(carryPackage, true, true)
|
||||
@@ -45,28 +46,24 @@ local function getRoute()
|
||||
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, vector3(v.l, v.w, 2.0), v.loc.w or 180.0, {
|
||||
{
|
||||
icon = 'fa-solid fa-truck-fast',
|
||||
label = Bridge.Language.Locale('oxy.targetPay'),
|
||||
action = function()
|
||||
ps.requestModel("burrito3", 30000)
|
||||
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))
|
||||
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 = Bridge.Language.Locale('oxy.targetGetPackage'),
|
||||
@@ -75,9 +72,9 @@ for k, v in pairs(locations.OxyPayForTruck) do
|
||||
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
|
||||
@@ -87,6 +84,8 @@ for k, v in pairs(locations.OxyPayForTruck) do
|
||||
end
|
||||
}
|
||||
})
|
||||
Wait(1000)
|
||||
getRoute()
|
||||
end,
|
||||
canInteract = function()
|
||||
if onMission then
|
||||
|
||||
+7
-7
@@ -1,4 +1,4 @@
|
||||
local locations = ps.callback('md-drugs:server:GetPharmaLocs')
|
||||
local locations = GlobalState.MDDrugsLocations.Pharma
|
||||
|
||||
Bridge.Callback.Register("md-drugs:client:prescriptionpad", function(data, op)
|
||||
local job = ps.getPlayerData().job.name
|
||||
@@ -6,28 +6,28 @@ Bridge.Callback.Register("md-drugs:client:prescriptionpad", function(data, op)
|
||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('pharma.notPharma'), 'error')
|
||||
return
|
||||
end
|
||||
local input = ps.input(Bridge.Language.Locale('pharma.input.header'), {
|
||||
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(Bridge.Language.Locale('pharma.write'), 4000, 'notepad') then return end
|
||||
if not progressbar(Bridge.Language.Locale('pharma.write'), 4000, 'notepad') then return end
|
||||
return {who = input[1], what = input[2]}
|
||||
end)
|
||||
|
||||
ps.registerCallback("md-drugs:client:unbottle", function()
|
||||
if not ps.progressbar(Bridge.Language.Locale('pharma.opening'), 4000, 'uncuff') then return end
|
||||
Bridge.Callback.Register("md-drugs:client:unbottle", function()
|
||||
if not progressbar(Bridge.Language.Locale('pharma.opening'), 4000, 'uncuff') 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,vector3(v.l, v.w, 1.0), v.loc.w or 180, {
|
||||
{
|
||||
icon = 'fa-solid fa-capsules',
|
||||
label = Bridge.Language.Locale('pharma.targetFill'),
|
||||
action = function()
|
||||
if not ps.progressbar(Bridge.Language.Locale('pharma.fill'), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('pharma.fill'), 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("md-drugs:server:fillprescription", k)
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
local DrugPlants = {
|
||||
{model = 'prop_plant_01a', label = 'coke', langs = Bridge.Language.Locale('coke.targetPick'), tbl = GlobalState.CocaPlant, plantTbl = {},
|
||||
pick = function(loc)
|
||||
if not ps.progressbar(Bridge.Language.Locale('coke.picking'), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('coke.picking'), 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("coke:pickupCane", loc)
|
||||
return true
|
||||
end,
|
||||
@@ -10,7 +10,7 @@ local DrugPlants = {
|
||||
},
|
||||
{model = 'prop_plant_01b', label = 'heroin',langs = Bridge.Language.Locale('heroin.targetPick'), tbl = GlobalState.PoppyPlants, plantTbl = {},
|
||||
pick = function(loc)
|
||||
if not ps.progressbar(Bridge.Language.Locale('heroin.picking'), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('heroin.picking'), 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("heroin:pickupCane", loc)
|
||||
return true
|
||||
end,
|
||||
@@ -18,7 +18,7 @@ local DrugPlants = {
|
||||
},
|
||||
{model = 'prop_cactus_03', label = 'Mescaline', langs = Bridge.Language.Locale('mesc.targetPick'), tbl = GlobalState.Mescaline, plantTbl = {},
|
||||
pick = function(loc)
|
||||
if not ps.progressbar(Bridge.Language.Locale('mesc.picking'), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('mesc.picking'), 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("Mescaline:pickupCane", loc)
|
||||
return true
|
||||
end,
|
||||
@@ -27,7 +27,7 @@ local DrugPlants = {
|
||||
},
|
||||
{model = 'prop_weed_01', label = 'weed', langs = Bridge.Language.Locale('weed.targetPick'), tbl = GlobalState.WeedPlant, plantTbl = {},
|
||||
pick = function(loc)
|
||||
if not ps.progressbar(Bridge.Language.Locale('weed.picking'), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('weed.picking'), 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("weed:pickupCane", loc)
|
||||
return true
|
||||
end,
|
||||
@@ -35,7 +35,7 @@ local DrugPlants = {
|
||||
},
|
||||
{model = 'mushroom', label = 'shrooms', langs = Bridge.Language.Locale('shrooms.targetPick'), tbl = GlobalState.shrooms, plantTbl = {},
|
||||
pick = function(loc)
|
||||
if not ps.progressbar(Bridge.Language.Locale('shrooms.picking'), 4000, 'uncuff') then return end
|
||||
if not progressbar(Bridge.Language.Locale('shrooms.picking'), 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("shrooms:pickupCane", loc)
|
||||
return true
|
||||
end,
|
||||
@@ -49,10 +49,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,
|
||||
@@ -76,7 +76,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,
|
||||
|
||||
+2
-2
@@ -16,8 +16,8 @@ local function EcstasyEffect()
|
||||
startStamina = 0
|
||||
end
|
||||
|
||||
ps.registerCallback("md-drugs:client:shrooms", function()
|
||||
if not ps.progressbar(Bridge.Language.Locale('shrooms.eat'), 5000, 'eat') then return end
|
||||
Bridge.Callback.Register("md-drugs:client:shrooms", function()
|
||||
if not progressbar(Bridge.Language.Locale('shrooms.eat'), 5000, 'eat') then return end
|
||||
CreateThread(function()
|
||||
EcstasyEffect()
|
||||
end)
|
||||
|
||||
+5
-5
@@ -18,7 +18,7 @@ for k, v in pairs (locations.WeedDry) do
|
||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('weed.wait'), "success")
|
||||
Wait(math.random(1000,5000))
|
||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('weed.take'), "success")
|
||||
ps.entityTarget(weedplant, {
|
||||
Bridge.Target.AddLocalEntity(weedplant, {
|
||||
{
|
||||
icon = "fa-solid fa-cannabis",
|
||||
label = Bridge.Language.Locale('weed.targetDryed'),
|
||||
@@ -118,12 +118,12 @@ RegisterNetEvent('md-drugs:client:rollBlunt', function(data)
|
||||
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 = Bridge.Language.Locale('weed.targetSales'),
|
||||
@@ -154,7 +154,7 @@ local props = {}
|
||||
|
||||
for locationKey, locationData in pairs (locations.MakeButter) do
|
||||
if locationData.prop then
|
||||
ps.requestModel(locationData.prop)
|
||||
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)
|
||||
@@ -162,7 +162,7 @@ for locationKey, locationData in pairs (locations.MakeButter) do
|
||||
end
|
||||
for locationKey, locationData in pairs (locations.MakeOil) do
|
||||
if locationData.prop then
|
||||
ps.requestModel(locationData.prop)
|
||||
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)
|
||||
|
||||
+3
-3
@@ -2,7 +2,7 @@ local prop = nil
|
||||
local function animation(color)
|
||||
local coords = GetEntityCoords(PlayerPedId())
|
||||
ps.requestAnim('mp_player_intdrink')
|
||||
ps.requestModel(color)
|
||||
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)
|
||||
@@ -40,12 +40,12 @@ end)
|
||||
local function spawnShops()
|
||||
local locations = ps.callback('md-drugs:server:getWhippitLocations')
|
||||
for k, v in pairs(locations) do
|
||||
ps.requestModel(v.ped)
|
||||
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)
|
||||
--ps.entityTarget(ped, {
|
||||
--Bridge.Target.AddLocalEntity(ped, {
|
||||
-- {
|
||||
-- label = Bridge.Language.Locale('Whippit.targetShop'),
|
||||
-- icon = 'fa-solid fa-cart-shopping',
|
||||
|
||||
@@ -33,7 +33,7 @@ function SetUpPeds(drugCount)
|
||||
local y = playerCoords.y + math.sin(math.rad(angle)) * 15
|
||||
local z = playerCoords.z
|
||||
local modelHash = GetHashKey(models[math.random(1, #models)])
|
||||
ps.requestModel(modelHash)
|
||||
requestModel(modelHash)
|
||||
local ped = CreatePed(4, modelHash, x, y, z, 0.0, true, false)
|
||||
local weapon = weaponTier[math.random(1, #weaponTier)]
|
||||
SetPedRelationshipGroupHash(ped, GetHashKey("HATES_PLAYER"))
|
||||
@@ -94,12 +94,12 @@ RegisterNetEvent("md-drugs:client:GetLocation", function(drug)
|
||||
elseif drug.count <= 0 then
|
||||
Bridge.Notify.SendNotify(Bridge.Language.Locale('wholesale.no_drugs'), 'error')
|
||||
end
|
||||
ps.requestModel("g_m_y_famdnf_01", settings.RequestModelTime)
|
||||
requestModel("g_m_y_famdnf_01", settings.RequestModelTime)
|
||||
local current = "g_m_y_famdnf_01"
|
||||
local drugdealer = CreatePed(0, current,loc.x,loc.y,loc.z-1, 90.0, false, false)
|
||||
FreezeEntityPosition(drugdealer, true)
|
||||
SetEntityInvincible(drugdealer, true)
|
||||
ps.entityTarget(drugdealer, {{
|
||||
Bridge.Target.AddLocalEntity(drugdealer, {{
|
||||
label = Bridge.Language.Locale('wholesale.targetBuyer'),
|
||||
icon = "fas fa-eye",
|
||||
action = function()
|
||||
|
||||
+3
-3
@@ -59,7 +59,7 @@ ps.registerCallback('md-drugs:client:setpress', function(xtcData)
|
||||
end
|
||||
},
|
||||
}
|
||||
ps.entityTarget(press, options)
|
||||
Bridge.Target.AddLocalEntity(press, options)
|
||||
return coords
|
||||
end)
|
||||
|
||||
@@ -114,10 +114,10 @@ for k, v in pairs(locations.rawxtcloc) do
|
||||
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 = Bridge.Language.Locale('xtc.getPress'),
|
||||
|
||||
@@ -38,7 +38,7 @@ local stores = {
|
||||
},
|
||||
}
|
||||
|
||||
ps.registerCallback('md-drugs:server:GetMerchant', function(source)
|
||||
Bridge.Callback.Register('md-drugs:server:GetMerchant', function(source)
|
||||
return {loc = loc, items = stores.travel}
|
||||
end)
|
||||
|
||||
@@ -46,7 +46,7 @@ end)
|
||||
|
||||
RegisterServerEvent("md-drugs:server:purchaseGoods", function(item)
|
||||
local src = source
|
||||
if not ps.checkDistance(src, loc, 10) then
|
||||
if not checkDistance(src, loc, 10) then
|
||||
Bridge.Notify.SendNotify(src, Bridge.Language.Locale('Catches.notIn'), "error")
|
||||
return
|
||||
end
|
||||
@@ -54,8 +54,8 @@ RegisterServerEvent("md-drugs:server:purchaseGoods", function(item)
|
||||
Bridge.Notify.SendNotify(src, Bridge.Language.Locale('Catches.invalidItem'), "error")
|
||||
return
|
||||
end
|
||||
if ps.removeMoney(src, 'cash', stores.travel[item]) then
|
||||
ps.addItem(src, item, 1)
|
||||
if Bridge.Framework.RemoveAccountBalance(src, 'cash', stores.travel[item]) then
|
||||
Bridge.Inventory.AddItem(src, item, 1)
|
||||
else
|
||||
Bridge.Notify.SendNotify(src, Bridge.Language.Locale('Catches.notEnoughMoney'), "error")
|
||||
end
|
||||
|
||||
+45
-21
@@ -1,11 +1,12 @@
|
||||
Locations = Locations or {}
|
||||
local prices = {
|
||||
payfortruck = 500,
|
||||
hotchance = 30,
|
||||
itemChance = 20,
|
||||
}
|
||||
local onRoute = {}
|
||||
|
||||
local oxyLocs = {
|
||||
local vehicles = {}
|
||||
Locations.Oxy = {
|
||||
OxyPayForTruck = {
|
||||
{loc = vector3(1437.64, -1491.91, 63.62), truckSpawn = vector4(1450.87, -1482.13, 63.22, 69.95), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
|
||||
},
|
||||
@@ -24,21 +25,25 @@ local oxyLocs = {
|
||||
vector4(474.88, 2609.56, 44.48, 357.0),
|
||||
}
|
||||
}
|
||||
GlobalState.MDDrugsLocations = Locations
|
||||
|
||||
ps.registerCallback('md-drugs:server:GetOxyLocs', function(source)
|
||||
return oxyLocs
|
||||
end)
|
||||
|
||||
ps.registerCallback('md-drugs:server:payfortruck', function(source)
|
||||
Bridge.Callback.Register('md-drugs:server:payfortruck', function(source, loc)
|
||||
local src = source
|
||||
if ps.removeMoney(src, 'cash', prices.payfortruck) or ps.removeMoney(src, 'bank', prices.payfortruck) then
|
||||
onRoute[src] = true
|
||||
Bridge.Notify.SendNotify(src, Bridge.Language.Locale('oxy.paid', prices.payfortruck), "success")
|
||||
return true
|
||||
else
|
||||
Bridge.Notify.SendNotify(src, Bridge.Language.Locale('Catches.notEnoughMoney'), "error")
|
||||
if timeOut(src, 'md-drugs:server:payfortruck') then return false end
|
||||
if not checkDistance(src, Locations.Oxy.OxyPayForTruck[loc].loc, 2.0) then
|
||||
Bridge.Prints.Warn(src, Bridge.Language.Locale('Catches.notIn'), "error")
|
||||
return false
|
||||
end
|
||||
if not Bridge.Framework.RemoveAccountBalance(src, 'cash', prices.payfortruck) then
|
||||
Bridge.Notify.SendNotify(src, Bridge.Language.Locale('oxy.notEnoughCash'), "error")
|
||||
return false
|
||||
end
|
||||
onRoute[src] = {
|
||||
amount = math.random(1, #Locations.Oxy.oxylocations),
|
||||
current = 0
|
||||
}
|
||||
return true
|
||||
end)
|
||||
|
||||
|
||||
@@ -50,11 +55,22 @@ RegisterServerEvent('md-drugs:server:giveoxybox', function()
|
||||
return
|
||||
end
|
||||
|
||||
if not ps.checkDistance(src, oxyLocs.oxylocations[onRoute[src]], 3.5) then
|
||||
if not checkDistance(src, Locations.Oxy.oxylocations[onRoute[src].current], 3.5) then
|
||||
Bridge.Notify.SendNotify(src, Bridge.Language.Locale('Catches.notIn'), "error")
|
||||
return
|
||||
end
|
||||
|
||||
local vehicles = vehicles[src]
|
||||
if not vehicles or GetEntityModel(vehicles) ~= GetHashKey("burrito3") then
|
||||
Bridge.Notify.SendNotify(src, Bridge.Language.Locale('oxy.notInVeh'), "error")
|
||||
return
|
||||
end
|
||||
|
||||
if #(GetEntityCoords(vehicles) - GetEntityCoords(GetPlayerPed(src))) > 35.0 then
|
||||
Bridge.Notify.SendNotify(src, Bridge.Language.Locale('oxy.notNearVeh'), "error")
|
||||
return
|
||||
end
|
||||
|
||||
local cash = math.random(50, 200)
|
||||
local itemchance = math.random(1,100)
|
||||
local itemList = {
|
||||
@@ -62,21 +78,29 @@ RegisterServerEvent('md-drugs:server:giveoxybox', function()
|
||||
{item = 'houselockpick', amount = 1},
|
||||
}
|
||||
local item = itemList[math.random(1, #itemList)]
|
||||
ps.addMoney(src,"cash", cash)
|
||||
Bridge.Framework.AddAccountBalance(src, 'cash', cash)
|
||||
if itemchance <= prices.itemChance then
|
||||
ps.addItem(src, item.item, item.amount)
|
||||
Bridge.Framework.AddItem(src, item.item, item.amount)
|
||||
end
|
||||
end)
|
||||
|
||||
ps.registerCallback('md-drugs:server:getRoute', function(source)
|
||||
Bridge.Callback.Register('md-drugs:server:getRoute', function(source)
|
||||
if not onRoute[source] then return false end
|
||||
local giveLocation = math.random(1, 10)
|
||||
if giveLocation >= 8 then
|
||||
if onRoute[source].amount == 0 then
|
||||
onRoute[source] = nil
|
||||
vehicles[source] = nil
|
||||
return false
|
||||
else
|
||||
onRoute[source] = math.random(1, #oxyLocs.oxylocations)
|
||||
return oxyLocs.oxylocations[onRoute[source]]
|
||||
end
|
||||
onRoute[source].current = math.random(1, #Locations.Oxy.oxylocations)
|
||||
onRoute[source].amount = onRoute[source].amount - 1
|
||||
return onRoute[source].current
|
||||
end)
|
||||
|
||||
RegisterNetEvent('md-drugs:server:startOxyRun', function(netId)
|
||||
local src = source
|
||||
if not onRoute[src] then return end
|
||||
local veh = NetworkGetEntityFromNetworkId(netId)
|
||||
if not veh or GetEntityModel(veh) ~= GetHashKey("burrito3") then return end
|
||||
vehicles[src] = veh
|
||||
|
||||
end)
|
||||
+39
-22
@@ -1,40 +1,56 @@
|
||||
local pharmaLocations = {
|
||||
Locations = Locations or {}
|
||||
|
||||
Locations.Pharma = {
|
||||
FillPrescription = { -- where to fill out your prescription
|
||||
{loc = vector3(2855.62, 4446.73, 48.53), l = 1.0, w = 1.0, rot = 45.0, gang = ""},
|
||||
},
|
||||
}
|
||||
|
||||
ps.registerCallback('md-drugs:server:GetPharmaLocs', function()
|
||||
return pharmaLocations
|
||||
end)
|
||||
GlobalState.MDDrugsLocations = Locations
|
||||
|
||||
local function GetJob(source)
|
||||
local src = source
|
||||
return ps.getJobType(src) == 'ems'
|
||||
local jobName = Bridge.Framework.GetPlayerJob(src)
|
||||
return jobName == 'ambulance'
|
||||
end
|
||||
|
||||
ps.createUseable('prescription_pad', function(source, item)
|
||||
local function getNearby(src, distance)
|
||||
local players = Bridge.Framework.GetPlayers()
|
||||
local nearPlayers = {}
|
||||
for index, sources in pairs(players) do
|
||||
--if sources ~= src then
|
||||
local target = GetEntityCoords(GetPlayerPed(sources))
|
||||
local you = GetEntityCoords(GetPlayerPed(src))
|
||||
local distanceBetween = #(you - target)
|
||||
if distanceBetween <= distance then
|
||||
table.insert(nearPlayers, {label = Bridge.Framework.GetPlayerName(sources), value = sources})
|
||||
end
|
||||
--end
|
||||
end
|
||||
return nearPlayers
|
||||
end
|
||||
|
||||
Bridge.Framework.RegisterUsableItem('prescription_pad', function(source, item)
|
||||
local src = source
|
||||
local near = {}
|
||||
if GetJob(src) then
|
||||
near = ps.getNearbyPlayers(src, 5.0)
|
||||
near = getNearby(src, 5.0)
|
||||
local options = {
|
||||
{label = ps.getItemLabel('vicodin_prescription'), value = 'vicodin_prescription'},
|
||||
{label = ps.getItemLabel('adderal_prescription'), value = 'adderal_prescription'},
|
||||
{label = ps.getItemLabel('morphine_prescription'), value = 'morphine_prescription'},
|
||||
{label = ps.getItemLabel('xanax_prescription'), value = 'xanax_prescription'}
|
||||
{label = Bridge.Inventory.GetItemInfo('vicodin_prescription').label, value = 'vicodin_prescription'},
|
||||
{label = Bridge.Inventory.GetItemInfo('adderal_prescription').label, value = 'adderal_prescription'},
|
||||
{label = Bridge.Inventory.GetItemInfo('morphine_prescription').label, value = 'morphine_prescription'},
|
||||
{label = Bridge.Inventory.GetItemInfo('xanax_prescription').label, value = 'xanax_prescription'}
|
||||
}
|
||||
local data = ps.callback('md-drugs:client:prescriptionpad', src, near, options)
|
||||
local data = Bridge.Callback.Trigger('md-drugs:client:prescriptionpad', src, near, options)
|
||||
if not data then return Bridge.Notify.SendNotify(src, Bridge.Language.Locale('pharma.canceled'), "error") end
|
||||
ps.addItem(ps.getSource(data.who), data.what, 1)
|
||||
Bridge.Framework.AddItem(data.who, data.what, 1)
|
||||
end
|
||||
end)
|
||||
|
||||
local pharmabottle = {'vicodinbottle', 'adderalbottle','morphinebottle','xanaxbottle'}
|
||||
for m, d in pairs (pharmabottle) do
|
||||
ps.createUseable(d, function(source, item)
|
||||
Bridge.Framework.RegisterUsableItem(d, function(source, item)
|
||||
local src = source
|
||||
local check = ps.callback("md-drugs:client:unbottle", src)
|
||||
local check = Bridge.Callback.Trigger("md-drugs:client:unbottle", src)
|
||||
if check then
|
||||
local get = {
|
||||
['vicodinbottle'] = 'vicodin',
|
||||
@@ -44,8 +60,8 @@ for m, d in pairs (pharmabottle) do
|
||||
}
|
||||
for k, v in pairs (get) do
|
||||
if d == k then
|
||||
if ps.removeItem(src, d, 1) then
|
||||
ps.addItem(src, v, math.random(10,30))
|
||||
if Bridge.Framework.RemoveItem(src, d, 1) then
|
||||
Bridge.Framework.AddItem(src, v, math.random(10,30))
|
||||
Bridge.Notify.SendNotify(src,Bridge.Language.Locale('pharma.unbottle'), "success")
|
||||
end
|
||||
end
|
||||
@@ -56,8 +72,9 @@ end
|
||||
|
||||
RegisterServerEvent('md-drugs:server:fillprescription', function(num)
|
||||
local src = source
|
||||
|
||||
if timeOut(src, 'md-drugs:server:fillprescription') then return end
|
||||
if not ps.checkDistance(src, pharmaLocations.FillPrescription[num].loc, 3.5) then
|
||||
if not checkDistance(src, Locations.Pharma.FillPrescription[num].loc, 3.5) then
|
||||
return Bridge.Notify.SendNotify(src, Bridge.Language.Locale('Catches.notIn'), "error")
|
||||
end
|
||||
local pres = {
|
||||
@@ -67,9 +84,9 @@ RegisterServerEvent('md-drugs:server:fillprescription', function(num)
|
||||
xanax_prescription = 'xanaxbottle'
|
||||
}
|
||||
for k, v in pairs (pres) do
|
||||
if ps.hasItem(src, k, 1) then
|
||||
ps.removeItem(src, k, 1)
|
||||
ps.addItem(src, v, 1)
|
||||
if Bridge.Framework.HasItem(src, k, 1) then
|
||||
Bridge.Framework.RemoveItem(src, k, 1)
|
||||
Bridge.Framework.AddItem(src, v, 1)
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
@@ -123,7 +123,7 @@ local plantData = {
|
||||
GlobalState.CocaPlant = plants.cocaine
|
||||
end,
|
||||
itemGive = function(src)
|
||||
ps.addItem(src, 'coca_leaf', 1)
|
||||
Bridge.Inventory.AddItem(src, 'coca_leaf', 1)
|
||||
end,
|
||||
coolDown = function(loc)
|
||||
CreateThread(function()
|
||||
@@ -142,7 +142,7 @@ local plantData = {
|
||||
GlobalState.PoppyPlants = plants.heroin
|
||||
end,
|
||||
itemGive = function(src)
|
||||
ps.addItem(src, 'poppyresin', 1)
|
||||
Bridge.Inventory.AddItem(src, 'poppyresin', 1)
|
||||
end,
|
||||
coolDown = function(loc)
|
||||
CreateThread(function()
|
||||
@@ -161,7 +161,7 @@ local plantData = {
|
||||
GlobalState.Mescaline = plants.mescaline
|
||||
end,
|
||||
itemGive = function(src)
|
||||
ps.addItem(src, 'cactusbulb', 1)
|
||||
Bridge.Inventory.AddItem(src, 'cactusbulb', 1)
|
||||
end,
|
||||
coolDown = function(loc)
|
||||
CreateThread(function()
|
||||
@@ -180,7 +180,7 @@ local plantData = {
|
||||
GlobalState.shrooms = plants.shrooms
|
||||
end,
|
||||
itemGive = function(src)
|
||||
ps.addItem(src, 'shrooms', 1)
|
||||
Bridge.Inventory.AddItem(src, 'shrooms', 1)
|
||||
end,
|
||||
coolDown = function(loc)
|
||||
CreateThread(function()
|
||||
@@ -199,7 +199,7 @@ local plantData = {
|
||||
GlobalState.WeedPlant = plants.weed
|
||||
end,
|
||||
itemGive = function(src)
|
||||
ps.addItem(src, 'wetcannabis', 1)
|
||||
Bridge.Inventory.AddItem(src, 'wetcannabis', 1)
|
||||
end,
|
||||
coolDown = function(loc)
|
||||
CreateThread(function()
|
||||
@@ -219,7 +219,7 @@ for k, v in pairs (plantData) do
|
||||
RegisterNetEvent(v.label ..":pickupCane", function(loc)
|
||||
local src = source
|
||||
if timeOut(src, v.label .. ":pickupCane") then return end
|
||||
if ps.checkDistance(src, v.plants[loc].location, 5.0) then
|
||||
if checkDistance(src, v.plants[loc].location, 5.0) then
|
||||
if not v.plants[loc].taken then
|
||||
v.plants[loc].taken = true
|
||||
v.globalState()
|
||||
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
|
||||
ps.createUseable('shrooms', function(source, item)
|
||||
Bridge.Framework.RegisterUsableItem('shrooms', function(source, item)
|
||||
local src = source
|
||||
if not ps.callback("md-drugs:client:shrooms", src) then
|
||||
if not Bridge.Callback.Trigger("md-drugs:client:shrooms", src) then
|
||||
Bridge.Notify.SendNotify(src, Bridge.Language.Locale('shrooms.cancel'), "error")
|
||||
return
|
||||
end
|
||||
ps.removeItem(src, 'shrooms', 1)
|
||||
Bridge.Inventory.RemoveItem(src, 'shrooms', 1)
|
||||
Bridge.Notify.SendNotify(src, Bridge.Language.Locale('shrooms.took'), 'success')
|
||||
end)
|
||||
|
||||
Reference in new issue
Block a user