Aviso: Este tutorial orienta sobre o processo de instalação do arquivo. Após a instalação, será necessário configurar os itens da sua base, como itens utilizáveis, baús, entre outros.
Primeiros passos
Para instalar o inventário é preciso ter em mente que ele funciona apenas em vRPEX, infelizmente ele não funcionará caso a base seja Creative.
- Realize a troca de ip do arquivo em nosso discord na sala de trocar ip
- Faça download do arquivo
dope_inventario em nosso discord
- Dentro da sua pasta
resources crie uma pasta chamada [DopeNUIs]
- Insira dentro da pasta
[DopeNUIs] o arquivo dope_inventario descompactado
- Inicie o arquivo em seu
server.cfg com o comando:
Instalando no servidor
Inicaremos agora os processos para adaptar o inventário ao seu servidor.
- Acesse o arquivo
vrp/mdoules/inventory.lua
- Procure pela função
vRP.giveInventoryItem
- Substitua toda a função pelo seguinte código:
vRP.giveInventoryItem = function(user_id, idname, amount, slot, durability)
if not user_id or not idname or not amount then
print("Erro ao receber parametros do giveItem")
return
end
if type(slot) == "boolean" then
slot = false
end
local response = exports["dope_inventario"]:giveInventoryItem(user_id, idname, amount, slot, durability)
local source = vRP.getUserSource(user_id) or vRP.Source(user_id)
TriggerClientEvent('dope_item', source, idname, amount, 'recebido', idname)
if response then
return true
else
return false
end
end
- Procure pela função
vRP.tryGetInventoryItem
- Substitua toda a função pelo seguinte código:
vRP.tryGetInventoryItem = function(user_id, idname, amount, slot)
if not user_id or not idname or not amount then
print("Erro ao receber parametros do tryGetItem")
return
end
if type(slot) == "boolean" then
slot = false
end
local source = vRP.getUserSource(user_id) or vRP.Source(user_id)
local response = exports["dope_inventario"]:removeInventoryItem(user_id, idname, amount, slot)
if response then
TriggerClientEvent('dope_item', source, idname, amount, 'enviado', idname)
return true
else
return false
end
end
- Vá em direção ao final do arquivo e na ultima linha cole o seguinte código:
vRP.setDataTable = function(user_id, tabela, name)
local data = vRP.getUserDataTable(user_id)
data[name] = tabela
end