Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- __title__ = 'Copyright'
- __author__ = 'samvds'
- __version__ = '1.0'
- import clr
- clr.AddReferenceByPartialName("Fougerite")
- import Fougerite
- white = "[color#FFFFFF]"
- cyan = "[color#00FFFF]"
- green = "[color#00FF00]"
- red = "[color#FF0000]"
- class Copyright:
- ResearchKitAmount = None
- SupplySignalAmount = None
- def On_PluginInit(self):
- Util.ConsoleLog("Copyright" + " v" + __version__ + " by " + __author__ + " loaded.", True)
- ini = self.Config()
- self.ResearchKitAmount = int(ini.GetSetting("Paper Required", "Research Kit")) # Get the values, and convert them to an integer.
- self.SupplySignalAmount = int(ini.GetSetting("Paper Required", "Supply Signal"))
- def Config(self):
- if not Plugin.IniExists("Config"):
- Plugin.CreateIni("Config")
- ini.AddSetting("Paper Required", "Research Kit", "15")
- ini.AddSetting("Paper Required", "Supply Signal", "120")
- ini.Save()
- return Plugin.GetIni("Config")
- def On_Command(self, Player, cmd, args):
- if cmd == "copyright":
- Player.Message("---------------------- [" + green + " Copyright " + white + "] ----------------------")
- Player.Message("Use " + cyan + "/copyright" + white + " - to view this menu.")
- Player.Message("Use " + cyan + "/rk" + white + " - to craft a research kit. (" + str(self.ResearchKitAmount) + " paper required)")
- Player.Message("Use " + cyan + "/ss" + white + " - to craft a supply signal. (" + str(self.SupplySignalAmount) + " paper required)")
- elif cmd == "rk":
- if Player.Inventory.HasItem("Paper", self.ResearchKitAmount):
- Player.Inventory.TakeItem("Paper", self.ResearchKitAmount)
- Player.Inventory.GiveItem("Research Kit 1", 1)
- Player.Message("☢ " + green + "You've crafted a research kit!")
- else:
- Player.Message("☢ " + red + "You don't have enough paper to craft this!")
- elif cmd == "ss":
- if Player.Inventory.HasItem("Paper", self.SupplySignalAmount):
- Player.Inventory.TakeItem("Paper", self.SupplySignalAmount)
- Player.Inventory.GiveItem("Supply Signal", 1)
- Player.Message("☢ " + green + "You've crafted a supply signal!")
- else:
- Player.Message("☢ " + red + "You don't have enough paper to craft this!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement