Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. __title__ = 'Copyright'
  2. __author__ = 'samvds'
  3. __version__ = '1.0'
  4.  
  5. import clr
  6.  
  7. clr.AddReferenceByPartialName("Fougerite")
  8. import Fougerite
  9.  
  10. white = "[color#FFFFFF]"
  11. cyan = "[color#00FFFF]"
  12. green = "[color#00FF00]"
  13. red = "[color#FF0000]"
  14.  
  15.  
  16. class Copyright:
  17.  
  18. ResearchKitAmount = None
  19. SupplySignalAmount = None
  20.  
  21. def On_PluginInit(self):
  22. Util.ConsoleLog("Copyright" + " v" + __version__ + " by " + __author__ + " loaded.", True)
  23. ini = self.Config()
  24. self.ResearchKitAmount = int(ini.GetSetting("Paper Required", "Research Kit")) # Get the values, and convert them to an integer.
  25. self.SupplySignalAmount = int(ini.GetSetting("Paper Required", "Supply Signal"))
  26.  
  27.  
  28. def Config(self):
  29. if not Plugin.IniExists("Config"):
  30. Plugin.CreateIni("Config")
  31. ini.AddSetting("Paper Required", "Research Kit", "15")
  32. ini.AddSetting("Paper Required", "Supply Signal", "120")
  33. ini.Save()
  34. return Plugin.GetIni("Config")
  35.  
  36. def On_Command(self, Player, cmd, args):
  37. if cmd == "copyright":
  38. Player.Message("---------------------- [" + green + " Copyright " + white + "] ----------------------")
  39. Player.Message("Use " + cyan + "/copyright" + white + " - to view this menu.")
  40. Player.Message("Use " + cyan + "/rk" + white + " - to craft a research kit. (" + str(self.ResearchKitAmount) + " paper required)")
  41. Player.Message("Use " + cyan + "/ss" + white + " - to craft a supply signal. (" + str(self.SupplySignalAmount) + " paper required)")
  42. elif cmd == "rk":
  43. if Player.Inventory.HasItem("Paper", self.ResearchKitAmount):
  44. Player.Inventory.TakeItem("Paper", self.ResearchKitAmount)
  45. Player.Inventory.GiveItem("Research Kit 1", 1)
  46. Player.Message("☢ " + green + "You've crafted a research kit!")
  47. else:
  48. Player.Message("☢ " + red + "You don't have enough paper to craft this!")
  49. elif cmd == "ss":
  50. if Player.Inventory.HasItem("Paper", self.SupplySignalAmount):
  51. Player.Inventory.TakeItem("Paper", self.SupplySignalAmount)
  52. Player.Inventory.GiveItem("Supply Signal", 1)
  53. Player.Message("☢ " + green + "You've crafted a supply signal!")
  54. else:
  55. Player.Message("☢ " + red + "You don't have enough paper to craft this!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement