updated a lot
This commit is contained in:
1 parent
99d0ae58be
commit
70c3d9ae15
13 files changed
+358
-317
No files matched your search
@@ -2,6 +2,7 @@ local QBCore = exports['qb-core']:GetCoreObject()
|
||||
|
||||
lib.callback.register('md-drugs:server:cornerselling:getAvailableDrugs', function(source, cb)
|
||||
local Player = QBCore.Functions.GetPlayer(source)
|
||||
local rep = getRep(source, 'cornerselling')
|
||||
if not Player then return nil end
|
||||
local type = 0
|
||||
for k, v in pairs(QBConfig.DrugsPrice) do
|
||||
@@ -12,7 +13,8 @@ lib.callback.register('md-drugs:server:cornerselling:getAvailableDrugs', functio
|
||||
local amount = math.random(1,item.amount)
|
||||
if amount >= 15 then amount = 15 end
|
||||
local price = math.random(QBConfig.DrugsPrice[k]['min'], QBConfig.DrugsPrice[k]['max']) * amount
|
||||
return item.name, amount, price
|
||||
local result = math.floor(price * rep.price)
|
||||
return item.name, amount, result
|
||||
end
|
||||
end
|
||||
if type == 0 then
|
||||
@@ -25,6 +27,7 @@ RegisterNetEvent('md-drugs:server:sellCornerDrugs', function(item, amount, price
|
||||
local src = source
|
||||
local Player = QBCore.Functions.GetPlayer(src)
|
||||
if RemoveItem(src, item, amount) then
|
||||
AddRep(src, 'cornerselling', QBConfig.DrugsPrice[item].rep * amount)
|
||||
Log(GetName(src) .. ' Sold ' .. amount .. ' Of ' .. item .. ' For A Price Of ' .. price .. '!' , 'cornerselling')
|
||||
if QBConfig.MarkedBills then
|
||||
if price >= QBConfig.DrugsPrice[item]['min'] * amount and price <= QBConfig.DrugsPrice[item]['max'] * amount then
|
||||
|
||||
Reference in new issue
Block a user