#include <amxmodx>
#include <fakemeta>
#pragma ctrlchar '\'
#define MAX_NAMESIZE 32
public plugin_init() {
register_forward(FM_ClientUserInfoChanged, "ClientUserInfoChanged_Pre", false);
}
public ClientUserInfoChanged_Pre(const iClient, const pszInfo) {
new szNetName[MAX_NAMESIZE];
pev(iClient, pev_netname, szNetName, charsmax(szNetName));
if (szNetName[0] == '\0') {
return;
}
new szName[MAX_NAMESIZE];
engfunc(EngFunc_InfoKeyValue, pszInfo, "name", szName, charsmax(szName));
if (equal(szNetName, szName)) {
return;
}
engfunc(EngFunc_SetClientKeyValue, iClient, pszInfo, "name", szNetName);
}