- fix bug with comparing rep
- fix travellingmerchant
This commit is contained in:
1 parent
ca50437751
commit
a079efd5c8
6 files changed
+26
-20
No files matched your search
@@ -1,19 +1,20 @@
|
||||
|
||||
local function spawn()
|
||||
local location, menus = ps.callback('md-drugs:server:GetMerchant')
|
||||
local data = ps.callback('md-drugs:server:GetMerchant')
|
||||
local model = 's_m_m_trucker_01'
|
||||
ps.requestModel(model)
|
||||
local ped = CreatePed(4, model, location.x, location.y, location.z, location.w, false, true)
|
||||
Freeze(ped, true, location.w)
|
||||
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, {
|
||||
{
|
||||
label = ps.lang('merchant.targetOpen'),
|
||||
action = function()
|
||||
local options = {}
|
||||
for k, v in pairs (menus) do
|
||||
for k, v in pairs (data.items) do
|
||||
options[#options+1] = {
|
||||
title = ps.getLabel(k),
|
||||
description = '$'..v,
|
||||
icon = ps.getImage(k),
|
||||
action = function()
|
||||
ps.triggerServerEvent('md-drugs:server:purchaseGoods', k)
|
||||
end
|
||||
|
||||
+2
-2
@@ -97,7 +97,7 @@ for k, v in pairs(locations.isosafrole) do
|
||||
end
|
||||
|
||||
for k, v in pairs(locations.rawxtcloc) do
|
||||
ps.boxTarget('xtc'..k, v.loc, {length = v.l, width = v.w, heading = v.rot}, {
|
||||
ps.boxTarget('xtcraw'..k, v.loc, {length = v.l, width = v.w, heading = v.rot}, {
|
||||
{
|
||||
icon = 'fa-solid fa-flask',
|
||||
label = ps.lang('xtc.targetRaw'),
|
||||
@@ -157,7 +157,7 @@ for k, v in pairs(locations.xtcpress) do
|
||||
end
|
||||
|
||||
for k, v in pairs (locations.stamp) do
|
||||
ps.boxTarget('xtc'..k, v.loc, {length = v.l, width = v.w, heading = v.rot}, {
|
||||
ps.boxTarget('xtcstamp'..k, v.loc, {length = v.l, width = v.w, heading = v.rot}, {
|
||||
{
|
||||
icon = 'fa-solid fa-flask',
|
||||
label = ps.lang('xtc.targetStamp'),
|
||||
|
||||
+7
-1
@@ -243,6 +243,12 @@ Lang.xtc = {
|
||||
noPills = 'You Dont Have Any Unstamped Pills'
|
||||
}
|
||||
|
||||
|
||||
Lang.merchant = {
|
||||
targetOpen = 'Open Merchant Menu',
|
||||
targetClose = 'Close Merchant Menu',
|
||||
notEnoughMoney = 'You Do Not Have Enough Money',
|
||||
purchased = 'You Purchased %s For $%s',
|
||||
canceled = 'You Canceled The Purchase'
|
||||
}
|
||||
|
||||
return Lang
|
||||
@@ -39,7 +39,7 @@ local stores = {
|
||||
}
|
||||
|
||||
ps.registerCallback('md-drugs:server:GetMerchant', function(source)
|
||||
return loc, stores.travel
|
||||
return {loc = loc, items = stores.travel}
|
||||
end)
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ RegisterServerEvent('md-drugs:server:makepowder', function(num)
|
||||
end
|
||||
local tier = 'tier1'
|
||||
if Config.TierSystem then
|
||||
local coke = getRep(src, 'coke')
|
||||
local coke = tonumber(getRep(src, 'coke'))
|
||||
if coke > Config.Tier1 and coke <= Config.Tier2 then
|
||||
tier = 'tier2'
|
||||
elseif coke > Config.Tier2 then
|
||||
|
||||
+10
-11
@@ -55,8 +55,6 @@ ps.registerCallback('removeCleaningkit', function(source)
|
||||
return false
|
||||
end)
|
||||
|
||||
|
||||
|
||||
RegisterServerEvent('md-drugs:server:dryplant', function(num)
|
||||
local src = source
|
||||
if not ps.checkDistance(src, heroinLocations.dryplant[num].loc, 3.0) then
|
||||
@@ -66,7 +64,7 @@ RegisterServerEvent('md-drugs:server:dryplant', function(num)
|
||||
|
||||
local tier = 'tier1'
|
||||
if Config.TierSystem then
|
||||
local heroin = getRep(src, 'heroin')
|
||||
local heroin = tonumber(getRep(src, 'heroin'))
|
||||
if heroin <= Config.Tier1 then
|
||||
tier = 'tier1'
|
||||
elseif heroin >= Config.Tier1 and heroin <= Config.Tier2 then
|
||||
@@ -153,14 +151,15 @@ ps.createUseable('heroinlabkit', function(source, item)
|
||||
if not ps.hasItem(src, 'heroinlabkit', 1) then return end
|
||||
local placed, loc = ps.callback('md-drugs:client:setheroinlabkit', src)
|
||||
if placed then
|
||||
ps.removeItem(src, 'heroinlabkit', 1)
|
||||
table.insert(heroinLabKits, {
|
||||
src = src,
|
||||
ownerid = ps.getIdentifier(src),
|
||||
coords = loc,
|
||||
name = ps.getPlayerName(src)
|
||||
})
|
||||
ps.notify(src, ps.lang('heroin.placedKit'), "success")
|
||||
if ps.removeItem(src, 'heroinlabkit', 1) then
|
||||
table.insert(heroinLabKits, {
|
||||
src = src,
|
||||
ownerid = ps.getIdentifier(src),
|
||||
coords = loc,
|
||||
name = ps.getPlayerName(src)
|
||||
})
|
||||
ps.notify(src, ps.lang('heroin.placedKit'), "success")
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
Reference in new issue
Block a user