Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Oxide.Core;
- using Oxide.Core.Plugins;
- using System.Linq;
- using System.Collections.Generic;
- using System;
- using System.Reflection;
- using System.Data;
- using System.Collections;
- using UnityEngine;
- using Oxide.Core;
- using RustProto;
- namespace Oxide.Plugins
- {
- [Info("Levels", "BDM", "1.1.0")]
- [Description("Basic level system.")]
- public class Levels: RustLegacyPlugin
- {
- private Core.Configuration.DynamicConfigFile Data;
- void Loaded()
- {
- LoadData();
- permission.RegisterPermission("levels.allowed", this);
- }
- void LoadData()
- {
- Data = Interface.GetMod().DataFileSystem.GetDatafile("AdvLevels");
- }
- void SaveData()
- {
- Interface.GetMod().DataFileSystem.SaveDatafile("AdvLevels");
- }
- void OnServerSave()
- {
- SaveData();
- }
- void Unload()
- {
- SaveData();
- }
- Dictionary<string, object> GetPlayerdata(string userid)
- {
- if (Data[userid] == null)
- Data[userid] = new Dictionary<string, object>();
- return Data[userid] as Dictionary<string, object>;
- }
- [ChatCommand("add")]
- void cmdConnect(NetUser netuser, string command)
- {
- if (!permission.UserHasPermission(netuser.playerClient.userID.ToString(), "levels.allowed"))
- {
- SendReply(netuser, "No perm");
- }
- else
- {
- var playerdata = GetPlayerdata("AdvLevels");
- playerdata.Add(netuser.displayName);
- SendReply(netuser, playerdata);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement