Coder Social home page Coder Social logo

recycle's Introduction

Recycle allows players to recycle items into their resources.

Permissions

  • recycle.use -- Allows players to use the recycler
  • recycle.admin -- Allows players to destroy all recyclers or dropped bags currently created by Recycle
  • recycle.bypass -- Allows players to bypass the cooldown of recycling

Commands

  • /recycle and recycle -- Opens a recycler, can be configured
  • /purgerecyclers -- Destroys all recyclers and drops their contents to a locked bag at the owner's position
  • /purgebags -- Destroys all bags created by Recycle

Configuration

{
  "Settings": {
    "Cooldown (in minutes)": 5.0,
    "Maximum Radiation": 1.0,
    "Refund Ratio": 0.5,
    "NPCs Only": false,
    "Allowed In Safe Zones": true,
    "Instant Recycling": false,
    "Send Recycled Items To Inventory": false,
    "Send Items To Inventory Before Bag": true,
    "Command To Open Recycler": "recycle",
    "NPC Ids": [],
    "Recyclable Types": [
      "Ammunition",
      "Attire",
      "Common",
      "Component",
      "Construction",
      "Electrical",
      "Fun",
      "Items",
      "Medical",
      "Misc",
      "Tool",
      "Traps",
      "Weapon"
    ],
    "Blacklisted Items": []
  },
  "VERSION": "3.0.4"
}

For Developers

Hooks

Invoked when checking if a recycler is safe to open.

bool CanOpenRecycler(BasePlayer player)

API Calls

Adds an NPC to the NPC list

public void AddNPC(string npcID)

Removes an NPC from the NPC list

public void RemoveNPC(string npcID)

Checks if an entity is a recycler managed by Recycler.

public bool IsRecycleBox(BaseNetworkable entity)

Checks if a player can safely open a recycler.

public bool CanPlayerOpenRecycler(BasePlayer player)

Checks if the player is current on cooldown from using the recycler.

public bool IsOnCooldown(BasePlayer player)

Forcefully opens a recycler for the player

!! No checks are done, including calling the hook !!

public void OpenRecycler(BasePlayer player)

Credits

  • Calytic, the original author of this plugin

recycle's People

Contributors

5dev24 avatar umod-org[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.