Hello
I am making a Register System plugin and the beta version is almost reаdy. My problem is that when player change his name and hi is logged to block the name change. I found that and works properly
PHP Code:
public client_infochanged(id)
{
if(!is_user_connected(id))
return PLUGIN_HANDLED
new newname[32]
get_user_info(id,"name",newname,31)
new oldname[32]
get_user_name(id,oldname,31)
if(!equal(newname,oldname))
{
set_user_info(id,"name",oldname)
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
and i change it to
PHP Code:
public client_infochanged(id)
{
if(is_logged[id])
{
if(!is_user_connected(id))
return PLUGIN_HANDLED
new newname[32]
get_user_info(id,"name",newname,31)
new oldname[32]
get_user_name(id,oldname,31)
if(!equal(newname,oldname))
{
set_user_info(id,"name",oldname)
return PLUGIN_HANDLED
}
}
else if(is_registerd[id])
{
is_registerd[id] = false
}
return PLUGIN_CONTINUE
}
The problem is that when player putinserver the plugin makes the checks and if his name is in the file is_registered makes true. But when player connect (i suppose) client_infochanged makes is_registered to false and the player can't log in.
My question:
Is there any other way to block name changing, except client_infochanged and the fakemeta way with FM_ClientUserInfoChanged. Or how to do my code to work properly?