Raised This Month: $ Target: $400
 0% 

Nick Words


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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