bmann: even though I don't use your amx_super anymore I do refer to it a lot and I found two bugs in the amx_gag
1.) this line:
Code:
client_print( 0, print_chat, "%L", LANG_PLAYER, "AMX_SUPER_GAG_CONNECTED", name, g_wasgagged[id] )
should be
Code:
client_print( 0, print_chat, "%L", LANG_PLAYER, "AMX_SUPER_GAG_PLAYER_DISCONNECT", name, g_wasgagged[id] )
2.) the way to block the name change is not right...it changes the player's username to the old name, but it doesn't prevent the name change message( xxx changed name to yyy) because the "client_infochanged" forward is called after the player changed their name apparently
here is the same thing in fakemeta that doesn't have this problem:
in plugin_init:
add
Code:
register_forward( FM_ClientUserInfoChanged, "info_changed" )
delete the whole client_infochanged function
add this in the amx_gag portion:
Code:
public info_changed( id, szInfo[] )
{
if( g_gagged[id] )
{
new newname[32], oldname[32]
get_user_info( id, "name", newname, 31 )
get_user_name( id, oldname, 31 )
if( !equali( newname, oldname ) )
{
client_print( id, print_chat, "%L", id, "AMX_SUPER_PLAYER_NAMELOCK" )
set_user_info( id, "name", oldname )
}
}
}
__________________