Code:
public fwClientUserInfoChanged(id, buffer)
{
if (!is_user_connected(id))
return FMRES_IGNORED;
static name[32], val[32];
get_user_name(id, name, sizeof name - 1)
engfunc(EngFunc_InfoKeyValue, buffer, "name", val, sizeof val - 1)
if (equal(val, name))
return FMRES_IGNORED;
if(i_NickNamer[id])
{
if(isNickChangeAccepted(val))
{
if(task_exists(NICK_NAMER + id))
remove_task(NICK_NAMER + id)
i_NickNamer[id] = 0;
set_user_info(id, "name", val);
engfunc(EngFunc_SetClientKeyValue, id, buffer, "name", val);
set_task(3.0, "pub_NnChRspwner", id);
client_print_color(id, -1, "%s %L", PREFIX, LANG_PLAYER, "NICK_WAIT_RESPAWN", 3.0);
return FMRES_SUPERCEDE;
}
}
else if(!isNickChangeAccepted(val) && isNickChangeAccepted(name))
NnChRspwner(id, 1);
return FMRES_IGNORED;
}
When player changed nickname as
!isNickChangeAccepted(val) && isNickChangeAccepted(name) msg in chat section about that user changed its nick not bloked.
I tried many operation with this block, but noting can't block default chat msg. I think that I can use #MSG hook and block it, but I want to know why
fwClientUserInfoChanged can't block this msg?
Code:
else if(!isNickChangeAccepted(val) && isNickChangeAccepted(name))
NnChRspwner(id, 1);
Other, it's blocked any msgs about name change in 1st section of this:
if(i_NickNamer[id])
P.S. i think this's engine feature, becouse it happens only when player in alive mode. And otherwise it not send any msg in chat when client changed its name when in dead state