Quote:
Originally Posted by CrazY.
Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
public plugin_init()
{
register_plugin("Get team on disconnect", "1.0", "Unknown");
register_forward(FM_ClientDisconnect, "fw_ClientDisconnect_Pre");
}
public fw_ClientDisconnect_Pre(pPlayer)
{
new CsTeams:iTeam = cs_get_user_team(pPlayer);
client_print(0, print_chat, "Team: %s", iTeam == CS_TEAM_T ? "TERRORIST" : "CT");
}
Or just use client_disconnected forward in AMx Mod X 1.8.3.
|
I have tried client_disconnect, client_disconnected (id), client_disconnected (id, bool: drop, message [], len), and now the method with fakemeta, and the result is always this log.
L 06/08/2018 - 21:59:16: [CSTRIKE] Invalid player 4
L 06/08/2018 - 21:59:16: [AMXX] Displaying debug trace (plugin "disconnect.amxx", version "13.0")
L 06/08/2018 - 21:59:16: [AMXX] Run time error 10: native error (native "cs_get_user_team")
L 06/08/2018 - 21:59:16: [AMXX] [0] disconnect.amxx::fw_ClientDisconnect_Pre (line 2105)