Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- YOU DON'T NEED TO TOUCH THIS IF YOU DON'T KNOW WHAT IT IS
- RARITY_UNCOMMON = 1
- RARITY_COMMON = 2
- RARITY_RARE = 3
- RARITY_EPIC = 4
- RARITY_LEGENDARY = 5
- Inventory.Config = Inventory.Config or {}
- function Inventory.Config:AddRarity(entClass, rarity)
- self.Rarities[entClass] = rarity
- end
- Inventory.Config.Items = Inventory.Config.Items or {}
- Inventory.Config.Rarities = {}
- -- TOUCH BELOW HERE
- -- Should you be able to use ALT + *key* to pick up items?
- Inventory.Config.PickUpWithALT = true
- -- What key should be used in combination with alt?
- -- https://wiki.garrysmod.com/page/Enums/BUTTON_CODE
- Inventory.Config.AltKey = IN_USE
- -- Type the letter that ^ actually is.
- Inventory.Config.AltKeyStr = "E"
- -- What key should you open the inventory menu with?
- -- https://wiki.garrysmod.com/page/Enums/BUTTON_CODE
- -- If you want to disable this, set it to false instead of a key!
- Inventory.Config.InventoryKey = KEY_I
- -- Should users spawn with an inventory weapon allowing them to pick up items with the weapon?
- Inventory.Config.SpawnWithInventorySWEP = true
- -- What color should the standard chat messages prefix have?
- Inventory.Config.PrefixCol = Color(46, 204, 113)
- -- What should the prefix say?
- Inventory.Config.PrefixText = "[INVENTORY]"
- -- What language?
- -- By default this only supports English, but you can add your own language
- Inventory.Config.Language = "English"
- -- The NPC's model?
- Inventory.Config.NPCModel = "models/misc/exchange_blue.mdl"
- -- The outline color of the NPC's overhead HUD.
- Inventory.Config.NPCColor = Color(201, 176, 15)
- -- The text on the NPC's overhead HUD
- Inventory.Config.NPCText = "Vault"
- -- The icon for the NPC's overhead HUD
- Inventory.Config.NPCIcon = Material("xenin/inventory/icon.png", "smooth")
- -- How many items should there be in a row in the bank?
- Inventory.Config.BankItemsPerRow = 8
- -- Slots for the bank.
- -- Free is for everyone that isn't in the paid list.
- -- The paid list works by doing ["rank"] = amount_of_slots
- Inventory.Config.BankSlots = {
- Free = 8,
- Paid = {
- ["bronzevip"] = 16,
- ["silvervip"] = 24,
- ["goldvip"] = 32,
- ["admin"] = 40,
- ["superadmin"] = 40
- }
- }
- -- Same as above but for the inventory itself, not the bank
- Inventory.Config.ItemsPerRow = 8
- -- Same as above but for the inventory itself, not the bank
- Inventory.Config.Slots = {
- Free = 8,
- Paid = {
- ["bronzevip"] = 16,
- ["silvervip"] = 24,
- ["goldvip"] = 32,
- ["admin"] = 40,
- ["superadmin"] = 40
- }
- }
- -- The categories are defined here
- -- [number] is the number the category will be known as.
- -- name is obviously the name.
- -- color represents the color used to visualise the category
- -- maxStack is how many items can max be stacked if it's that category
- -- amountBackgroundColor is an optional thing! Use this for colors where seeing the default amount text background color might be hard.
- Inventory.Config.Categories = {
- [1] = { name = "Common", color = Color(168, 168, 168), maxStack = 10, amountBackgroundColor = Color(0, 0, 0, 225) }, -- grey
- [2] = { name = "Uncommon", color = Color(0, 255, 132), maxStack = 10 }, -- green
- [3] = { name = "Rare", color = Color(0, 174, 255), maxStack = 10 }, -- blue
- [4] = { name = "Epic", color = Color(112, 0, 209), maxStack = 5 }, -- purple
- [5] = { name = "Legendary", color = Color(224, 191, 0), maxStack = 1 }, -- orange
- }
- -- Should users be able to sort by rarity quality?
- Inventory.Config.EnableRaritySorting = true
- -- If you want a specific entity class to be a rarity.
- Inventory.Config:AddRarity("rw_sw_b2rp_blaster", RARITY_LEGENDARY)
- Inventory.Config:AddRarity("rw_sw_droideka", RARITY_LEGENDARY)
- Inventory.Config:AddRarity("rw_sw_droideka_sniper", RARITY_LEGENDARY)
- Inventory.Config:AddRarity("rw_sw_dual_e5", RARITY_EPIC)
- Inventory.Config:AddRarity("rw_sw_dual_e5bx", RARITY_EPIC)
- Inventory.Config:AddRarity("rw_sw_dual_rg4d", RARITY_EPIC)
- Inventory.Config:AddRarity("rw_sw_dual_se14", RARITY_EPIC)
- Inventory.Config:AddRarity("rw_sw_e5", RARITY_UNCOMMON)
- Inventory.Config:AddRarity("rw_sw_e5bx", RARITY_RARE)
- Inventory.Config:AddRarity("rw_sw_e5c", RARITY_RARE)
- Inventory.Config:AddRarity("rw_sw_e5s", RARITY_RARE)
- Inventory.Config:AddRarity("rw_sw_e5s_auto", RARITY_LEGENDARY)
- Inventory.Config:AddRarity("rw_sw_rg4d", RARITY_COMMON)
- Inventory.Config:AddRarity("rw_sw_se14", RARITY_COMMON)
- Inventory.Config:AddRarity("rw_sw_se14c", RARITY_COMMON)
- Inventory.Config:AddRarity("rw_sw_sg6", RARITY_EPIC)
- Inventory.Config:AddRarity("rw_sw_z4", RARITY_LEGENDARY)
- Inventory.Config:AddRarity("rw_sw_arc_blaster", RARITY_LEGENDARY)
- Inventory.Config:AddRarity("rw_sw_bowcaster", RARITY_EPIC)
- Inventory.Config:AddRarity("rw_sw_cr2", RARITY_EPIC)
- Inventory.Config:AddRarity("rw_sw_cr2c", RARITY_EPIC)
- Inventory.Config:AddRarity("rw_sw_tusken_cycler", RARITY_LEGENDARY)
- Inventory.Config:AddRarity("rw_sw_d", RARITY_COMMON)
- Inventory.Config:AddRarity("rw_sw_defender", RARITY_COMMON)
- Inventory.Config:AddRarity("rw_sw_dl18", RARITY_COMMON)
- Inventory.Config:AddRarity("rw_sw_dl44", RARITY_UNCOMMON)
- Inventory.Config:AddRarity("rw_sw_dt29_1", RARITY_UNCOMMON)
- Inventory.Config:AddRarity("rw_sw_dt29_2", RARITY_UNCOMMON)
- Inventory.Config:AddRarity("rw_sw_dt29_3", RARITY_UNCOMMON)
- Inventory.Config:AddRarity("rw_sw_dt29_4", RARITY_UNCOMMON)
- Inventory.Config:AddRarity("rw_sw_dual_defender", RARITY_EPIC)
- Inventory.Config:AddRarity("rw_sw_ee3", RARITY_RARE)
- Inventory.Config:AddRarity("rw_sw_ee3a", RARITY_RARE)
- Inventory.Config:AddRarity("rw_sw_huntershotgun", RARITY_EPIC)
- Inventory.Config:AddRarity("rw_sw_iqa11", RARITY_EPIC)
- Inventory.Config:AddRarity("rw_sw_iqa11c", RARITY_EPIC)
- Inventory.Config:AddRarity("rw_sw_manda_blaster", RARITY_LEGENDARY)
- Inventory.Config:AddRarity("rw_sw_nt242", RARITY_RARE)
- Inventory.Config:AddRarity("rw_sw_nt242c", RARITY_RARE)
- Inventory.Config:AddRarity("rw_sw_relbyv10", RARITY_UNCOMMON)
- Inventory.Config:AddRarity("rw_sw_s5", RARITY_UNCOMMON)
- Inventory.Config:AddRarity("rw_sw_s5c", RARITY_UNCOMMON)
- Inventory.Config:AddRarity("rw_sw_scattershotgun", RARITY_EPIC)
- Inventory.Config:AddRarity("rw_sw_x8", RARITY_UNCOMMON)
- Inventory.Config:AddRarity("rw_sw_z2", RARITY_LEGENDARY)
- Inventory.Config:AddRarity("rw_sw_dlt19", RARITY_RARE)
- Inventory.Config:AddRarity("rw_sw_dlt19x", RARITY_RARE)
- Inventory.Config:AddRarity("rw_sw_dual_e11", RARITY_EPIC)
- Inventory.Config:AddRarity("rw_sw_dual_rk3", RARITY_EPIC)
- Inventory.Config:AddRarity("rw_sw_e11", RARITY_COMMON)
- Inventory.Config:AddRarity("rw_sw_e11_noscope", RARITY_COMMON)
- Inventory.Config:AddRarity("rw_sw_e11d", RARITY_LEGENDARY)
- Inventory.Config:AddRarity("rw_sw_rk3", RARITY_COMMON)
- Inventory.Config:AddRarity("rw_sw_scoutblaster", RARITY_COMMON)
- Inventory.Config:AddRarity("rw_sw_t21", RARITY_EPIC)
- Inventory.Config:AddRarity("rw_sw_t21b", RARITY_EPIC)
- Inventory.Config:AddRarity("rw_sw_tl40", RARITY_EPIC)
- Inventory.Config:AddRarity("rw_sw_tl50", RARITY_EPIC)
- Inventory.Config:AddRarity("rw_sw_a280", RARITY_UNCOMMON)
- Inventory.Config:AddRarity("rw_sw_a280cfe", RARITY_RARE)
- Inventory.Config:AddRarity("rw_sw_a280c", RARITY_UNCOMMON)
- Inventory.Config:AddRarity("rw_sw_dh17", RARITY_COMMON)
- Inventory.Config:AddRarity("rw_sw_dh17a", RARITY_COMMON)
- Inventory.Config:AddRarity("rw_sw_dlt20a", RARITY_EPIC)
- Inventory.Config:AddRarity("rw_sw_dual_dh17a", RARITY_EPIC)
- Inventory.Config:AddRarity("rw_sw_rt97c", RARITY_LEGENDARY)
- Inventory.Config:AddRarity("rw_sw_t7", RARITY_LEGENDARY)
- Inventory.Config:AddRarity("rw_sw_dc15a", RARITY_UNCOMMON)
- Inventory.Config:AddRarity("rw_sw_dc15a_o", RARITY_RARE)
- Inventory.Config:AddRarity("rw_sw_dc15le", RARITY_UNCOMMON)
- Inventory.Config:AddRarity("rw_sw_dc15le_o", RARITY_RARE)
- Inventory.Config:AddRarity("rw_sw_dc15s", RARITY_UNCOMMON)
- Inventory.Config:AddRarity("rw_sw_dc15se", RARITY_UNCOMMON)
- Inventory.Config:AddRarity("rw_sw_dc15x", RARITY_RARE)
- Inventory.Config:AddRarity("rw_sw_dc17", RARITY_COMMON)
- Inventory.Config:AddRarity("rw_sw_dc17c", RARITY_COMMON)
- Inventory.Config:AddRarity("rw_sw_dc17s", RARITY_COMMON)
- Inventory.Config:AddRarity("rw_sw_dc19", RARITY_UNCOMMON)
- Inventory.Config:AddRarity("rw_sw_dc19le", RARITY_RARE)
- Inventory.Config:AddRarity("rw_sw_dp23", RARITY_LEGENDARY)
- Inventory.Config:AddRarity("rw_sw_dp24", RARITY_RARE)
- Inventory.Config:AddRarity("rw_sw_dual_dc15s", RARITY_EPIC)
- Inventory.Config:AddRarity("rw_sw_dual_dc17", RARITY_EPIC)
- Inventory.Config:AddRarity("rw_sw_dual_dc17s", RARITY_EPIC)
- Inventory.Config:AddRarity("rw_sw_valken38x", RARITY_EPIC)
- Inventory.Config:AddRarity("rw_sw_valkenx38a", RARITY_EPIC)
- Inventory.Config:AddRarity("rw_sw_westarm5", RARITY_LEGENDARY)
- Inventory.Config:AddRarity("rw_sw_z6", RARITY_LEGENDARY)
- Inventory.Config:AddRarity("seal6-tac-insert", RARITY_COMMON)
- Inventory.Config:AddRarity("zeus-thermaldet", RARITY_RARE)
- Inventory.Config:AddRarity("zeus-smokegranade", RARITY_RARE)
- Inventory.Config:AddRarity("zeus-flashbang", RARITY_RARE)
- Inventory.Config:AddRarity("rw_sw_bx_sword", RARITY_EPIC)
- Inventory.Config:AddRarity("rw_vibrosword", RARITY_EPIC)
- Inventory.Config:AddRarity("holocomm", RARITY_EPIC)
- Inventory.Config:AddRarity("stealth_camo", RARITY_LEGENDARY)
- -- Chat commands
- -- Code to holster weapons
- local funcHolster = function(ply)
- if (!IsValid(ply)) then return end
- if (!ply:IsPlayer()) then return end
- if (!ply:Alive()) then return end
- local activeWep = ply:GetActiveWeapon()
- if (!IsValid(activeWep)) then return end
- local inv = ply:Inventory()
- local amt = table.Count(inv:GetInventory())
- local slots = inv:GetSlots()
- if (amt >= slots) then
- XeninUI:Notify(ply, Inventory:GetPhrase("ChatCommand.Holster.Unable"), 1, 4, XeninUI.Theme.Red)
- return
- end
- ply:dropDRPWeapon(activeWep, function(wep)
- ply:Inventory():Pickup(wep)
- end, false)
- end
- local openMenu = function(ply)
- ply:ConCommand("inventory")
- end
- Inventory.Config.ChatCommands = {
- ["/holster"] = funcHolster,
- ["/holsterwep"] = funcHolster,
- ["/gunholster"] = funcHolster,
- ["/invholster"] = funcHolster,
- ["/drop"] = function(ply)
- if (!IsValid(ply)) then return end
- if (!ply:IsPlayer()) then return end
- if (!ply:Alive()) then return end
- local activeWep = ply:GetActiveWeapon()
- if (!IsValid(activeWep)) then return end
- ply:dropDRPWeapon(activeWep)
- end,
- ["/inventory"] = openMenu,
- ["!inventory"] = openMenu,
- ["/inv"] = openMenu,
- ["!inv"] = openMenu
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement