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 = "")
|
||||
{
|
||||
if (!Main.player[ply].active)
|
||||
return false;
|
||||
return true;
|
||||
if (!TShock.players[ply].group.HasPermission("immunetokick"))
|
||||
{
|
||||
string playerName = Main.player[ply].name;
|
||||
|
|
@ -254,6 +254,7 @@ namespace TShockAPI
|
|||
string ip = GetPlayerIP(plr);
|
||||
string playerName = Main.player[plr].name;
|
||||
TShock.Bans.AddBan(ip, playerName, reason);
|
||||
if (!Main.player[plr].active)
|
||||
NetMessage.SendData(0x2, plr, -1, "Banned: " + reason, 0x0, 0f, 0f, 0f);
|
||||
Log.Info("Banned " + playerName + " for : " + reason);
|
||||
if (adminUserName.Length == 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue