Здравствуйте! Подскажите что не так с плагином, (только начал изучать) при вводе чат команды ничего не выполняется
C#:
using System;
using Newtonsoft.Json;
using UnityEngine;
using System.Collections;
using Oxide.Core;
using System.IO;
using Oxide.Core.Libraries.Covalence;
namespace Oxide.Plugins
{
[Info("MyfirstPlugin", "GGGG", "0.0.1")]
[Description("Bla bla bla")]
public class MyfirstPlugin : RustPlugin
{
[ChatCommand("kit")]
void onCommandKit(BasePlayer player, IPlayer Iplayer)
{
PrintToChat("Pllugin run");
if (Interface.Oxide.DataFileSystem.ExistsDatafile("PlayerInfo / " + player.userID.ToString() + ".json"))
{
ExitInfo(player);
} else
{
NewProfileInfo(player, Iplayer);
}
}
void ExitInfo(BasePlayer player)
{
string infoPlayers = Interface.Oxide.DataFileSystem.ReadObject<string>("PlayerInfo/" + player.userID.ToString() + ".json");
Item[] item = { ItemManager.CreateByItemID(-1583967946, 1), ItemManager.CreateByItemID(171931394, 1), ItemManager.CreateByItemID(-1039528932, 1), ItemManager.CreateByItemID(1873897110, 5), ItemManager.CreateByItemID(1722154847, 1), ItemManager.CreateByItemID(-1163532624, 1) };
foreach (Item element in item)
{
player.GiveItem(element);
}
DateTime StartkitTime = new DateTime(2020, 3, 24, 0, 0, 0);
DateTime datekit = DateTime.Now;
Interface.Oxide.DataFileSystem.WriteObject("PlayerInfo/" + player.userID.ToString() + ".json", datekit);
}
void NewProfileInfo(BasePlayer player, IPlayer Iplayer)
{
Puts("MyDataFile does not exist");
DateTime datekit = DateTime.Now;
string adressip = Iplayer.Address;
string steamid = player.userID.ToString();
Item[] item = { ItemManager.CreateByItemID(-1583967946, 1), ItemManager.CreateByItemID(171931394, 1), ItemManager.CreateByItemID(-1039528932, 1), ItemManager.CreateByItemID(1873897110, 5), ItemManager.CreateByItemID(1722154847, 1), ItemManager.CreateByItemID(-1163532624, 1) };
foreach (Item element in item)
{
player.GiveItem(element);
}
string[] playerInfo = { steamid + adressip + datekit };
Interface.Oxide.DataFileSystem.WriteObject("PlayerInfo/" + player.userID.ToString() + ".json", datekit);
}
void Loaded()
{
PrintToChat("Plugin loaded");
}
}
}