Besoin d'aide [URGENT] | Merci a vous

  • Initiateur de la discussion
Arsenic180

Arsenic180

Têtard
Messages
20
Score réaction
0
Points
10
Bonsoir / Bonjour.

J'ai acheter DInventory pour mon serveur et a chaque foit que je veux mettre un arme dans mon inventaire cela marche pas !
Peut t'on m'aider

Merci.
Arsenic.
 
xLomble77

xLomble77

Psychopathe
Messages
2 191
Score réaction
348
Points
290
Bonjour,

Tu l'as bien installé ?
Et tu es sûr d'avoir correctement fais les configurations ?
 
  • Initiateur de la discussion
Arsenic180

Arsenic180

Têtard
Messages
20
Score réaction
0
Points
10
Bonjour,

Je pense que oui.
Arsenic


--THIS ADDON REQUIRES libmysql AND mysqloo for data to save. Please enter your database information in sv_inventory_database.lua
DINVENTORY = DINVENTORY or {}
DINVENTORY.RegisteredItems = DINVENTORY.RegisteredItems or {}
DINVENTORY.RegisteredItemsID = DINVENTORY.RegisteredItemsID or {}
DINVENTORY.DefaultSlots = {
["default"] = 8,
["vip"] = 12,
["superadmin"] = 16,
["founder"] = 20,
}

DINVENTORY.ItemColors = {
["weapon"] = Color(23, 133, 207),
["entity"] = Color(193,103,204),
["ammo"] = Color(75,222,112),
}
DINVENTORY.Stackables = {
["entity"] = true,
["weapon"] = true,
["ammo"] = true,
}
DINVENTORY.HotBar = true --Only allows the player to hold 3 DINVENTORY weapons at once and requires equipping from DINVENTORY if true.
DINVENTORY.DropHotBar = true -- Drop Weapons on ground when dead: True: Drop False: Delete
DINVENTORY.PermaWeapons = true --DINVENTORY.DropHotBar must be set to FALSE. DINVENTORY.HotBar must be set to TRUE. True: Weapons will stay on character after death.
DINVENTORY.PickUpKey = KEY_E -- ALT + PickUpKey <- will pick up an item from the ground. Supports 0 - 9 -> A - Z ( Garry's Mod Wiki - Garry's Mod Wiki ) ( I DON'T RECOMMEND CHANGING THIS)
DINVENTORY.Blacklist = { --These items can not be picked up from the ground or put into the DINVENTORY
--["cw_ak74"] = true,
}
DINVENTORY.AdminGroups = {
"superadmin",
"founder",
}
DINVENTORY.PickupDelay = 3.25
DINVENTORY.UseF2 = true --This will disable opening the menu with F2. Chat commands !inv and console inv will be available.
function registerItem(class, tbl)

tbl.id = table.insert(DINVENTORY.RegisteredItemsID, tbl)

DINVENTORY.RegisteredItems[class] = tbl

end

-- Some weapons remove themselves instead of using ammunition (WHICH IS BAD DESIGN!)
-- If you find that you can un-equip a weapon and re-equip it to gain an advantage,
-- add the weapon here to remove it from the inventory when it gets removed.
DINVENTORY.RemoveOnStrip = {
["fire_molotov"] = true,
["fire_extinguisher"] = true,
}










--DON'T TOUCH ANYTHING BELOW HERE OR YOU'LL BREAK EVERYTHING.
local function cache()

if CLIENT then
for k,v in pairs(DINVENTORY.RegisteredItems) do
util.PrecacheModel(v.model)
end
end
end

local function loadreg()

timer.Simple(3, function()
for k,v in pairs(CustomShipments) do
registerItem(v.entity, {
classname = v.entity,
name = v.name,
model = v.model,
itemtype = "weapon",
baseclass = "spawned_weapon",
})
end

local gm = GM or GAMEMODE
for k,v in pairs(gm.AmmoTypes) do
registerItem(v.ammoType, {
classname = v.ammoType,
name = v.name,
ammoType = v.ammoType,
model = v.model,
amountGive = v.amountGiven,
itemtype = "ammo",
baseclass = "spawned_ammo",
})
end

for k,v in pairs(DarkRPEntities) do
registerItem(v.ent, {
classname = v.ent,
name = v.name,
model = v.model,
itemtype = "entity",
})
end
if DXANS then
registerItem("dxans_bagpills", {
classname = "dxans_bagpills",
name = "Bag of Xanax",
model = "models/dxans/alprazolam_pills_packed.mdl",
itemtype = "entity",
})
DINVENTORY.Blacklist["dxans_alprazolam"] = true
end
cache()
if SERVER then
hook.Run( "DINVENTORY_REGISTER_CREATED" )
end
end)

end


if DCONFIG then
hook.Add("DConfigDataLoaded", "LoadDINVENTORYRegister", function() //ANY CHANGES REQUIRE A RESTART
loadreg()
end)
else
hook.Add("loadCustomDarkRPItems", "LoadDINVENTORYRegister", function()
loadreg()
end)
end


if SERVER then

local function sendreg(ply)
net.Start("sync_register")
net.WriteTable(DINVENTORY.RegisteredItems)
net.WriteTable(DINVENTORY.RegisteredItemsID)
net.Send(ply)
end
util.AddNetworkString("sync_register")
hook.Add("PlayerInitialSpawn", "Inventory_SendRegisterInfo", function(ply)

sendreg(ply)
if not DINVENTORY.RegisteredItems or #DINVENTORY.RegisteredItems == 0 then
timer.Create(tostring(ply) .. "inv_sendreg", 1, 0, function()
sendreg(ply)
timer.Destroy(tostring(ply) .. "inv_sendreg")
end)
end

end)

end

if CLIENT then

net.Receive("sync_register", function()

local reg = net.ReadTable()
local regid = net.ReadTable()
DINVENTORY.RegisteredItems = reg
DINVENTORY.RegisteredItemsID = regid

end)

end


hook.Run("DInventory_Loaded")
 
xLomble77

xLomble77

Psychopathe
Messages
2 191
Score réaction
348
Points
290
D'accord, et la base de données, tu l'as bien relié ?
 
  • Initiateur de la discussion
Arsenic180

Arsenic180

Têtard
Messages
20
Score réaction
0
Points
10
Oui
 
  • Initiateur de la discussion
Arsenic180

Arsenic180

Têtard
Messages
20
Score réaction
0
Points
10
C'est bon j'ai trouver merci a vous!
 
xLomble77

xLomble77

Psychopathe
Messages
2 191
Score réaction
348
Points
290
  • Initiateur de la discussion
Arsenic180

Arsenic180

Têtard
Messages
20
Score réaction
0
Points
10
Oups. Excuse moi je me suis tromper de discutions
 
  • Initiateur de la discussion
Arsenic180

Arsenic180

Têtard
Messages
20
Score réaction
0
Points
10
Régler solution dans le fichier config!
 
Discord d'entraide
Rejoignz-nous sur Discord