Advertisement
Guest User

Untitled

a guest
Feb 14th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. using Oxide.Core;
  2. using Oxide.Core.Plugins;
  3. using System.Linq;
  4. using System.Collections.Generic;
  5. using System;
  6. using System.Reflection;
  7. using System.Data;
  8. using System.Collections;
  9. using UnityEngine;
  10. using Oxide.Core;
  11. using RustProto;
  12.  
  13. namespace Oxide.Plugins
  14. {
  15. [Info("Levels", "BDM", "1.1.0")]
  16. [Description("Basic level system.")]
  17. public class Levels: RustLegacyPlugin
  18.  
  19. {
  20.  
  21.  
  22. private Core.Configuration.DynamicConfigFile Data;
  23.  
  24. void Loaded()
  25. {
  26. LoadData();
  27. permission.RegisterPermission("levels.allowed", this);
  28. }
  29.  
  30. void LoadData()
  31. {
  32. Data = Interface.GetMod().DataFileSystem.GetDatafile("AdvLevels");
  33. }
  34. void SaveData()
  35. {
  36. Interface.GetMod().DataFileSystem.SaveDatafile("AdvLevels");
  37. }
  38. void OnServerSave()
  39. {
  40. SaveData();
  41. }
  42. void Unload()
  43. {
  44. SaveData();
  45. }
  46.  
  47. Dictionary<string, object> GetPlayerdata(string userid)
  48. {
  49. if (Data[userid] == null)
  50. Data[userid] = new Dictionary<string, object>();
  51. return Data[userid] as Dictionary<string, object>;
  52. }
  53.  
  54.  
  55.  
  56.  
  57.  
  58. [ChatCommand("add")]
  59. void cmdConnect(NetUser netuser, string command)
  60. {
  61. if (!permission.UserHasPermission(netuser.playerClient.userID.ToString(), "levels.allowed"))
  62. {
  63. SendReply(netuser, "No perm");
  64. }
  65. else
  66. {
  67. var playerdata = GetPlayerdata("AdvLevels");
  68. playerdata.Add(netuser.displayName);
  69. SendReply(netuser, playerdata);
  70.  
  71. }
  72.  
  73. }
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82. }
  83. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement