-
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.
Merged branch develop and master together
- Loading branch information
Showing
78 changed files
with
1,435 additions
and
1,795 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 |
---|---|---|
@@ -1,27 +1,29 @@ | ||
using System; | ||
using static BP_Essentials.EssentialsVariablesPlugin; | ||
namespace BP_Essentials.Commands { | ||
public class Ban : EssentialsChatPlugin { | ||
public static bool Run(object oPlayer, string message) { | ||
try | ||
public class Ban : 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) || !string.IsNullOrEmpty(arg2)) | ||
{ | ||
var player = (SvPlayer)oPlayer; | ||
if (HasPermission.Run(player, CmdBanExecutableBy)) | ||
var shPlayer = GetShByStr.Run(arg1, true); | ||
if (shPlayer == null) | ||
{ | ||
string arg1 = GetArgument.Run(1, false, true, message); | ||
if (!string.IsNullOrEmpty(arg1)) | ||
ExecuteOnPlayer.Run(player, message, arg1); | ||
else | ||
player.SendToSelf(Channel.Unsequenced, ClPacket.GameMessage, ArgRequired); | ||
player.SendToSelf(Channel.Unsequenced, ClPacket.GameMessage, NotFoundOnlineIdOnly); | ||
return; | ||
} | ||
else | ||
player.SendToSelf(Channel.Unsequenced, ClPacket.GameMessage, MsgNoPerm); | ||
LogMessage.LogOther($"{SetTimeStamp.Run()}[INFO] {shPlayer.username} Got banned by {player.playerData.username}"); | ||
player.SendToAll(Channel.Unsequenced, ClPacket.GameMessage, $"<color={argColor}>{shPlayer.username}</color> <color={warningColor}>Just got banned by</color> <color={argColor}>{player.playerData.username}</color>"); | ||
SendDiscordMessage.BanMessage(shPlayer.username, player.playerData.username, arg2); | ||
player.SendToSelf(Channel.Unsequenced, ClPacket.GameMessage, $"<color={infoColor}>Banned</color> <color={argColor}>{shPlayer.username}</color><color={infoColor}>. (Reason: {arg2})</color>"); | ||
player.svManager.AddBanned(shPlayer); | ||
player.svManager.Disconnect(shPlayer.svPlayer.connection); | ||
} | ||
catch (Exception ex) | ||
{ | ||
ErrorLogging.Run(ex); | ||
} | ||
return true; | ||
else | ||
player.SendToSelf(Channel.Unsequenced, ClPacket.GameMessage, ArgRequired); | ||
} | ||
} | ||
} |
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,31 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using static BP_Essentials.EssentialsVariablesPlugin; | ||
namespace BP_Essentials.Commands | ||
{ | ||
public class Clear : EssentialsChatPlugin | ||
{ | ||
public static void Run(SvPlayer player, string message) | ||
{ | ||
string arg1 = GetArgument.Run(1, false, true, message); | ||
if (!string.IsNullOrEmpty(arg1)) | ||
{ | ||
var shPlayer = GetShByStr.Run(arg1); | ||
if (shPlayer == null) | ||
{ | ||
player.SendToSelf(Channel.Unsequenced, ClPacket.GameMessage, NotFoundOnline); | ||
return; | ||
} | ||
var tempList = new List<InventoryItem>(); | ||
foreach (var item in shPlayer.myItems.Values) | ||
tempList.Add(item); | ||
for (int i = 0; i < tempList.Count; i++) | ||
shPlayer.TransferItem(2, tempList[i].item.index, shPlayer.MyItemCount(tempList[i].item.index), true); | ||
player.SendToSelf(Channel.Unsequenced, ClPacket.GameMessage, $"<color={infoColor}>You cleared the inventory of</color> <color={argColor}>{shPlayer.username}</color><color={infoColor}>.</color>"); | ||
shPlayer.svPlayer.SendToSelf(Channel.Unsequenced, ClPacket.GameMessage, $"<color={warningColor}>Your inventory has been cleared by</color> <color={argColor}>{player.playerData.username}</color><color={warningColor}>.</color>"); | ||
} | ||
else | ||
player.SendToSelf(Channel.Unsequenced, ClPacket.GameMessage, ArgRequired); | ||
} | ||
} | ||
} |
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.