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 );
}温馨提示:返回后,您可点击恢复数据,恢复您刚刚编辑的内容! 游泳没有啊 ,请指教啊 啊晕轻轻去去去去去去去去去{:4_124:} 0.0.0.0.00.0.0.0.0.0
啊晕轻轻去去去去去去去去去
页:
[1]