actually now its usable

This commit is contained in:
zznty
2023-11-13 23:17:39 +07:00
parent aecc7ee66f
commit ce07a1e86a
41 changed files with 1401 additions and 138 deletions

25
Kits/Commands.cs Normal file
View File

@@ -0,0 +1,25 @@
using Sandbox.Game.World;
using Torch.API.Managers;
using Torch.Commands;
using Torch.Commands.Permissions;
using VRage.Game.ModAPI;
namespace Kits;
public class Commands : CommandModule
{
[Command("kit")]
[Permission(MyPromoteLevel.None)]
public void GetKit(string name)
{
var manager = Context.Torch.CurrentSession.Managers.GetManager<IKitManager>();
var player = (MyPlayer)Context.Player;
if (!manager.CanGiveKit(player, name, out var reason))
{
Context.Respond(reason, "Error");
return;
}
manager.GiveKit(player, player.Character.GetInventoryBase(), name);
Context.Respond($"You have got kit {name}");
}
}