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

Fuse this 3 plugins


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DIREKTOR
Senior Member
Join Date: Jan 2010
Location: On server
Old 03-21-2010 , 10:38   Fuse this 3 plugins
Reply With Quote #1

as i sed is it possible to fuse this three plugins because they are great anti advertisment plugins

1st plugin
Code:
#include < amxmodx >

enum
{
    CHECK_NO,
    CHECK_FIRST,
    CHECK_CHANGE
};

#define MAX_PLAYERS 32

new const g_szNameKey[ ] = "name";
new const g_szDefaultName[ ] = "Player";

new pCvar_MaxNameDigits;

new g_iCheckStatus[ MAX_PLAYERS + 1 ];

public plugin_init( )
{
    register_plugin( "Max Name Digits", "0.0.1", "Exolent" );
    
    pCvar_MaxNameDigits = register_cvar( "max_name_digits", "13" );
}

public client_putinserver( iPlayer )
{
    g_iCheckStatus[ iPlayer ] = CHECK_FIRST;
    
    new szName[ 32 ];
    get_user_name( iPlayer, szName, charsmax( szName ) );
    
    if( !IsNameValid( szName ) )
    {
        set_user_info( iPlayer, g_szNameKey, g_szDefaultName );
    }
    
    g_iCheckStatus[ iPlayer ] = CHECK_CHANGE;
}

public client_disconnect( iPlayer )
{
    g_iCheckStatus[ iPlayer ] = CHECK_NO;
}

public client_infochanged( iPlayer )
{
    if( g_iCheckStatus[ iPlayer ] == CHECK_CHANGE )
    {
        static szNewName[ 32 ], szOldName[ 32 ];
        get_user_name( iPlayer, szOldName, charsmax( szOldName ) );
        get_user_info( iPlayer, g_szNameKey, szNewName, charsmax( szNewName ) );
        
        if( !equal( szNewName, szOldName )
        &&  !IsNameValid( szNewName ) )
        {
            set_user_info( iPlayer, g_szNameKey, szOldName );
        }
    }
}

bool:IsNameValid( const szName[ ] )
{
    new iCount;
    new iMax = get_pcvar_num( pCvar_MaxNameDigits );
    
    new i = -1;
    while( szName[ ++i ] )
    {
        if( '0' <= szName[ i ] <= '9' )
        {
            if( ++iCount >= iMax )
            {
                return false;
            }
        }
    }
    
    return true;
}
2. plugin

Code:
#include <amxmodx> 

#define PLUGIN "resname" 
#define VERSION "1.0" 
#define AUTHOR "" 
public plugin_init() 
{ 
        register_plugin(PLUGIN, VERSION, AUTHOR) 
} 
public client_connect(id) 
{ 
        new name[32] 
        get_user_name(id, name, 31) 
        check_name(id, name) 
} 
public client_infochanged(id) 
{ 
        new name[32] 
        get_user_info(id, "name", name, 31) 
        check_name(id, name) 
} 
kick(id) 
{ 
        server_cmd("kick #%d ^"Ovde nemozes da Reklamiras promeni nik pa udji^"", get_user_userid(id)) 
} 
check_name(id, name[]) 
{ 
        if(containi(name, "www.") != -1 || containi(name, ".ro") != -1 || containi(name, ".com") != -1 || containi(name, ".net") != -1 || containi(name, ".org") != -1 || containi(name, ".uk") != -1) 
        { 
                kick(id) 
                return 
        } 
        new i, c 
        while((c = name[i++])) 
        { 
                switch(c) 
                { 
                        case 31, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 64, 94, 123, 125: 
                        { 
                                kick(id) 
                                return 
                        } 
                } 
        } 
}
3rd plugin
Code:
#include < amxmodx >

new pCvar_MaxSayDigits;

public plugin_init( )
{
    register_plugin( "Max Say Digits", "0.0.1", "Exolent" );
    
    register_clcmd( "say", "CmdSay" );
    register_clcmd( "say_team", "CmdSay" );
    
    pCvar_MaxSayDigits = register_cvar( "max_say_digits", "13" );
}

public CmdSay( iPlayer )
{
    new szMessage[ 194 ];
    read_args( szMessage, charsmax( szMessage ) );
    remove_quotes( szMessage );
    
    new iCount;
    new iMax = get_pcvar_num( pCvar_MaxSayDigits );
    
    new i = -1;
    while( szMessage[ ++i ] )
    {
        if( '0' <= szMessage[ i ] <= '9' )
        {
            if( ++iCount >= iMax )
            {
                client_print( iPlayer, print_chat, "Botu nemozes ovde da reklamiras ", iMax, iMax == 1 ? "" : "s" );
                
                return PLUGIN_HANDLED;
            }
        }
    }
    
    return PLUGIN_CONTINUE;
}
Please fuse this tree plugins , Exolent you can help me these are your plugins please
DIREKTOR is offline
Send a message via MSN to DIREKTOR
KadiR
Unnecessary Member
Join Date: Aug 2008
Location: Zürich / Switzerland
Old 03-21-2010 , 11:46   Re: Fuse this 3 plugins
Reply With Quote #2

shiva shiva?
KadiR is offline
xtinct
Senior Member
Join Date: Jan 2010
Location: http://tekxtinct.ning.co
Old 03-21-2010 , 12:28   Re: Fuse this 3 plugins
Reply With Quote #3

Quote:
Originally Posted by KadiR View Post
shiva shiva?
[OffTopic]

By the way...Do u Know Shiva? How have you heard about him?
__________________
Sorry If I Hurt! Orpheu

1 crab has been found and delivered my me.
xtinct is offline
surfhope
Member
Join Date: Aug 2010
Location: Austria
Old 10-23-2010 , 11:04   Re: Fuse this 3 plugins
Reply With Quote #4

Much Fun!
Attached Files
File Type: sma Get Plugin or Get Source (Ready.sma - 503 views - 3.6 KB)
__________________
surfhope is offline
Send a message via Skype™ to surfhope
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 10-23-2010 , 14:41   Re: Fuse this 3 plugins
Reply With Quote #5

Use them all at once instead of combining them?

Also, LORDSHIVA ROCKS!!!!
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
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 08:14.


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