I have been able to get normal responses in the "reason" from the event "player_disconnect"
You must have a plugin that is overwriting the disconnect reason. If a plugin hooks "player_disconnect" with EventHookMode_Pre and does a return Plugin_Changed or return Plugin_Handled, it would most likely be blocking the "reason" for further events.
I got the returns of:
Code:
By disconnect or quit
Disconnect by 1 "Disconnect by user."
By kick
Disconnect by 1 "Kicked by Console"
From this:
PHP Code:
public void OnPluginStart()
{
HookEventEx("player_disconnect", Event_Disconnect, EventHookMode_Post);
}
public Action Event_Disconnect(Event event, const char[] name, bool dontBroadcast)
{
char szReason[128];
GetEventString(event, "reason", szReason, sizeof(szReason), "No Reason");
int client = GetClientOfUserId(GetEventInt(event,"userid"));
PrintToServer("Disconnect by %i \"%s\"", client, szReason);
}
Edit:
As expected, running this on separate plugin:
PHP Code:
HookEventEx("player_disconnect", Event_DisconnectPre, EventHookMode_Pre);
public Action Event_DisconnectPre(Event event, const char[] name, bool dontBroadcast)
{
SetEventString(event, "reason", "Overridden");
return Plugin_Changed;
}
Changed the returns of the other plugins Post hook to:
Code:
Disconnect by 1 "Overridden"