Raised This Month: $ Target: $400
 0% 

Need help to solve problem with FM_ClientUserInfoChanged


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ZASTRELIS
Veteran Member
Join Date: Nov 2010
Location: Siberia, Irkutsk
Old 04-16-2017 , 02:06   Need help to solve problem with FM_ClientUserInfoChanged
Reply With Quote #1

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

Last edited by ZASTRELIS; 04-16-2017 at 02:15.
ZASTRELIS is offline
ZASTRELIS
Veteran Member
Join Date: Nov 2010
Location: Siberia, Irkutsk
Old 04-16-2017 , 02:41   Re: Need help to solve problem with FM_ClientUserInfoChanged
Reply With Quote #2

LOL. SOLVED.

Code:
else if(!isNickChangeAccepted(val) && isNickChangeAccepted(name)) {     //client_print_color(id, -1, "New: %s || Old: %s", val, name);     engfunc(EngFunc_SetClientKeyValue, id, buffer, "name", name);     NnChRspwner(id, 1);     engfunc(EngFunc_SetClientKeyValue, id, buffer, "name", val);     return FMRES_SUPERCEDE; }
ZASTRELIS is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 04-16-2017 , 15:29   Re: Need help to solve problem with FM_ClientUserInfoChanged
Reply With Quote #3

Don't use FMRES_SUPERCEDE in ClientUserInfoChanged, its buggy.
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:49.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode