make sure to Register or Create the shop you want to use in a server side script here is an example for the qb-inventory:
local farmeritems = {
{ name = 'water_can', amount = 500, price = 15 },
{ name = 'fertilizer', amount = 500, price = 20 },
{ name = 'plant_pot', amount = 500, price = 5 },
{ name = 'empty_weed_bag', amount = 500, price = 1 },
{ name = 'soil_bag', amount = 500, price = 15 },
{ name = 'lighter', amount = 10, price = 10 },
}
exports['qb-inventory']:CreateShop({
name = 'farmer',
label = 'Farmer Store',
slots = #farmeritems,
items = farmeritems
})
the shop i have register is ‘farmer’ we have to call that from the dialog npc in a client side script here is an example:
exports['rip_dialog']:CreateNPC("farmer", "a_m_m_hillbilly_01", vector4(2195.274, 5594.096, 53.76, 342.99), {
label = "Talk",
icon = "fas fa-user",
title = "Farmer Shop",
content = "Hello! How can i help you sir?"
}, {
options = {
{
icon = "fas fa-seedling",
label = "I want to buy plant tools",
params = {
type = 'action',
event = function()
if GetResourceState("ox_inventory") ~= 'missing' then
exports.ox_inventory:openInventory('shop', {type = 'farmer'})
elseif GetResourceState("qb-inventory") ~= 'missing' then
TriggerServerEvent('rip_dialog:server:openShop', 'farmer')
end
end,
args = {}
}
},
{
icon = "fas fa-angle-right",
label = "i'm just looking around"
},
},
})
as you can see we open it by calling this Server Event and add the shop name (‘farmer’)
TriggerServerEvent('rip_dialog:server:openShop', 'farmer')
some people use or try to open the shop that already created in the rip_dialog\server\main.lua but its not gonna work because you dont have my weed script rip_weed_plant soo you have create new shop or to delete :
in line 1
if GetResourceState("rip_weed_plant") ~= 'missing' then
and in line 49
end