AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Auto Name (https://forums.alliedmods.net/showthread.php?t=346709)

tedaimlocks 03-12-2024 10:02

Auto Name
 
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.

bigdaddy424 03-12-2024 16:00

Re: Auto Name
 
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"


fysiks 03-13-2024 00:53

Re: Auto Name
 
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.

tedaimlocks 03-13-2024 08:46

Re: Auto Name
 
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)
    }



Bugsy 03-13-2024 16:28

Re: Auto Name
 
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
            
}
        }
    }



fysiks 03-13-2024 23:13

Re: Auto Name
 
Quote:

Originally Posted by tedaimlocks (Post 2819426)
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.

DJEarthQuake 03-13-2024 23:57

Re: Auto Name
 
@Bugsy: Client_infochanged is more direct.

Bugsy 03-14-2024 06:25

Re: Auto Name
 
Quote:

Originally Posted by DJEarthQuake (Post 2819455)
@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.

mlibre 03-14-2024 09:07

Re: Auto Name
 
that is correct, since this is called many times even if you have changed the name or not.

DJEarthQuake 03-14-2024 12:05

Re: Auto Name
 
[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 ) )



All times are GMT -4. The time now is 13:32.

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