Fixed ban to not kick inactive players as well.
This commit is contained in:
parent
cfd4de2f32
commit
a87eeaffeb
1 changed files with 3 additions and 2 deletions
|
|
@ -227,7 +227,7 @@ namespace TShockAPI
|
||||||
public static bool Kick(int ply, string reason, string adminUserName = "")
|
public static bool Kick(int ply, string reason, string adminUserName = "")
|
||||||
{
|
{
|
||||||
if (!Main.player[ply].active)
|
if (!Main.player[ply].active)
|
||||||
return false;
|
return true;
|
||||||
if (!TShock.players[ply].group.HasPermission("immunetokick"))
|
if (!TShock.players[ply].group.HasPermission("immunetokick"))
|
||||||
{
|
{
|
||||||
string playerName = Main.player[ply].name;
|
string playerName = Main.player[ply].name;
|
||||||
|
|
@ -254,7 +254,8 @@ namespace TShockAPI
|
||||||
string ip = GetPlayerIP(plr);
|
string ip = GetPlayerIP(plr);
|
||||||
string playerName = Main.player[plr].name;
|
string playerName = Main.player[plr].name;
|
||||||
TShock.Bans.AddBan(ip, playerName, reason);
|
TShock.Bans.AddBan(ip, playerName, reason);
|
||||||
NetMessage.SendData(0x2, plr, -1, "Banned: " + reason, 0x0, 0f, 0f, 0f);
|
if (!Main.player[plr].active)
|
||||||
|
NetMessage.SendData(0x2, plr, -1, "Banned: " + reason, 0x0, 0f, 0f, 0f);
|
||||||
Log.Info("Banned " + playerName + " for : " + reason);
|
Log.Info("Banned " + playerName + " for : " + reason);
|
||||||
if (adminUserName.Length == 0)
|
if (adminUserName.Length == 0)
|
||||||
Broadcast(playerName + " was banned for " + reason.ToLower());
|
Broadcast(playerName + " was banned for " + reason.ToLower());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue