private void OnPlayerKicked(PlayerKickEvent evt) { if (evt.Player != null) { // Call universal hook Interface.Call("OnPlayerKicked", evt.Player.IPlayer, evt.Reason); } }
public bool Kick(IPlayer target, IUser kicker = null, string reason = null) { PlayerKickEvent @event = new PlayerKickEvent(target, kicker, reason, true); eventManager.Emit(host, @event); if (@event.IsCancelled) { return(false); } Provider.kick(((UnturnedPlayer)target).CSteamID, reason); return(true); }
public async Task <bool> KickAsync(IUser user, IUser kickedBy = null, string reason = null) { var target = ((UnturnedUser)user).Player; PlayerKickEvent @event = new PlayerKickEvent(target, kickedBy, reason, true); eventManager.Emit(host, @event); if (@event.IsCancelled) { return(false); } if (target.IsOnline) { Provider.kick(target.CSteamID, reason); } return(true); }
public void OnPlayerKick(PlayerKickEvent ev) => DiscordLab.bot.NewMessage($"**Player kicked!**```autohotkey\nUser: {ev.Player}\nAdmin: {(ev.Admin.ToString() == " ()" ? "Server console" : ev.Admin.ToString())}```");