Add files via upload
This commit is contained in:
1 parent
7d9d4a030d
commit
f9709311af
20 files changed
+1701
-3894
No files matched your search
@@ -2,82 +2,45 @@ local QBCore = exports['qb-core']:GetCoreObject()
|
||||
|
||||
CreateThread(function()
|
||||
local current = "g_m_y_famdnf_01"
|
||||
lib.requestModel(current, Config.requestModelTime)
|
||||
lib.requestModel(current, Config.RequestModelTime)
|
||||
local CurrentLocation = Config.Travellingmerchant[math.random(#Config.Travellingmerchant)]
|
||||
travellingmerchant = CreatePed(0, current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, CurrentLocation.h, false, false)
|
||||
local travellingmerchant = CreatePed(0, current,CurrentLocation.x,CurrentLocation.y,CurrentLocation.z-1, CurrentLocation.w, false, false)
|
||||
FreezeEntityPosition(travellingmerchant, true)
|
||||
SetEntityInvincible(travellingmerchant, true)
|
||||
if Config.OxInv then
|
||||
if Config.oxtarget then
|
||||
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
|
||||
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
|
||||
if Config.oxtarget then
|
||||
options = {
|
||||
{
|
||||
label = "Travelling Merchant",
|
||||
icon = "fas fa-eye",
|
||||
onSelect = function()
|
||||
TriggerServerEvent("inventory:server:OpenInventory", "shop", "travelling merchant", Config.Items)
|
||||
end,
|
||||
},
|
||||
}
|
||||
exports.ox_target:addLocalEntity(travellingmerchant, options)
|
||||
else
|
||||
exports['qb-target']:AddTargetEntity(travellingmerchant, {
|
||||
exports['qb-target']:AddTargetEntity(travellingmerchant, {
|
||||
options = {
|
||||
{
|
||||
label = "Travelling Merchant",
|
||||
icon = "fas fa-eye",
|
||||
action = function()
|
||||
TriggerServerEvent("inventory:server:OpenInventory", "shop", "travelling merchant", Config.Items)
|
||||
end,
|
||||
},
|
||||
}
|
||||
})
|
||||
end
|
||||
{ label = "Travelling Merchant", icon = "fas fa-eye", action = function() lib.showContext('travellingmerchant') end},
|
||||
}
|
||||
})
|
||||
end
|
||||
end)
|
||||
|
||||
CreateThread(function()
|
||||
local ShopMenu = {}
|
||||
local ShopMenu = {}
|
||||
|
||||
for k, v in pairs (Config.Items.items) do
|
||||
ShopMenu[#ShopMenu + 1] = {
|
||||
icon = "nui://"..Config.imagelink..QBCore.Shared.Items[v.name].image,
|
||||
header = v.label,
|
||||
title = v.label,
|
||||
event = "md-drugs:client:travellingmerchantox",
|
||||
args = {
|
||||
item = v.name,
|
||||
cost = v.price,
|
||||
amount = v.amount,
|
||||
}
|
||||
for k, v in pairs (Config.Items.items) do
|
||||
ShopMenu[#ShopMenu + 1] = {
|
||||
icon = "nui://"..Config.imagelink..QBCore.Shared.Items[v.name].image,
|
||||
description = '$'.. v.price,
|
||||
title = QBCore.Shared.Items[v.name].label,
|
||||
event = "md-drugs:client:travellingmerchantox",
|
||||
args = {
|
||||
item = v.name,
|
||||
cost = v.price,
|
||||
amount = v.amount,
|
||||
table = Config.Items.items,
|
||||
num = k
|
||||
}
|
||||
|
||||
lib.registerContext({id = 'travellingmerchant',title = "Travelling Merchant", options = ShopMenu})
|
||||
end
|
||||
}
|
||||
|
||||
lib.registerContext({id = 'travellingmerchant',title = "Travelling Merchant", options = ShopMenu})
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
@@ -95,5 +58,5 @@ RegisterNetEvent("md-drugs:client:travellingmerchantox", function(data) local di
|
||||
{ type = 'number', label = "Amount to buy", description = settext, min = 0, max = max, default = 1 },
|
||||
})
|
||||
if data.cost == "Free" then data.cost = 0 end
|
||||
TriggerServerEvent("md-drugs:server:travellingmerchantox", dialog[2], dialog[1], data.item, data.cost )
|
||||
TriggerServerEvent("md-drugs:server:travellingmerchantox", dialog[2], dialog[1], data.item, data.cost, data.table, data.num )
|
||||
end)
|
||||
Reference in new issue
Block a user