-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
90 changed files
with
1,167 additions
and
643 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using static BP_Essentials.EssentialsVariablesPlugin; | ||
using System; | ||
using static BP_Essentials.EssentialsMethodsPlugin; | ||
using System.IO; | ||
using System.Collections.Generic; | ||
using Newtonsoft.Json; | ||
|
||
namespace BP_Essentials.Commands | ||
{ | ||
public class CreateKit : EssentialsChatPlugin | ||
{ | ||
public static void Run(SvPlayer player, string message) | ||
{ | ||
var arg1 = GetArgument.Run(1, false, false, message); | ||
var arg2 = GetArgument.Run(2, false, true, message); | ||
if (string.IsNullOrEmpty(arg1.Trim()) || string.IsNullOrEmpty(arg2.Trim())) | ||
{ | ||
player.Send(SvSendType.Self, Channel.Unsequenced, ClPacket.GameMessage, ArgRequired); | ||
return; | ||
} | ||
if (!int.TryParse(arg1, out int arg1i)) | ||
{ | ||
player.Send(SvSendType.Self, Channel.Unsequenced, ClPacket.GameMessage, $"<color={errorColor}>Cannot convert {arg1} to a integer.</color>"); | ||
return; | ||
} | ||
var file = Path.Combine(KitDirectory, $"{arg2}.json"); | ||
if (File.Exists(file)) | ||
{ | ||
player.Send(SvSendType.Self, Channel.Unsequenced, ClPacket.GameMessage, $"<color={errorColor}>A kit already exists with that name.</color>"); | ||
return; | ||
} | ||
Kits.CreateKit(player, arg2, arg1i, file); | ||
player.Send(SvSendType.Self, Channel.Unsequenced, ClPacket.GameMessage, $"<color={infoColor}>Kit created. Please edit </color><color={argColor}>{file}</color> <color={infoColor}>to add ExecuteableBy.</color>"); | ||
} | ||
} | ||
} |
Oops, something went wrong.