Raised This Month: $ Target: $400
 0% 

Nick Words


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BaD CopY
Senior Member
Join Date: Oct 2014
Location: Home
Old 05-08-2015 , 12:06   Nick Words
Reply With Quote #1

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...
BaD CopY is offline
Send a message via Yahoo to BaD CopY Send a message via Skype™ to BaD CopY
wickedd
Veteran Member
Join Date: Nov 2009
Old 05-08-2015 , 15:29   Re: Nick Words
Reply With Quote #2

Search "Restrict Names".
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
Eagle07
Veteran Member
Join Date: May 2014
Location: Morocco :D
Old 05-08-2015 , 16:37   Re: Nick Words
Reply With Quote #3

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))
        }
    }

__________________
Eagle07 is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 05-08-2015 , 17:10   Re: Nick Words
Reply With Quote #4

Quote:
Originally Posted by Eagle07 View Post
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.
__________________
Black Rose is offline
Decak
Senior Member
Join Date: Sep 2012
Old 05-08-2015 , 18:00   Re: Nick Words
Reply With Quote #5

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

So, nick must have 2 space or what?
Decak is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-08-2015 , 22:51   Re: Nick Words
Reply With Quote #6

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 );
        }
    }

__________________
Bugsy is offline
BaD CopY
Senior Member
Join Date: Oct 2014
Location: Home
Old 05-09-2015 , 04:44   Re: Nick Words
Reply With Quote #7

Thx

#lock
BaD CopY is offline
Send a message via Yahoo to BaD CopY Send a message via Skype™ to BaD CopY
Reply


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 20:02.


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