-
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.
Updated to game version 0.88 Added kit price, set to 0 to disable Added delete kit command Added warps, *almost* the same as kits
- Loading branch information
Showing
34 changed files
with
384 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
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 CreateWarp | ||
{ | ||
public static void Run(SvPlayer player, string message) | ||
{ | ||
var arg1 = GetArgument.Run(1, false, false, message); | ||
var arg2 = GetArgument.Run(2, false, false, message); | ||
var arg3 = GetArgument.Run(3, false, true, message); | ||
if (string.IsNullOrEmpty(arg1.Trim()) || string.IsNullOrEmpty(arg2.Trim()) || string.IsNullOrEmpty(arg3.Trim())) | ||
{ | ||
player.Send(SvSendType.Self, Channel.Unsequenced, ClPacket.GameMessage, ArgRequired); | ||
return; | ||
} | ||
if (!int.TryParse(arg1, out int arg1i) || !int.TryParse(arg2, out int arg2i)) | ||
{ | ||
player.Send(SvSendType.Self, Channel.Unsequenced, ClPacket.GameMessage, $"<color={errorColor}>Cannot convert {arg1} or {arg2} to a integer.</color>"); | ||
return; | ||
} | ||
if (arg1i < 0) | ||
{ | ||
player.Send(SvSendType.Self, Channel.Unsequenced, ClPacket.GameMessage, $"<color={errorColor}>The delay must be a positive number (0 to disable)</color>"); | ||
return; | ||
} | ||
var file = Path.Combine(WarpDirectory, $"{arg3}.json"); | ||
if (File.Exists(file)) | ||
{ | ||
player.Send(SvSendType.Self, Channel.Unsequenced, ClPacket.GameMessage, $"<color={errorColor}>A warp already exists with that name.</color>"); | ||
return; | ||
} | ||
Warps.CreateWarp(player, arg3, arg1i, arg2i, file); | ||
player.Send(SvSendType.Self, Channel.Unsequenced, ClPacket.GameMessage, $"<color={infoColor}>Warp created. Please edit </color><color={argColor}>{file}</color> <color={infoColor}>to add ExecuteableBy and Price.</color>"); | ||
} | ||
} | ||
} |
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,30 @@ | ||
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 DeleteKit | ||
{ | ||
public static void Run(SvPlayer player, string message) | ||
{ | ||
var arg1 = GetArgument.Run(1, false, true, message); | ||
if (string.IsNullOrEmpty(arg1.Trim())) | ||
{ | ||
player.Send(SvSendType.Self, Channel.Unsequenced, ClPacket.GameMessage, ArgRequired); | ||
return; | ||
} | ||
var file = Path.Combine(KitDirectory, $"{arg1}.json"); | ||
if (!File.Exists(file)) | ||
{ | ||
player.Send(SvSendType.Self, Channel.Unsequenced, ClPacket.GameMessage, $"<color={errorColor}>No kits exist with that name.</color>"); | ||
return; | ||
} | ||
Kits.DeleteKit(player, file, arg1); | ||
player.Send(SvSendType.Self, Channel.Unsequenced, ClPacket.GameMessage, $"<color={infoColor}>Kit deleted.</color>"); | ||
} | ||
} | ||
} |
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,30 @@ | ||
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 DeleteWarp | ||
{ | ||
public static void Run(SvPlayer player, string message) | ||
{ | ||
var arg1 = GetArgument.Run(1, false, true, message); | ||
if (string.IsNullOrEmpty(arg1.Trim())) | ||
{ | ||
player.Send(SvSendType.Self, Channel.Unsequenced, ClPacket.GameMessage, ArgRequired); | ||
return; | ||
} | ||
var file = Path.Combine(WarpDirectory, $"{arg1}.json"); | ||
if (!File.Exists(file)) | ||
{ | ||
player.Send(SvSendType.Self, Channel.Unsequenced, ClPacket.GameMessage, $"<color={errorColor}>No warps exist with that name.</color>"); | ||
return; | ||
} | ||
Warps.DeleteWarp(player, file, arg1); | ||
player.Send(SvSendType.Self, Channel.Unsequenced, ClPacket.GameMessage, $"<color={infoColor}>Warp deleted.</color>"); | ||
} | ||
} | ||
} |
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
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
Oops, something went wrong.