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:
@ -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
|
||||
|
Reference in New Issue
Block a user