1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-07-03 07:27:11 +02:00

Add the ability to specify a custom header/payload when kicking/banning a player.

This commit is contained in:
Sandu Liviu Catalin
2016-08-17 13:48:29 +03:00
parent 4e039d415a
commit c4e82d6756
5 changed files with 57 additions and 1 deletions

View File

@ -257,7 +257,15 @@ static void OnPlayerDisconnect(int32_t player_id, vcmpDisconnectReason reason)
// Attempt to forward the event
try
{
Core::Get().DisconnectPlayer(player_id, reason, NullObject());
if (reason == vcmpDisconnectReasonKick)
{
Core::Get().DisconnectPlayer(player_id, Core::Get().GetPlayer(player_id).mKickBanHeader,
Core::Get().GetPlayer(player_id).mKickBanPayload);
}
else
{
Core::Get().DisconnectPlayer(player_id, reason, NullObject());
}
}
SQMOD_CATCH_EVENT_EXCEPTION(OnPlayerDisconnect)
// See if a reload was requested