Raised This Month: $ Target: $400
 0% 

Other way to block changing name


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
m0skVi4a
Senior Member
Join Date: May 2011
Location: Rousse, Bulgaria
Old 11-04-2011 , 13:59   Other way to block changing name
Reply With Quote #1

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?
m0skVi4a is offline
Send a message via Skype™ to m0skVi4a
 


Thread Tools
Display Modes

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 01:30.


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