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

Auto Name


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tedaimlocks
Member
Join Date: Jan 2024
Old 03-12-2024 , 10:02   Auto Name
Reply With Quote #1

Is there any auto name changers? like for example
If your name is Player -> Server automatically changes your name to something else.
Ive searched it on google but didnt find what im looking for.
tedaimlocks is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 03-12-2024 , 16:00   Re: Auto Name
Reply With Quote #2

this is the simplest form when not accounting for any conditions
PHP Code:
#include <amxmodx>

public client_authorized(id)
    
set_user_info(id"name""asd"
__________________
bigdaddy424 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-13-2024 , 00:53   Re: Auto Name
Reply With Quote #3

I have a plugin that does this: https://github.com/fysiks1/amxx-no_player_name. It was a plugin originally by a friend (Vet) and then I made some unique modifications to it but here I removed my unique modifications so it may be just the original plugin by Vet but with new randomly generated names.
__________________
fysiks is offline
tedaimlocks
Member
Join Date: Jan 2024
Old 03-13-2024 , 08:46   Re: Auto Name
Reply With Quote #4

It works, how may i add more default names? like the name "Player" name
I know its this line but how do i add more names?

And also how can i make it so they have the same name from the list on other servers aswell? ( if possible )

PHP Code:
public client_infochanged(id// This changes a user's name to one of the predefined names
{
    static 
newname[32]
    
get_user_info(id"name"newnamecharsmax(newname))
    if( 
equali(newname"Player") )
    {
        
set_player_name(id)
    }


Last edited by tedaimlocks; 03-13-2024 at 09:49.
tedaimlocks is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-13-2024 , 16:28   Re: Auto Name
Reply With Quote #5

Not sure what you mean by your second request.

PHP Code:

#include <amxmodx>
#include <fakemeta>

new const Version[] = "0.2";

#define MAX_PLAYERS 32

new const DefaultNames[][] = 
{
    
"Player",
    
"Sizzle Chest",
    
"Frank Rizzo",
    
"Sol Rosenberg",
    
"Mike Derucki"
};

new 
g_szNameMAX_PLAYERS ][ 32 ];
new 
g_iInfoChangedFwd;

public 
plugin_init() 
{
    
register_plugin"Name Change Hook" Version "bugsy" );
    
    
register_event"SayText" "EventSayText" "a" "2=#Cstrike_Name_Change" );
}

public 
EventSayText()
{
    
g_iInfoChangedFwd register_forwardFM_ClientUserInfoChanged "ClientUserInfoChanged" );
}

public 
ClientUserInfoChangedid )
{
    if ( 
is_user_connectedid ) )
    {
        
get_user_nameid g_szNameid ] , charsmaxg_szName[] ) );
        
unregister_forwardFM_ClientUserInfoChanged g_iInfoChangedFwd );
        
        for ( new 
sizeof DefaultNames ) ; i++ )
        {
            if ( 
equalig_szNameid ] , DefaultNames] ) )
            {
                
//set name
            
}
        }
    }

__________________

Last edited by Bugsy; 03-13-2024 at 16:36.
Bugsy is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-13-2024 , 23:13   Re: Auto Name
Reply With Quote #6

Quote:
Originally Posted by tedaimlocks View Post
And also how can i make it so they have the same name from the list on other servers aswell? ( if possible )
You don't. Don't try to be an jerk like that. Things like this are childish and/or unnecessary, depending on your reasoning for wanting this. It is commonly known as "slowhacking" and is not allowed on this forum. Therefore, the plugin is written specifically to not do exactly that.

If the player wants to change their name they can choose to change their own name.
__________________

Last edited by fysiks; 03-13-2024 at 23:33.
fysiks is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 03-13-2024 , 23:57   Re: Auto Name
Reply With Quote #7

@Bugsy: Client_infochanged is more direct.
__________________

Last edited by DJEarthQuake; 03-14-2024 at 21:07.
DJEarthQuake is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-14-2024 , 06:25   Re: Auto Name
Reply With Quote #8

Quote:
Originally Posted by DJEarthQuake View Post
@Bugsy: Client_infochanged is more direct.
But yours will constantly get spammed, mine won’t. Add logs within both codes to see. The extra code is to make it only fire for a name change, nothing else.
__________________

Last edited by Bugsy; 03-14-2024 at 06:56.
Bugsy is offline
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 03-14-2024 , 09:07   Re: Auto Name
Reply With Quote #9

that is correct, since this is called many times even if you have changed the name or not.
__________________
mlibre is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 03-14-2024 , 12:05   Re: Auto Name
Reply With Quote #10

[generic_name_change.amxx] Client_infochanged hit 1 times! That was admin change. Otherwise 0. Your initial code I see more useful to counter Half-Life model spammers. When they bind a new model to each command to make the hitboxes askew and confuse people.

Code:
    g_counter++
    if ( is_user_connected( id ) )
__________________

Last edited by DJEarthQuake; 03-14-2024 at 12:09.
DJEarthQuake is offline
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:43.


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