I don't understand why, but here you go
PHP Code:
#include <sourcemod>
public void OnPluginStart()
{
HookEvent("player_disconnect", Event_Disconnect);
}
public Action Event_Disconnect(Event hEvent, const char[] sName, bool bDontBroadcast)
{
char sReason[256];
GetEventString(hEvent, "reason", sReason, sizeof(sReason));
if (StrEqual(sReason, "VAC")) /* "VAC" is just an example, I don't know how it looks like while getting vac banned */
{
/* Do something here */
}
}