Kick a Player From a Party
Last updated on
The party leader has the privilege to remove a party member from their party by kicking them out of the party. The kicked party member will receive a notification that they've been kicked out of the party, and current party members will also receive a notification that someone has been kicked from the party.
- Unreal Engine
- Unity
FRegistry::Lobby.Connect();
FRegistry::Lobby.SetInvitePartyKickMemberResponseDelegate(AccelByte::Api::Lobby::FPartyKickResponse::CreateLambda([](const FAccelByteModelsKickPartyMemberResponse& Result)
{
if (Result.Code == "0")
{
// Do something if InvitePartyKickMemberResponseDelegate has been successful
}
else
{
// Do something if InvitePartyKickMemberResponseDelegate has an error
}
}));
FString UserId = FString("SomeUserId");
FRegistry::Lobby.SendKickPartyMemberRequest(UserId);
string userId = "SomeUserId";
AccelBytePlugin.GetLobby().Connect();
AccelBytePlugin.GetLobby().KickPartyMember(userId, result =>
{
if (result.IsError)
{
// Do something if KickPartyMember has an error
Debug.Log($"Error KickPartyMember, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
}
else
{
// Do something if KickPartyMember has been successful
}
});