Raised This Month: $51 Target: $400
 12% 

Block Changing Name


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 06-29-2017 , 08:51   Block Changing Name
Reply With Quote #1

Hello Friends,
I know that it's already made. I was using that until I saw persons that are changing their name in my server.
I need a plugin that is blocking name.
When I use "name purposeless" or "setinfo name purposeless", in console it will say "Renaming is blocked"
And his name will not be changed.

Last edited by PurposeLessx; 06-29-2017 at 08:53.
PurposeLessx is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 06-29-2017 , 09:00   Re: Block Changing Name
Reply With Quote #2

PHP Code:
set_user_info(id"name""purposeless"); 
Keep in mind that such thing is incredibly annoying if you wish to keep your players in the server.
eyal282 is offline
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 06-29-2017 , 09:15   Re: Block Changing Name
Reply With Quote #3

Quote:
Originally Posted by eyal282 View Post
PHP Code:
set_user_info(id"name""purposeless"); 
Keep in mind that such thing is incredibly annoying if you wish to keep your players in the server.
I know this code. set_user_info
But I don't know that control rename. Should I use fakemeta include?
PurposeLessx is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 06-29-2017 , 09:23   Re: Block Changing Name
Reply With Quote #4

Search. It has been done 100 times.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 06-29-2017 , 09:24   Re: Block Changing Name
Reply With Quote #5

Would it work?

PHP Code:
#include <amxmodx>
#include <fakemeta>

public plugin_init() {
    
register_plugin("No Change Nick""0.1.2""VEN"//Edited by PurposeLess

    
register_forward(FM_ClientUserInfoChanged"ForwardUserInfoChanged")
}

public 
ForwardUserInfoChanged(idbuffer)
{
    if(!
is_user_connected(id))
        return 
FMRES_IGNORED;

    static 
name[32]
    
get_user_name(idnamesizeof(name) - 1)

    
engfunc(EngFunc_SetClientKeyValueidbuffer"name"name)
    
client_cmd(id"name ^"%s^""name)
    
set_user_info(id"name"name)
    return 
FMRES_SUPERCEDE;


Last edited by PurposeLessx; 06-29-2017 at 09:24.
PurposeLessx is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 06-29-2017 , 10:25   Re: Block Changing Name
Reply With Quote #6

Can't you test it?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 07-03-2017 , 05:14   Re: Block Changing Name
Reply With Quote #7

why you set 3 times the name ?

client_infochanged(id) is ok don't need fakemeta, also set_user_info is enough.
__________________
Project: Among Us

Last edited by Craxor; 07-03-2017 at 05:14.
Craxor is offline
Send a message via ICQ to Craxor
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 07-05-2017 , 06:37   Re: Block Changing Name
Reply With Quote #8

Why isn't it working?

PHP Code:
public client_infochanged(id)
{
    if(
get_pcvar_num(nickengel) == 1)
    {
        static 
oldname[32], newname[32]
        
get_user_name(idoldnamecharsmax(oldname) - 1)
        
get_user_info(id"name"newnamecharsmax(newname))
        
        if(
equal(newnameoldname))
            return 
PLUGIN_CONTINUE;
        
        if(
nick_flood[id]) {
            
console_print(id"[SERVER GUARD] You can change your name after %i minutes"nicksuresi[id])
            return 
PLUGIN_HANDLED;
        }
        else {
            
nick_flood[id] = true
            nicksuresi
[id] = nicktime
            set_task
(1.0"nickflood_control"id)
        }
    }
    return 
PLUGIN_CONTINUE;
}

public 
nickflood_control(id)
{
    if(
nicksuresi[id] == 0)
    {
        
nick_flood[id] = false
    
}
    else
    {
        
nicksuresi[id]--;

        
set_task(1.0"nickflood_control"id)
    }

PurposeLessx is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-05-2017 , 09:30   Re: Block Changing Name
Reply With Quote #9

IIRC, you can't block anything with client_infochanged(), you have to use Fakemeta.

You should find one of the many "name change" plugins and see how it is done there.
__________________

Last edited by fysiks; 07-05-2017 at 09:31.
fysiks is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 07-05-2017 , 10:15   Re: Block Changing Name
Reply With Quote #10

fyisiks, as i know you can 'block' changing name with client_infochanged.

@OP: You have also to use set_user_info to set the OldName as being the new name.
__________________
Project: Among Us

Last edited by Craxor; 07-05-2017 at 10:20.
Craxor is offline
Send a message via ICQ to Craxor
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 15:11.


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