-- This table is used by the client to show items in the equipment menu, and by -- the server to check if a certain role is allowed to buy a certain item. -- If you have custom items you want to add, consider using a separate lua -- script that uses table.insert to add an entry to this table. This method -- means you won't have to add your code back in after every TTT update. Just -- make sure the script is also run on the client. -- -- For example: -- table.insert(EquipmentItems[ROLE_DETECTIVE], { id = EQUIP_ARMOR, ... }) -- -- Note that for existing items you can just do: -- table.insert(EquipmentItems[ROLE_DETECTIVE], GetEquipmentItem(ROLE_TRAITOR, EQUIP_ARMOR)) -- Special equipment bitflags. Every unique piece of equipment needs its own flag. EQUIP_NONE = 0 EQUIP_ARMOR = 1 EQUIP_RADAR = 2 EQUIP_DISGUISE = 4 -- Icon doesn't have to be in this dir, but all default ones are in here local mat_dir = "VGUI/ttt/" -- Stick to around 35 characters per description line, and add a "\n" where you -- want a new line to start. EquipmentItems = { [ROLE_DETECTIVE] = { -- body armor { id = EQUIP_ARMOR, loadout = true, -- default equipment for detectives type = "Passive effect item", material = mat_dir .. "icon_armor", name = "Body Armor", desc = "Reduces bullet damage by 30% when\nyou get hit.\n\nDefault equipment for Detectives." }, -- radar { id = EQUIP_RADAR, type = "Active use item", material = mat_dir .. "icon_radar", name = "Radar", desc = "Allows you to scan for life signs.\n\nStarts automatic scans as soon as you\nbuy it. Configure it in Radar tab of this\nmenu." } }; [ROLE_TRAITOR] = { -- body armor { id = EQUIP_ARMOR, type = "Passive effect item", material = mat_dir .. "icon_armor", name = "Body Armor", desc = "Reduces bullet damage by 30% when\nyou get hit.\n\nThe effect is automatic and always-on." }, -- radar { id = EQUIP_RADAR, type = "Active use item", material = mat_dir .. "icon_radar", name = "Radar", desc = "Allows you to scan for life signs.\n\nStarts automatic scans as soon as you\nbuy it. Configure it in Radar tab of this\nmenu." }, -- disguiser { id = EQUIP_DISGUISE, type = "Active use item", material = mat_dir .. "icon_disguise", name = "Disguiser", desc = "Hides your ID info while on. Also avoids\nbeing seen last by a victim.\n\nToggle in the Disguise tab of this menu\nor press Numpad Enter." } }; }; -- Search if an item is in the equipment table of a given role, and return it if -- it exists, else return nil. function GetEquipmentItem(role, id) local tbl = EquipmentItems[role] if not tbl then return end for k, v in pairs(tbl) do if v and v.id == id then return v end end end