forked from FrenchFiveMDev/FFD_CreativeInv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.lua
19 lines (17 loc) · 884 Bytes
/
server.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
local inventory <const> = exports.ox_inventory
local items <const> = inventory:Items()
RegisterNetEvent('ox:creativechest', function()
local player <const> = Player(source).state
if not (Config.groups[player.group]) then return print("Vous devez être admin.") end
inventory:RegisterStash('creativechest', Config.NameCreativeMenu, Config.MaxSlotsCreativeMenu, Config.MaxWeight, true)
for _, item in ipairs(items) do
inventory:AddItem('creativechest', item.label, item.amount, item.data)
end
end)
RegisterNetEvent('ox:admintrash', function()
local player <const> = Player(source).state
if not (Config.groups[player.group]) then return print("Vous devez être admin.") end
inventory:RegisterStash('admintrash', Config.NameTrashAdmin, Config.MaxSlotsTrash, Config.MaxWeightTrash, true)
Citizen.Wait(Config.ClearTrash)
inventory:ClearInventory('admintrash')
end)