Kick
Removes a player from the server with a reason. The player sees the Kick Message.
Command
/kick <player> [reason]
/kick Bob Spamming
/kick #3 AFK
/kick "Some Name" Please read the rules
Permission: serveradmincore.kick
Blueprint
Kick Player (Caller, Player Id, Reason) → Result
- Get Server Admin Core
- Kick Player with a caller from Make Caller (an admin's player controller) or Make System Caller (game logic)
- Check the returned Result
C++
UServerAdminCoreSubsystem* ServerAdminCore = UServerAdminCoreSubsystem::Get(this);
const EServerAdminCoreResult Result = ServerAdminCore->KickPlayer(
ServerAdminCore->MakeCaller(AdminController), TargetPlayerId, TEXT("Spamming"));
Rules
- The target must be online.
- Players can only kick players with a lower group priority (see Permission Groups).
- You can't kick yourself or the listen server host.
- The kick is written to the Admin Log and fires On Player Kicked.
Showing the kick reason to the player
When a player is kicked, the client is disconnected right away and returns to the default map, so the in-game HUD is gone. Just before the disconnect, Server Admin Core sends the kick message to the client and stores it on the client's Server Admin Core subsystem. The subsystem lives on the game instance, so the message is still there after the client is back on the menu map.
This works for every kick: manual kicks, bans, AFK and high ping kicks, whitelist and ban checks on join, and restart or shutdown.
Blueprint
In Event Construct of your main menu widget, or the HUD of your default map:
- Get Server Admin Core → Was Kicked
- Branch: if true, Get Last Kick Reason and show it in a popup or text block
- Clear Last Kick Reason when the player closes the popup, so it isn't shown again
| Function / Event | Where | Description |
|---|---|---|
| Was Kicked | Server Admin Core | True if this client was kicked and the reason hasn't been cleared |
| Get Last Kick Reason | Server Admin Core | The kick message the player received, for example the Kick Message with the reason filled in |
| Clear Last Kick Reason | Server Admin Core | Clears the stored reason |
| On Local Player Kicked (Reason) | Server Admin Core | Fires on the client when the kick message arrives, just before the disconnect |
| On Kicked (Reason) | Player Component | Same, on the local player's component |
On Local Player Kicked and On Kicked fire just before the disconnect, so anything you show then disappears almost at once. To show the reason to the player, read Get Last Kick Reason after the client is back on the menu map.
C++
UServerAdminCoreSubsystem* ServerAdminCore = UServerAdminCoreSubsystem::Get(this);
if (ServerAdminCore && ServerAdminCore->WasKicked())
{
ShowKickPopup(ServerAdminCore->GetLastKickReason());
ServerAdminCore->ClearLastKickReason();
}