big update. i prob broke something, let me know in discord

This commit is contained in:
Mustache Dom authored and GitHub committed 2024-09-24 15:07:41 -07:00
1 parent 009b0a4f4a
commit 028c5f771f
42 files changed
+2042 -3056

No files matched your search

+4 -16
View File
@@ -3,26 +3,15 @@ local QBCore = exports['qb-core']:GetCoreObject()
CreateThread(function()
local current = "g_m_y_famdnf_01"
lib.requestModel(current, Config.RequestModelTime)
local CurrentLocation = Config.Travellingmerchant[math.random(#Config.Travellingmerchant)]
local num = lib.callback.await('md-drugs:server:GetMerchant', false)
local CurrentLocation = Config.Travellingmerchant[num]
local travellingmerchant = CreatePed(0, current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, CurrentLocation.w, false, false)
Freeze(travellingmerchant, true, CurrentLocation.w)
if Config.oxtarget then
local options = {
{ label = "Travelling Merchant", icon = "fas fa-eye", onSelect = function() lib.showContext('travellingmerchant') end},
}
exports.ox_target:addLocalEntity(travellingmerchant, options)
else
exports['qb-target']:AddTargetEntity(travellingmerchant, {
options = {
{ label = "Travelling Merchant", icon = "fas fa-eye", action = function() lib.showContext('travellingmerchant') end},
}
})
end
AddSingleModel(travellingmerchant, { label = "Travelling Merchant", icon = "fas fa-eye", action = function() lib.showContext('travellingmerchant') end}, nil)
end)
CreateThread(function()
local ShopMenu = {}
for k, v in pairs (Config.Items.items) do
ShopMenu[#ShopMenu + 1] = {
icon = GetImage(v.name),
@@ -37,13 +26,12 @@ CreateThread(function()
num = k
}
}
lib.registerContext({id = 'travellingmerchant',title = "Travelling Merchant", options = ShopMenu})
end
end)
RegisterNetEvent("md-drugs:client:travellingmerchantox", function(data) local dialog
RegisterNetEvent("md-drugs:client:travellingmerchantox", function(data)
local price = data.cost
local settext = "Amnt: "..data.amount.." | Cost: "..price or "Cost: "..price
local max = data.amount