AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Nick Words (https://forums.alliedmods.net/showthread.php?t=262595)

BaD CopY 05-08-2015 12:06

Nick Words
 
Hello all,

Can anyone create plugin who allow players to connect to the server only if player's nick have 3 or more then 3 words. If player's nick have one or two words, server will kick him...

wickedd 05-08-2015 15:29

Re: Nick Words
 
Search "Restrict Names".

Eagle07 05-08-2015 16:37

Re: Nick Words
 
PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "EaGle"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
// Add your code here...
}
public 
client_connectid )
{
    if(!
is_user_bot(id))
    {
        new 
szName32 ];
        
get_user_name(id,szName,charsmaxszName ) )
        new 
szString strlenszName )
        if(
szString <= 3)
        {
            
server_cmd("kick #%d ^"This name is not allowed here^"",get_user_userid(id))
        }
    }



Black Rose 05-08-2015 17:10

Re: Nick Words
 
Quote:

Originally Posted by Eagle07 (Post 2294709)
PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "EaGle"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
// Add your code here...
}
public 
client_connectid )
{
    if(!
is_user_bot(id))
    {
        new 
szName32 ];
        
get_user_name(id,szName,charsmaxszName ) )
        new 
szString strlenszName )
        if(
szString <= 3)
        {
            
server_cmd("kick #%d ^"This name is not allowed here^"",get_user_userid(id))
        }
    }



The request says 3 words, not 3 characters.

Decak 05-08-2015 18:00

Re: Nick Words
 
Define 'words'... You want, for example, this:
word1 word2 word3

So, nick must have 2 space or what?

Bugsy 05-08-2015 22:51

Re: Nick Words
 
Supports up to 5 names out of the box. I added comments if you want to increase this. Set min word limit via cvar.

PHP Code:


#include <amxmodx>

new const Version[] = "0.1";

new 
g_pMinWords;

public 
plugin_init() 
{
    
register_plugin"Name Word Limit" Version "bugsy" );
    
    
g_pMinWords register_cvar"name_minwords" "3" );
}

public 
client_connectid )
{
    if ( !
is_user_botid ) && !is_user_hltvid ) )
    {
        new 
szName33 ] , szWords][ ] , iWords iMinWords;
        
        
get_user_nameid szName charsmaxszName ) );
        
        
//If you want to support more than 5 words, you must increase the szWords[] array 
        //size and add to parse().
        
iWords parseszName szWords] , charsmaxszWords[] ) , 
                            
szWords] , charsmaxszWords[] ) , 
                            
szWords] , charsmaxszWords[] ) ,
                            
szWords] , charsmaxszWords[] ) ,
                            
szWords] , charsmaxszWords[] ) );
                         
        if ( 
iWords < ( iMinWords get_pcvar_numg_pMinWords ) ) )
        {
            
server_cmd"kick #%d ^"Your name must have at least %d word(s)^"" get_user_useridid  ) , iMinWords );
        }
    }



BaD CopY 05-09-2015 04:44

Re: Nick Words
 
Thx :)

#lock


All times are GMT -4. The time now is 20:02.

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