update fix most of the script
This commit is contained in:
1 parent
36131995d4
commit
f06778c345
12 files changed
+287
-303
No files matched your search
+20
-2
@@ -64,8 +64,8 @@ function progressbar(text, time, anim)
|
||||
until cancelled or test
|
||||
if test then return true end
|
||||
else
|
||||
print"^1 SCRIPT ERROR: Md-DRUGS set your progressbar with one of the options!"
|
||||
end
|
||||
print"^1 SCRIPT ERROR: Md-DRUGS set your progressbar with one of the options!"
|
||||
end
|
||||
end
|
||||
|
||||
function loadParticle(dict)
|
||||
@@ -655,6 +655,24 @@ function StartRay2()
|
||||
until run == false
|
||||
end
|
||||
|
||||
function getAmbo()
|
||||
if Config.Framework == 'qb' then
|
||||
local Player = QBCore.Functions.GetPlayerData()
|
||||
if Player.PlayerData.job.type == 'ems' then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
elseif Config.Framework == 'esx' then
|
||||
local Player = ESX.GetPlayerData()
|
||||
if Player.job.name == 'ambulance' then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
CreateThread(function()
|
||||
LoadModel('prop_plant_01b')
|
||||
LoadModel('prop_plant_01a')
|
||||
|
||||
+1
-1
@@ -1,13 +1,13 @@
|
||||
local carryPackage = nil
|
||||
|
||||
RegisterNetEvent("md-drugs:client:GetOxyCar", function()
|
||||
print("oxy")
|
||||
lib.requestModel("burrito3", Config.RequestModelTime)
|
||||
local paid = lib.callback.await('md-drugs:server:payfortruck', false)
|
||||
if not paid then return end
|
||||
local loca = lib.callback.await('md-drugs:server:getLocs', false)
|
||||
local loc = loca.singleSpot.truckspawn
|
||||
local oxycar = CreateVehicle("burrito3",loc.x, loc.y,loc.z, loc.w, true, false)
|
||||
exports[Config.Fuel]:SetFuel(oxycar, 100.0)
|
||||
TriggerEvent("vehiclekeys:client:SetOwner", GetVehicleNumberPlateText(oxycar))
|
||||
Notify(Lang.oxy.truck, 'success')
|
||||
TriggerEvent("md-drugs:client:getoxylocationroute")
|
||||
|
||||
+2
-1
@@ -1,6 +1,6 @@
|
||||
|
||||
lib.callback.register("md-drugs:client:prescriptionpad", function(data, op)
|
||||
if getJobType() ~= 'ems' then return end
|
||||
if not getAmbo() then return end
|
||||
local input = lib.inputDialog('Who To Give A Prescription To?',{
|
||||
{type = 'select', label = 'Player Name', options = data},
|
||||
{type = 'select', label = 'Prescription', options = op}})
|
||||
@@ -18,3 +18,4 @@ lib.callback.register("md-drugs:client:unbottle", function()
|
||||
if not progressbar(Lang.Pharma.open, 4000, 'uncuff') then return end
|
||||
return true
|
||||
end)
|
||||
|
||||
@@ -201,8 +201,8 @@ lib.addCommand("deletedealer", {
|
||||
MySQL.query('DELETE FROM dealers WHERE name = ?', { dealerName })
|
||||
QBConfig.Dealers[dealerName] = nil
|
||||
TriggerClientEvent('md-drugs:client:RefreshDealers', -1, QBConfig.Dealers)
|
||||
TriggerClientEvent('QBCore:Notify', source, "Dealer Deleted", "success")
|
||||
Notifys(source, "Dealer Deleted", "success")
|
||||
else
|
||||
TriggerClientEvent('QBCore:Notify', source, "Who You Tryna Delete", "error")
|
||||
Notifys(source, "Who You Tryna Delete", "error")
|
||||
end
|
||||
end)
|
||||
+47
-2
@@ -74,6 +74,16 @@ function getPlayer(source)
|
||||
end
|
||||
end
|
||||
|
||||
function getPlayerByCid(cid)
|
||||
if Config.Framework == 'qb' then
|
||||
local Player = QBCore.Functions.GetPlayerByCitizenId(cid)
|
||||
return Player
|
||||
elseif Config.Framework == 'esx' then
|
||||
local Player = ESX.GetPlayerFromIdentifier(cid)
|
||||
return Player
|
||||
end
|
||||
end
|
||||
|
||||
function GetName(source)
|
||||
local src = source
|
||||
if Config.Framework == 'qb' then
|
||||
@@ -279,10 +289,16 @@ function removeMoney(source, type, amount)
|
||||
return false
|
||||
end
|
||||
elseif Config.Framework == 'esx' then
|
||||
if type == 'bank' then
|
||||
print('Does Not Support Bank Funds Removing From ESX Defaulted To Cash')
|
||||
end
|
||||
local Player = getPlayer(source)
|
||||
Player.removeMoney(amount)
|
||||
print(Player.removeMoney(amount))
|
||||
if Player.getMoney() >= amount then
|
||||
Player.removeMoney(amount)
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
local function handleFresh(source)
|
||||
@@ -393,6 +409,35 @@ function getCops()
|
||||
return amount
|
||||
end
|
||||
|
||||
function getNear(src)
|
||||
if Config.Framework == 'qb' then
|
||||
local near = {}
|
||||
local players = QBCore.Functions.GetPlayers()
|
||||
for k, v in pairs (players) do
|
||||
local targ = QBCore.Functions.GetPlayerByCitizenId(v.PlayerData.citizenid)
|
||||
local tname = GetName(v.PlayerData.source)
|
||||
local ped, tped = GetPlayerPed(src), GetPlayerPed(v.PlayerData.source)
|
||||
local dist = #(GetEntityCoords(ped) - GetEntityCoords(tped))
|
||||
if dist < 5.0 then
|
||||
table.insert(near, {label = tname, value = targ.PlayerData.citizenid})
|
||||
end
|
||||
end
|
||||
return near
|
||||
elseif Config.Framework == 'esx' then
|
||||
local near = {}
|
||||
local players = ESX.GetPlayers()
|
||||
for k, v in pairs (players) do
|
||||
local targ = ESX.GetPlayerFromId(v)
|
||||
local tname = GetName(v)
|
||||
local ped, tped = GetPlayerPed(src), GetPlayerPed(v)
|
||||
local dist = #(GetEntityCoords(ped) - GetEntityCoords(tped))
|
||||
if dist < 5.0 then
|
||||
table.insert(near, {label = tname, value = getCid(v)})
|
||||
end
|
||||
end
|
||||
return near
|
||||
end
|
||||
end
|
||||
function handleCornersell(source, item, amount, price)
|
||||
if RemoveItem(source, item, amount) then
|
||||
if inventory == 'qb' then
|
||||
|
||||
+52
-68
@@ -83,18 +83,18 @@ RegisterServerEvent('md-drugs:server:cutheroin', function(num)
|
||||
if not checkLoc(source, 'cutheroinone', num) then return end
|
||||
if not Itemcheck(src, 'bakingsoda', 1) then return end
|
||||
if Config.TierSystem then
|
||||
local rawh = Player.Functions.GetItemByName('heroin')
|
||||
local rawh2 = Player.Functions.GetItemByName('heroinstagetwo')
|
||||
local rawh3 = Player.Functions.GetItemByName('heroinstagethree')
|
||||
if rawh then
|
||||
if not GetRecipe(src, 'heroin', 'cutheroin', 'tier1') then return end
|
||||
elseif rawh2 then
|
||||
if not GetRecipe(src, 'heroin', 'cutheroin', 'tier2') then return end
|
||||
elseif rawh3 then
|
||||
if not GetRecipe(src, 'heroin', 'cutheroin', 'tier3') then return end
|
||||
else
|
||||
Notifys(src, Lang.Heroin.noheroin, "error")
|
||||
local heroin = {
|
||||
heroin = 'tier1',
|
||||
heroinstagetwo = 'tier2',
|
||||
heroinstagethree = 'tier3'
|
||||
}
|
||||
for k, v in pairs (heroin) do
|
||||
if hasItem(src, k, 1) then
|
||||
if not GetRecipe(src, 'heroin', 'cutheroin', v) then return end
|
||||
return
|
||||
end
|
||||
end
|
||||
Notifys(src, Lang.Heroin.noheroin, "error")
|
||||
else
|
||||
if not GetRecipe(src, 'heroin', 'cutheroin', 'tier1') then return end
|
||||
end
|
||||
@@ -102,11 +102,9 @@ end)
|
||||
|
||||
RegisterServerEvent('md-drugs:server:getheroinlabkit', function()
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
if not checkLoc(source, 'singleSpot', 'buyheroinlabkit') then return end
|
||||
local has = Player.Functions.GetItemByName('heroinlabkit')
|
||||
if has then Notifys(src, Lang.Heroin.haskit, 'error') return end
|
||||
if Player.Functions.RemoveMoney('cash', prices.heroinlabkitprice) then
|
||||
if not checkLoc(src, 'singleSpot', 'buyheroinlabkit') then return end
|
||||
if hasItem(src, 'heroinlabkit', 1) then Notifys(src, Lang.Heroin.haskit, 'error') return end
|
||||
if removeMoney(src, 'cash', prices.heroinlabkitprice) then
|
||||
AddItem(src, 'heroinlabkit', 1)
|
||||
else
|
||||
Notifys(src, 'You Need '.. prices.heroinlabkitprice .. ' In Cash For This', 'error')
|
||||
@@ -126,7 +124,6 @@ end
|
||||
|
||||
RegisterServerEvent('md-drugs:server:getheroinlabkitback', function()
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
if not hasHKit(src) then return end
|
||||
for k, v in pairs (heroinLabKits) do
|
||||
if v.ownerid == getCid(source) then
|
||||
@@ -139,7 +136,6 @@ end)
|
||||
|
||||
CUI('heroinlabkit', function(source, item)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
if not Itemcheck(source, 'heroinlabkit', 1) then return end
|
||||
local placed, loc = lib.callback.await('md-drugs:client:setheroinlabkit', src)
|
||||
if placed then
|
||||
@@ -156,67 +152,55 @@ end)
|
||||
|
||||
RegisterServerEvent('md-drugs:server:heatliquidheroin', function()
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
if not hasHKit(src) then return end
|
||||
if not Itemcheck(source, 'emptyvial', 1) then return end
|
||||
if Config.TierSystem then
|
||||
local cuth = Player.Functions.GetItemByName('heroincut')
|
||||
local cuth2 = Player.Functions.GetItemByName('heroincutstagetwo')
|
||||
local cuth3 = Player.Functions.GetItemByName('heroincutstagethree')
|
||||
if cuth then
|
||||
if not GetRecipe(src, 'heroin', 'fillvial', 'tier1') then return end
|
||||
elseif cuth2 then
|
||||
if not GetRecipe(src, 'heroin', 'fillvial', 'tier2') then return end
|
||||
elseif cuth3 then
|
||||
if not GetRecipe(src, 'heroin', 'fillvial', 'tier3') then return end
|
||||
else
|
||||
Notifys(src, 'no cut heroin', "error")
|
||||
local heroin = {
|
||||
heroincut = 'tier1',
|
||||
heroincutstagetwo = 'tier2',
|
||||
heroincutstagethree = 'tier3'
|
||||
}
|
||||
for k, v in pairs (heroin) do
|
||||
if hasItem(src, k, 1) then
|
||||
if not GetRecipe(src, 'heroin', 'fillvial', v) then return end
|
||||
return
|
||||
end
|
||||
end
|
||||
Notifys(src, 'no cut heroin', "error")
|
||||
else
|
||||
if not GetRecipe(src, 'heroin', 'fillvial', 'tier1') then return end
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterServerEvent('md-drugs:server:failheatingheroin', function()
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
if not hasHKit(src) then return end
|
||||
local cuth = Player.Functions.GetItemByName('heroincut')
|
||||
local cuth2 = Player.Functions.GetItemByName('heroincutstagetwo')
|
||||
local cuth3 = Player.Functions.GetItemByName('heroincutstagethree')
|
||||
if cuth then
|
||||
RemoveItem(src, 'heroincut', 1)
|
||||
Notifys(src,Lang.Heroin.fail, "error")
|
||||
elseif cuth2 then
|
||||
RemoveItem(src, 'heroincutstagetwo', 1)
|
||||
Notifys(src,Lang.Heroin.fail, "error")
|
||||
elseif cuth3 then
|
||||
RemoveItem(src, 'heroincutstagethree', 1)
|
||||
Notifys(src,Lang.Heroin.fail, "error")
|
||||
local src = source
|
||||
if not hasHKit(src) then return end
|
||||
local heroin = {'heroincut', 'heroincutstagetwo', 'heroincutstagethree'}
|
||||
for k, v in pairs (heroin) do
|
||||
if hasItem(src, v, 1) then
|
||||
RemoveItem(src, v, 1)
|
||||
Notifys(src, Lang.Heroin.fail, "error")
|
||||
return
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterServerEvent('md-drugs:server:fillneedle', function(num)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
if not checkLoc(source, 'fillneedle', num) then return end
|
||||
if not Itemcheck(src, 'needle', 1) then return end
|
||||
if Config.TierSystem then
|
||||
local heroin = getRep(src, 'heroin')
|
||||
local vh = Player.Functions.GetItemByName('heroinvial')
|
||||
local vh2 = Player.Functions.GetItemByName('heroinvialstagetwo')
|
||||
local vh3 = Player.Functions.GetItemByName('heroinvialstagethree')
|
||||
if vh then
|
||||
if not GetRecipe(src, 'heroin', 'fillneedle', 'tier1') then return end
|
||||
AddRep(src, 'heroin')
|
||||
elseif vh2 then
|
||||
if not GetRecipe(src, 'heroin', 'fillneedle', 'tier2') then return end
|
||||
AddRep(src, 'heroin')
|
||||
elseif vh3 then
|
||||
if not GetRecipe(src, 'heroin', 'fillneedle', 'tier3') then return end
|
||||
AddRep(src, 'heroin')
|
||||
else
|
||||
Notifys(src,Lang.Heroin.nofill, "error")
|
||||
local vials = {
|
||||
heroinvial = 'tier1',
|
||||
heroinvialstagetwo = 'tier2',
|
||||
heroinvialstagethree = 'tier3'
|
||||
}
|
||||
for k, v in pairs (vials) do
|
||||
if hasItem(src, k, 1) then
|
||||
if not GetRecipe(src, 'heroin', 'fillneedle', v) then return end
|
||||
AddRep(src, 'heroin')
|
||||
return
|
||||
end
|
||||
end
|
||||
else
|
||||
if not GetRecipe(src, 'heroin', 'fillneedle', 'tier1') then return end
|
||||
@@ -225,15 +209,15 @@ end)
|
||||
|
||||
RegisterServerEvent('md-drugs:server:failheroin', function()
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
Log(GetName(src) ..' Sucks And Burned Their Heroin', 'heroin')
|
||||
if Config.TierSystem then
|
||||
local vh = Player.Functions.GetItemByName('heroinvial')
|
||||
local vh2 = Player.Functions.GetItemByName('heroinvialstagetwo')
|
||||
local vh3 = Player.Functions.GetItemByName('heroinvialstagethree')
|
||||
if vh then RemoveItem(src, 'heroinvialstagethree', 1 )
|
||||
elseif vh2 then RemoveItem(src, 'heroinvialstagetwo', 1)
|
||||
elseif vh3 then RemoveItem(src, 'heroinvial', 1)
|
||||
local heroin = {'heroinvial', 'heroinvialstagetwo', 'heroinvialstagethree'}
|
||||
for k, v in pairs (heroin) do
|
||||
if hasItem(src, v, 1) then
|
||||
RemoveItem(src, v, 1)
|
||||
Notifys(src, Lang.Heroin.fail, "error")
|
||||
return
|
||||
end
|
||||
end
|
||||
else
|
||||
RemoveItem(src, 'heroinvial', 1)
|
||||
|
||||
+20
-28
@@ -22,13 +22,12 @@ end)
|
||||
|
||||
CUI('lsdlabkit', function(source, item)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
local placed, loc = lib.callback.await('md-drugs:client:setlsdlabkit', src)
|
||||
if placed then
|
||||
if RemoveItem(src, 'lsdlabkit', 1) then
|
||||
table.insert(lsdTables, {
|
||||
owner = GetName(src),
|
||||
ownerid = getCid(source),
|
||||
ownerid = getCid(src),
|
||||
src = src,
|
||||
loc = loc
|
||||
})
|
||||
@@ -37,8 +36,6 @@ CUI('lsdlabkit', function(source, item)
|
||||
end)
|
||||
|
||||
local function hasLabKit(source)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
for k, v in pairs (lsdTables) do
|
||||
if v.ownerid == getCid(source) then
|
||||
return true
|
||||
@@ -56,7 +53,6 @@ end)
|
||||
|
||||
RegisterServerEvent('md-drugs:server:getlabkitback', function()
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
for k, v in pairs (lsdTables) do
|
||||
if v.ownerid == getCid(source) then
|
||||
table.remove(lsdTables, k)
|
||||
@@ -104,19 +100,21 @@ if not Itemcheck(src, 'lsd_one_vial', 1) then return end
|
||||
end
|
||||
else
|
||||
local randomchance = math.random(1,100)
|
||||
if RemoveItem(src,'lsd_one_vial', 1) then
|
||||
if randomchance <= 60 then
|
||||
AddItem(src,'lsd_vial_two', 1)
|
||||
elseif randomchance >= 61 and randomchance <= 75 then
|
||||
AddItem(src,'lsd_vial_three', 1)
|
||||
elseif randomchance >= 76 and randomchance <= 85 then
|
||||
AddItem(src,'lsd_vial_four', 1)
|
||||
elseif randomchance >= 86 and randomchance <= 93 then
|
||||
AddItem(src,'lsd_vial_five', 1)
|
||||
else
|
||||
AddItem(src,'lsd_vial_six', 1)
|
||||
local items = {
|
||||
{chance = 60, item = 'lsd_vial_two'},
|
||||
{chance = 75, item = 'lsd_vial_three'},
|
||||
{chance = 85, item = 'lsd_vial_four'},
|
||||
{chance = 93, item = 'lsd_vial_five'},
|
||||
{chance = 100, item = 'lsd_vial_six'}
|
||||
}
|
||||
if RemoveItem(src, 'lsd_one_vial', 1) then
|
||||
for k, v in ipairs(items) do
|
||||
if randomchance <= v.chance then
|
||||
AddItem(src, v.item, 1)
|
||||
break
|
||||
end
|
||||
end
|
||||
Log(GetName(src) ..' Refined Acid!', 'lsd')
|
||||
Log(GetName(src) .. ' Refined Acid!', 'lsd')
|
||||
end
|
||||
end
|
||||
end)
|
||||
@@ -125,26 +123,24 @@ RegisterServerEvent('md-drugs:server:failrefinequality', function()
|
||||
local src = source
|
||||
if not hasLabKit(src) then return end
|
||||
if not Itemcheck(src, 'lsd_one_vial', 1) then return end
|
||||
RemoveItem(src,'lsd_one_vial', 1)
|
||||
RemoveItem(src,'lsd_one_vial', 1)
|
||||
end)
|
||||
|
||||
|
||||
RegisterServerEvent('md-drugs:server:gettabpaper', function(num)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
if not checkLoc(src, 'gettabs', num) then return end
|
||||
if Player.Functions.RemoveMoney('cash', prices.tabcost * 10) then
|
||||
if removeMoney(src, 'cash', prices.tabcost * 10) then
|
||||
AddItem(src,'tab_paper', 10)
|
||||
else
|
||||
Notifys(Lang.lsd.broke, "error")
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
RegisterServerEvent('md-drugs:server:getlabkit', function()
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
if not checkLoc(src,'singleSpot', 'buylsdlabkit') then return end
|
||||
if Player.Functions.RemoveMoney('cash', prices.lsdlabkitcost) then
|
||||
if removeMoney(src,'cash', prices.lsdlabkitcost) then
|
||||
AddItem(src,'lsdlabkit', 1)
|
||||
else
|
||||
Notifys(src, Lang.lsd.broke, "error")
|
||||
@@ -169,9 +165,7 @@ RegisterServerEvent('md-drugs:server:maketabpaper', function()
|
||||
sortTab(vialdata, 'vial')
|
||||
for k, v in pairs (vialdata) do
|
||||
if count >= 1 then break end
|
||||
local check = Player.Functions.GetItemByName(v.vial)
|
||||
|
||||
if check and check.amount >= 1 then
|
||||
if hasItem(src, v.vial, 1) then
|
||||
items = v.vial
|
||||
recieve = v.sheet
|
||||
count = count + 1
|
||||
@@ -197,7 +191,6 @@ local sheets = {
|
||||
for k, v in pairs (sheets) do
|
||||
CUI(v.item, function(source)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
local math = math.random(1,10)
|
||||
if RemoveItem(src, v.item, 1) then
|
||||
AddItem(src, v.recieve, math)
|
||||
@@ -208,7 +201,6 @@ end
|
||||
|
||||
AddEventHandler('playerDropped', function()
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
for k, v in pairs (lsdTables) do
|
||||
if v.ownerid == getCid(source) then
|
||||
table.remove(lsdTables, k)
|
||||
|
||||
+3
-6
@@ -6,8 +6,7 @@ local prices = {
|
||||
}
|
||||
lib.callback.register('md-drugs:server:payfortruck', function()
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
if Player.Functions.RemoveMoney('cash', prices.payfortruck) or Player.Functions.RemoveMoney('bank', prices.payfortruck) then
|
||||
if removeMoney(src, 'cash', prices.payfortruck) or removeMoney(src, 'bank', prices.payfortruck) then
|
||||
Log(GetName(src) .. ' Rented A Van For OxyRuns', 'oxy')
|
||||
return true
|
||||
else
|
||||
@@ -19,7 +18,6 @@ end)
|
||||
|
||||
RegisterServerEvent('md-drugs:server:giveoxybox', function()
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
local chance = math.random(1,100)
|
||||
local cash = 200
|
||||
local itemchance = math.random(1,100)
|
||||
@@ -30,10 +28,10 @@ RegisterServerEvent('md-drugs:server:giveoxybox', function()
|
||||
local item = itemList[math.random(1, #itemList)]
|
||||
if chance <= prices.hotchance then
|
||||
Notifys(src, Lang.oxy.hot, "error")
|
||||
Player.Functions.AddMoney("cash", cash * 0.5)
|
||||
addMoney(src, "cash", cash * 0.5)
|
||||
if itemchance <= prices.itemChance then
|
||||
AddItem(src, item.item, item.amount)
|
||||
end
|
||||
end
|
||||
else
|
||||
Notifys(Lang.oxy.next, "success")
|
||||
TriggerClientEvent("md-drugs:client:getoxylocationroute", src)
|
||||
@@ -42,6 +40,5 @@ RegisterServerEvent('md-drugs:server:giveoxybox', function()
|
||||
AddItem(src, item.item, item.amount)
|
||||
end
|
||||
end
|
||||
|
||||
end)
|
||||
|
||||
+43
-43
@@ -1,35 +1,37 @@
|
||||
|
||||
local function GetJob(source)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
if Player.PlayerData.job.type == 'ems' then
|
||||
return true
|
||||
else
|
||||
Notifys(src, 'You Must Be EMS To Do This', 'error')
|
||||
return false
|
||||
local function getAmbo(source)
|
||||
if Config.Framework == 'qbcore' then
|
||||
local Player = QBCore.Functions.GetPlayer(source)
|
||||
if Player.PlayerData.job.type == 'ems' then
|
||||
return true
|
||||
end
|
||||
elseif Config.Framework == 'esx' then
|
||||
local Player = ESX.GetPlayerFromId(source)
|
||||
if Player.job.name == 'ambulance' then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function getSource(player)
|
||||
if Config.Framework == 'qbcore' then
|
||||
return player.PlayerData.source
|
||||
elseif Config.Framework == 'esx' then
|
||||
return player.source
|
||||
end
|
||||
end
|
||||
|
||||
CUI('prescription_pad', function(source, item)
|
||||
local src = source
|
||||
local near = {}
|
||||
if GetJob(src) then
|
||||
for k, v in pairs (QBCore.Functions.GetQBPlayers()) do
|
||||
local targ = QBCore.Functions.GetPlayerByCitizenId(v.PlayerData.citizenid)
|
||||
local tname = GetName(v.PlayerData.source)
|
||||
local ped, tped = GetPlayerPed(src), GetPlayerPed(v.PlayerData.source)
|
||||
local dist = #(GetEntityCoords(ped) - GetEntityCoords(tped))
|
||||
if dist < 5.0 then
|
||||
table.insert(near, {label = tname, value = targ.PlayerData.citizenid})
|
||||
end
|
||||
end
|
||||
if getAmbo(src) then
|
||||
local near = getNear(src)
|
||||
local options = { {label = 'Vicodin', value = 'vicodin_prescription'}, {label = 'Adderal', value = 'adderal_prescription'}, {label = 'Morphine', value = 'morphine_prescription'},{label = 'Xanax', value = 'xanax_prescription'}}
|
||||
local data = lib.callback.await('md-drugs:client:prescriptionpad', src, near, options)
|
||||
if type(data) == 'table' then
|
||||
local give = QBCore.Functions.GetPlayerByCitizenId(data.who)
|
||||
local give = getPlayerByCid(data.who)
|
||||
for i = 1, #options do
|
||||
if data.what == options[i].value then
|
||||
AddItem(give.PlayerData.source, data.what, 1)
|
||||
AddItem(getSource(give), data.what, 1)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -38,36 +40,34 @@ end)
|
||||
|
||||
local pharmabottle = {'vicodinbottle', 'adderalbottle','morphinebottle','xanaxbottle'}
|
||||
for m, d in pairs (pharmabottle) do
|
||||
CUI(d, function(source, item)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
local check = lib.callback.await("md-drugs:client:unbottle", src)
|
||||
if check then
|
||||
local get = {
|
||||
['vicodinbottle'] = 'vicodin',
|
||||
['adderalbottle'] = 'adderal',
|
||||
['morphinebottle'] = 'morphine',
|
||||
['xanaxbottle'] = 'xanax'
|
||||
}
|
||||
for k, v in pairs (get) do
|
||||
if d == k then
|
||||
RemoveItem(src, d, 1)
|
||||
AddItem(src, v, math.random(10,30))
|
||||
Notifys(src,Lang.Pharma.unbottle, "success")
|
||||
Log(GetName(src) .. ' Unbottled 30 Of ' .. v .. '!', 'pharma')
|
||||
CUI(d, function(source, item)
|
||||
local src = source
|
||||
local check = lib.callback.await("md-drugs:client:unbottle", src)
|
||||
if check then
|
||||
local get = {
|
||||
['vicodinbottle'] = 'vicodin',
|
||||
['adderalbottle'] = 'adderal',
|
||||
['morphinebottle'] = 'morphine',
|
||||
['xanaxbottle'] = 'xanax'
|
||||
}
|
||||
for k, v in pairs (get) do
|
||||
if d == k then
|
||||
RemoveItem(src, d, 1)
|
||||
AddItem(src, v, math.random(10,30))
|
||||
Notifys(src,Lang.Pharma.unbottle, "success")
|
||||
Log(GetName(src) .. ' Unbottled 30 Of ' .. v .. '!', 'pharma')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
RegisterServerEvent('md-drugs:server:fillprescription', function()
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
local pres = {vicodin_prescription = 'vicodinbottle', adderal_prescription = 'adderalbottle', morphine_prescription = 'morphinebottle', xanax_prescription = 'xanaxbottle'}
|
||||
for k, v in pairs (pres) do
|
||||
if Player.Functions.GetItemByName(k) then
|
||||
RemoveItem(src, k, 1 )
|
||||
if hasItem(src, k, 1) then
|
||||
RemoveItem(src, k, 1 )
|
||||
AddItem(src,v, 1)
|
||||
break
|
||||
end
|
||||
|
||||
+2
-12
@@ -67,7 +67,6 @@ end)
|
||||
|
||||
RegisterServerEvent('md-drugs:server:dryoutweed', function()
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
if RemoveItem(src,"wetcannabis", 1) then
|
||||
AddItem(src,"drycannabis", 1)
|
||||
Log(GetName(source) .. ' Dried Weed', 'weed')
|
||||
@@ -90,24 +89,18 @@ end
|
||||
|
||||
RegisterServerEvent('md-drugs:server:MakeWeedItems', function(data)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
if not Player then return end
|
||||
if not GetRecipe(src, data.recipe, data.table, data.item) then return end
|
||||
end)
|
||||
|
||||
RegisterServerEvent('md-drugs:server:makeoil', function(data)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
if not Player then return end
|
||||
if not GetRecipe(src, 'weed', 'oil', 'shatter') then return end
|
||||
end)
|
||||
|
||||
|
||||
CUI("dabrig", function(source, item)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
|
||||
if Player.Functions.GetItemByName("butanetorch") then
|
||||
if hasItem(src,"butanetorch",1) then
|
||||
if RemoveItem(src, "shatter", 1) then
|
||||
TriggerClientEvent("md-drugs:client:dodabs", src)
|
||||
end
|
||||
@@ -118,9 +111,7 @@ end)
|
||||
|
||||
CUI("weedgrinder", function(source, item)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
local has = Player.Functions.GetItemByName("drycannabis")
|
||||
if not has then Notifys(src, 'You Need Dried Cannabis', 'error') return end
|
||||
if not hasItem(src, 'drycannabis',1) then Notifys(src, 'You Need Dried Cannabis', 'error') return end
|
||||
local check = lib.callback.await('md-drugs:client:uncuff', src, 'Grinding Weed')
|
||||
if not check then return end
|
||||
if RemoveItem(src, "drycannabis",1 ) then
|
||||
@@ -130,7 +121,6 @@ end)
|
||||
|
||||
CUI("mdwoods", function(source, item)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
local check = lib.callback.await('md-drugs:client:uncuff', src, 'Breaking Blunt Open')
|
||||
if not check then return end
|
||||
if RemoveItem(src, "mdwoods",1 ) then
|
||||
|
||||
@@ -18,10 +18,9 @@ local Price = {
|
||||
for k, v in pairs (burners) do
|
||||
CUI(k, function(source, item)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
if getCops() < Config.PoliceCount then return Notifys(src, Lang.Wholesale.na, 'error') end
|
||||
for m, d in pairs (active) do
|
||||
if d.cid == GetCid(source) then
|
||||
if d.cid == getCid(source) then
|
||||
return Notifys(src, Lang.Wholesale.al, 'error' )
|
||||
end
|
||||
end
|
||||
@@ -36,12 +35,12 @@ for k, v in pairs (burners) do
|
||||
src = src,
|
||||
item = k,
|
||||
location = getRandW(src),
|
||||
cid = GetCid(source),
|
||||
cid = getCid(source),
|
||||
type = v,
|
||||
price = Price[tab]
|
||||
})
|
||||
for m, d in pairs (active) do
|
||||
if d.cid == GetCid(source) then
|
||||
if d.cid == getCid(source) then
|
||||
TriggerClientEvent("md-drugs:client:GetLocation", src, active[m])
|
||||
end
|
||||
end
|
||||
@@ -53,13 +52,13 @@ RegisterNetEvent('md-drugs:server:SuccessSale', function(data)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
for k, v in pairs (active) do
|
||||
if v.cid == GetCid(source) then
|
||||
if v.cid == getCid(source) then
|
||||
local payout = math.random(v.price.min, v.price.max)
|
||||
for m, d in pairs (v.type) do
|
||||
local git = Player.Functions.GetItemByName(d)
|
||||
if git and git.amount >= 1 then
|
||||
RemoveItem(src, d, git.amount)
|
||||
Player.Functions.AddMoney('cash', git.amount * payout)
|
||||
addMoney(src, 'cash', git.amount * payout)
|
||||
end
|
||||
table.remove(active, k)
|
||||
end
|
||||
|
||||
+90
-132
@@ -4,16 +4,14 @@ local activePresses = {}
|
||||
RegisterServerEvent('md-drugs:server:stealisosafrole', function(num)
|
||||
local src = source
|
||||
if not checkLoc(src, 'isosafrole',num) then return end
|
||||
if AddItem(src, "isosafrole", 1) then
|
||||
|
||||
if AddItem(src, "isosafrole", 1) then
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterServerEvent('md-drugs:server:stealmdp2p', function(num)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
if not checkLoc(src, 'mdp2p',num) then return end
|
||||
if AddItem(src,"mdp2p", 1) then
|
||||
if AddItem(src,"mdp2p", 1) then
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -34,7 +32,7 @@ local check, loc = lib.callback.await('md-drugs:client:setpress', src, v.data)
|
||||
press = v.data,
|
||||
get = v.item,
|
||||
owner = GetName(src),
|
||||
ownerid = GetCid(source),
|
||||
ownerid = getCid(source),
|
||||
src = src,
|
||||
loc = loc
|
||||
})
|
||||
@@ -47,7 +45,7 @@ RegisterServerEvent('md-drugs:server:getpressback', function(type)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
for k, v in pairs (activePresses) do
|
||||
if v.ownerid == GetCid(source) then
|
||||
if v.ownerid == getCid(source) then
|
||||
if v.press == type then
|
||||
table.remove(activePresses, k)
|
||||
AddItem(src, v.get, 1)
|
||||
@@ -62,7 +60,7 @@ local function pressout(source)
|
||||
local ped = GetPlayerPed(src)
|
||||
local coords = GetEntityCoords(ped)
|
||||
for k, v in pairs (activePresses) do
|
||||
if v.ownerid == GetCid(source) then
|
||||
if v.ownerid == getCid(source) then
|
||||
if #(coords - v.loc) < 3.0 then
|
||||
return v.press
|
||||
end
|
||||
@@ -72,51 +70,26 @@ local function pressout(source)
|
||||
end
|
||||
|
||||
RegisterServerEvent('md-drugs:server:makextc', function(data)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
if not Itemcheck(src, 'raw_xtc', 1) then return end
|
||||
if pressout(src) == 'none' then return end
|
||||
if pressout(src) == 'single' then
|
||||
if data.color == 'white' then
|
||||
if not GetRecipe(src, 'xtc', 'singlestack', 'white') then return end
|
||||
elseif data.color == 'red' then
|
||||
if not GetRecipe(src, 'xtc', 'singlestack', 'red') then return end
|
||||
elseif data.color == 'orange' then
|
||||
if not GetRecipe(src, 'xtc', 'singlestack', 'orange') then return end
|
||||
elseif data.color == 'blue' then
|
||||
if not GetRecipe(src, 'xtc', 'singlestack', 'blue') then return end
|
||||
end
|
||||
elseif pressout(src) == 'dual' then
|
||||
if data.color == 'white' then
|
||||
if not GetRecipe(src, 'xtc', 'dualstack', 'white') then return end
|
||||
elseif data.color == 'red' then
|
||||
if not GetRecipe(src, 'xtc', 'dualstack', 'red') then return end
|
||||
elseif data.color == 'orange' then
|
||||
if not GetRecipe(src, 'xtc', 'dualstack', 'orange') then return end
|
||||
elseif data.color == 'blue' then
|
||||
if not GetRecipe(src, 'xtc', 'dualstack', 'blue') then return end
|
||||
end
|
||||
elseif pressout(src) == 'triple' then
|
||||
if data.color == 'white' then
|
||||
if not GetRecipe(src, 'xtc', 'triplestack', 'white') then return end
|
||||
elseif data.color == 'red' then
|
||||
if not GetRecipe(src, 'xtc', 'triplestack', 'red') then return end
|
||||
elseif data.color == 'orange' then
|
||||
if not GetRecipe(src, 'xtc', 'triplestack', 'orange') then return end
|
||||
elseif data.color == 'blue' then
|
||||
if not GetRecipe(src, 'xtc', 'triplestack', 'blue') then return end
|
||||
end
|
||||
elseif pressout(src) == 'quad' then
|
||||
if data.color == 'white' then
|
||||
if not GetRecipe(src, 'xtc', 'quadstack', 'white') then return end
|
||||
elseif data.color == 'red' then
|
||||
if not GetRecipe(src, 'xtc', 'quadstack', 'red') then return end
|
||||
elseif data.color == 'orange' then
|
||||
if not GetRecipe(src, 'xtc', 'quadstack', 'orange') then return end
|
||||
elseif data.color == 'blue' then
|
||||
if not GetRecipe(src, 'xtc', 'quadstack', 'blue') then return end
|
||||
end
|
||||
end
|
||||
local src = source
|
||||
if not Itemcheck(src, 'raw_xtc', 1) then return end
|
||||
|
||||
local pressType = pressout(src)
|
||||
if pressType == 'none' then return end
|
||||
|
||||
local validColors = {'white', 'red', 'orange', 'blue'}
|
||||
local isValidColor = false
|
||||
|
||||
for _, color in ipairs(validColors) do
|
||||
if data.color == color then
|
||||
isValidColor = true
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if not isValidColor then return end
|
||||
|
||||
local stackType = pressType .. 'stack'
|
||||
if not GetRecipe(src, 'xtc', stackType, data.color) then return end
|
||||
end)
|
||||
|
||||
RegisterServerEvent('md-drugs:server:buypress', function()
|
||||
@@ -133,117 +106,102 @@ RegisterServerEvent('md-drugs:server:buypress', function()
|
||||
|
||||
RegisterServerEvent('md-drugs:server:upgradepress', function(data)
|
||||
local src = source
|
||||
if data == 'dual' then
|
||||
if not GetRecipe(src, 'xtc', 'press', 'dual') then return end
|
||||
elseif data == 'triple' then
|
||||
if not GetRecipe(src, 'xtc', 'press', 'triple') then return end
|
||||
elseif data == 'quad' then
|
||||
if not GetRecipe(src, 'xtc', 'press', 'quad') then return end
|
||||
else
|
||||
Notifys(src, 'huh', 'error')
|
||||
end
|
||||
if not GetRecipe(src, 'xtc', 'press', data) then return end
|
||||
end)
|
||||
|
||||
------------- making powder
|
||||
RegisterServerEvent('md-drugs:server:makingrawxtc', function(num)
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
if not checkLoc(src, 'rawxtcloc',num) then return end
|
||||
if not GetRecipe(src, 'xtc', 'raw', 'raw_xtc') then return end
|
||||
end)
|
||||
|
||||
RegisterServerEvent('md-drugs:server:stampwhite', function(num)
|
||||
local src = source
|
||||
local one = {'white_playboys', 'white_aliens', 'white_pl', 'white_trolls', 'white_cats'}
|
||||
local chance = math.random(#one)
|
||||
local two = {'white_playboys2', 'white_aliens2', 'white_pl2', 'white_trolls2', 'white_cats2'}
|
||||
local three = {'white_playboys3', 'white_aliens3', 'white_pl3', 'white_trolls3', 'white_cats3'}
|
||||
local four = {'white_playboys4', 'white_aliens4', 'white_pl4', 'white_trolls4', 'white_cats4'}
|
||||
if not checkLoc(src, 'stamp', num) then return end
|
||||
local whitePills = {
|
||||
{item = 'white_xtc', stamped = {'white_playboys', 'white_aliens', 'white_pl', 'white_trolls', 'white_cats'}},
|
||||
{item = 'white_xtc2', stamped = {'white_playboys2', 'white_aliens2', 'white_pl2', 'white_trolls2', 'white_cats2'}},
|
||||
{item = 'white_xtc3', stamped = {'white_playboys3', 'white_aliens3', 'white_pl3', 'white_trolls3', 'white_cats3'}},
|
||||
{item = 'white_xtc4', stamped = {'white_playboys4', 'white_aliens4', 'white_pl4', 'white_trolls4', 'white_cats4'}}
|
||||
}
|
||||
local chance = math.random(1, 5)
|
||||
|
||||
if RemoveItem(src, "white_xtc", 1) then
|
||||
AddItem(src, one[chance], 1)
|
||||
elseif RemoveItem(src, "white_xtc2", 1) then
|
||||
AddItem(src, two[chance], 1)
|
||||
elseif RemoveItem(src, "white_xtc3", 1) then
|
||||
AddItem(src, three[chance], 1)
|
||||
elseif RemoveItem(src, "white_xtc4", 1) then
|
||||
AddItem(src, four[chance], 1)
|
||||
else
|
||||
Notifys('You Dont Have Unstamped White Pills', 'error')
|
||||
end
|
||||
if not checkLoc(src, 'stamp', num) then return end
|
||||
for k, v in ipairs(whitePills) do
|
||||
if RemoveItem(src, v.item, 1) then
|
||||
AddItem(src, v.stamped[chance], 1)
|
||||
return
|
||||
end
|
||||
end
|
||||
Notifys('You Dont Have Unstamped White Pills', 'error')
|
||||
end)
|
||||
|
||||
RegisterServerEvent('md-drugs:server:stampred', function(num)
|
||||
local src = source
|
||||
local one = {'red_playboys', 'red_aliens', 'red_pl', 'red_trolls', 'red_cats'}
|
||||
local chance = math.random(#one)
|
||||
local two = {'red_playboys2', 'red_aliens2', 'red_pl2', 'red_trolls2', 'red_cats2'}
|
||||
local three = {'red_playboys3', 'red_aliens3', 'red_pl3', 'red_trolls3', 'red_cats3'}
|
||||
local four = {'red_playboys4', 'red_aliens4', 'red_pl4', 'red_trolls4', 'red_cats4'}
|
||||
if not checkLoc(src, 'stamp', num) then return end
|
||||
|
||||
if RemoveItem(src, "red_xtc", 1) then
|
||||
AddItem(src, one[chance], 1)
|
||||
elseif RemoveItem(src, "red_xtc2", 1) then
|
||||
AddItem(src, two[chance], 1)
|
||||
elseif RemoveItem(src, "red_xtc3", 1) then
|
||||
AddItem(src, three[chance], 1)
|
||||
elseif RemoveItem(src, "red_xtc4", 1) then
|
||||
AddItem(src, four[chance], 1)
|
||||
else
|
||||
Notifys('You Dont Have Unstamped red Pills', 'error')
|
||||
end
|
||||
local redPills = {
|
||||
{item = 'red_xtc', stamped = {'red_playboys', 'red_aliens', 'red_pl', 'red_trolls', 'red_cats'}},
|
||||
{item = 'red_xtc2', stamped = {'red_playboys2', 'red_aliens2', 'red_pl2', 'red_trolls2', 'red_cats2'}},
|
||||
{item = 'red_xtc3', stamped = {'red_playboys3', 'red_aliens3', 'red_pl3', 'red_trolls3', 'red_cats3'}},
|
||||
{item = 'red_xtc4', stamped = {'red_playboys4', 'red_aliens4', 'red_pl4', 'red_trolls4', 'red_cats4'}}
|
||||
}
|
||||
local chance = math.random(1, 5)
|
||||
|
||||
if not checkLoc(src, 'stamp', num) then return end
|
||||
for k, v in ipairs(redPills) do
|
||||
if RemoveItem(src, v.item, 1) then
|
||||
AddItem(src, v.stamped[chance], 1)
|
||||
return
|
||||
end
|
||||
end
|
||||
Notifys('You Dont Have Unstamped Red Pills', 'error')
|
||||
end)
|
||||
|
||||
RegisterServerEvent('md-drugs:server:stamporange', function(num)
|
||||
local src = source
|
||||
local one = {'orange_playboys', 'orange_aliens', 'orange_pl', 'orange_trolls', 'orange_cats'}
|
||||
local two = {'orange_playboys2', 'orange_aliens2', 'orange_pl2', 'orange_trolls2', 'orange_cats2'}
|
||||
local three = {'orange_playboys3', 'orange_aliens3', 'orange_pl3', 'orange_trolls3', 'orange_cats3'}
|
||||
local four = {'orange_playboys4', 'orange_aliens4', 'orange_pl4', 'orange_trolls4', 'orange_cats4'}
|
||||
local chance = math.random(#one)
|
||||
if not checkLoc(src, 'stamp', num) then return end
|
||||
|
||||
if RemoveItem(src, "orange_xtc", 1) then
|
||||
AddItem(src, one[chance], 1)
|
||||
elseif RemoveItem(src, "orange_xtc2", 1) then
|
||||
AddItem(src, two[chance], 1)
|
||||
elseif RemoveItem(src, "orange_xtc3", 1) then
|
||||
AddItem(src, three[chance], 1)
|
||||
elseif RemoveItem(src, "orange_xtc4", 1) then
|
||||
AddItem(src, four[chance], 1)
|
||||
else
|
||||
Notifys('You Dont Have Unstamped orange Pills', 'error')
|
||||
end
|
||||
local orangePills = {
|
||||
{item = 'orange_xtc', stamped = {'orange_playboys', 'orange_aliens', 'orange_pl', 'orange_trolls', 'orange_cats'}},
|
||||
{item = 'orange_xtc2', stamped = {'orange_playboys2', 'orange_aliens2', 'orange_pl2', 'orange_trolls2', 'orange_cats2'}},
|
||||
{item = 'orange_xtc3', stamped = {'orange_playboys3', 'orange_aliens3', 'orange_pl3', 'orange_trolls3', 'orange_cats3'}},
|
||||
{item = 'orange_xtc4', stamped = {'orange_playboys4', 'orange_aliens4', 'orange_pl4', 'orange_trolls4', 'orange_cats4'}}
|
||||
}
|
||||
local chance = math.random(1, 5)
|
||||
|
||||
if not checkLoc(src, 'stamp', num) then return end
|
||||
for k, v in ipairs(orangePills) do
|
||||
if RemoveItem(src, v.item, 1) then
|
||||
AddItem(src, v.stamped[chance], 1)
|
||||
return
|
||||
end
|
||||
end
|
||||
Notifys('You Dont Have Unstamped Orange Pills', 'error')
|
||||
end)
|
||||
|
||||
RegisterServerEvent('md-drugs:server:stampblue', function(num)
|
||||
local src = source
|
||||
local one = {'blue_playboys', 'blue_aliens', 'blue_pl', 'blue_trolls', 'blue_cats'}
|
||||
local chance = math.random(#one)
|
||||
local two = {'blue_playboys2', 'blue_aliens2', 'blue_pl2', 'blue_trolls2', 'blue_cats2'}
|
||||
local three = {'blue_playboys3', 'blue_aliens3', 'blue_pl3', 'blue_trolls3', 'blue_cats3'}
|
||||
local four = {'blue_playboys4', 'blue_aliens4', 'blue_pl4', 'blue_trolls4', 'blue_cats4'}
|
||||
|
||||
local bluePills = {
|
||||
{item = 'blue_xtc', stamped = {'blue_playboys', 'blue_aliens', 'blue_pl', 'blue_trolls', 'blue_cats'}},
|
||||
{item = 'blue_xtc2', stamped = {'blue_playboys2', 'blue_aliens2', 'blue_pl2', 'blue_trolls2', 'blue_cats2'}},
|
||||
{item = 'blue_xtc3', stamped = {'blue_playboys3', 'blue_aliens3', 'blue_pl3', 'blue_trolls3', 'blue_cats3'}},
|
||||
{item = 'blue_xtc4', stamped = {'blue_playboys4', 'blue_aliens4', 'blue_pl4', 'blue_trolls4', 'blue_cats4'}}
|
||||
}
|
||||
local chance = math.random(1, 5)
|
||||
|
||||
if not checkLoc(src, 'stamp', num) then return end
|
||||
if RemoveItem(src, "blue_xtc", 1) then
|
||||
AddItem(src, one[chance], 1)
|
||||
elseif RemoveItem(src, "blue_xtc2", 1) then
|
||||
AddItem(src, two[chance], 1)
|
||||
elseif RemoveItem(src, "blue_xtc3", 1) then
|
||||
AddItem(src, three[chance], 1)
|
||||
elseif RemoveItem(src, "blue_xtc4", 1) then
|
||||
AddItem(src, four[chance], 1)
|
||||
else
|
||||
Notifys('You Dont Have Unstamped blue Pills', 'error')
|
||||
end
|
||||
for k, v in ipairs(bluePills) do
|
||||
if RemoveItem(src, v.item, 1) then
|
||||
AddItem(src, v.stamped[chance], 1)
|
||||
return
|
||||
end
|
||||
end
|
||||
Notifys('You Dont Have Unstamped Blue Pills', 'error')
|
||||
end)
|
||||
|
||||
AddEventHandler('playerDropped', function()
|
||||
local src = source
|
||||
local Player = getPlayer(src)
|
||||
for k, v in pairs (activePresses) do
|
||||
if v.ownerid == GetCid(source) then
|
||||
if v.ownerid == getCid(source) then
|
||||
table.remove(activePresses, k)
|
||||
AddItem(src, v.get, 1)
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user