How to insert multiples lines JSON?

Hello i need to make a new line in my “filelog.json” for my chest system for admins control the given/take items, actually my file is updated…

This is my code :

            -- Control Players logs
            local data = LoadResourceFile(GetCurrentResourceName(), "/modules/vault/vaultlogs.json")
            local log = {
                steam_id            = userid , 
                player_name         = playername, 
                item_deposit        = ItemName, 
                quantity_deposit    = 1
            SaveResourceFile(GetCurrentResourceName(), "/modules/vault/vaultlogs.json", json.encode(log))

Output file is make in my ressource root.


Thanks for help :wink:

local data= {}
local datas = LoadResourceFile(GetCurrentResourceName(), "/modules/vault/vaultlogs.json") or ""
if stats ~= "" then
    data= json.decode(stats)
    data= {}
function adddata(_data,key)
  data[key] = _data
  SaveResourceFile(GetCurrentResourceName(), "/modules/vault/vaultlogs.json", json.encode(data), -1)
1 Like

My best :wink: thanks for reply !

its me : How to make a locker ? · Issue #17 · RedEM-RP/redemrp_inventory · GitHub :smiley: i have make my own vault system.

Just final question, it’s possible to UNHASH the weapon Hash (redmrp inventory) ?
Because the ItemAmount function return (table lot number) :confused:

        local Item              = data.getItem(_source, _itemgiven) 
        if Item.ItemAmount >= 1 then 

print(Item) show table: 15f4e7fe87zz…