07. Item Defect Inspection Checks (sc.AddCheck)
When buying items from the player, a customer can run any combination of the 9 vanilla defect checks via sc.AddCheck(string checkName). If an item on the counter fails an active check (such as a rusted pistol or an expired blood bag), the customer flags the defect and penalizes or rejects the deal.
All 9 Vanilla Inspection Check Constants
NpcCheckNames Constant | String Value | Defect Inspected |
|---|---|---|
NpcCheckNames.Freshness | "CHECK_FRESHNESS" | Checks food and organic goods for spoilage. |
NpcCheckNames.Rust | "CHECK_RUST" | Checks firearms, tools, and metal items for surface rust. |
NpcCheckNames.Dented | "CHECK_DENTED" | Checks cans, armor, and weapon casings for dents. |
NpcCheckNames.Expired | "CHECK_EXPIRED" | Checks medical injectors, blood bags, and pills for expiration dates. |
NpcCheckNames.OpenBox | "CHECK_OPEN_BOX" | Checks boxed merchandise for broken seals. |
NpcCheckNames.IngotFlashlight | "CHECK_INGOT_FLASHLIGHT" | Uses flashlight inspection on bullion/ingots. |
NpcCheckNames.IngotDetector | "CHECK_INGOT_DETECTOR" | Uses a metal detector to spot counterfeit tungsten-core ingots. |
NpcCheckNames.WaterFlashlight | "CHECK_WATER_FLASHLIGHT" | Uses light inspection to check liquid turbidity. |
NpcCheckNames.WaterStrip | "CHECK_WATER_STRIP" | Uses test strips to check water contamination. |
Code Example
csharp
sc.clientBuyingTagList.Add("FIREARM");
sc.clientBuyingTagList.Add("WEAPON");
sc.AddCheck("CHECK_RUST");
sc.AddCheck("CHECK_DENTED");