hackroad 发表于 2013-6-4 23:38:58

KKLV在国外发布的插件-貌似是假人攻击类的

#include <amxmodx>
#include <fakemeta>

#define PLUGIN_NAME "Connnection Protection"
#define PLUGIN_VERSION"0.1"

#define fClearTrieTime      12.4
#define iConnectionBanCount6

new Trie:ghTrie;

public plugin_init( )
{
    register_plugin( PLUGIN_NAME , PLUGIN_VERSION , "LittleKu-Lv" );
   
    register_cvar( "amx_cfp_version" , PLUGIN_VERSION , FCVAR_SPONLY | FCVAR_SERVER );
   
    register_forward( FM_ClientConnect , "fwClientConnectPost" , true );
   
    ghTrie = TrieCreate();
}

public fwClientConnectPost( id , const szName[] , const szAddress[] , const szRejectReason[ 128 ] )
{
    if ( pev( id , pev_flags ) & FL_FAKECLIENT )
    {
      return FMRES_IGNORED;
    }
   
    if ( szAddress[ 0 ] == 0 )
    {
      return FMRES_IGNORED;
    }
   
    static iConnectionCount;
    static params[ 32 ];
   
    if ( !TrieGetCell( ghTrie , szAddress , iConnectionCount ) )
    {
      copy( params , 31 , szAddress );
      set_task( fClearTrieTime , "ClearValueFromTrie" , 0 , params , 32 );
      
      TrieSetCell( ghTrie , szAddress, 0 );
      return FMRES_IGNORED;
    }
   
    if ( iConnectionCount == iConnectionBanCount )
    {
      static iUserId;
      iUserId = get_user_userid( id );
      server_cmd( "kick #%d;addip 0 %s;writeip" , iUserId , szAddress );
      return FMRES_IGNORED;
    }
   
    TrieSetCell( ghTrie , szAddress , ( iConnectionCount + 1 ) );
    return FMRES_IGNORED;
}

public ClearValueFromTrie( params[] )
{
    static szAddress[ 32 ];
   
    copy( szAddress, 31, params );
   
    TrieDeleteKey( ghTrie , szAddress );
   
    return PLUGIN_CONTINUE;
}

public plugin_end()
{
    TrieClear( ghTrie );
}温馨提示:返回后,您可点击恢复数据,恢复您刚刚编辑的内容!

css 发表于 2013-8-4 22:31:37

游泳没有啊 ,请指教啊

看看123123123 发表于 2015-4-5 17:15:57

啊晕轻轻去去去去去去去去去{:4_124:}

zzx767545521 发表于 2015-4-12 18:25:40

0.0.0.0.00.0.0.0.0.0

zzx767545521 发表于 2015-4-12 18:29:48


啊晕轻轻去去去去去去去去去
页: [1]
查看完整版本: KKLV在国外发布的插件-貌似是假人攻击类的