Code: Select all
#include <amxmodx>
#pragma tabsize 0
/* ========================================================================================================
* [ Plugin initiation ]
* ======================================================================================================*/
const RETRY_DURATION = 60; //in s.
new Trie:g_tPlayer;
public plugin_init( ){
register_plugin( "Anti retry","1.0b","Manu" );//sigur nu e el
g_tPlayer = TrieCreate( );
}
public plugin_end( ) TrieDestroy( g_tPlayer );
/* ========================================================================================================
* [ Functions ]
* ======================================================================================================*/
public client_putinserver( iId ){
if(is_user_bot(iId)||is_user_hltv(iId)) return
static szIp[ 35 ],iTime; get_user_ip( iId,szIp,charsmax( szIp ) );
if( TrieKeyExists( g_tPlayer,szIp ) ){
TrieGetCell( g_tPlayer,szIp,iTime );
if( get_systime( ) < iTime ){
if(is_user_alive(iId)){
user_silentkill(iId)
client_print(iId,print_chat,"You have to wait %ds. before to reconnect",iTime - get_systime( ))
} else server_cmd("kick #%d You have to wait %ds. before to reconnect",get_user_userid(iId),iTime - get_systime( ))
}
TrieDeleteKey( g_tPlayer,szIp );
}
}
public client_disconnect( iId ){
if(is_user_bot(iId)||is_user_hltv(iId)) return
static szIp[ 35 ]; get_user_ip( iId,szIp,charsmax( szIp ) );
if( !TrieKeyExists( g_tPlayer,szIp ) ) TrieSetCell( g_tPlayer,szIp,get_systime( ) + RETRY_DURATION );
}